diff --git a/resource/WEB-INF/config/mapper/hrmelog/ElogTableCheckerMapper.xml b/resource/WEB-INF/config/mapper/hrmelog/ElogTableCheckerMapper.xml new file mode 100644 index 000000000..cbf1e900d --- /dev/null +++ b/resource/WEB-INF/config/mapper/hrmelog/ElogTableCheckerMapper.xml @@ -0,0 +1,451 @@ + + + + + insert into hrsa_elog_version (id, maintable, version) values (#{id},#{mainTable},#{version}) + + + + create table ${mainTable} + ( + id bigint comment 'ID', + create_time datetime default current_timestamp , + update_time datetime default current_timestamp , + creator bigint, + delete_type int, + tenant_key varchar(10), + uuid char(36), + log_date datetime default current_timestamp , + log_operator varchar(50), + operatorName varchar(50), + targetId varchar(50), + targetName text, + modulename varchar(100), + functionname varchar(100), + interfaceName varchar(100), + requesturl varchar(200), + requesturi varchar(200), + operateType varchar(50), + operatetypename varchar(100), + operatedesc varchar(1000), + params longtext, + belongmainid varchar(36), + clientIp varchar(50), + groupid varchar(50), + device varchar(200), + groupNameLabel varchar(500), + redoService varchar(200), + redoContext longtext, + cancelService varchar(200), + cancelContext longtext, + totalruntime bigint, + mainruntime bigint, + log_result varchar(100), + fromterminal varchar(100), + resultdesc text, + old_content varchar(1000), + link_type varchar(20), + link_id bigint, + old_link_id bigint, + PRIMARY KEY (id) + ) + + + + create table ${mainTable} + ( + id number(*,0) not null primary key, + create_time date default sysdate, + update_time date default sysdate, + creator number(*,0), + delete_type number(*,0), + tenant_key varchar2(10), + uuid varchar2(36), + log_date date default sysdate, + log_operator varchar2(50), + operatorName varchar2(50), + targetId varchar2(50), + targetName varchar2(4000), + modulename varchar2(100), + functionname varchar2(100), + interfaceName varchar2(100), + requesturl varchar2(200), + requesturi varchar2(200), + operateType varchar2(50), + operatetypename varchar2(100), + operatedesc varchar2(1000), + params clob, + belongmainid varchar2(36), + clientIp varchar2(200), + groupid varchar2(50), + device varchar2(200), + groupNameLabel varchar2(500), + redoService varchar2(200), + redoContext varchar2(4000), + cancelService varchar2(200), + cancelContext varchar2(4000), + totalruntime number(*,0), + mainruntime number(*,0), + log_result varchar2(4000), + fromterminal varchar2(100), + resultdesc varchar2(4000), + old_content varchar2(1000), + link_type varchar2(20), + link_id number(*,0), + old_link_id number(*,0) + ) + + + create table ${mainTable} + ( + id bigint not null primary key, + create_time datetime default getdate(), + update_time datetime default getdate(), + creator bigint default '-1', + delete_type bigint default 0, + tenant_key nvarchar(10), + uuid nvarchar(36), + log_date datetime default getdate(), + device nvarchar(500), + log_operator bigint default '-1', + operatorname nvarchar(100), + targetid bigint default '-1', + targetname nvarchar(3000), + modulename nvarchar(100), + functionname nvarchar(100), + interfacename nvarchar(100), + requesturl nvarchar(200), + requesturi nvarchar(200), + operatetype nvarchar(50), + operatetypename nvarchar(100), + operatedesc nvarchar(3000), + params nvarchar(max), + belongmainid nvarchar(36), + clientip nvarchar(200), + groupid nvarchar(50), + groupnamelabel nvarchar(1000), + redoservice nvarchar(200), + redocontext nvarchar(3000), + cancelservice nvarchar(200), + cancelcontext nvarchar(3000), + totalruntime bigint default 0, + mainruntime bigint default 0, + log_result nvarchar(100), + fromterminal nvarchar(100), + resultdesc nvarchar(3000), + old_content nvarchar(3000), + link_type nvarchar(20), + link_id bigint default 0, + old_link_id bigint default 0 + ) + + + create table ${mainTable} + ( + id int8 not null primary key, + create_time timestamp default current_timestamp, + update_time timestamp default current_timestamp, + creator int8, + delete_type int, + tenant_key varchar(10), + uuid varchar(36), + log_date timestamp default current_timestamp, + log_operator varchar(50), + operatorName varchar(50), + targetId varchar(50), + targetName text, + modulename varchar(100), + functionname varchar(100), + interfaceName varchar(100), + requesturl varchar(200), + requesturi varchar(200), + operateType varchar(50), + operatetypename varchar(100), + operatedesc varchar(1000), + params text, + belongmainid varchar(36), + clientIp varchar(200), + groupid varchar(50), + device varchar(200), + groupNameLabel varchar(500), + redoService varchar(200), + redoContext text, + cancelService varchar(200), + cancelContext text, + totalruntime int4, + mainruntime int4, + log_result varchar(100), + fromterminal varchar(100), + resultdesc text, + old_content varchar(1000), + link_type varchar(20), + link_id int4, + old_link_id int4 + ) + + + create table ${detailTable} + ( + id bigint not null primary key, + create_time datetime default current_timestamp , + update_time datetime default current_timestamp , + creator bigint, + delete_type int, + tenant_key varchar(10), + uuid varchar(36), + mainid varchar(36), + dataid varchar(50), + belongdataid varchar(50), + tableName varchar(200), + tablenamelabelid varchar(50), + tablenamedesc varchar(50), + fieldName varchar(200), + fieldnamelabelid varchar(200), + newValue longtext, + oldValue longtext, + newrealvalue longtext, + oldrealvalue longtext, + fieldDesc varchar(200), + showorder int default 0, + isdetail int default 0 + ) + + + create table ${detailTable} + ( + id int8 not null primary key, + create_time timestamp default current_timestamp , + update_time timestamp default current_timestamp , + creator int8, + delete_type int8, + tenant_key varchar(10), + uuid varchar(36), + mainid varchar(36), + dataid varchar(50), + belongdataid varchar(50), + tableName varchar(200), + tablenamelabelid varchar(50), + tablenamedesc varchar(50), + fieldName varchar(200), + fieldnamelabelid varchar(200), + newValue text, + oldValue text, + newrealvalue text, + oldrealvalue text, + fieldDesc varchar(200), + showorder int8 default 0, + isdetail int8 default 0 + ) + + + create table ${detailTable} + ( + id number(*,0) not null primary key, + create_time date default sysdate, + update_time date default sysdate, + creator number(*,0), + delete_type number(*,0), + tenant_key varchar2(10), + uuid varchar2(36), + mainid varchar2(36), + dataid varchar2(50), + belongdataid varchar2(50), + tableName varchar2(200), + tablenamelabelid varchar2(50), + tablenamedesc varchar2(50), + fieldName varchar2(200), + fieldnamelabelid varchar2(200), + newValue CLOB, + oldValue CLOB, + newrealvalue CLOB, + oldrealvalue CLOB, + fieldDesc varchar2(200), + showorder number(*,0) default 0, + isdetail number(*,0) default 0 + ) + + + create table ${detailTable} + ( + id bigint not null primary key, + create_time datetime default getdate(), + update_time datetime default getdate(), + creator bigint, + delete_type bigint, + tenant_key nvarchar(10), + uuid nvarchar(36), + mainid nvarchar(36), + dataid nvarchar(50), + belongdataid nvarchar(50), + tableName nvarchar(200), + tablenamelabelid nvarchar(50), + tablenamedesc nvarchar(50), + fieldName nvarchar(200), + fieldnamelabelid nvarchar(200), + newValue nvarchar(max), + oldValue nvarchar(max), + newrealvalue nvarchar(max), + oldrealvalue nvarchar(max), + fieldDesc varchar(200), + showorder bigint default 0, + isdetail bigint default 0 + ) + + + + + + + + + + + ${createElogSql} + + + + + + + + + + + + + + + + create index idx${id} on ${tableName} (${columnName}) + + + + create index idx${id} on ${tableName} (${columnName}) + + + + create index idx${id} on ${tableName} (${columnName}) + + + + + + + + + + diff --git a/resource/WEB-INF/config/mapper/hrmelog/LocalElogAopDaoMapper.xml b/resource/WEB-INF/config/mapper/hrmelog/LocalElogAopDaoMapper.xml new file mode 100644 index 000000000..8fcc1b9c1 --- /dev/null +++ b/resource/WEB-INF/config/mapper/hrmelog/LocalElogAopDaoMapper.xml @@ -0,0 +1,170 @@ + + + + + + insert into ${tableName} (id, uuid, log_date, tenant_key, modulename, functionName, operatetypename, + log_operator, operatorname, targetid, targetname, interfacename, operatetype, + operatedesc, + params, clientIp, groupnamelabel, redoservice, redocontext, cancelservice, + cancelcontext, device, groupid, + belongMainId, requestUrl, requestUri, totalRunTime, mainRunTime, log_result, + fromTerminal, resultDesc, old_content, + link_type, link_id, old_link_id, create_time, update_time, delete_type, creator + ${cusColumns}) + values (#{logContent.id}, #{logContent.uuid}, #{logContent.date}, + #{logContent.tenant_key}, #{logContent.moduleName}, #{logContent.functionName}, + #{logContent.operateTypeName}, #{logContent.logOperator}, #{logContent.operatorName}, + #{logContent.logTargetid} + , #{logContent.targetName}, #{logContent.interfaceName}, #{logContent.operateType}, + #{logContent.operatedesc}, + #{logContent.paramsStr}, #{logContent.clientIp}, #{logContent.groupNameLabel}, + #{logContent.redoService}, + #{logContent.redoContextStr}, #{logContent.cancelService}, #{logContent.cancelContextStr}, + #{logContent.device}, #{logContent.groupId}, + #{logContent.belongMainId}, #{logContent.requestUrl}, #{logContent.requestUri}, + #{logContent.totalRunTime}, #{logContent.mainRunTime} + , #{logContent.result}, #{logContent.fromTerminal}, #{logContent.resultDesc}, + #{logContent.old_content}, #{logContent.link_type} + , #{logContent.link_id}, #{logContent.old_link_id}, #{logContent.create_time}, + #{logContent.update_time}, #{logContent.delete_type}, #{logContent.logOperator} + ${cusValus}) + + + + insert into ${detailTableName} (id, mainid, uuid, tablename, fieldname, newvalue, oldvalue, + fielddesc, showorder, dataid, belongDataid, isDetail, tenant_key, creator, + newRealValue, oldRealValue, tableNameDesc, + tableNameLabelId, fieldNameLabelId, create_time, update_time + ${cusColumns}) + values (#{detailContext.id}, #{mainid}, #{detailContext.uuid}, #{detailContext.tableName}, + #{detailContext.fieldName}, #{detailContext.newValue}, + #{detailContext.oldValue}, #{detailContext.fieldDesc}, #{detailContext.showorder}, + #{detailContext.dataid}, + #{detailContext.belongDataid}, #{detailContext.isDetail}, #{detailContext.tenant_key}, + #{detailContext.creator}, #{detailContext.newRealValue} + , #{detailContext.oldRealValue}, #{detailContext.tableNameDesc}, #{detailContext.tableNameLabelId}, + #{detailContext.fieldNameLabelId}, #{detailContext.create_time}, #{detailContext.update_time} + ${cusValus}) + + + ${sql} + + + + + + + + insert into ${tablename} (id, mainid, uuid, tablename, fieldname, newvalue, oldvalue, + fielddesc, showorder, dataid, belongDataid, isDetail, tenant_key,creator, newRealValue, + oldRealValue,tableNameDesc, + tableNameLabelId,fieldNameLabelId, create_time, update_time,delete_type) + values + + ( #{detailContext.id},#{mainid}, #{detailContext.uuid}, #{detailContext.tableName}, + #{detailContext.fieldName}, #{detailContext.newValue}, + #{detailContext.oldValue}, #{detailContext.fieldDesc}, #{detailContext.showorder}, #{detailContext.dataid}, + #{detailContext.belongDataid}, #{detailContext.isDetail}, + #{detailContext.tenant_key},#{detailContext.creator}, #{detailContext.newRealValue} + , #{detailContext.oldRealValue}, #{detailContext.tableNameDesc}, #{detailContext.tableNameLabelId}, + #{detailContext.fieldNameLabelId} + , #{detailContext.create_time}, #{detailContext.update_time}, #{detailContext.delete_type}) + + + + + + insert into ${tablename} (id, mainid, uuid, tablename, fieldname, newvalue, oldvalue, + fielddesc, showorder, dataid, belongDataid, isDetail, tenant_key,creator, newRealValue, + oldRealValue,tableNameDesc, + tableNameLabelId,fieldNameLabelId, create_time, update_time,delete_type) + VALUES + ( + #{detailContext.id},#{mainid}, #{detailContext.uuid}, #{detailContext.tableName}, + #{detailContext.fieldName}, #{detailContext.newValue}, + #{detailContext.oldValue}, #{detailContext.fieldDesc}, #{detailContext.showorder}, #{detailContext.dataid}, + #{detailContext.belongDataid}, #{detailContext.isDetail}, + #{detailContext.tenant_key},#{detailContext.creator}, #{detailContext.newRealValue} + , #{detailContext.oldRealValue}, #{detailContext.tableNameDesc}, #{detailContext.tableNameLabelId}, + #{detailContext.fieldNameLabelId} + , #{detailContext.create_time}, #{detailContext.update_time}, #{detailContext.delete_type} + ) + + + + + insert into ${tablename} (id, mainid, uuid, tablename, fieldname, newvalue, oldvalue, + fielddesc, showorder, dataid, belongDataid, isDetail, tenant_key,creator, newRealValue, + oldRealValue,tableNameDesc, + tableNameLabelId,fieldNameLabelId, create_time, update_time + ${cusColumns}) + values + + ( #{detailContext.id},#{mainid}, #{detailContext.uuid}, #{detailContext.tableName}, + #{detailContext.fieldName}, #{detailContext.newValue}, + #{detailContext.oldValue}, #{detailContext.fieldDesc}, #{detailContext.showorder}, #{detailContext.dataid}, + #{detailContext.belongDataid}, #{detailContext.isDetail}, + #{detailContext.tenant_key},#{detailContext.creator}, #{detailContext.newRealValue} + , #{detailContext.oldRealValue}, #{detailContext.tableNameDesc}, #{detailContext.tableNameLabelId}, + #{detailContext.fieldNameLabelId} + , #{detailContext.create_time}, #{detailContext.update_time} + ${detailContext.cusValus}) + + + + + update ${tableName} + set delete_type = 3 + where id = #{id} + + + update ${tableName} + set delete_type = 3 + where mainid = #{mainid} + + + + insert into ${tablename} (id, mainid, uuid, tablename, fieldname, newvalue, oldvalue, + fielddesc, showorder, dataid, belongDataid, isDetail, tenant_key,creator, newRealValue, + oldRealValue,tableNameDesc, + tableNameLabelId,fieldNameLabelId, create_time, update_time,delete_type) + + SELECT #{detailContext.id},#{mainid}, #{detailContext.uuid}, #{detailContext.tableName}, + #{detailContext.fieldName}, #{detailContext.newValue}, + #{detailContext.oldValue}, #{detailContext.fieldDesc}, #{detailContext.showorder}, #{detailContext.dataid}, + #{detailContext.belongDataid}, #{detailContext.isDetail}, + #{detailContext.tenant_key},#{detailContext.creator}, #{detailContext.newRealValue} + , #{detailContext.oldRealValue}, #{detailContext.tableNameDesc}, #{detailContext.tableNameLabelId}, + #{detailContext.fieldNameLabelId} + , #{detailContext.create_time}, #{detailContext.update_time}, #{detailContext.delete_type} + FROM DUAL + + + + + insert into ${tablename} (id, mainid, uuid, tablename, fieldname, newvalue, oldvalue, + fielddesc, showorder, dataid, belongDataid, isDetail, tenant_key,creator, newRealValue, + oldRealValue,tableNameDesc, + tableNameLabelId,fieldNameLabelId, create_time, update_time + ${cusColumns}) + + SELECT #{detailContext.id},#{mainid}, #{detailContext.uuid}, #{detailContext.tableName}, + #{detailContext.fieldName}, #{detailContext.newValue}, + #{detailContext.oldValue}, #{detailContext.fieldDesc}, #{detailContext.showorder}, #{detailContext.dataid}, + #{detailContext.belongDataid}, #{detailContext.isDetail}, + #{detailContext.tenant_key},#{detailContext.creator}, #{detailContext.newRealValue} + , #{detailContext.oldRealValue}, #{detailContext.tableNameDesc}, #{detailContext.tableNameLabelId}, + #{detailContext.fieldNameLabelId} + , #{detailContext.create_time}, #{detailContext.update_time} + ${detailContext.cusValus} + FROM DUAL + + + + diff --git a/resource/WEB-INF/config/mapper/hrmelog/LocalElogDaoMapper.xml b/resource/WEB-INF/config/mapper/hrmelog/LocalElogDaoMapper.xml new file mode 100644 index 000000000..2c1f0f427 --- /dev/null +++ b/resource/WEB-INF/config/mapper/hrmelog/LocalElogDaoMapper.xml @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resource/WEB-INF/config/mapper/hrmelog/QueryCurretValusMapper.xml b/resource/WEB-INF/config/mapper/hrmelog/QueryCurretValusMapper.xml new file mode 100644 index 000000000..b88e3cfee --- /dev/null +++ b/resource/WEB-INF/config/mapper/hrmelog/QueryCurretValusMapper.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/resource/WEB-INF/lib/hrmelog.jar b/resource/WEB-INF/lib/hrmelog.jar new file mode 100644 index 000000000..b1ce56c11 Binary files /dev/null and b/resource/WEB-INF/lib/hrmelog.jar differ diff --git a/resource/WEB-INF/prop/hrmSalary.properties b/resource/WEB-INF/prop/hrmSalary.properties index 743f4df00..4ca5b1e88 100644 --- a/resource/WEB-INF/prop/hrmSalary.properties +++ b/resource/WEB-INF/prop/hrmSalary.properties @@ -1,5 +1,5 @@ log=false defaultCloseNonStandard149=true AESEncryptScrect=990EB004A1C862721C1513AE90038C9E -version=2.7.3.2304.01 +version=2.12.1.2403.02 openFormulaForcedEditing=false \ No newline at end of file diff --git a/resource/WEB-INF/prop/hrmSalaryBillToken.properties b/resource/WEB-INF/prop/hrmSalaryBillToken.properties deleted file mode 100644 index 9efa48c03..000000000 --- a/resource/WEB-INF/prop/hrmSalaryBillToken.properties +++ /dev/null @@ -1,2 +0,0 @@ -appid_id=123456 -ip=127.0.0.1:8080 \ No newline at end of file diff --git a/resource/WEB-INF/prop/hrmSalaryCustom.properties b/resource/WEB-INF/prop/hrmSalaryCustom.properties deleted file mode 100644 index b873bc15e..000000000 --- a/resource/WEB-INF/prop/hrmSalaryCustom.properties +++ /dev/null @@ -1 +0,0 @@ -formulaRunOvertimeThreshold=10 \ No newline at end of file diff --git a/resource/jar/artemis-http-client-1.1.3.jar b/resource/jar/artemis-http-client-1.1.3.jar deleted file mode 100644 index df04afa68..000000000 Binary files a/resource/jar/artemis-http-client-1.1.3.jar and /dev/null differ diff --git a/resource/sql/公式修改.sql b/resource/sql/公式修改.sql deleted file mode 100644 index 2baed0f20..000000000 --- a/resource/sql/公式修改.sql +++ /dev/null @@ -1,3 +0,0 @@ -update hrsa_formula set formula = '' where id = 1651742702735 ; - -update hrsa_formula set formulaRunScript = '' where id = 1651742702735 ; \ No newline at end of file diff --git a/resource/sql/公式配置修改.sql b/resource/sql/公式配置修改.sql deleted file mode 100644 index 2b4700ad4..000000000 --- a/resource/sql/公式配置修改.sql +++ /dev/null @@ -1,31 +0,0 @@ - -INSERT INTO hrsa_formula (id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1653993466778, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{累计专项附加扣除.累计住房贷款利息}', 'addUpDeductions_addUpHousingLoanInterest', 1, 0, '2022-05-31 18:37:47', '2022-05-31 18:37:47') - / -INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653993466787, '累计住房贷款利息', 1653993466778, 'addUpDeductions_addUpHousingLoanInterest', '{累计专项附加扣除.累计住房贷款利息}', 'number', 'addUpDeductions', 0, 1, 0, '2022-05-31 18:37:47', '2022-05-31 18:37:47') - / -INSERT INTO hrsa_formula ( id , name , description , module , use_for , reference_type , return_type , validate_type , extend_param , formula , formulaRunScript , creator , delete_type , create_time , update_time ) VALUES (1653993837931, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{累计专项附加扣除.累计住房租金}', 'addUpDeductions_addUpHousingRent', 1, 0, '2022-05-31 18:43:58', '2022-05-31 18:43:58') - / -INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653993837947, '累计住房租金', 1653993837931, 'addUpDeductions_addUpHousingRent', '{累计专项附加扣除.累计住房租金}', 'number', 'addUpDeductions', 0, 1, 0, '2022-05-31 18:43:58', '2022-05-31 18:43:58') - / -INSERT INTO hrsa_formula ( id , name , description , module , use_for , reference_type , return_type , validate_type , extend_param , formula , formulaRunScript , creator , delete_type , create_time , update_time ) VALUES (1653993954233, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{累计专项附加扣除.累计继续教育}', 'addUpDeductions_addUpContinuingEducation', 1, 0, '2022-05-31 18:45:54', '2022-05-31 18:45:54') - / -INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653993954257, '累计继续教育', 1653993954233, 'addUpDeductions_addUpContinuingEducation', '{累计专项附加扣除.累计继续教育}', 'number', 'addUpDeductions', 0, 1, 0, '2022-05-31 18:45:54', '2022-05-31 18:45:54') - / -INSERT INTO hrsa_formula ( id , name , description , module , use_for , reference_type , return_type , validate_type , extend_param , formula , formulaRunScript , creator , delete_type , create_time , update_time ) VALUES (1653994061764, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{累计专项附加扣除.累计赡养老人}', 'addUpDeductions_addUpSupportElderly', 1, 0, '2022-05-31 18:47:42', '2022-05-31 18:47:42') - / -INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653994061780, '累计赡养老人', 1653994061764, 'addUpDeductions_addUpSupportElderly', '{累计专项附加扣除.累计赡养老人}', 'number', 'addUpDeductions', 0, 1, 0, '2022-05-31 18:47:42', '2022-05-31 18:47:42') - / - - -delete from hrsa_salary_item where sys_salary_item_id in (674853617092214800,674853617092214801,674853617092214802,674853617092214803) - / - - -update hrsa_sys_salary_item set formula_id = 1653993466778 where id = 674853617092214800 - / -update hrsa_sys_salary_item set formula_id = 1653993837931 where id = 674853617092214801 - / -update hrsa_sys_salary_item set formula_id = 1653993954233 where id = 674853617092214802 - / -update hrsa_sys_salary_item set formula_id = 1653994061764 where id = 674853617092214803 - / diff --git a/resource/sql/初始化系统薪资项目及对应的公式.sql b/resource/sql/初始化系统薪资项目及对应的公式.sql deleted file mode 100644 index 0027dc8e4..000000000 --- a/resource/sql/初始化系统薪资项目及对应的公式.sql +++ /dev/null @@ -1,200 +0,0 @@ -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214787, '工资薪金合计', 'wagesTotal', 1, 5, 22, 1, 0, 2, 2, 2, 1, 1651736817711, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:32:58', '2022-05-10 16:03:02', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214788, '全年一次性奖金合计', 'annualBonusTotal', 1, 5, 22, 0, 0, 2, 2, 2, 1, 1651737358294, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:32:58', '2022-05-10 16:03:07', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214789, '税前扣款合计', 'preTaxDeductionsTotal', 1, 5, 22, 1, 0, 2, 2, 2, 1, 1651737635353, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:32:58', '2022-05-10 16:03:22', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214790, '本月(次)应税收入合计', 'income', 1, 5, 22, 1, 0, 2, 2, 2, 0, 1651737859216, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:32:58', '2022-05-10 16:03:25', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214791, '当前累计应税收入合计', 'addUpIncome', 1, 5, 22, 1, 0, 2, 2, 2, 0, 1651738034028, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:32:58', '2022-05-10 16:03:28', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214792, '养老个人', 'endowmentInsurance', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651749914746, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214793, '医疗个人', 'medicalInsurance', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651749958879, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214795, '失业个人', 'unemploymentInsurance', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651750005281, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214796, '公积金个人', 'housingProvidentFund', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651750034689, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214797, '本月(次)专项扣除合计', 'specialDeduction', 1, 5, 22, 1, 0, 2, 2, 2, 7, 1651738826550, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 16:03:40', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214798, '当前累计专项扣除合计', 'addUpSpecialDeduction', 1, 5, 22, 1, 0, 2, 2, 2, 7, 1651739000845, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214799, '累计子女教育', 'addUpChildEducation', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739053212, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214800, '累计住房贷款利息', 'addUpHousingLoanInterest', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739100651, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214801, '累计住房租金', 'addUpHousingRent', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739151122, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214802, '累计继续教育', 'addUpContinuingEducation', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739212437, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214803, '累计赡养老人', 'addUpSupportElderly', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739310959, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214804, '当前累计专项附加扣除合计', 'addUpSpeAddiDeduction', 1, 5, 22, 1, 0, 2, 2, 2, 6, 1651739411365, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214805, '本月(次)其他扣除合计', 'otherDeduction', 1, 5, 22, 0, 0, 2, 2, 2, 8, 1651739815651, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214806, '当前累计其他扣除合计', 'addUpOtherDeduction', 1, 5, 22, 0, 0, 2, 2, 2, 5, 1651740238860, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214807, '本月(次)减除费用', 'subtraction', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651740311026, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:56:11', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214808, '当前累计减除费用', 'addUpSubtraction', 1, 5, 22, 1, 0, 2, 2, 2, 5, 1651740397225, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:32:59', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214809, '本月(次)工资薪金税税率', 'taxRate', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651742185837, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214810, '本月(次)工资薪金税速算扣除数', 'quickDeductionFactor', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651742702735, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214811, '当前累计应纳税所得额', 'addUpTaxableIncome', 1, 5, 22, 1, 0, 2, 2, 2, 5, 1651745445982, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 16:04:12', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214812, '当前累计应纳税额', 'addUpTaxPayable', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651748888864, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 16:04:14', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214813, '当前累计已扣缴税额合计', 'addUpAdvanceTax', 1, 5, 22, 1, 0, 2, 2, 2, 5, 1651748978482, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 16:04:18', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214814, '本月(次)应补税额', 'refundedOrSupplementedTax', 1, 6, 16, 1, 0, 2, 2, 2, 1, 1651749111981, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214815, '本月(次)实发薪资合计', 'netSalaryTotal', 1, 5, 22, 1, 0, 2, 2, 2, 1, 1651749240004, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 16:04:24', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674861648655892480, '基本工资', 'baseSalary', 1, 1, 1, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:57:46', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674861768948531201, '岗位工资', 'postSalary', 1, 1, 1, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:57:57', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674861880508628992, '考勤扣款', 'attendanceDeduction', 1, 2, 9, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:58:04', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093121, '税后报销合计', 'afterTaxReimbursementTotal', 1, 5, 22, 0, 0, 3, 2, 1, 1, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:58:06', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093122, '年金个人', 'annuity', 1, 2, 12, 0, 0, 2, 2, 2, 7, 1651749398360, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093123, '商业健康保险', 'commercialHealthInsurance', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1651749448800, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:00', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093124, '税延养老保险', 'taxDeferredEndowmentInsurance', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1651749487187, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093125, '财产原值', 'originalValueOfProperty', 1, 2, 12, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:58:29', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093126, '允许扣除的税费', 'deductedTax', 1, 2, 12, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:58:42', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093127, '其他', 'other', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1651749540147, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093128, '本月(次)费用', 'fee', 1, 7, 19, 0, 0, 2, 2, 1, 0, 0, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093129, '本月(次)免税收入', 'taxFreeIncome', 1, 7, 19, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:58:54', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093130, '减按计税比例', 'lessTaxProportion', 1, 7, 19, 0, 0, 2, 2, 1, 0, 0, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646657, '税后调整合计', 'afterTaxAdjustmentTotal', 1, 5, 22, 0, 0, 2, 2, 1, 1, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:59:09', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646658, '当前累计减免税额合计', 'addUpTaxDeduction', 1, 5, 22, 0, 0, 2, 2, 1, 5, 0, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646659, '本月(次)准允扣除的捐赠额', 'allowedDonation', 1, 5, 22, 0, 0, 2, 2, 2, 8, 1651749595061, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646660, '当前累计准备扣除的捐赠额', 'addUpAllowedDonation', 1, 5, 22, 0, 0, 2, 2, 2, 5, 1651749675268, '', 0, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 15:54:31', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646661, '本月(次)减免税额', 'taxDeduction', 1, 5, 22, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:01', '2022-05-10 16:00:25', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646662, '税后扣款合计', 'afterTaxDeductionsTotal', 1, 5, 22, 0, 0, 2, 2, 1, 1, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:02', '2022-05-10 16:00:37', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674919424520683521, '税后扣款', 'afterTaxDeductions', 1, 4, 15, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:02', '2022-05-10 16:00:39', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674919682288984064, '税后报销', 'afterTaxReimbursement', 1, 3, 13, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:02', '2022-05-10 16:00:40', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674919776783499264, '税后调整', 'afterTaxAdjustment', 1, 3, 14, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:02', '2022-05-10 16:00:48', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674920588574261248, '年终奖', 'annualBonus', 1, 1, 2, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', '2022-03-28 10:33:02', '2022-05-10 16:00:51', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (697532371614588928, '当前累计社保个人合计', 'addUpSocialSecurityTotal', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1651801433504, '', 0, 1, 0, 0, 'all_teams', '2022-03-07 10:22:55', '2022-05-06 09:44:23', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (697532667749400576, '当前累计公积金个人合计', 'addUpAccumulationFundTotal', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1651801586972, '', 0, 1, 0, 0, 'all_teams', '2022-03-07 10:22:55', '2022-05-06 09:46:40', 'number'); -INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (697536344384012289, '当前累计企业(职业)年金及其他福利个人合计', 'addUpEnterpriseAndOther', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1651801667770, '', 0, 1, 0, 0, 'all_teams', '2022-03-07 10:22:56', '2022-05-06 09:48:07', 'number'); - - - - -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651736817711, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.基本工资}+{薪资项目.岗位工资}', 'salaryItem_baseSalary+salaryItem_postSalary', 1, 0, '2022-05-05 15:46:58', '2022-05-05 15:46:58'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651737358294, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.年终奖}', 'salaryItem_annualBonus', 1, 0, '2022-05-05 15:55:58', '2022-05-05 15:55:58'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651737635353, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.考勤扣款}', 'salaryItem_attendanceDeduction', 1, 0, '2022-05-05 16:00:35', '2022-05-05 16:00:35'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651737859216, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.工资薪金合计}+{薪资项目.全年一次性奖金合计}-{薪资项目.税前扣款合计}', 'salaryItem_wagesTotal+salaryItem_annualBonusTotal-salaryItem_preTaxDeductionsTotal', 1, 0, '2022-05-05 16:04:19', '2022-05-05 16:04:19'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651738034028, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.本月(次)应税收入合计}+{往期累计情况.累计收入额}', 'salaryItem_income+addUpSituation_addUpIncome', 1, 0, '2022-05-05 16:07:14', '2022-05-05 16:07:14'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749914746, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.养老保险个人}', 'welfare_9001socialPer', 1, 0, '2022-05-05 19:25:15', '2022-05-05 19:25:15'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749958879, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.医疗保险个人}', 'welfare_9002socialPer', 1, 0, '2022-05-05 19:25:59', '2022-05-05 19:25:59'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651750005281, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.失业保险个人}', 'welfare_9004socialPer', 1, 0, '2022-05-05 19:26:45', '2022-05-05 19:26:45'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651750034689, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.住房公积金个人}', 'welfare_9006fundPer', 1, 0, '2022-05-05 19:27:15', '2022-05-05 19:27:15'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651738826550, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.养老个人}+{薪资项目.医疗个人}+{薪资项目.失业个人}+{薪资项目.公积金个人}', 'salaryItem_endowmentInsurance+salaryItem_medicalInsurance+salaryItem_unemploymentInsurance+salaryItem_housingProvidentFund', 1, 0, '2022-05-05 16:20:27', '2022-05-05 16:20:27'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739000845, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.本月(次)专项扣除合计}+{往期累计情况.累计社保个人合计}+{往期累计情况.累计公积金个人合计}', 'salaryItem_specialDeduction+addUpSituation_addUpSocialSecurityTotal+addUpSituation_addUpAccumulationFundTotal', 1, 0, '2022-05-05 16:23:21', '2022-05-05 16:23:21'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739053212, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{累计专项附加扣除.累计子女教育}', 'addUpDeductions_addUpChildEducation', 1, 0, '2022-05-05 16:24:13', '2022-05-05 16:24:13'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739100651, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{往期累计情况.累计住房贷款利息}', 'addUpSituation_addUpHousingLoanInterest', 1, 0, '2022-05-05 16:25:01', '2022-05-05 16:25:01'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739151122, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{往期累计情况.累计住房租金}', 'addUpSituation_addUpHousingRent', 1, 0, '2022-05-05 16:25:51', '2022-05-05 16:25:51'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739212437, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{往期累计情况.累计继续教育}', 'addUpSituation_addUpContinuingEducation', 1, 0, '2022-05-05 16:26:52', '2022-05-05 16:26:52'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739310959, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{往期累计情况.累计赡养老人}', 'addUpSituation_addUpSupportElderly', 1, 0, '2022-05-05 16:28:31', '2022-05-05 16:28:31'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739411365, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.累计子女教育}+{薪资项目.累计住房贷款利息}+{薪资项目.累计住房租金}+{薪资项目.累计继续教育}+{薪资项目.累计赡养老人}', 'salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly', 1, 0, '2022-05-05 16:30:11', '2022-05-05 16:30:11'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739815651, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.年金个人}+{薪资项目.商业健康保险}+{薪资项目.税延养老保险}+{薪资项目.财产原值}+{薪资项目.允许扣除的税费}+{薪资项目.其他}', 'salaryItem_annuity+salaryItem_commercialHealthInsurance+salaryItem_taxDeferredEndowmentInsurance+salaryItem_originalValueOfProperty+salaryItem_deductedTax+salaryItem_other', 1, 0, '2022-05-05 16:36:56', '2022-05-05 16:36:56'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651740238860, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.本月(次)其他扣除合计}+{往期累计情况.累计其他免税扣除}+{往期累计情况.累计企业(职业)年金及其他福利}', 'salaryItem_otherDeduction+addUpSituation_addUpOtherDeduction+addUpSituation_addUpEnterpriseAndOther', 1, 0, '2022-05-05 16:43:59', '2022-05-05 16:43:59'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651740311026, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '5000', '5000', 1, 0, '2022-05-05 16:45:11', '2022-05-05 16:45:11'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651740397225, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.本月(次)减除费用}+{往期累计情况.累计减除费用}', 'salaryItem_subtraction+addUpSituation_addUpSubtraction', 1, 0, '2022-05-05 16:46:37', '2022-05-05 16:46:37'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651742185837, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if({薪资项目.当前累计应纳税所得额}<=0){0;}else if({薪资项目.当前累计应纳税所得额}<=36000){0.03;}else if({薪资项目.当前累计应纳税所得额}<=144000){0.1;}else if({薪资项目.当前累计应纳税所得额}<=300000){0.2;}else if({薪资项目.当前累计应纳税所得额}<=420000){0.25;}else if({薪资项目.当前累计应纳税所得额}<=660000){0.3;}else if({薪资项目.当前累计应纳税所得额}<=960000){0.35;}else{0.45;}', 'if(salaryItem_addUpTaxableIncome<=0){0;}else if(salaryItem_addUpTaxableIncome<=36000){0.03;}else if(salaryItem_addUpTaxableIncome<=144000){0.1;}else if(salaryItem_addUpTaxableIncome<=300000){0.2;}else if(salaryItem_addUpTaxableIncome<=420000){0.25;}else if(salaryItem_addUpTaxableIncome<=660000){0.3;}else if(salaryItem_addUpTaxableIncome<=960000){0.35;}else{0.45;}', 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651742702735, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if(<=36000){{薪资项目.当前累计应纳税所得额}<=36000){0;}else if({薪资项目.当前累计应纳税所得额}<=144000){2520;}else if({薪资项目.当前累计应纳税所得额}<=300000){16920;}else if({薪资项目.当前累计应纳税所得额}<=420000){31920;}else if({薪资项目.当前累计应纳税所得额}<=660000){52920;}else if({薪资项目.当前累计应纳税所得额}<=960000){85920;}else{181920;}', 'if(<=36000){salaryItem_addUpTaxableIncome<=36000){0;}else if(salaryItem_addUpTaxableIncome<=144000){2520;}else if(salaryItem_addUpTaxableIncome<=300000){16920;}else if(salaryItem_addUpTaxableIncome<=420000){31920;}else if(salaryItem_addUpTaxableIncome<=660000){52920;}else if(salaryItem_addUpTaxableIncome<=960000){85920;}else{181920;}', 1, 0, '2022-05-05 17:25:03', '2022-05-05 17:25:03'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651745445982, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.当前累计应税收入合计}-{薪资项目.当前累计专项扣除合计}-{薪资项目.当前累计专项附加扣除合计}-{薪资项目.当前累计其他扣除合计}-{薪资项目.当前累计减除费用}-{薪资项目.当前累计准备扣除的捐赠额}', 'salaryItem_addUpIncome-salaryItem_addUpSpecialDeduction-salaryItem_addUpSpeAddiDeduction-salaryItem_addUpOtherDeduction-salaryItem_addUpSubtraction-salaryItem_addUpAllowedDonation', 1, 0, '2022-05-05 18:10:46', '2022-05-05 18:10:46'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651748888864, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.当前累计应纳税所得额}*{薪资项目.本月(次)工资薪金税税率}-{薪资项目.本月(次)工资薪金税速算扣除数}', 'salaryItem_addUpTaxableIncome*salaryItem_taxRate-salaryItem_quickDeductionFactor', 1, 0, '2022-05-05 19:08:09', '2022-05-05 19:08:09'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651748978482, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{往期累计情况.累计已预扣预缴税额}', 'addUpSituation_addUpAdvanceTax', 1, 0, '2022-05-05 19:09:38', '2022-05-05 19:09:38'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749111981, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.当前累计应纳税额}-{薪资项目.当前累计已扣缴税额合计}-{薪资项目.当前累计减免税额合计}', 'salaryItem_addUpTaxPayable-salaryItem_addUpAdvanceTax-salaryItem_addUpTaxDeduction', 1, 0, '2022-05-05 19:11:52', '2022-05-05 19:11:52'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749240004, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.本月(次)应税收入合计}-{薪资项目.本月(次)专项扣除合计}-{薪资项目.本月(次)应补税额}+{薪资项目.税后调整合计}+{薪资项目.税后报销合计}-{薪资项目.税后扣款合计}', 'salaryItem_income-salaryItem_specialDeduction-salaryItem_refundedOrSupplementedTax+salaryItem_afterTaxAdjustmentTotal+salaryItem_afterTaxReimbursementTotal-salaryItem_afterTaxDeductionsTotal', 1, 0, '2022-05-05 19:14:00', '2022-05-05 19:14:00'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749398360, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.企业年金个人}', 'welfare_9007otherPer', 1, 0, '2022-05-05 19:16:38', '2022-05-05 19:16:38'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749448800, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{其他免税扣除.商业健康保险}', 'otherDeduction_businessHealthyInsurance', 1, 0, '2022-05-05 19:17:29', '2022-05-05 19:17:29'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749487187, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{其他免税扣除.税延养老保险}', 'otherDeduction_taxDelayEndowmentInsurance', 1, 0, '2022-05-05 19:18:07', '2022-05-05 19:18:07'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749540147, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{其他免税扣除.其他}', 'otherDeduction_otherDeduction', 1, 0, '2022-05-05 19:19:00', '2022-05-05 19:19:00'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749595061, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{其他免税扣除.准予扣除的捐赠额}', 'otherDeduction_deductionAllowedDonation', 1, 0, '2022-05-05 19:19:55', '2022-05-05 19:19:55'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749675268, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.本月(次)准允扣除的捐赠额}+{往期累计情况.累计准予扣除的捐赠额}', 'salaryItem_allowedDonation+addUpSituation_addUpAllowedDonation', 1, 0, '2022-05-05 19:21:15', '2022-05-05 19:21:15'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651801433504, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.社保个人合计}+{往期累计情况.累计社保个人合计}', 'welfare_socialPerSum+addUpSituation_addUpSocialSecurityTotal', 1, 0, '2022-05-06 09:43:54', '2022-05-06 09:43:54'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651801586972, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.公积金个人合计}+{往期累计情况.累计公积金个人合计}', 'welfare_fundPerSum+addUpSituation_addUpAccumulationFundTotal', 1, 0, '2022-05-06 09:46:27', '2022-05-06 09:46:27'); -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651801667770, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{社保福利.其他福利个人合计}+{往期累计情况.累计企业(职业)年金及其他福利}', 'welfare_otherPerSum+addUpSituation_addUpEnterpriseAndOther', 1, 0, '2022-05-06 09:47:48', '2022-05-06 09:47:48'); - - - - - - -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651736818266, '基本工资', 1651736817711, 'salaryItem_baseSalary', '{薪资项目.基本工资}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 15:46:58', '2022-05-05 15:46:58'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651736818329, '岗位工资', 1651736817711, 'salaryItem_postSalary', '{薪资项目.岗位工资}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 15:46:58', '2022-05-05 15:46:58'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737360610, '年终奖', 1651737358294, 'salaryItem_annualBonus', '{薪资项目.年终奖}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 15:55:58', '2022-05-05 15:55:58'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737636061, '考勤扣款', 1651737635353, 'salaryItem_attendanceDeduction', '{薪资项目.考勤扣款}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:00:35', '2022-05-05 16:00:35'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737859281, '工资薪金合计', 1651737859216, 'salaryItem_wagesTotal', '{薪资项目.工资薪金合计}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:04:19', '2022-05-05 16:04:19'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737859342, '全年一次性奖金合计', 1651737859216, 'salaryItem_annualBonusTotal', '{薪资项目.全年一次性奖金合计}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 16:04:19', '2022-05-05 16:04:19'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737859401, '税前扣款合计', 1651737859216, 'salaryItem_preTaxDeductionsTotal', '{薪资项目.税前扣款合计}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 16:04:19', '2022-05-05 16:04:19'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738035450, '本月(次)应税收入合计', 1651738034028, 'salaryItem_income', '{薪资项目.本月(次)应税收入合计}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:07:14', '2022-05-05 16:07:14'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738035488, '累计收入额', 1651738034028, 'addUpSituation_addUpIncome', '{往期累计情况.累计收入额}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-05 16:07:14', '2022-05-05 16:07:14'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738832854, '养老个人', 1651738826550, 'salaryItem_endowmentInsurance', '{薪资项目.养老个人}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:20:27', '2022-05-05 16:20:27'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738837363, '医疗个人', 1651738826550, 'salaryItem_medicalInsurance', '{薪资项目.医疗个人}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 16:20:27', '2022-05-05 16:20:27'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738837909, '失业个人', 1651738826550, 'salaryItem_unemploymentInsurance', '{薪资项目.失业个人}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 16:20:27', '2022-05-05 16:20:27'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738838429, '公积金个人', 1651738826550, 'salaryItem_housingProvidentFund', '{薪资项目.公积金个人}', 'number', 'salaryItem', 3, 1, 0, '2022-05-05 16:20:27', '2022-05-05 16:20:27'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739002623, '本月(次)专项扣除合计', 1651739000845, 'salaryItem_specialDeduction', '{薪资项目.本月(次)专项扣除合计}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:23:21', '2022-05-05 16:23:21'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739002682, '累计社保个人合计', 1651739000845, 'addUpSituation_addUpSocialSecurityTotal', '{往期累计情况.累计社保个人合计}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-05 16:23:21', '2022-05-05 16:23:21'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739003139, '累计公积金个人合计', 1651739000845, 'addUpSituation_addUpAccumulationFundTotal', '{往期累计情况.累计公积金个人合计}', 'number', 'addUpSituation', 2, 1, 0, '2022-05-05 16:23:21', '2022-05-05 16:23:21'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739054270, '累计子女教育', 1651739053212, 'addUpDeductions_addUpChildEducation', '{累计专项附加扣除.累计子女教育}', 'number', 'addUpDeductions', 0, 1, 0, '2022-05-05 16:24:13', '2022-05-05 16:24:13'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739101122, '累计住房贷款利息', 1651739100651, 'addUpSituation_addUpHousingLoanInterest', '{往期累计情况.累计住房贷款利息}', 'number', 'addUpSituation', 0, 1, 0, '2022-05-05 16:25:01', '2022-05-05 16:25:01'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739151221, '累计住房租金', 1651739151122, 'addUpSituation_addUpHousingRent', '{往期累计情况.累计住房租金}', 'number', 'addUpSituation', 0, 1, 0, '2022-05-05 16:25:51', '2022-05-05 16:25:51'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739213082, '累计继续教育', 1651739212437, 'addUpSituation_addUpContinuingEducation', '{往期累计情况.累计继续教育}', 'number', 'addUpSituation', 0, 1, 0, '2022-05-05 16:26:52', '2022-05-05 16:26:52'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739311009, '累计赡养老人', 1651739310959, 'addUpSituation_addUpSupportElderly', '{往期累计情况.累计赡养老人}', 'number', 'addUpSituation', 0, 1, 0, '2022-05-05 16:28:31', '2022-05-05 16:28:31'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411502, '累计子女教育', 1651739411365, 'salaryItem_addUpChildEducation', '{薪资项目.累计子女教育}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:30:11', '2022-05-05 16:30:11'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411637, '累计住房贷款利息', 1651739411365, 'salaryItem_addUpHousingLoanInterest', '{薪资项目.累计住房贷款利息}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 16:30:11', '2022-05-05 16:30:11'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411715, '累计住房租金', 1651739411365, 'salaryItem_addUpHousingRent', '{薪资项目.累计住房租金}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 16:30:11', '2022-05-05 16:30:11'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411773, '累计继续教育', 1651739411365, 'salaryItem_addUpContinuingEducation', '{薪资项目.累计继续教育}', 'number', 'salaryItem', 3, 1, 0, '2022-05-05 16:30:11', '2022-05-05 16:30:11'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739412718, '累计赡养老人', 1651739411365, 'salaryItem_addUpSupportElderly', '{薪资项目.累计赡养老人}', 'number', 'salaryItem', 4, 1, 0, '2022-05-05 16:30:11', '2022-05-05 16:30:11'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739819892, '年金个人', 1651739815651, 'salaryItem_annuity', '{薪资项目.年金个人}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:36:56', '2022-05-05 16:36:56'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739822564, '商业健康保险', 1651739815651, 'salaryItem_commercialHealthInsurance', '{薪资项目.商业健康保险}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 16:36:56', '2022-05-05 16:36:56'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739826637, '税延养老保险', 1651739815651, 'salaryItem_taxDeferredEndowmentInsurance', '{薪资项目.税延养老保险}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 16:36:56', '2022-05-05 16:36:56'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739828954, '财产原值', 1651739815651, 'salaryItem_originalValueOfProperty', '{薪资项目.财产原值}', 'number', 'salaryItem', 3, 1, 0, '2022-05-05 16:36:56', '2022-05-05 16:36:56'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739829915, '允许扣除的税费', 1651739815651, 'salaryItem_deductedTax', '{薪资项目.允许扣除的税费}', 'number', 'salaryItem', 4, 1, 0, '2022-05-05 16:36:56', '2022-05-05 16:36:56'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739830465, '其他', 1651739815651, 'salaryItem_other', '{薪资项目.其他}', 'number', 'salaryItem', 5, 1, 0, '2022-05-05 16:36:56', '2022-05-05 16:36:56'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740240713, '本月(次)其他扣除合计', 1651740238860, 'salaryItem_otherDeduction', '{薪资项目.本月(次)其他扣除合计}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:43:59', '2022-05-05 16:43:59'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740241221, '累计其他免税扣除', 1651740238860, 'addUpSituation_addUpOtherDeduction', '{往期累计情况.累计其他免税扣除}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-05 16:43:59', '2022-05-05 16:43:59'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740241717, '累计企业(职业)年金及其他福利', 1651740238860, 'addUpSituation_addUpEnterpriseAndOther', '{往期累计情况.累计企业(职业)年金及其他福利}', 'number', 'addUpSituation', 2, 1, 0, '2022-05-05 16:43:59', '2022-05-05 16:43:59'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740397497, '本月(次)减除费用', 1651740397225, 'salaryItem_subtraction', '{薪资项目.本月(次)减除费用}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 16:46:37', '2022-05-05 16:46:37'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740397989, '累计减除费用', 1651740397225, 'addUpSituation_addUpSubtraction', '{往期累计情况.累计减除费用}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-05 16:46:37', '2022-05-05 16:46:37'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742185950, '当前累计应纳税所得额', 1651742185837, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742185995, '当前累计应纳税所得额', 1651742185837, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186035, '当前累计应纳税所得额', 1651742185837, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186085, '当前累计应纳税所得额', 1651742185837, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 3, 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186122, '当前累计应纳税所得额', 1651742185837, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 4, 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186155, '当前累计应纳税所得额', 1651742185837, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 5, 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186199, '当前累计应纳税所得额', 1651742185837, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 6, 1, 0, '2022-05-05 17:16:26', '2022-05-05 17:16:26'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742704826, '当前累计应纳税所得额', 1651742702735, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 17:25:03', '2022-05-05 17:25:03'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742705308, '当前累计应纳税所得额', 1651742702735, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 17:25:03', '2022-05-05 17:25:03'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742705782, '当前累计应纳税所得额', 1651742702735, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 17:25:03', '2022-05-05 17:25:03'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742705831, '当前累计应纳税所得额', 1651742702735, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 3, 1, 0, '2022-05-05 17:25:03', '2022-05-05 17:25:03'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742706306, '当前累计应纳税所得额', 1651742702735, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 4, 1, 0, '2022-05-05 17:25:03', '2022-05-05 17:25:03'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742706368, '当前累计应纳税所得额', 1651742702735, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 5, 1, 0, '2022-05-05 17:25:03', '2022-05-05 17:25:03'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745446904, '当前累计应税收入合计', 1651745445982, 'salaryItem_addUpIncome', '{薪资项目.当前累计应税收入合计}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 18:10:46', '2022-05-05 18:10:46'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745447442, '当前累计专项扣除合计', 1651745445982, 'salaryItem_addUpSpecialDeduction', '{薪资项目.当前累计专项扣除合计}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 18:10:46', '2022-05-05 18:10:46'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745447969, '当前累计专项附加扣除合计', 1651745445982, 'salaryItem_addUpSpeAddiDeduction', '{薪资项目.当前累计专项附加扣除合计}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 18:10:46', '2022-05-05 18:10:46'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745448475, '当前累计其他扣除合计', 1651745445982, 'salaryItem_addUpOtherDeduction', '{薪资项目.当前累计其他扣除合计}', 'number', 'salaryItem', 3, 1, 0, '2022-05-05 18:10:46', '2022-05-05 18:10:46'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745451616, '当前累计减除费用', 1651745445982, 'salaryItem_addUpSubtraction', '{薪资项目.当前累计减除费用}', 'number', 'salaryItem', 4, 1, 0, '2022-05-05 18:10:46', '2022-05-05 18:10:46'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745452097, '当前累计准备扣除的捐赠额', 1651745445982, 'salaryItem_addUpAllowedDonation', '{薪资项目.当前累计准备扣除的捐赠额}', 'number', 'salaryItem', 5, 1, 0, '2022-05-05 18:10:46', '2022-05-05 18:10:46'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748888918, '当前累计应纳税所得额', 1651748888864, 'salaryItem_addUpTaxableIncome', '{薪资项目.当前累计应纳税所得额}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 19:08:09', '2022-05-05 19:08:09'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748888952, '本月(次)工资薪金税税率', 1651748888864, 'salaryItem_taxRate', '{薪资项目.本月(次)工资薪金税税率}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 19:08:09', '2022-05-05 19:08:09'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748888989, '本月(次)工资薪金税速算扣除数', 1651748888864, 'salaryItem_quickDeductionFactor', '{薪资项目.本月(次)工资薪金税速算扣除数}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 19:08:09', '2022-05-05 19:08:09'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748978520, '累计已预扣预缴税额', 1651748978482, 'addUpSituation_addUpAdvanceTax', '{往期累计情况.累计已预扣预缴税额}', 'number', 'addUpSituation', 0, 1, 0, '2022-05-05 19:09:38', '2022-05-05 19:09:38'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749112037, '当前累计应纳税额', 1651749111981, 'salaryItem_addUpTaxPayable', '{薪资项目.当前累计应纳税额}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 19:11:52', '2022-05-05 19:11:52'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749112068, '当前累计已扣缴税额合计', 1651749111981, 'salaryItem_addUpAdvanceTax', '{薪资项目.当前累计已扣缴税额合计}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 19:11:52', '2022-05-05 19:11:52'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749112116, '当前累计减免税额合计', 1651749111981, 'salaryItem_addUpTaxDeduction', '{薪资项目.当前累计减免税额合计}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 19:11:52', '2022-05-05 19:11:52'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240040, '本月(次)应税收入合计', 1651749240004, 'salaryItem_income', '{薪资项目.本月(次)应税收入合计}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 19:14:00', '2022-05-05 19:14:00'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240082, '本月(次)专项扣除合计', 1651749240004, 'salaryItem_specialDeduction', '{薪资项目.本月(次)专项扣除合计}', 'number', 'salaryItem', 1, 1, 0, '2022-05-05 19:14:00', '2022-05-05 19:14:00'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240117, '本月(次)应补税额', 1651749240004, 'salaryItem_refundedOrSupplementedTax', '{薪资项目.本月(次)应补税额}', 'number', 'salaryItem', 2, 1, 0, '2022-05-05 19:14:00', '2022-05-05 19:14:00'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240164, '税后调整合计', 1651749240004, 'salaryItem_afterTaxAdjustmentTotal', '{薪资项目.税后调整合计}', 'number', 'salaryItem', 3, 1, 0, '2022-05-05 19:14:00', '2022-05-05 19:14:00'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240199, '税后报销合计', 1651749240004, 'salaryItem_afterTaxReimbursementTotal', '{薪资项目.税后报销合计}', 'number', 'salaryItem', 4, 1, 0, '2022-05-05 19:14:00', '2022-05-05 19:14:00'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240245, '税后扣款合计', 1651749240004, 'salaryItem_afterTaxDeductionsTotal', '{薪资项目.税后扣款合计}', 'number', 'salaryItem', 5, 1, 0, '2022-05-05 19:14:00', '2022-05-05 19:14:00'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749398399, '企业年金个人', 1651749398360, 'welfare_9007otherPer', '{社保福利.企业年金个人}', 'number', 'welfare', 0, 1, 0, '2022-05-05 19:16:38', '2022-05-05 19:16:38'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749448843, '商业健康保险', 1651749448800, 'otherDeduction_businessHealthyInsurance', '{其他免税扣除.商业健康保险}', 'number', 'otherDeduction', 0, 1, 0, '2022-05-05 19:17:29', '2022-05-05 19:17:29'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749487225, '税延养老保险', 1651749487187, 'otherDeduction_taxDelayEndowmentInsurance', '{其他免税扣除.税延养老保险}', 'number', 'otherDeduction', 0, 1, 0, '2022-05-05 19:18:07', '2022-05-05 19:18:07'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749540213, '其他', 1651749540147, 'otherDeduction_otherDeduction', '{其他免税扣除.其他}', 'number', 'otherDeduction', 0, 1, 0, '2022-05-05 19:19:00', '2022-05-05 19:19:00'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749596472, '准予扣除的捐赠额', 1651749595061, 'otherDeduction_deductionAllowedDonation', '{其他免税扣除.准予扣除的捐赠额}', 'number', 'otherDeduction', 0, 1, 0, '2022-05-05 19:19:55', '2022-05-05 19:19:55'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749675326, '本月(次)准允扣除的捐赠额', 1651749675268, 'salaryItem_allowedDonation', '{薪资项目.本月(次)准允扣除的捐赠额}', 'number', 'salaryItem', 0, 1, 0, '2022-05-05 19:21:15', '2022-05-05 19:21:15'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749675365, '累计准予扣除的捐赠额', 1651749675268, 'addUpSituation_addUpAllowedDonation', '{往期累计情况.累计准予扣除的捐赠额}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-05 19:21:15', '2022-05-05 19:21:15'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749914793, '养老保险个人', 1651749914746, 'welfare_9001socialPer', '{社保福利.养老保险个人}', 'number', 'welfare', 0, 1, 0, '2022-05-05 19:25:15', '2022-05-05 19:25:15'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749958917, '医疗保险个人', 1651749958879, 'welfare_9002socialPer', '{社保福利.医疗保险个人}', 'number', 'welfare', 0, 1, 0, '2022-05-05 19:25:59', '2022-05-05 19:25:59'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651750005320, '失业保险个人', 1651750005281, 'welfare_9004socialPer', '{社保福利.失业保险个人}', 'number', 'welfare', 0, 1, 0, '2022-05-05 19:26:45', '2022-05-05 19:26:45'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651750034727, '住房公积金个人', 1651750034689, 'welfare_9006fundPer', '{社保福利.住房公积金个人}', 'number', 'welfare', 0, 1, 0, '2022-05-05 19:27:15', '2022-05-05 19:27:15'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801435862, '社保个人合计', 1651801433504, 'welfare_socialPerSum', '{社保福利.社保个人合计}', 'number', 'welfare', 0, 1, 0, '2022-05-06 09:43:54', '2022-05-06 09:43:54'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801436423, '累计社保个人合计', 1651801433504, 'addUpSituation_addUpSocialSecurityTotal', '{往期累计情况.累计社保个人合计}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-06 09:43:54', '2022-05-06 09:43:54'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801587331, '公积金个人合计', 1651801586972, 'welfare_fundPerSum', '{社保福利.公积金个人合计}', 'number', 'welfare', 0, 1, 0, '2022-05-06 09:46:27', '2022-05-06 09:46:27'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801587794, '累计公积金个人合计', 1651801586972, 'addUpSituation_addUpAccumulationFundTotal', '{往期累计情况.累计公积金个人合计}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-06 09:46:27', '2022-05-06 09:46:27'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801669969, '其他福利个人合计', 1651801667770, 'welfare_otherPerSum', '{社保福利.其他福利个人合计}', 'number', 'welfare', 0, 1, 0, '2022-05-06 09:47:48', '2022-05-06 09:47:48'); -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801670474, '累计企业(职业)年金及其他福利', 1651801667770, 'addUpSituation_addUpEnterpriseAndOther', '{往期累计情况.累计企业(职业)年金及其他福利}', 'number', 'addUpSituation', 1, 1, 0, '2022-05-06 09:47:48', '2022-05-06 09:47:48'); - - - - -INSERT INTO hrsa_sob_default_emp_field(id, field_code, sorted_index, can_delete, creator, create_time, update_time, delete_type, tenant_key) VALUES (681983911359291652, 'taxAgentName', 0, 0, 0, '2022-02-23 17:32:08', '2022-02-23 17:32:08', 0, 'all_teams'); -INSERT INTO hrsa_sob_default_emp_field(id, field_code, sorted_index, can_delete, creator, create_time, update_time, delete_type, tenant_key) VALUES (681983911359291653, 'username', 1, 0, 0, '2022-02-23 17:32:08', '2022-02-23 17:32:08', 0, 'all_teams'); -INSERT INTO hrsa_sob_default_emp_field(id, field_code, sorted_index, can_delete, creator, create_time, update_time, delete_type, tenant_key) VALUES (681983911359291654, 'departmentName', 2, 0, 0, '2022-02-23 17:32:08', '2022-02-23 17:32:08', 0, 'all_teams'); - - -ALTER TABLE hrsa_salary_sob_item ADD COLUMN can_delete int(0) NULL COMMENT '是否可删除,0:不可删除,1:可删除' AFTER tenant_key; - -ALTER TABLE hrsa_salary_sob_item ADD can_delete int NULL -GO \ No newline at end of file diff --git a/resource/sql/初始化账套默认分组和项目.sql b/resource/sql/初始化账套默认分组和项目.sql deleted file mode 100644 index ee8843cf7..000000000 --- a/resource/sql/初始化账套默认分组和项目.sql +++ /dev/null @@ -1,74 +0,0 @@ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368900, 4, 703459464954929153, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368899, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368902, 4, 703458434280095745, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368901, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368903, 4, 703458558739300353, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368901, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368905, 4, 674914626953093123, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368904, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368906, 4, 674914626953093124, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368904, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368907, 4, 674914626953093127, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368904, 2); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368908, 4, 674916065864646659, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368904, 3); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368910, 4, 704467747234045953, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368909, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368911, 4, 704468391612751873, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368909, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368912, 4, 704468443048992769, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368909, 2); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368913, 4, 704468490269204481, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368909, 3); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368914, 4, 704468528928063488, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 704495325212368909, 4); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368915, 4, 703459151591383041, 1, 0, 0, '2022-03-14 11:32:32', '2022-03-17 16:14:11', 0, 'all_teams', 0, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312448, 1, 703459151591383041, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-18 16:59:23', 0, 'all_teams', 0, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312449, 1, 674861648655892480, 1, 1, 0, '2022-03-14 11:32:28', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614083, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312450, 1, 674861768948531201, 1, 1, 0, '2022-03-14 11:32:28', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614083, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312451, 1, 674861880508628992, 1, 1, 0, '2022-03-14 11:32:28', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614083, 2); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312452, 1, 674920588574261248, 1, 1, 0, '2022-03-14 11:32:28', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614083, 3); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312453, 1, 674853617092214790, 1, 0, 0, '2022-03-14 11:32:28', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614083, 4); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312454, 1, 674853617092214791, 1, 0, 0, '2022-03-14 11:32:28', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614083, 5); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312455, 1, 674914626953093129, 1, 0, 0, '2022-03-14 11:32:28', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614083, 6); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312456, 1, 703419929857687552, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614083, 7); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312457, 1, 674853617092214792, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614092, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312458, 1, 674853617092214793, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614092, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312459, 1, 674853617092214795, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614092, 2); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312460, 1, 674853617092214796, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614092, 3); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312461, 1, 700599184238075904, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614092, 4); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312462, 1, 700599446244319233, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614092, 5); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312463, 1, 674853617092214797, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614092, 6); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312464, 1, 697532371614588928, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614092, 7); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312465, 1, 697532667749400576, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614092, 8); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312466, 1, 697536344384012289, 1, 0, 0, '2022-03-18 16:24:49', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614092, 9); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312467, 1, 674853617092214798, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614092, 10); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312468, 1, 674853617092214803, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614103, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312469, 1, 674853617092214802, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614103, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312470, 1, 674853617092214801, 1, 0, 0, '2022-03-14 11:32:29', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614103, 2); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312471, 1, 674853617092214800, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614103, 3); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312472, 1, 674853617092214799, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614103, 4); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312473, 1, 705641858303836161, 1, 0, 0, '2022-03-17 13:48:51', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614103, 5); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312474, 1, 674853617092214804, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614103, 6); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312475, 1, 674853617092214807, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614110, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312476, 1, 674853617092214808, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614110, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312477, 1, 674914626953093122, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614110, 2); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312478, 1, 674914626953093123, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614110, 3); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312479, 1, 674914626953093124, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614110, 4); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312480, 1, 674914626953093127, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614110, 5); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312481, 1, 674853617092214805, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614110, 6); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312482, 1, 674853617092214806, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614110, 7); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312483, 1, 674916065864646659, 1, 0, 0, '2022-03-18 16:30:21', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614110, 8); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312484, 1, 674916065864646660, 1, 0, 0, '2022-03-18 16:30:21', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614110, 9); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312485, 1, 674853617092214811, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 0); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312486, 1, 674853617092214809, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614119, 1); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312487, 1, 674853617092214810, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614119, 2); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312488, 1, 674853617092214812, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614119, 3); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312489, 1, 674853617092214813, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614119, 4); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312490, 1, 674916065864646661, 1, 1, 0, '2022-03-18 16:33:37', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614119, 5); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312491, 1, 674916065864646658, 1, 1, 0, '2022-03-18 16:33:37', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614119, 6); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312492, 1, 674853617092214814, 1, 0, 0, '2022-03-14 11:32:31', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 7); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312493, 1, 674853617092214815, 1, 1, 0, '2022-03-14 11:32:31', '2022-03-18 16:59:23', 0, 'all_teams', 703433961629614126, 6); -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312494, 1, 700769462612156416, 1, 1, 0, '2022-03-14 11:32:31', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614126, 7); - - - - -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614083, 1, '收入以及免税', 0, '', '2022-03-11 14:49:01', '2022-03-11 14:49:01', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614092, 1, '专项扣除', 1, '', '2022-03-11 14:49:27', '2022-03-11 14:49:27', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614103, 1, '累计专项附加扣除', 2, '', '2022-03-11 14:49:27', '2022-03-11 14:49:27', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614110, 1, '其他扣除等信息', 3, '', '2022-03-11 14:49:27', '2022-03-11 14:49:27', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614119, 1, '税款计算', 4, '', '2022-03-11 14:49:27', '2022-03-11 14:49:27', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614126, 1, '应发实发', 5, '', '2022-03-11 14:49:28', '2022-03-11 14:49:28', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368899, 4, '所得项目', 0, '', '2022-03-15 17:52:48', '2022-03-15 18:14:53', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368901, 4, '收入及免税', 1, '', '2022-03-15 17:52:48', '2022-03-15 18:14:53', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368904, 4, '其他扣除等信息', 2, '', '2022-03-15 17:52:48', '2022-03-15 18:14:53', 0, 0, 'all_teams'); -INSERT INTO hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368909, 4, '税款计算', 3, '', '2022-03-15 17:52:48', '2022-03-15 18:14:53', 0, 0, 'all_teams'); diff --git a/resource/sql/删除档案脚本.sql b/resource/sql/删除档案脚本.sql deleted file mode 100644 index f9c9aeb13..000000000 --- a/resource/sql/删除档案脚本.sql +++ /dev/null @@ -1,3 +0,0 @@ -update hrsa_salary_archive_item set delete_type = 1 where salary_archive_id in ( select id from hrsa_salary_archive where id in (select salary_archive_id from hrsa_salary_archive_tax_agent where tax_agent_id = 3)); - -update hrsa_salary_archive set delete_type = 1 where id in (select salary_archive_id from hrsa_salary_archive_tax_agent where tax_agent_id = 3); \ No newline at end of file diff --git a/resource/sql/未使用自增长作为主键的表 b/resource/sql/未使用自增长作为主键的表 deleted file mode 100644 index eb23c4475..000000000 --- a/resource/sql/未使用自增长作为主键的表 +++ /dev/null @@ -1,30 +0,0 @@ -ICategoryPO hrsa_insurance_category - - -// hrsa_bill_inspect -// hrsa_bill_detail -// hrsa_social_archives -// hrsa_fund_archives -// hrsa_other_archives - - -hrsa_salary_item -hrsa_salary_sob_item_group -hrsa_sob_default_item_group -TaxDeclarationDetailPO -hrsa_attend_quote_data -hrsa_salary_archive -hrsa_tax_declaration -hrsa_tax_declaration_detail - - -HRSA_FORMULA -HRSA_FORMULA_VAR - -hrsa_salary_send -hrsa_salary_send_info - - -HRSA_SYS_SALARY_ITEM -HRSA_SOB_DEFAULT_EMP_FIELD -hrsa_salary_sob_default_item diff --git a/resource/sql/清理账套异常薪资项目.sql b/resource/sql/清理账套异常薪资项目.sql deleted file mode 100644 index ee5bee406..000000000 --- a/resource/sql/清理账套异常薪资项目.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE hrsa_salary_sob_item set delete_type = 1 where id in (select * from hrsa_salary_sob_item where delete_type =0 and salary_item_id not in (select id from hrsa_salary_item where delete_type =0)) diff --git a/resource/sql/薪酬还原脚本-sqlserver.sql b/resource/sql/薪酬还原脚本-sqlserver.sql deleted file mode 100644 index d08d0ed72..000000000 --- a/resource/sql/薪酬还原脚本-sqlserver.sql +++ /dev/null @@ -1,177 +0,0 @@ -delete from hrsa_acct_result_temp where 1=1 -GO -delete from hrsa_add_up_deduction where 1=1 -GO -delete from hrsa_add_up_situation where 1=1 -GO -delete from hrsa_attend_quote where 1=1 -GO -delete from hrsa_attend_quote_data where 1=1 -GO -delete from hrsa_attend_quote_data_value where 1=1 -GO -delete from hrsa_attend_quote_field where 1=1 -GO -delete from hrsa_attend_quote_sync_set where 1=1 -GO - - -delete from hrsa_scheme_detail where 1=1 -GO -delete from hrsa_social_archives where 1=1 -GO -delete from hrsa_fund_archives where 1=1 -GO -delete from hrsa_other_archives where 1=1 -GO - - -delete from hrsa_bill_batch where 1=1 -GO - -delete from hrsa_bill_detail where 1=1 -GO -delete from hrsa_bill_detail_temp where 1=1 -GO -delete from hrsa_bill_inspect where 1=1 -GO - --- delete from hrsa_insurance_category where 1=1 --- GO - -delete from hrsa_check_result where 1=1 -GO -delete from hrsa_check_result_record where 1=1 -GO -delete from hrsa_ck_result_detail_temp where 1=1 -GO -delete from hrsa_excel_acct_result where 1=1 -GO - -delete from hrsa_other_deduction where 1=1 -GO -delete from hrsa_salary_acct_emp where 1=1 -GO -delete from hrsa_salary_acct_record where 1=1 -GO -delete from hrsa_salary_acct_result where 1=1 -GO -delete from hrsa_salary_archive where 1=1 -GO -delete from hrsa_salary_archive_dimission where 1=1 -GO -delete from hrsa_salary_archive_item where 1=1 -GO -delete from hrsa_salary_archive_tax_agent where 1=1 -GO -delete from hrsa_salary_item where 1=1 -GO -delete from hrsa_salary_send where 1=1 -GO -delete from hrsa_salary_send_info where 1=1 -GO -delete from hrsa_salary_sob where 1=1 -GO -delete from hrsa_salary_sob_adjust_rule where 1=1 -GO -delete from hrsa_salary_sob_emp_field where 1=1 -GO -delete from hrsa_salary_sob_item where 1=1 -GO -delete from hrsa_salary_sob_item_group where 1=1 -GO -delete from hrsa_salary_sob_range where 1=1 -GO -delete from hrsa_salary_template where 1=1 -GO - -delete from hrsa_social_security_scheme where 1=1 -GO -delete from hrsa_sys_tax_rate_base where 1=1 -GO -delete from hrsa_sys_tax_rate_detail where 1=1 -GO -delete from hrsa_tax_agent where 1=1 -GO -delete from hrsa_tax_agent_emp where 1=1 -GO -delete from hrsa_tax_agent_emp_change where 1=1 -GO -delete from hrsa_tax_agent_admin where 1=1 -GO -delete from hrsa_tax_agent_manage_range where 1=1 -GO --- delete from hrsa_tax_agent_base where 1=1 --- GO -delete from hrsa_tax_agent_sub_admin where 1=1 -GO -delete from hrsa_tax_agent_sub_admin_emp where 1=1 -GO - -delete from hrsa_tax_declaration where 1=1 -GO -delete from hrsa_tax_declaration_detail where 1=1 -GO -delete from hrsa_tax_rate_base where 1=1 -GO -delete from hrsa_tax_rate_detail where 1=1 -GO -delete from hrsa_salary_acct_result_report where 1=1 -GO - -delete from hrsa_insurance_base_info where 1=1 -GO - -delete from hrsa_salary_item_hide where 1=1 -GO - -delete from hrsa_special_add_deduction where 1=1 -GO - -delete from hrsa_excel_bill_detail where 1=1 -GO - -delete from hrsa_salary_send_range where 1=1 -GO - -delete from hrsa_salary_send_range_obj where 1=1 -GO - -delete from hrsa_compensation_log where 1=1 -GO - -delete from hrsa_compensation_config where 1=1 -GO - -delete from hrsa_salary_sob_back_item where 1=1 -GO - -delete from hrsa_sub_table where 1=1 -GO - -delete from hrsa_sub_table_item where 1=1 -GO - -delete from hrsa_salary_stats_dim where 1=1 -GO - -delete from hrsa_salary_stats_report where 1=1 -GO - -delete from hrsa_salary_statistics_item where 1=1 -GO - -delete from hrsa_charts_setting where 1=1 -GO - -delete from hrsa_salary_echarts_setting where 1=1 -GO - -delete from hrsa_statreportlogs_detail where 1=1 -GO - -delete from hrsa_statreportlogs where 1=1 -GO - --- INSERT INTO hrsa_tax_agent_base(id, devolution_status, create_time, update_time, creator, delete_type, tenant_key) VALUES (1653303537239, 0, '2022-05-23 18:58:53', '2022-05-23 19:12:12', 1, 0, 'all_teams') --- GO diff --git a/resource/sql/调整系统薪资项目.sql b/resource/sql/调整系统薪资项目.sql deleted file mode 100644 index 3b9f78e0d..000000000 --- a/resource/sql/调整系统薪资项目.sql +++ /dev/null @@ -1,23 +0,0 @@ -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1655976865885, '公式1', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{薪资项目.累计子女教育}+{薪资项目.累计住房贷款利息}+{薪资项目.累计住房租金}+{薪资项目.累计继续教育}+{薪资项目.累计赡养老人}+{薪资项目.累计大病医疗}+{薪资项目.累计婴幼儿照护}', 'salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly+salaryItem_addUpIllnessMedical+salaryItem_addUpInfantCare', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ - -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865909, '累计赡养老人', 1655976865885, 'salaryItem_addUpSupportElderly', '{薪资项目.累计赡养老人}', 'number', 'salaryItem', 4, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865913, '累计继续教育', 1655976865885, 'salaryItem_addUpContinuingEducation', '{薪资项目.累计继续教育}', 'number', 'salaryItem', 3, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865917, '累计住房租金', 1655976865885, 'salaryItem_addUpHousingRent', '{薪资项目.累计住房租金}', 'number', 'salaryItem', 2, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865921, '累计住房贷款利息', 1655976865885, 'salaryItem_addUpHousingLoanInterest', '{薪资项目.累计住房贷款利息}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865924, '累计子女教育', 1655976865885, 'salaryItem_addUpChildEducation', '{薪资项目.累计子女教育}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865929, '累计大病医疗', 1655976865885, 'salaryItem_addUpIllnessMedical', '{薪资项目.累计大病医疗}', 'number', 'salaryItem', 5, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865933, '累计婴幼儿照护', 1655976865885, 'salaryItem_addUpInfantCare', '{薪资项目.累计婴幼儿照护}', 'number', 'salaryItem', 6, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ - -update hrsa_sys_salary_item set formula_id = 1655976865885 where id = 674853617092214804 -/ - -update hrsa_salary_item set formula_id = 1655976865885 where sys_salary_item_id = 674853617092214804 -/ \ No newline at end of file diff --git a/resource/sql/还原.sql b/resource/sql/还原.sql deleted file mode 100644 index fc70ed7b0..000000000 --- a/resource/sql/还原.sql +++ /dev/null @@ -1,138 +0,0 @@ -delete from hrsa_acct_result_temp where 1=1 -; -delete from hrsa_add_up_deduction where 1=1 -; -delete from hrsa_add_up_situation where 1=1 -; -delete from hrsa_attend_quote where 1=1 -; -delete from hrsa_attend_quote_data where 1=1 -; -delete from hrsa_attend_quote_data_value where 1=1 -; -delete from hrsa_attend_quote_field where 1=1 -; -delete from hrsa_attend_quote_sync_set where 1=1 -; - - -delete from hrsa_scheme_detail where 1=1 -; -delete from hrsa_social_archives where 1=1 -; -delete from hrsa_fund_archives where 1=1 -; -delete from hrsa_other_archives where 1=1 -; - - -delete from hrsa_bill_batch where 1=1 -; - -delete from hrsa_bill_detail where 1=1 -; -delete from hrsa_bill_detail_temp where 1=1 -; -delete from hrsa_bill_inspect where 1=1 -; - - - -delete from hrsa_check_result where 1=1 -; -delete from hrsa_check_result_record where 1=1 -; -delete from hrsa_ck_result_detail_temp where 1=1 -; -delete from hrsa_excel_acct_result where 1=1 -; - -delete from hrsa_other_deduction where 1=1 -; -delete from hrsa_salary_acct_emp where 1=1 -; -delete from hrsa_salary_acct_record where 1=1 -; -delete from hrsa_salary_acct_result where 1=1 -; -delete from hrsa_salary_archive where 1=1 -; -delete from hrsa_salary_archive_dimission where 1=1 -; -delete from hrsa_salary_archive_item where 1=1 -; -delete from hrsa_salary_archive_tax_agent where 1=1 -; -delete from hrsa_salary_item where 1=1 -; -delete from hrsa_salary_send where 1=1 -; -delete from hrsa_salary_send_info where 1=1 -; -delete from hrsa_salary_sob where 1=1 -; -delete from hrsa_salary_sob_adjust_rule where 1=1 -; -delete from hrsa_salary_sob_emp_field where 1=1 -; -delete from hrsa_salary_sob_item where 1=1 -; -delete from hrsa_salary_sob_item_group where 1=1 -; -delete from hrsa_salary_sob_range where 1=1 -; -delete from hrsa_salary_template where 1=1 -; - -delete from hrsa_social_security_scheme where 1=1 -; -delete from hrsa_sys_tax_rate_base where 1=1 -; -delete from hrsa_sys_tax_rate_detail where 1=1 -; -delete from hrsa_tax_agent where 1=1 -; -delete from hrsa_tax_agent_emp where 1=1 -; -delete from hrsa_tax_agent_emp_change where 1=1 -; -delete from hrsa_tax_agent_admin where 1=1 -; -delete from hrsa_tax_agent_manage_range where 1=1 -; - -delete from hrsa_tax_agent_sub_admin where 1=1 -; -delete from hrsa_tax_agent_sub_admin_emp where 1=1 -; - -delete from hrsa_tax_declaration where 1=1 -; -delete from hrsa_tax_declaration_detail where 1=1 -; -delete from hrsa_tax_rate_base where 1=1 -; -delete from hrsa_tax_rate_detail where 1=1 -; -delete from hrsa_salary_acct_result_report where 1=1 -; - -delete from hrsa_insurance_base_info where 1=1 -; - - -delete from hrsa_salary_sob_back_item where 1=1 -; -delete from hrsa_salary_send_range where 1=1 -; -delete from hrsa_salary_send_range_obj where 1=1 -; -delete from hrsa_compensation_log where 1=1 -; -delete from hrsa_compensation_config where 1=1 -; -delete from hrsa_special_add_deduction where 1=1 -; - - - diff --git a/resource/sqlupgrade/DM/sql202304270203.sql b/resource/sqlupgrade/DM/sql202304270203.sql index 6508455fd..65af1f28f 100644 --- a/resource/sqlupgrade/DM/sql202304270203.sql +++ b/resource/sqlupgrade/DM/sql202304270203.sql @@ -157,77 +157,6 @@ alter table hrsa_salary_stats_dim modify dim_type varchar2(30); alter table hrsa_salary_stats_report modify income_category_setting varchar2(1000); / -create table hrsa_statreportlogs_detail -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - mainid varchar2(36) not null, - dataid varchar2(50) not null, - belongdataid varchar2(50) not null, - tablename varchar2(200) not null, - tablenamelabelid varchar2(50) default '-1' not null, - tablenamedesc varchar2(50) not null, - fieldname varchar2(200) not null, - fieldnamelabelid varchar2(50) default '-1' not null, - newvalue clob not null, - oldvalue clob not null, - newrealvalue clob not null, - oldrealvalue clob not null, - fielddesc varchar2(200) not null, - showorder int not null, - isdetail int default 0 not null -); -/ - -create table hrsa_statreportlogs -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - log_date date not null, - device varchar2(500) not null, - log_operator number not null, - operatorname varchar2(100), - targetid number default '-1' not null, - targetname clob not null, - modulename varchar2(100) not null, - functionname varchar2(100) not null, - interfacename varchar2(100) not null, - requesturl varchar2(200) not null, - requesturi varchar2(200) not null, - operatetype varchar2(50) not null, - operatetypename varchar2(100) not null, - operatedesc varchar2(3000) not null, - params clob not null, - belongmainid varchar2(36) not null, - clientip varchar2(50) not null, - groupid varchar2(50) not null, - groupnamelabel varchar2(1000) not null, - redoservice varchar2(200) not null, - redocontext clob not null, - cancelservice varchar2(200) not null, - cancelcontext clob not null, - totalruntime number default '0' not null, - mainruntime number default '0' not null, - log_result varchar2(100) not null, - fromterminal varchar2(100) not null, - resultdesc clob not null, - old_content varchar2(3000) not null, - link_type varchar2(20) not null, - link_id number default '0' not null, - old_link_id number default '0' not null -); -/ - alter table hrsa_salary_stats_report add remark varchar2(100); / @@ -241,4 +170,5 @@ alter table hrsa_salary_stats_report add sort_type varchar2(100); / alter table hrsa_salary_stats_dim add label_id int; -/ \ No newline at end of file +/ + diff --git a/resource/sqlupgrade/DM/sql202312130203.sql b/resource/sqlupgrade/DM/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/DM/sql202401080103.sql b/resource/sqlupgrade/DM/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/DM/sql202401230403.sql b/resource/sqlupgrade/DM/sql202401230403.sql new file mode 100644 index 000000000..9549b4a38 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202401230403.sql @@ -0,0 +1,8 @@ +CREATE TABLE hrsa_elog_version +( + id NUMBER(38,0) primary key NOT NULL, + mainTable varchar2(255), + version NUMBER(38,0) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202401300303.sql b/resource/sqlupgrade/DM/sql202401300303.sql new file mode 100644 index 000000000..edf082294 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202401300303.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500); +/ + diff --git a/resource/sqlupgrade/DM/sql202402190103.sql b/resource/sqlupgrade/DM/sql202402190103.sql new file mode 100644 index 000000000..ee754d9b3 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202402190103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add feedback_status int; +/ + diff --git a/resource/sqlupgrade/DM/sql202402280703.sql b/resource/sqlupgrade/DM/sql202402280703.sql new file mode 100644 index 000000000..e03280b13 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202402280703.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_salary_stats_report ADD ( + salary_sob_setting varchar2(1000) NULL +); +/ + diff --git a/resource/sqlupgrade/DM/sql202403150103.sql b/resource/sqlupgrade/DM/sql202403150103.sql new file mode 100644 index 000000000..ddd68bf00 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202403150103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_send_info add first_reading_time date; +/ + diff --git a/resource/sqlupgrade/GS/sql202205100201.sql b/resource/sqlupgrade/GS/sql202205100201.sql new file mode 100644 index 000000000..a4930cad6 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202205100201.sql @@ -0,0 +1,455 @@ +delete from HtmlLabelIndex where id = 537997 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 537997,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 537997 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537997 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537997 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537997 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537997 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537997 as indexid ,'Salary management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537997 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537997 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537997 as indexid ,'н' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537997 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 537998 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 537998,'ҵнʸ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 537998 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537998 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537998 as indexid ,'ҵнʸ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537998 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537998 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537998 as indexid ,'My salary and benefits' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537998 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537998 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537998 as indexid ,'ҵнY' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537998 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 537996 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 537996,'˰۽' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 537996 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537996 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537996 as indexid ,'˰۽' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537996 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537996 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537996 as indexid ,'Individual income tax withholding agent' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537996 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537996 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537996 as indexid ,'Ux' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537996 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 537999 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 537999,'籣' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 537999 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537999 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537999 as indexid ,'籣' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537999 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537999 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537999 as indexid ,'Social security benefits' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537999 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 537999 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 537999 as indexid ,'籣' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 537999 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538000 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538000,'籣' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538000 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538000 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538000 as indexid ,'籣' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538000 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538000 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538000 as indexid ,'Social security welfare scheme' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538000 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538000 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538000 as indexid ,'籣' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538000 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538001 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538001,'籣' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538001 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538001 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538001 as indexid ,'籣' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538001 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538001 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538001 as indexid ,'Social security benefit file' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538001 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538001 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538001 as indexid ,'籣n' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538001 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538002 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538002,'籣̨' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538002 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538002 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538002 as indexid ,'籣̨' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538002 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538002 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538002 as indexid ,'Social security benefit account' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538002 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538002 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538002 as indexid ,'籣̨~' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538002 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538003 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538003,'нĿ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538003 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538003 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538003 as indexid ,'нĿ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538003 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538003 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538003 as indexid ,'Salary item management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538003 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538003 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538003 as indexid ,'нYĿ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538003 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538004 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538004,'нʵ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538004 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538004 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538004 as indexid ,'нʵ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538004 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538004 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538004 as indexid ,'Salary file' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538004 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538004 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538004 as indexid ,'нYn' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538004 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538005 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538005,'ݲɼ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538005 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538005 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538005 as indexid ,'ݲɼ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538005 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538005 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538005 as indexid ,'data acquisition' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538005 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538005 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538005 as indexid ,'' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538005 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538006 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538006,'ۼרӿ۳' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538006 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538006 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538006 as indexid ,'ۼרӿ۳' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538006 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538006 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538006 as indexid ,'Accumulated special additional deduction' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538006 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538006 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538006 as indexid ,'Ӌ헸ӿ۳' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538006 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538007 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538007,'˰۳' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538007 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538007 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538007 as indexid ,'˰۳' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538007 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538007 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538007 as indexid ,'Other tax exempt deductions' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538007 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538007 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538007 as indexid ,'ⶐ۳' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538007 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538008 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538008,'ۼ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538008 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538008 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538008 as indexid ,'ۼ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538008 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538008 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538008 as indexid ,'Cumulative situation in previous periods' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538008 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538008 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538008 as indexid ,'Ӌr' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538008 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538009 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538009,'' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538009 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538009 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538009 as indexid ,'' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538009 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538009 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538009 as indexid ,'Attendance reference' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538009 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538009 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538009 as indexid ,'' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538009 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538010 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538010,'н' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538010 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538010 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538010 as indexid ,'н' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538010 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538010 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538010 as indexid ,'Salary a / C set' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538010 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538010 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538010 as indexid ,'нY~' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538010 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538011 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538011,'нʺ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538011 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538011 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538011 as indexid ,'нʺ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538011 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538011 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538011 as indexid ,'Salary accounting' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538011 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538011 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538011 as indexid ,'нY' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538011 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538012 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538012,'ʵ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538012 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538012 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538012 as indexid ,'ʵ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538012 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538012 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538012 as indexid ,'Payroll payment' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538012 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538012 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538012 as indexid ,'Yΰl' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538012 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538013 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538013,'˰걨' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538013 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538013 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538013 as indexid ,'˰걨' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538013 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538013 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538013 as indexid ,'Individual income tax return' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538013 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538013 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538013 as indexid ,'' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538013 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 538014 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 538014,'˰˰ʱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 538014 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538014 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538014 as indexid ,'˰˰ʱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538014 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538014 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538014 as indexid ,'Individual income tax rate table' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538014 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 538014 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 538014 as indexid ,'ʱ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 538014 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202205100402.sql b/resource/sqlupgrade/GS/sql202205100402.sql new file mode 100644 index 000000000..d297514d6 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202205100402.sql @@ -0,0 +1,269 @@ +Delete from LeftMenuInfo where id=100118; +/ + +Delete from LeftMenuConfig where infoid=100118; +/ + +call LMConfig_U_ByInfoInsert (1,0,-1); +/ + +call LMInfo_Insert (100118,537997,NULL,NULL,1,0,-1,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='' where id = 100118; +/ + +Delete from LeftMenuInfo where id=100132; +/ + +Delete from LeftMenuConfig where infoid=100132; +/ + +call LMConfig_U_ByInfoInsert (2,100118,5); +/ + +call LMInfo_Insert (100132,538011,'','',2,100118,5,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate' where id = 100132; +/ + +Delete from LeftMenuInfo where id=100125; +/ + +Delete from LeftMenuConfig where infoid=100125; +/ + +call LMConfig_U_ByInfoInsert (2,100118,2); +/ + +call LMInfo_Insert (100125,538004,'','',2,100118,2,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/salaryFile' where id = 100125; +/ + +Delete from LeftMenuInfo where id=100130; +/ + +Delete from LeftMenuConfig where infoid=100130; +/ + +call LMConfig_U_ByInfoInsert (2,100126,0); +/ + +call LMInfo_Insert (100130,538009,'','',2,100126,0,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/dataAcquisition/attendance' where id = 100130; +/ + +Delete from LeftMenuInfo where id=100129; +/ + +Delete from LeftMenuConfig where infoid=100129; +/ + +call LMConfig_U_ByInfoInsert (2,100126,0); +/ + +call LMInfo_Insert (100129,538008,'','',2,100126,0,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/dataAcquisition/cumSituation' where id = 100129; +/ + +Delete from LeftMenuInfo where id=100120; +/ + +Delete from LeftMenuConfig where infoid=100120; +/ + +call LMConfig_U_ByInfoInsert (2,100118,0); +/ + +call LMInfo_Insert (100120,537999,'','',2,100118,0,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='' where id = 100120; +/ + +Delete from LeftMenuInfo where id=100123; +/ + +Delete from LeftMenuConfig where infoid=100123; +/ + +call LMConfig_U_ByInfoInsert (2,100120,1); +/ + +call LMInfo_Insert (100123,538002,'','',2,100120,1,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBook' where id = 100123; +/ + +Delete from LeftMenuInfo where id=100122; +/ + +Delete from LeftMenuConfig where infoid=100122; +/ + +call LMConfig_U_ByInfoInsert (2,100120,0); +/ + +call LMInfo_Insert (100122,538001,'','',2,100120,0,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/archives' where id = 100122; +/ + +Delete from LeftMenuInfo where id=100135; +/ + +Delete from LeftMenuConfig where infoid=100135; +/ + +call LMConfig_U_ByInfoInsert (2,100118,8); +/ + +call LMInfo_Insert (100135,537996,'','',2,100118,8,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/taxAgent' where id = 100135; +/ + +Delete from LeftMenuInfo where id=100121; +/ + +Delete from LeftMenuConfig where infoid=100121; +/ + +call LMConfig_U_ByInfoInsert (2,100120,-1); +/ + +call LMInfo_Insert (100121,538000,'','',2,100120,-1,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/programme' where id = 100121; +/ + +Delete from LeftMenuInfo where id=100126; +/ + +Delete from LeftMenuConfig where infoid=100126; +/ + +call LMConfig_U_ByInfoInsert (2,100118,3); +/ + +call LMInfo_Insert (100126,538005,'','',2,100118,3,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='' where id = 100126; +/ + +Delete from LeftMenuInfo where id=100127; +/ + +Delete from LeftMenuConfig where infoid=100127; +/ + +call LMConfig_U_ByInfoInsert (2,100126,-1); +/ + +call LMInfo_Insert (100127,538006,'','',2,100126,-1,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/dataAcquisition/cumDeduct' where id = 100127; +/ + +Delete from LeftMenuInfo where id=100133; +/ + +Delete from LeftMenuConfig where infoid=100133; +/ + +call LMConfig_U_ByInfoInsert (2,100118,6); +/ + +call LMInfo_Insert (100133,538012,'','',2,100118,6,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/payroll' where id = 100133; +/ + +Delete from LeftMenuInfo where id=100128; +/ + +Delete from LeftMenuConfig where infoid=100128; +/ + +call LMConfig_U_ByInfoInsert (2,100126,0); +/ + +call LMInfo_Insert (100128,538007,'','',2,100126,0,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/dataAcquisition/otherDeduct' where id = 100128; +/ + +Delete from LeftMenuInfo where id=100119; +/ + +Delete from LeftMenuConfig where infoid=100119; +/ + +call LMConfig_U_ByInfoInsert (2,100118,-1); +/ + +call LMInfo_Insert (100119,537998,'','',2,100118,-1,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/mySalary' where id = 100119; +/ + +Delete from LeftMenuInfo where id=100131; +/ + +Delete from LeftMenuConfig where infoid=100131; +/ + +call LMConfig_U_ByInfoInsert (2,100118,4); +/ + +call LMInfo_Insert (100131,538010,'','',2,100118,4,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/ledger' where id = 100131; +/ + +Delete from LeftMenuInfo where id=100124; +/ + +Delete from LeftMenuConfig where infoid=100124; +/ + +call LMConfig_U_ByInfoInsert (2,100118,1); +/ + +call LMInfo_Insert (100124,538003,'','',2,100118,1,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/salaryItem' where id = 100124; +/ + +Delete from LeftMenuInfo where id=100134; +/ + +Delete from LeftMenuConfig where infoid=100134; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100134,538013,'','',2,100118,7,2); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/declare' where id = 100134; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202205130903.sql b/resource/sqlupgrade/GS/sql202205130903.sql new file mode 100644 index 000000000..8ab2d398d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202205130903.sql @@ -0,0 +1,2410 @@ +CREATE TABLE hrsa_acct_result_temp( + id NUMBER(38,0) primary key NOT NULL, + calculate_key varchar2(50) DEFAULT '', + salary_sob_id NUMBER(38,0) DEFAULT 0, + salary_acct_emp_id NUMBER(38,0) DEFAULT 0, + salary_acct_record_id NUMBER(38,0) DEFAULT 0, + employee_id NUMBER(38,0) DEFAULT 0, + tax_agent_id NUMBER(38,0) DEFAULT 0, + salary_item_id NUMBER(38,0) DEFAULT 0, + result_value varchar2(1000) DEFAULT '', + creator NUMBER(38,0) DEFAULT '0', + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +create sequence hrsa_acct_result_temp_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_acct_result_temp_Tri +before insert on hrsa_acct_result_temp +for each row +begin +select hrsa_acct_result_temp_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_add_up_deduction ( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + tax_agent_id NUMBER(38,0) NOT NULL, + declare_month DATE DEFAULT sysdate, + add_up_child_education varchar2(255) DEFAULT '', + add_up_continuing_education varchar2(255) DEFAULT '', + add_up_housing_loan_interest varchar2(255) DEFAULT '', + add_up_housing_rent varchar2(255) DEFAULT '' , + add_up_support_elderly varchar2(255) DEFAULT '' , + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0 , + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '' + ); +/ + +create sequence hrsa_add_up_deduction_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_add_up_deduction_Tri +before insert on hrsa_add_up_deduction +for each row +begin +select hrsa_add_up_deduction_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_add_up_situation( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + tax_agent_id NUMBER(38,0) NOT NULL, + tax_year_month date DEFAULT sysdate, + year NUMBER(38,0) DEFAULT 0, + add_up_income varchar2(255) DEFAULT '' , + add_up_subtraction varchar2(255) DEFAULT '' , + add_up_social_security_total varchar2(255) DEFAULT '' , + add_up_accumulation_fund_total varchar2(255) DEFAULT '' , + add_up_child_education varchar2(255) DEFAULT '' , + add_up_continuing_education varchar2(255) DEFAULT '' , + add_up_housing_loan_interest varchar2(255) DEFAULT '' , + add_up_housing_rent varchar2(255) DEFAULT '' , + add_up_support_elderly varchar2(255) DEFAULT '' , + add_up_enterprise_and_other varchar2(255) DEFAULT '', + add_up_other_deduction varchar2(255) DEFAULT '0.00000', + add_up_tax_exempt_income varchar2(255) DEFAULT '' , + add_up_allowed_donation varchar2(255) DEFAULT '' , + add_up_advance_tax varchar2(255) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0 , + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '' + ); +/ + +create sequence hrsa_add_up_situation_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_add_up_situation_Tri +before insert on hrsa_add_up_situation +for each row +begin +select hrsa_add_up_situation_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_attend_quote( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_year_month date NOT NULL, + year number DEFAULT 0, + month number DEFAULT 0, + salary_sob_id NUMBER(38,0) DEFAULT '', + source_type number DEFAULT 0, + salary_accounting_status number DEFAULT 0, + attend_cycle varchar2(100) DEFAULT '' , + salary_cycle varchar2(100) DEFAULT '' , + description varchar2(100) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' + ); +/ + +create sequence hrsa_attend_quote_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_attend_quote_Tri +before insert on hrsa_attend_quote +for each row +begin +select hrsa_attend_quote_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_attend_quote_data( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) DEFAULT 0, + attend_quote_id NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_attend_quote_data_value( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) DEFAULT 0, + attend_quote_id NUMBER(38,0) DEFAULT 0, + attend_quote_data_id NUMBER(38,0) NOT NULL, + attend_quote_field_id NUMBER(38,0) NOT NULL, + data_value varchar2(250) NOT NULL, + create_time date DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +create sequence hrsa_attend_quote_d_v_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_attend_quote_d_v_Tri +before insert on hrsa_attend_quote_data_value +for each row +begin +select hrsa_attend_quote_d_v_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_attend_quote_field( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + field_name varchar2(100) DEFAULT '' , + source_type number DEFAULT 0, + field_type number DEFAULT 0, + enable_status number DEFAULT 0, + code varchar2(50) DEFAULT '' , + description varchar2(100) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +create sequence hrsa_attend_quote_field_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_attend_quote_field_Tri +before insert on hrsa_attend_quote_field +for each row +begin +select hrsa_attend_quote_field_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_attend_quote_sync_set( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + source_type number DEFAULT 0, + current_setting_content varchar2(4000) DEFAULT '', + default_setting_content varchar2(4000) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +create sequence hrsa_attend_quote_sync_set_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_attend_quote_sync_set_Tri +before insert on hrsa_attend_quote_sync_set +for each row +begin +select hrsa_attend_quote_sync_set_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_bill_batch( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + bill_month varchar2(30) NOT NULL, + bill_status number NOT NULL, + social_num number DEFAULT 0, + fund_num number DEFAULT 0 , + other_num number DEFAULT 0 , + social_pay varchar2(4000) NULL, + fund_pay varchar2(4000) NULL, + other_pay varchar2(4000) NULL, + accountant varchar2(200) NOT NULL, + remarks varchar2(60) NULL, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' + ); +/ + +create sequence hrsa_bill_batch_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_bill_batch_Tri +before insert on hrsa_bill_batch +for each row +begin +select hrsa_bill_batch_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_bill_batch_encdata( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + tablename varchar2(50) NOT NULL, + fieldname varchar2(50) NOT NULL, + enc_value varchar2(4000) NOT NULL, + skey varchar2(4000) NOT NULL, + crc varchar2(4000) NULL, + creater NUMBER(38,0) NULL, + created varchar2(50) NULL, + MODIFIER NUMBER(38,0) NULL, + modified varchar2(50) NULL, + tenant_key varchar2(10) NULL + ); +/ + +CREATE sequence hrsa_bill_batch_encdata_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_bill_batch_encdata_Tri +before insert on hrsa_bill_batch_encdata +for each row +begin +select hrsa_bill_batch_encdata_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_bill_detail( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + bill_month varchar2(30) NOT NULL, + bill_status number NOT NULL, + payment_status number NOT NULL, + supplementary_month varchar2(50) NULL, + supplementary_projects varchar2(50) NULL, + resource_from number NOT NULL, + social_pay_org number NULL, + social_account varchar2(50) NULL, + social_scheme_id NUMBER(38,0) NULL, + social_payment_base_string varchar2(512) NULL, + fund_pay_org number NULL, + fund_account varchar2(50) NULL, + supplement_fund_account varchar2(50) NULL, + fund_scheme_id number NULL, + fund_payment_base_string varchar2(512) NULL, + other_pay_org number NULL, + other_scheme_id NUMBER(38,0) NULL, + other_payment_base_string varchar2(512) NULL, + social_per_json varchar2(512) NULL, + social_per_sum varchar2(512) NULL, + fund_per_json varchar2(512) NULL, + fund_per_sum varchar2(512) NULL, + other_per_json varchar2(512) NULL, + other_per_sum varchar2(512) NULL, + per_sum varchar2(512) NULL, + social_com_json varchar2(512) NULL, + social_com_sum varchar2(512) NULL, + fund_com_json varchar2(512) NULL, + fund_com_sum varchar2(512) NULL, + other_com_json varchar2(512) NULL, + other_com_sum varchar2(512) NULL, + com_sum varchar2(512) NULL, + social_sum varchar2(512) NULL, + fund_sum varchar2(512) NULL, + other_sum varchar2(512) NULL, + total varchar2(512) NULL, + creator NUMBER(38,0) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL + ); +/ + +CREATE sequence hrsa_bill_detail_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_bill_detail_Tri +before insert on hrsa_bill_detail +for each row +begin +select hrsa_bill_detail_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_bill_detail_temp( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + bill_month varchar2(30) NOT NULL, + bill_status number NOT NULL, + payment_status number NOT NULL, + supplementary_month varchar2(50) NULL, + supplementary_projects varchar2(50) NULL, + resource_from number NOT NULL, + social_pay_org number NULL, + social_account varchar2(50) NULL, + social_scheme_id NUMBER(38,0) NULL, + social_payment_base_string varchar2(512) NULL, + fund_pay_org number NULL, + fund_account varchar2(50) NULL, + supplement_fund_account varchar2(50) NULL, + fund_scheme_id NUMBER(38,0) NULL, + fund_payment_base_string varchar2(512) NULL, + other_pay_org number NULL, + other_scheme_id number NULL, + other_payment_base_string varchar2(512) NULL, + social_per_json varchar2(512) NULL, + social_per_sum varchar2(512) NULL, + fund_per_json varchar2(512) NULL, + fund_per_sum varchar2(512) NULL, + other_per_json varchar2(512) NULL, + other_per_sum varchar2(512) NULL, + per_sum varchar2(512) NULL, + social_com_json varchar2(512) NULL, + social_com_sum varchar2(512) NULL, + fund_com_json varchar2(512) NULL, + fund_com_sum varchar2(512) NULL, + other_com_json varchar2(512) NULL, + other_com_sum varchar2(512) NULL, + com_sum varchar2(512) NULL, + social_sum varchar2(512) NULL, + fund_sum varchar2(512) NULL, + other_sum varchar2(512) NULL, + total varchar2(512) NULL, + creator NUMBER(38,0) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL +); +/ + +CREATE sequence hrsa_bill_detail_temp_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_bill_detail_temp_Tri +before insert on hrsa_bill_detail_temp +for each row +begin +select hrsa_bill_detail_temp_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_bill_inspect( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + bill_month varchar2(30) NOT NULL, + payment_status number NOT NULL, + supplementary_month varchar2(50) NULL, + supplementary_projects varchar2(50) NULL, + inspect_status number NOT NULL, + creator NUMBER(38,0) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL + +); +/ + +CREATE sequence hrsa_bill_inspect_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_bill_inspect_Tri +before insert on hrsa_bill_inspect +for each row +begin +select hrsa_bill_inspect_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_check_result( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_acct_record_id NUMBER(38,0) NOT NULL, + salary_check_rule_id NUMBER(38,0) NOT NULL, + formula_id NUMBER(38,0) NOT NULL, + ignore_type number NOT NULL, + creator NUMBER(38,0) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL + ); +/ + +CREATE sequence hrsa_check_result_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_check_result_Tri +before insert on hrsa_check_result +for each row +begin +select hrsa_check_result_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_check_result_record( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_acct_record_id NUMBER(38,0) NOT NULL, + salary_check_rule_id NUMBER(38,0) NOT NULL, + formula_id NUMBER(38,0) NOT NULL, + check_result_id NUMBER(38,0) NOT NULL, + salary_acct_emp_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + creator NUMBER(38,0) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL + ); +/ + +CREATE sequence hrsa_check_result_record_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_check_result_record_Tri +before insert on hrsa_check_result_record +for each row +begin +select hrsa_check_result_record_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_ck_result_detail_temp( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_acct_emp_id NUMBER(38,0) NOT NULL, + salary_acct_record_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + salary_check_rule_id NUMBER(38,0) NOT NULL, + formula_id NUMBER(38,0) NOT NULL, + creator NUMBER(38,0) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL, + calculate_key varchar2(50) NOT NULL +); +/ + +CREATE sequence hrsa_ck_result_detail_temp_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_ck_result_detail_temp_Tri +before insert on hrsa_ck_result_detail_temp +for each row +begin +select hrsa_ck_result_detail_temp_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_excel_acct_result( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) NOT NULL, + salary_acct_emp_id NUMBER(38,0) NOT NULL, + salary_acct_record_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + salary_item_id NUMBER(38,0) NOT NULL, + result_value varchar2(1000) NOT NULL, + creator NUMBER(38,0) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL, + tax_agent_id NUMBER(38,0) NOT NULL + ); +/ + +CREATE sequence hrsa_excel_acct_result_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_excel_acct_result_Tri +before insert on hrsa_excel_acct_result +for each row +begin +select hrsa_excel_acct_result_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_formula( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + name varchar2(255) NOT NULL, + description varchar2(255) NULL , + module varchar2(255) NOT NULL, + use_for varchar2(255) NULL , + reference_type varchar2(255) NULL , + return_type varchar2(255) NOT NULL, + validate_type varchar2(255) NOT NULL, + extend_param varchar2(255) NULL , + formula varchar2(4000) NOT NULL, + formulaRunScript varchar2(4000) NOT NULL, + creator NUMBER(38,0) NOT NULL, + delete_type number DEFAULT 0, + create_time date NOT NULL, + update_time date NOT NULL + ); +/ + +CREATE TABLE hrsa_formula_var( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + name varchar2(255) NOT NULL, + formula_id NUMBER(38,0) NOT NULL, + field_id varchar2(255) NOT NULL, + field_name varchar2(500) NOT NULL, + field_type varchar2(255) NOT NULL, + source varchar2(255) NOT NULL, + order_index number NOT NULL, + creator NUMBER(38,0) NOT NULL, + delete_type number DEFAULT 0, + create_time date NOT NULL, + update_time date NOT NULL +); +/ + +CREATE TABLE hrsa_fund_archives( + id number PRIMARY KEY NOT NULL, + employee_id number NOT NULL, + non_payment number NULL, + welfare_type number NOT NULL, + fund_start_time varchar2(20) NULL, + fund_end_time varchar2(20) NULL, + fund_scheme_id number NULL, + fund_account varchar2(50) NULL, + supplement_fund_account varchar2(50) NULL, + payment_organization number NULL, + under_take number NULL, + fund_payment_base_string varchar2(4000) NULL, + create_time date NOT NULL, + update_time date NOT NULL, + creator number NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_fund_archives_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_fund_archives_Tri +before insert on hrsa_fund_archives +for each row +begin +select hrsa_fund_archives_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_insurance_category( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + insurance_name varchar2(50) NOT NULL, + welfare_type number NOT NULL, + is_use number DEFAULT 1, + payment_scope varchar2(10) NULL, + data_type number DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_other_archives( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + non_payment number NULL, + welfare_type number NOT NULL, + other_start_time varchar2(20) NULL, + other_end_time varchar2(20) NULL, + other_scheme_id NUMBER(38,0) NULL, + payment_organization number NULL, + under_take number NULL, + other_payment_base_string varchar2(4000) NULL, + create_time date NOT NULL, + update_time date NOT NULL, + creator NUMBER(38,0) NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' + ); +/ + +CREATE sequence hrsa_other_archives_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_other_archives_Tri +before insert on hrsa_other_archives +for each row +begin +select hrsa_other_archives_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_other_deduction( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + tax_agent_id NUMBER(38,0) NOT NULL, + declare_month date DEFAULT sysdate, + business_healthy_insurance varchar2(255) DEFAULT '0.00000', + tax_delay_endowment_insurance varchar2(255) DEFAULT '', + other_deduction varchar2(255) DEFAULT '', + deduction_allowed_donation varchar2(255) DEFAULT '', + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' + ); +/ + +CREATE sequence hrsa_other_deduction_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_other_deduction_Tri +before insert on hrsa_other_deduction +for each row +begin +select hrsa_other_deduction_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_acct_emp( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_acct_record_id NUMBER(38,0) DEFAULT 0, + salary_sob_id NUMBER(38,0) DEFAULT 0, + employee_id NUMBER(38,0) DEFAULT 0, + tax_agent_id NUMBER(38,0) DEFAULT 0, + salary_month DATE DEFAULT to_date('1900-01-01','YYYY-DD-mm'), + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' + ); +/ + +CREATE sequence hrsa_salary_acct_emp_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_acct_emp_Tri +before insert on hrsa_salary_acct_emp +for each row +begin +select hrsa_salary_acct_emp_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_acct_record( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_month DATE DEFAULT to_date('1900-01-01','YYYY-DD-mm'), + tax_cycle DATE DEFAULT to_date('1900-01-01','YYYY-DD-mm'), + salary_sob_id NUMBER(38,0) DEFAULT 0, + status number DEFAULT 1, + acct_times number DEFAULT 0, + description varchar2(100) DEFAULT '', + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_acct_record_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_acct_record_Tri +before insert on hrsa_salary_acct_record +for each row +begin +select hrsa_salary_acct_record_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_acct_result( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) DEFAULT 0, + salary_acct_emp_id NUMBER(38,0) DEFAULT 0, + salary_acct_record_id NUMBER(38,0) DEFAULT 0, + employee_id NUMBER(38,0) DEFAULT 0, + tax_agent_id NUMBER(38,0) DEFAULT 0, + salary_item_id NUMBER(38,0) DEFAULT 0, + result_value varchar2(1000) DEFAULT '' , + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_acct_result_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_acct_result_Tri +before insert on hrsa_salary_acct_result +for each row +begin +select hrsa_salary_acct_result_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_archive( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' + ); +/ + +CREATE TABLE hrsa_salary_archive_dimission( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + dimission_time_interval varchar2(20) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + creator NUMBER(38,0) NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL + ); +/ + +CREATE sequence hrsa_salary_archive_d_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_archive_d_Tri +before insert on hrsa_salary_archive_dimission +for each row +begin +select hrsa_salary_archive_d_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_archive_item( + id NUMBER(38,0) NOT NULL, + salary_archive_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) DEFAULT 0, + effective_time DATE DEFAULT sysdate, + adjust_reason varchar2(100) DEFAULT '', + salary_item_id NUMBER(38,0) DEFAULT 0, + item_value varchar2(200) DEFAULT '' , + description varchar2(200) DEFAULT '' , + operator NUMBER(38,0) DEFAULT 0, + operate_time date NULL , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_archive_item_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hhrsa_salary_archive_item_Tri +before insert on hrsa_salary_archive_item +for each row +begin +select hrsa_salary_archive_item_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_archive_tax_agent( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_archive_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) DEFAULT 0, + effective_time DATE DEFAULT sysdate, + adjust_reason varchar2(100) DEFAULT '' , + tax_agent_id NUMBER(38,0) DEFAULT 0, + operator NUMBER(38,0) DEFAULT 0, + operate_time date NULL , + description varchar2(200) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_archive_tax_a_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_archive_tax_a_Tri +before insert on hrsa_salary_archive_tax_agent +for each row +begin +select hrsa_salary_archive_tax_a_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_item( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + name varchar2(100) DEFAULT '' , + code varchar2(100) DEFAULT '' , + system_type number DEFAULT 0, + sys_salary_item_id NUMBER(38,0) DEFAULT 0, + category number DEFAULT 7 , + item_type number DEFAULT 1 , + use_default number DEFAULT 0, + use_in_employee_salary number DEFAULT 0, + rounding_mode number DEFAULT 1 , + pattern number DEFAULT 5 , + value_type number DEFAULT 1 , + datasource number DEFAULT 0, + formula_id NUMBER(38,0) DEFAULT 0, + description varchar2(1000) DEFAULT '', + can_edit number DEFAULT 1 , + can_delete number DEFAULT 1 , + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + data_type varchar2(20) NOT NULL +); +/ + +CREATE TABLE hrsa_salary_send( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_month date NOT NULL, + salary_accounting_id NUMBER(38,0) DEFAULT 0, + salary_sob_id NUMBER(38,0) NOT NULL, + send_num number DEFAULT 0, + send_total number DEFAULT 0, + last_send_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_salary_send_info( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_send_id NUMBER(38,0) NOT NULL, + salary_month date NOT NULL, + salary_acct_record_id NUMBER(38,0) DEFAULT 0, + tax_agent_id NUMBER(38,0) DEFAULT 0, + employee_id NUMBER(38,0) DEFAULT 0, + send_status number DEFAULT 0, + send_time DATE , + salary_template clob NULL, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_salary_sob( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + name varchar2(100) DEFAULT '' , + income_category number DEFAULT 1 , + salary_cycle_type number DEFAULT 3 , + salary_cycle_from_day number DEFAULT 1 , + tax_cycle_type number DEFAULT 3 , + attend_cycle_type number DEFAULT 3 , + attend_cycle_from_day number DEFAULT 1 , + social_security_cycle_type number DEFAULT 3 , + disable number DEFAULT 0, + description varchar2(1000) DEFAULT '', + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_sob_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_sob_Tri +before insert on hrsa_salary_sob +for each row +begin +select hrsa_salary_sob_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_sob_adjust_rule( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) NOT NULL, + salary_item_id NUMBER(38,0) NOT NULL, + day_of_month number DEFAULT 0, + before_adjustment_type number DEFAULT 1 , + after_adjustment_type number DEFAULT 1 , + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_sob_a_r_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_sob_a_r_Tri +before insert on hrsa_salary_sob_adjust_rule +for each row +begin +select hrsa_salary_sob_a_r_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_sob_check_rule( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) NOT NULL, + name varchar2(100) NOT NULL, + formula_id NUMBER(38,0) NOT NULL, + description varchar2(1000) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + creator NUMBER(38,0) NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL +); +/ + +CREATE sequence hrsa_salary_sob_c_r_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_sob_c_r_Tri +before insert on hrsa_salary_sob_check_rule +for each row +begin +select hrsa_salary_sob_c_r_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_sob_default_item( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + income_category number DEFAULT 1 , + sys_salary_item_id NUMBER(38,0) DEFAULT 0, + can_edit number DEFAULT 1 , + can_delete number DEFAULT 1 , + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '', + sob_default_item_group_id NUMBER(38,0) NOT NULL, + sorted_index number NOT NULL +); +/ + +CREATE sequence hrsa_salary_sob_d_i_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_sob_d_i_Tri +before insert on hrsa_salary_sob_default_item +for each row +begin +select hrsa_salary_sob_d_i_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_sob_emp_field( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) DEFAULT 0, + field_code varchar2(100) DEFAULT '' , + sorted_index number DEFAULT 0, + can_delete number DEFAULT 1 , + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_sob_emp_field_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_sob_emp_field_Tri +before insert on hrsa_salary_sob_emp_field +for each row +begin +select hrsa_salary_sob_emp_field_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_sob_item( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) NOT NULL, + salary_item_id NUMBER(38,0) NOT NULL, + salary_sob_item_group_id NUMBER(38,0) NOT NULL, + formula_id NUMBER(38,0) NOT NULL, + sorted_index number NOT NULL, + description varchar2(1000) DEFAULT '' , + create_time date NOT NULL, + update_time date NOT NULL, + creator NUMBER(38,0) NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL +); +/ + +CREATE sequence hrsa_salary_sob_item_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_sob_item_Tri +before insert on hrsa_salary_sob_item +for each row +begin +select hrsa_salary_sob_item_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_sob_item_group( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) NOT NULL, + name varchar2(100) NOT NULL, + sorted_index number NOT NULL, + description varchar2(1000) DEFAULT '', + create_time date NOT NULL, + update_time date NOT NULL, + creator NUMBER(38,0) NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL +); +/ + +CREATE TABLE hrsa_salary_sob_range( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) DEFAULT 0, + target_type number DEFAULT 1 , + target_id NUMBER(38,0) DEFAULT 0, + employee_status number DEFAULT 0, + include_type number DEFAULT 1 , + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_sob_range_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_sob_range_Tri +before insert on hrsa_salary_sob_range +for each row +begin +select hrsa_salary_sob_range_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_salary_template +( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + name varchar2(100) DEFAULT '', + salary_sob_id NUMBER(38,0) NOT NULL, + use_type number DEFAULT 0, + description varchar2(100) DEFAULT '', + email_status number DEFAULT 0, + send_email_id NUMBER(38,0) DEFAULT 0, + msg_status number DEFAULT 0, + theme varchar2(100) DEFAULT '', + background varchar2(2000) DEFAULT '', + text_content varchar2(100) DEFAULT '', + text_content_position number DEFAULT 0, + salary_item_null_status number DEFAULT 0, + salary_item_zero_status number DEFAULT 0, + salary_item_setting clob NOT NULL, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_salary_template_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_salary_template_Tri +before insert on hrsa_salary_template +for each row +begin +select hrsa_salary_template_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_scheme_detail( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + insurance_id NUMBER(38,0) NOT NULL, + primary_id NUMBER(38,0) NOT NULL, + effective_time varchar2(20) NULL, + expiration_time varchar2(20) NULL, + is_payment number DEFAULT 1 , + payment_scope number NOT NULL, + upper_limit varchar2(1024) NULL, + lower_limit varchar2(1024) NULL, + payment_proportion varchar2(1024) NULL, + fixed_cost varchar2(1024) NULL, + valid_num number DEFAULT 2 , + rentention_rule number NULL, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_scheme_detail_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_scheme_detail_Tri +before insert on hrsa_scheme_detail +for each row +begin +select hrsa_scheme_detail_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_sob_default_emp_field( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + field_code varchar2(30) DEFAULT '' , + sorted_index number DEFAULT 0, + can_delete number 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(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_sob_default_item_group( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + income_category number DEFAULT 1 , + name varchar2(100) DEFAULT '', + sorted_index number DEFAULT 0, + description varchar2(1000) DEFAULT '', + create_time date NOT NULL, + update_time date NOT NULL, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_social_archives( + id number PRIMARY KEY NOT NULL, + employee_id number NOT NULL, + non_payment number NULL, + welfare_type number NOT NULL, + social_start_time varchar2(20) NULL, + social_end_time varchar2(20) NULL, + social_scheme_id number NULL, + social_account varchar2(50) NULL, + payment_organization number NULL, + under_take number NULL, + social_payment_base_string varchar2(4000) NULL, + create_time date NOT NULL, + update_time date NOT NULL, + creator number NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_social_archives_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_social_archives_Tri +before insert on hrsa_social_archives +for each row +begin +select hrsa_social_archives_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_social_archives_encdata( + id number PRIMARY KEY NOT NULL, + tablename varchar2(50) NOT NULL, + fieldname varchar2(50) NOT NULL, + enc_value varchar2(4000) NOT NULL, + skey varchar2(4000) NOT NULL, + crc varchar2(4000) NULL, + creater number NULL, + created varchar2(50) NULL, + MODIFIER number NULL, + modified varchar2(50) NULL, + tenant_key varchar2(10) NULL +); +/ + +CREATE sequence hrsa_social_a_e_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_social_a_e_Tri +before insert on hrsa_social_archives_encdata +for each row +begin +select hrsa_social_a_e_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_social_security_scheme( + id number PRIMARY KEY NOT NULL, + payment_area varchar2(100) NOT NULL, + payment_type number DEFAULT 1 , + scheme_name varchar2(100) NOT NULL, + welfare_type number NOT NULL, + is_use number DEFAULT 1 , + remarks varchar2(30) DEFAULT '', + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator number DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_social_s_s_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_social_s_s_Tri +before insert on hrsa_social_security_scheme +for each row +begin +select hrsa_social_s_s_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_sys_salary_item( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + name varchar2(100) DEFAULT '', + code varchar2(100) DEFAULT '', + system_type number DEFAULT 0, + category number DEFAULT 7 , + item_type number DEFAULT 1 , + use_default number DEFAULT 0, + use_in_employee_salary number DEFAULT 0, + rounding_mode number DEFAULT 1 , + pattern number DEFAULT 5 , + value_type number DEFAULT 1 , + datasource number DEFAULT 0, + formula_id NUMBER(38,0) DEFAULT 0, + description varchar2(1000) DEFAULT '', + can_edit number DEFAULT 1 , + can_delete number DEFAULT 1 , + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '', + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + data_type varchar2(20) NOT NULL +); +/ + +CREATE TABLE hrsa_sys_tax_rate_base( + id number PRIMARY KEY NOT NULL, + name varchar2(100) NOT NULL, + system_type number NOT NULL, + description varchar2(100) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + creator number NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL +); +/ + +CREATE sequence hrsa_sys_tax_rate_base_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_sys_tax_rate_base_Tri +before insert on hrsa_sys_tax_rate_base +for each row +begin +select hrsa_sys_tax_rate_base_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_sys_tax_rate_detail( + id number PRIMARY KEY NOT NULL, + base_id number NOT NULL, + index_num number NOT NULL, + income_lower_limit number(15, 5) NULL, + income_upper_limit number(15, 5) NULL, + duty_free_value number(15, 5) NULL, + duty_free_rate number(15, 5) NULL, + taxable_income_ll number(15, 5) NULL, + taxable_income_ul number(15, 5) NOT NULL, + tax_rate number(15, 5) NOT NULL, + tax_deduction number(15, 5) NOT NULL, + create_time date NOT NULL, + update_time date NOT NULL, + creator number NOT NULL, + delete_type number DEFAULT 0, + tenant_key varchar2(10) NOT NULL +); +/ + +CREATE sequence hrsa_sys_tax_rate_detail_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_sys_tax_rate_detail_Tri +before insert on hrsa_sys_tax_rate_detail +for each row +begin +select hrsa_sys_tax_rate_detail_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_tax_agent( + id number PRIMARY KEY NOT NULL, + name varchar2(100) DEFAULT '', + description varchar2(100) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator number DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_tax_agent_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_tax_agent_Tri +before insert on hrsa_tax_agent +for each row +begin +select hrsa_tax_agent_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_tax_declaration( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_month date DEFAULT to_date('1900-01-01','YYYY-DD-mm'), + tax_cycle date DEFAULT to_date('1900-01-01','YYYY-DD-mm'), + tax_agent_id number DEFAULT 0, + description varchar2(1000) DEFAULT '', + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_tax_declaration_detail( + id NUMBER(38,0) NOT NULL, + tax_declaration_id NUMBER(38,0) DEFAULT 0, + employee_id NUMBER(38,0) DEFAULT 0, + field_code varchar2(100) DEFAULT '' , + field_value varchar2(1000) DEFAULT '' , + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_tax_rate_base( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + name varchar2(100) DEFAULT '' , + system_type number DEFAULT 0, + description varchar2(100) DEFAULT '' , + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_tax_rate_base_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_tax_rate_base_Tri +before insert on hrsa_tax_rate_base +for each row +begin +select hrsa_tax_rate_base_id.nextval into :new.id from dual; +end; +/ + +CREATE TABLE hrsa_tax_rate_detail( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + base_id NUMBER(38,0) DEFAULT 0, + index_num number DEFAULT 0, + income_upper_limit number(15, 5) DEFAULT 0.00000, + income_lower_limit number(15, 5) DEFAULT 0.00000, + duty_free_value number(15, 5) DEFAULT 0.00000, + duty_free_rate number(15, 5) DEFAULT 0.00000, + taxable_income_ul number(15, 5) DEFAULT 0.00000, + taxable_income_ll number(15, 5) DEFAULT 0.00000, + tax_rate number(15, 5) DEFAULT 0.00000, + tax_deduction number(15, 5) DEFAULT 0.00000, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE sequence hrsa_tax_rate_detail_id +start with 1 +increment by 1 +nomaxvalue +nocycle; +/ + +create or replace trigger hrsa_tax_rate_detail_Tri +before insert on hrsa_tax_rate_detail +for each row +begin +select hrsa_tax_rate_detail_id.nextval into :new.id from dual; +end; +/ + +ALTER TABLE hrsa_salary_sob_item ADD can_delete number NULL; +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214787, 'нϼ', 'wagesTotal', 1, 5, 22, 1, 0, 2, 2, 2, 1, 1651736817711, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214788, 'ȫһԽϼ', 'annualBonusTotal', 1, 5, 22, 0, 0, 2, 2, 2, 1, 1651737358294, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:07','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214789, '˰ǰۿϼ', 'preTaxDeductionsTotal', 1, 5, 22, 1, 0, 2, 2, 2, 1, 1651737635353, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:22','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214790, '£ΣӦ˰ϼ', 'income', 1, 5, 22, 1, 0, 2, 2, 2, 0, 1651737859216, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:25','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214791, 'ǰۼӦ˰ϼ', 'addUpIncome', 1, 5, 22, 1, 0, 2, 2, 2, 0, 1651738034028, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:28','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214792, 'ϸ', 'endowmentInsurance', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651749914746, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214793, 'ҽƸ', 'medicalInsurance', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651749958879, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214795, 'ʧҵ', 'unemploymentInsurance', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651750005281, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214796, '', 'housingProvidentFund', 1, 2, 10, 1, 0, 2, 2, 2, 7, 1651750034689, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214797, '£Σר۳ϼ', 'specialDeduction', 1, 5, 22, 1, 0, 2, 2, 2, 7, 1651738826550, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:40','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214798, 'ǰۼר۳ϼ', 'addUpSpecialDeduction', 1, 5, 22, 1, 0, 2, 2, 2, 7, 1651739000845, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214799, 'ۼŮ', 'addUpChildEducation', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739053212, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214800, 'ۼסϢ', 'addUpHousingLoannumbererest', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739100651, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214801, 'ۼס', 'addUpHousingRent', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739151122, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214802, 'ۼƼ', 'addUpContinuingEducation', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739212437, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214803, 'ۼ', 'addUpSupportElderly', 1, 2, 11, 1, 0, 2, 2, 2, 6, 1651739310959, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214804, 'ǰۼרӿ۳ϼ', 'addUpSpeAddiDeduction', 1, 5, 22, 1, 0, 2, 2, 2, 6, 1651739411365, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214805, '£Σ۳ϼ', 'otherDeduction', 1, 5, 22, 0, 0, 2, 2, 2, 8, 1651739815651, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214806, 'ǰۼ۳ϼ', 'addUpOtherDeduction', 1, 5, 22, 0, 0, 2, 2, 2, 5, 1651740238860, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214807, '£Σ', 'subtraction', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651740311026, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:56:11','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214808, 'ǰۼƼ', 'addUpSubtraction', 1, 5, 22, 1, 0, 2, 2, 2, 5, 1651740397225, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214809, '£Σн˰˰', 'taxRate', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651742185837, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214810, '£Σн˰۳', 'quickDeductionFactor', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651742702735, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214811, 'ǰۼӦ˰ö', 'addUpTaxableIncome', 1, 5, 22, 1, 0, 2, 2, 2, 5, 1651745445982, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:04:12','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214812, 'ǰۼӦ˰', 'addUpTaxPayable', 1, 7, 19, 1, 0, 2, 2, 2, 1, 1651748888864, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:04:14','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214813, 'ǰۼѿ۽˰ϼ', 'addUpAdvanceTax', 1, 5, 22, 1, 0, 2, 2, 2, 5, 1651748978482, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:04:18','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214814, '£ΣӦ˰', 'refundedOrSupplementedTax', 1, 6, 16, 1, 0, 2, 2, 2, 1, 1651749111981,' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674853617092214815, '£Σʵнʺϼ', 'netSalaryTotal', 1, 5, 22, 1, 0, 2, 2, 2, 1, 1651749240004, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:04:24','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674861648655892480, '', 'baseSalary', 1, 1, 1, 1, 1, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:57:46','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674861768948531201, 'λ', 'postSalary', 1, 1, 1, 1, 1, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:57:57','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674861880508628992, 'ڿۿ', 'attendanceDeduction', 1, 2, 9, 1, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:58:04','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093121, '˰ϼ', 'afterTaxReimbursementTotal', 1, 5, 22, 0, 0, 3, 2, 1, 1, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:58:06','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093122, '', 'annuity', 1, 2, 12, 0, 0, 2, 2, 2, 7, 1651749398360, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093123, 'ҵ', 'commercialHealthInsurance', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1651749448800, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093124, '˰ϱ', 'taxDeferredEndowmentInsurance', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1651749487187, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093125, 'Ʋԭֵ', 'originalValueOfProperty', 1, 2, 12, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:58:29','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093126, '۳˰', 'deductedTax', 1, 2, 12, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:58:42','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093127, '', 'other', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1651749540147, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093128, '£Σ', 'fee', 1, 7, 19, 0, 0, 2, 2, 1, 0, 0, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093129, '£Σ˰', 'taxFreeIncome', 1, 7, 19, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:58:54','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674914626953093130, '˰', 'lessTaxProportion', 1, 7, 19, 0, 0, 2, 2, 1, 0, 0, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646657, '˰ϼ', 'afterTaxAdjustmentTotal', 1, 5, 22, 0, 0, 2, 2, 1, 1, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:59:09','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646658, 'ǰۼƼ˰ϼ', 'addUpTaxDeduction', 1, 5, 22, 0, 0, 2, 2, 1, 5, 0, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646659, '£Σ׼ʿ۳ľ', 'allowedDonation', 1, 5, 22, 0, 0, 2, 2, 2, 8, 1651749595061, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646660, 'ǰۼ׼۳ľ', 'addUpAllowedDonation', 1, 5, 22, 0, 0, 2, 2, 2, 5, 1651749675268, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 15:54:31','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646661, '£Σ˰', 'taxDeduction', 1, 5, 22, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:00:25','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674916065864646662, '˰ۿϼ', 'afterTaxDeductionsTotal', 1, 5, 22, 0, 0, 2, 2, 1, 1, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:00:37','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674919424520683521, '˰ۿ', 'afterTaxDeductions', 1, 4, 15, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:00:39','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674919682288984064, '˰', 'afterTaxReimbursement', 1, 3, 13, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:00:40','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674919776783499264, '˰', 'afterTaxAdjustment', 1, 3, 14, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:00:48','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (674920588574261248, 'ս', 'annualBonus', 1, 1, 2, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:33:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:00:51','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (697532371614588928, 'ǰۼ籣˺ϼ', 'addUpSocialSecurityTotal', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1651801433504, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-07 10:22:55','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:44:23','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (697532667749400576, 'ǰۼƹ˺ϼ', 'addUpAccumulationFundTotal', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1651801586972, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-07 10:22:55','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:46:40','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (697536344384012289, 'ǰۼҵְҵ˺ϼ', 'addUpEnterpriseAndOther', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1651801667770, ' ', 0, 1, 0, 0, 'all_teams', to_date('2022-03-07 10:22:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:48:07','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651736817711, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.}+{нĿ.λ}', 'salaryItem_baseSalary+salaryItem_postSalary', 1, 0, to_date('2022-05-05 15:46:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 15:46:58','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651737358294, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ս}', 'salaryItem_annualBonus', 1, 0, to_date('2022-05-05 15:55:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 15:55:58','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651737635353, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ڿۿ}', 'salaryItem_attendanceDeduction', 1, 0, to_date('2022-05-05 16:00:35','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:00:35','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651737859216, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.нϼ}+{нĿ.ȫһԽϼ}-{нĿ.˰ǰۿϼ}', 'salaryItem_wagesTotal+salaryItem_annualBonusTotal-salaryItem_preTaxDeductionsTotal', 1, 0, to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651738034028, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.£ΣӦ˰ϼ}+{ۼ.ۼ}', 'salaryItem_income+addUpSituation_addUpIncome', 1, 0, to_date('2022-05-05 16:07:14','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:07:14','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749914746, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.ϱո}', 'welfare_9001socialPer', 1, 0, to_date('2022-05-05 19:25:15','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:25:15','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749958879, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.ҽƱո}', 'welfare_9002socialPer', 1, 0, to_date('2022-05-05 19:25:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:25:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651750005281, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.ʧҵո}', 'welfare_9004socialPer', 1, 0, to_date('2022-05-05 19:26:45','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:26:45','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651750034689, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.ס}', 'welfare_9006fundPer', 1, 0, to_date('2022-05-05 19:27:15','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:27:15','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651738826550, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ϸ}+{нĿ.ҽƸ}+{нĿ.ʧҵ}+{нĿ.}', 'salaryItem_endowmentInsurance+salaryItem_medicalInsurance+salaryItem_unemploymentInsurance+salaryItem_housingProvidentFund', 1, 0, to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739000845, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.£Σר۳ϼ}+{ۼ.ۼ籣˺ϼ}+{ۼ.ۼƹ˺ϼ}', 'salaryItem_specialDeduction+addUpSituation_addUpSocialSecurityTotal+addUpSituation_addUpAccumulationFundTotal', 1, 0, to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739053212, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼרӿ۳.ۼŮ}', 'addUpDeductions_addUpChildEducation', 1, 0, to_date('2022-05-05 16:24:13','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:24:13','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739100651, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼ.ۼסϢ}', 'addUpSituation_addUpHousingLoannumbererest', 1, 0, to_date('2022-05-05 16:25:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:25:01','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739151122, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼ.ۼס}', 'addUpSituation_addUpHousingRent', 1, 0, to_date('2022-05-05 16:25:51','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:25:51','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739212437, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼ.ۼƼ}', 'addUpSituation_addUpContinuingEducation', 1, 0, to_date('2022-05-05 16:26:52','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:26:52','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739310959, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼ.ۼ}', 'addUpSituation_addUpSupportElderly', 1, 0, to_date('2022-05-05 16:28:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:28:31','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739411365, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ۼŮ}+{нĿ.ۼסϢ}+{нĿ.ۼס}+{нĿ.ۼƼ}+{нĿ.ۼ}', 'salaryItem_addUpChildEducation+salaryItem_addUpHousingLoannumbererest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly', 1, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651739815651, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.}+{нĿ.ҵ}+{нĿ.˰ϱ}+{нĿ.Ʋԭֵ}+{нĿ.۳˰}+{нĿ.}', 'salaryItem_annuity+salaryItem_commercialHealthInsurance+salaryItem_taxDeferredEndowmentInsurance+salaryItem_originalValueOfProperty+salaryItem_deductedTax+salaryItem_other', 1, 0, to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651740238860, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.£Σ۳ϼ}+{ۼ.ۼ˰۳}+{ۼ.ۼҵְҵ}', 'salaryItem_otherDeduction+addUpSituation_addUpOtherDeduction+addUpSituation_addUpEnterpriseAndOther', 1, 0, to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651740311026, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '5000', '5000', 1, 0, to_date('2022-05-05 16:45:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:45:11','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651740397225, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.£Σ}+{ۼ.ۼƼ}', 'salaryItem_subtraction+addUpSituation_addUpSubtraction', 1, 0, to_date('2022-05-05 16:46:37','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:46:37','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type,extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651742185837, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if({нĿ.ǰۼӦ˰ö}<=0){0;}else if({нĿ.ǰۼӦ˰ö}<=36000){0.03;}else if({нĿ.ǰۼӦ˰ö}<=144000){0.1;}else if({нĿ.ǰۼӦ˰ö}<=300000){0.2;}else if({нĿ.ǰۼӦ˰ö}<=420000){0.25;}else if({нĿ.ǰۼӦ˰ö}<=660000){0.3;}else if({нĿ.ǰۼӦ˰ö}<=960000){0.35;}else{0.45;}', 'if(salaryItem_addUpTaxableIncome<=0){0;}else if(salaryItem_addUpTaxableIncome<=36000){0.03;}else if(salaryItem_addUpTaxableIncome<=144000){0.1;}else if(salaryItem_addUpTaxableIncome<=300000){0.2;}else if(salaryItem_addUpTaxableIncome<=420000){0.25;}else if(salaryItem_addUpTaxableIncome<=660000){0.3;}else if(salaryItem_addUpTaxableIncome<=960000){0.35;}else{0.45;}', 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651742702735, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if({нĿ.ǰۼӦ˰ö}<=36000){{нĿ.ǰۼӦ˰ö}<=36000){0;}else if({нĿ.ǰۼӦ˰ö}<=144000){2520;}else if({нĿ.ǰۼӦ˰ö}<=300000){16920;}else if({нĿ.ǰۼӦ˰ö}<=420000){31920;}else if({нĿ.ǰۼӦ˰ö}<=660000){52920;}else if({нĿ.ǰۼӦ˰ö}<=960000){85920;}else{181920;}', 'if(salaryItem_addUpTaxableIncome<=36000){0;}else if(salaryItem_addUpTaxableIncome<=144000){2520;}else if(salaryItem_addUpTaxableIncome<=300000){16920;}else if(salaryItem_addUpTaxableIncome<=420000){31920;}else if(salaryItem_addUpTaxableIncome<=660000){52920;}else if(salaryItem_addUpTaxableIncome<=960000){85920;}else{181920;}', 1, 0, to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651745445982, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ǰۼӦ˰ϼ}-{нĿ.ǰۼר۳ϼ}-{нĿ.ǰۼרӿ۳ϼ}-{нĿ.ǰۼ۳ϼ}-{нĿ.ǰۼƼ}-{нĿ.ǰۼ׼۳ľ}', 'salaryItem_addUpIncome-salaryItem_addUpSpecialDeduction-salaryItem_addUpSpeAddiDeduction-salaryItem_addUpOtherDeduction-salaryItem_addUpSubtraction-salaryItem_addUpAllowedDonation', 1, 0, to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651748888864, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ǰۼӦ˰ö}*{нĿ.£Σн˰˰}-{нĿ.£Σн˰۳}', 'salaryItem_addUpTaxableIncome*salaryItem_taxRate-salaryItem_quickDeductionFactor', 1, 0, to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651748978482, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼ.ۼԤԤ˰}', 'addUpSituation_addUpAdvanceTax', 1, 0, to_date('2022-05-05 19:09:38','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:09:38','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749111981, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ǰۼӦ˰}-{нĿ.ǰۼѿ۽˰ϼ}-{нĿ.ǰۼƼ˰ϼ}', 'salaryItem_addUpTaxPayable-salaryItem_addUpAdvanceTax-salaryItem_addUpTaxDeduction', 1, 0, to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749240004, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.£ΣӦ˰ϼ}-{нĿ.£Σר۳ϼ}-{нĿ.£ΣӦ˰}+{нĿ.˰ϼ}+{нĿ.˰ϼ}-{нĿ.˰ۿϼ}', 'salaryItem_income-salaryItem_specialDeduction-salaryItem_refundedOrSupplementedTax+salaryItem_afterTaxAdjustmentTotal+salaryItem_afterTaxReimbursementTotal-salaryItem_afterTaxDeductionsTotal', 1, 0, to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749398360, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.ҵ}', 'welfare_9007otherPer', 1, 0, to_date('2022-05-05 19:16:38','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:16:38','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749448800, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.ҵ}', 'otherDeduction_businessHealthyInsurance', 1, 0, to_date('2022-05-05 19:17:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:17:29','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749487187, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.˰ϱ}', 'otherDeduction_taxDelayEndowmentInsurance', 1, 0, to_date('2022-05-05 19:18:07','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:18:07','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749540147, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.}', 'otherDeduction_otherDeduction', 1, 0, to_date('2022-05-05 19:19:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:19:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749595061, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.׼۳ľ}', 'otherDeduction_deductionAllowedDonation', 1, 0, to_date('2022-05-05 19:19:55','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:19:55','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651749675268, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.£Σ׼ʿ۳ľ}+{ۼ.ۼ׼۳ľ}', 'salaryItem_allowedDonation+addUpSituation_addUpAllowedDonation', 1, 0, to_date('2022-05-05 19:21:15','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:21:15','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651801433504, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.籣˺ϼ}+{ۼ.ۼ籣˺ϼ}', 'welfare_socialPerSum+addUpSituation_addUpSocialSecurityTotal', 1, 0, to_date('2022-05-06 09:43:54','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:43:54','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651801586972, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.˺ϼ}+{ۼ.ۼƹ˺ϼ}', 'welfare_fundPerSum+addUpSituation_addUpAccumulationFundTotal', 1, 0, to_date('2022-05-06 09:46:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:46:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1651801667770, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.˺ϼ}+{ۼ.ۼҵְҵ}', 'welfare_otherPerSum+addUpSituation_addUpEnterpriseAndOther', 1, 0, to_date('2022-05-06 09:47:48','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:47:48','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651736818266, '', 1651736817711, 'salaryItem_baseSalary', '{нĿ.}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 15:46:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 15:46:58','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651736818329, 'λ', 1651736817711, 'salaryItem_postSalary', '{нĿ.λ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 15:46:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 15:46:58','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737360610, 'ս', 1651737358294, 'salaryItem_annualBonus', '{нĿ.ս}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 15:55:58','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 15:55:58','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737636061, 'ڿۿ', 1651737635353, 'salaryItem_attendanceDeduction', '{нĿ.ڿۿ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:00:35','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:00:35','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737859281, 'нϼ', 1651737859216, 'salaryItem_wagesTotal', '{нĿ.нϼ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737859342, 'ȫһԽϼ', 1651737859216, 'salaryItem_annualBonusTotal', '{нĿ.ȫһԽϼ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651737859401, '˰ǰۿϼ', 1651737859216, 'salaryItem_preTaxDeductionsTotal', '{нĿ.˰ǰۿϼ}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:04:19','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738035450, '£ΣӦ˰ϼ', 1651738034028, 'salaryItem_income', '{нĿ.£ΣӦ˰ϼ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:07:14','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:07:14','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738035488, 'ۼ', 1651738034028, 'addUpSituation_addUpIncome', '{ۼ.ۼ}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-05 16:07:14','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:07:14','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738832854, 'ϸ', 1651738826550, 'salaryItem_endowmentInsurance', '{нĿ.ϸ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738837363, 'ҽƸ', 1651738826550, 'salaryItem_medicalInsurance', '{нĿ.ҽƸ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738837909, 'ʧҵ', 1651738826550, 'salaryItem_unemploymentInsurance', '{нĿ.ʧҵ}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651738838429, '', 1651738826550, 'salaryItem_housingProvidentFund', '{нĿ.}', 'number', 'salaryItem', 3, 1, 0, to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:20:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739002623, '£Σר۳ϼ', 1651739000845, 'salaryItem_specialDeduction', '{нĿ.£Σר۳ϼ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739002682, 'ۼ籣˺ϼ', 1651739000845, 'addUpSituation_addUpSocialSecurityTotal', '{ۼ.ۼ籣˺ϼ}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739003139, 'ۼƹ˺ϼ', 1651739000845, 'addUpSituation_addUpAccumulationFundTotal', '{ۼ.ۼƹ˺ϼ}', 'number', 'addUpSituation', 2, 1, 0, to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:23:21','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739054270, 'ۼŮ', 1651739053212, 'addUpDeductions_addUpChildEducation', '{ۼרӿ۳.ۼŮ}', 'number', 'addUpDeductions', 0, 1, 0, to_date('2022-05-05 16:24:13','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:24:13','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739101122, 'ۼסϢ', 1651739100651, 'addUpSituation_addUpHousingLoannumbererest', '{ۼ.ۼסϢ}', 'number', 'addUpSituation', 0, 1, 0, to_date('2022-05-05 16:25:01','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:25:01','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739151221, 'ۼס', 1651739151122, 'addUpSituation_addUpHousingRent', '{ۼ.ۼס}', 'number', 'addUpSituation', 0, 1, 0, to_date('2022-05-05 16:25:51','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:25:51','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739213082, 'ۼƼ', 1651739212437, 'addUpSituation_addUpContinuingEducation', '{ۼ.ۼƼ}', 'number', 'addUpSituation', 0, 1, 0, to_date('2022-05-05 16:26:52','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:26:52','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739311009, 'ۼ', 1651739310959, 'addUpSituation_addUpSupportElderly', '{ۼ.ۼ}', 'number', 'addUpSituation', 0, 1, 0, to_date('2022-05-05 16:28:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:28:31','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411502, 'ۼŮ', 1651739411365, 'salaryItem_addUpChildEducation', '{нĿ.ۼŮ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411637, 'ۼסϢ', 1651739411365, 'salaryItem_addUpHousingLoannumbererest', '{нĿ.ۼסϢ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411715, 'ۼס', 1651739411365, 'salaryItem_addUpHousingRent', '{нĿ.ۼס}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739411773, 'ۼƼ', 1651739411365, 'salaryItem_addUpContinuingEducation', '{нĿ.ۼƼ}', 'number', 'salaryItem', 3, 1, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739412718, 'ۼ', 1651739411365, 'salaryItem_addUpSupportElderly', '{нĿ.ۼ}', 'number', 'salaryItem', 4, 1, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739819892, '', 1651739815651, 'salaryItem_annuity', '{нĿ.}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739822564, 'ҵ', 1651739815651, 'salaryItem_commercialHealthInsurance', '{нĿ.ҵ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739826637, '˰ϱ', 1651739815651, 'salaryItem_taxDeferredEndowmentInsurance', '{нĿ.˰ϱ}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739828954, 'Ʋԭֵ?', 1651739815651, 'salaryItem_originalValueOfProperty', '{нĿ.Ʋԭֵ}', 'number', 'salaryItem', 3, 1, 0, to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739829915, '۳˰', 1651739815651, 'salaryItem_deductedTax', '{нĿ.۳˰}', 'number', 'salaryItem', 4, 1, 0, to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651739830465, '', 1651739815651, 'salaryItem_other', '{нĿ.}', 'number', 'salaryItem', 5, 1, 0, to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:36:56','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740240713, '£Σ۳ϼ', 1651740238860, 'salaryItem_otherDeduction', '{нĿ.£Σ۳ϼ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740241221, 'ۼ˰۳', 1651740238860, 'addUpSituation_addUpOtherDeduction', '{ۼ.ۼ˰۳}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740241717, 'ۼҵְҵ', 1651740238860, 'addUpSituation_addUpEnterpriseAndOther', '{ۼ.ۼҵְҵ}', 'number', 'addUpSituation', 2, 1, 0, to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:43:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740397497, '£Σ', 1651740397225, 'salaryItem_subtraction', '{нĿ.£Σ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 16:46:37','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:46:37','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651740397989, 'ۼƼ', 1651740397225, 'addUpSituation_addUpSubtraction', '{ۼ.ۼƼ}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-05 16:46:37','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:46:37','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742185950, 'ǰۼӦ˰ö', 1651742185837, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742185995, 'ǰۼӦ˰ö', 1651742185837, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186035, 'ǰۼӦ˰ö', 1651742185837, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186085, 'ǰۼӦ˰ö', 1651742185837, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 3, 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186122, 'ǰۼӦ˰ö', 1651742185837, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 4, 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186155, 'ǰۼӦ˰ö', 1651742185837, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 5, 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742186199, 'ǰۼӦ˰ö', 1651742185837, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 6, 1, 0, to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:16:26','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742704826, 'ǰۼӦ˰ö', 1651742702735, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742705308, 'ǰۼӦ˰ö', 1651742702735, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742705782, 'ǰۼӦ˰ö', 1651742702735, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742705831, 'ǰۼӦ˰ö', 1651742702735, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 3, 1, 0, to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742706306, 'ǰۼӦ˰ö', 1651742702735, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 4, 1, 0, to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651742706368, 'ǰۼӦ˰ö', 1651742702735, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 5, 1, 0, to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 17:25:03','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745446904, 'ǰۼӦ˰ϼ', 1651745445982, 'salaryItem_addUpIncome', '{нĿ.ǰۼӦ˰ϼ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745447442, 'ǰۼר۳ϼ', 1651745445982, 'salaryItem_addUpSpecialDeduction', '{нĿ.ǰۼר۳ϼ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745447969, 'ǰۼרӿ۳ϼ', 1651745445982, 'salaryItem_addUpSpeAddiDeduction', '{нĿ.ǰۼרӿ۳ϼ}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745448475, 'ǰۼ۳ϼ', 1651745445982, 'salaryItem_addUpOtherDeduction', '{нĿ.ǰۼ۳ϼ}', 'number', 'salaryItem', 3, 1, 0, to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745451616, 'ǰۼƼ', 1651745445982, 'salaryItem_addUpSubtraction', '{нĿ.ǰۼƼ}', 'number', 'salaryItem', 4, 1, 0, to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651745452097, 'ǰۼ׼۳ľ', 1651745445982, 'salaryItem_addUpAllowedDonation', '{нĿ.ǰۼ׼۳ľ}', 'number', 'salaryItem', 5, 1, 0, to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 18:10:46','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748888918, 'ǰۼӦ˰ö', 1651748888864, 'salaryItem_addUpTaxableIncome', '{нĿ.ǰۼӦ˰ö}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748888952, '£Σн˰˰', 1651748888864, 'salaryItem_taxRate', '{нĿ.£Σн˰˰}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748888989, '£Σн˰۳', 1651748888864, 'salaryItem_quickDeductionFactor', '{нĿ.£Σн˰۳}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:08:09','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651748978520, 'ۼԤԤ˰', 1651748978482, 'addUpSituation_addUpAdvanceTax', '{ۼ.ۼԤԤ˰}', 'number', 'addUpSituation', 0, 1, 0, to_date('2022-05-05 19:09:38','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:09:38','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749112037, 'ǰۼӦ˰', 1651749111981, 'salaryItem_addUpTaxPayable', '{нĿ.ǰۼӦ˰}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749112068, 'ǰۼѿ۽˰ϼ', 1651749111981, 'salaryItem_addUpAdvanceTax', '{нĿ.ǰۼѿ۽˰ϼ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749112116, 'ǰۼƼ˰ϼ', 1651749111981, 'salaryItem_addUpTaxDeduction', '{нĿ.ǰۼƼ˰ϼ}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:11:52','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240040, '£ΣӦ˰ϼ', 1651749240004, 'salaryItem_income', '{нĿ.£ΣӦ˰ϼ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240082, '£Σר۳ϼ', 1651749240004, 'salaryItem_specialDeduction', '{нĿ.£Σר۳ϼ}', 'number', 'salaryItem', 1, 1, 0, to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240117, '£ΣӦ˰', 1651749240004, 'salaryItem_refundedOrSupplementedTax', '{нĿ.£ΣӦ˰}', 'number', 'salaryItem', 2, 1, 0, to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240164, '˰ϼ', 1651749240004, 'salaryItem_afterTaxAdjustmentTotal', '{нĿ.˰ϼ}', 'number', 'salaryItem', 3, 1, 0, to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240199, '˰ϼ', 1651749240004, 'salaryItem_afterTaxReimbursementTotal', '{нĿ.˰ϼ}', 'number', 'salaryItem', 4, 1, 0, to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749240245, '˰ۿϼ', 1651749240004, 'salaryItem_afterTaxDeductionsTotal', '{нĿ.˰ۿϼ}', 'number', 'salaryItem', 5, 1, 0, to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:14:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749398399, 'ҵ', 1651749398360, 'welfare_9007otherPer', '{籣.ҵ}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-05 19:16:38','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:16:38','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749448843, 'ҵ', 1651749448800, 'otherDeduction_businessHealthyInsurance', '{˰۳.ҵ}', 'number', 'otherDeduction', 0, 1, 0, to_date('2022-05-05 19:17:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:17:29','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749487225, '˰ϱ', 1651749487187, 'otherDeduction_taxDelayEndowmentInsurance', '{˰۳.˰ϱ}', 'number', 'otherDeduction', 0, 1, 0, to_date('2022-05-05 19:18:07','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:18:07','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749540213, '', 1651749540147, 'otherDeduction_otherDeduction', '{˰۳.}', 'number', 'otherDeduction', 0, 1, 0, to_date('2022-05-05 19:19:00','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:19:00','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749596472, '׼۳ľ', 1651749595061, 'otherDeduction_deductionAllowedDonation', '{˰۳.׼۳ľ}', 'number', 'otherDeduction', 0, 1, 0, to_date('2022-05-05 19:19:55','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:19:55','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749675326, '£Σ׼ʿ۳ľ', 1651749675268, 'salaryItem_allowedDonation', '{нĿ.£Σ׼ʿ۳ľ}', 'number', 'salaryItem', 0, 1, 0, to_date('2022-05-05 19:21:15','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:21:15','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749675365, 'ۼ׼۳ľ', 1651749675268, 'addUpSituation_addUpAllowedDonation', '{ۼ.ۼ׼۳ľ}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-05 19:21:15','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:21:15','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749914793, 'ϱո', 1651749914746, 'welfare_9001socialPer', '{籣.ϱո}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-05 19:25:15','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:25:15','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651749958917, 'ҽƱո', 1651749958879, 'welfare_9002socialPer', '{籣.ҽƱո}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-05 19:25:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:25:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651750005320, 'ʧҵո', 1651750005281, 'welfare_9004socialPer', '{籣.ʧҵո}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-05 19:26:45','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:26:45','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651750034727, 'ס', 1651750034689, 'welfare_9006fundPer', '{籣.ס}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-05 19:27:15','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 19:27:15','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801435862, '籣˺ϼ', 1651801433504, 'welfare_socialPerSum', '{籣.籣˺ϼ}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-06 09:43:54','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:43:54','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801436423, 'ۼ籣˺ϼ', 1651801433504, 'addUpSituation_addUpSocialSecurityTotal', '{ۼ.ۼ籣˺ϼ}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-06 09:43:54','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:43:54','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801587331, '˺ϼ', 1651801586972, 'welfare_fundPerSum', '{籣.˺ϼ}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-06 09:46:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:46:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801587794, 'ۼƹ˺ϼ', 1651801586972, 'addUpSituation_addUpAccumulationFundTotal', '{ۼ.ۼƹ˺ϼ}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-06 09:46:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:46:27','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801669969, '˺ϼ', 1651801667770, 'welfare_otherPerSum', '{籣.˺ϼ}', 'number', 'welfare', 0, 1, 0, to_date('2022-05-06 09:47:48','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:47:48','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1651801670474, 'ۼҵְҵ', 1651801667770, 'addUpSituation_addUpEnterpriseAndOther', '{ۼ.ۼҵְҵ}', 'number', 'addUpSituation', 1, 1, 0, to_date('2022-05-06 09:47:48','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-06 09:47:48','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT into hrsa_sob_default_emp_field(id, field_code, sorted_index, can_delete, creator, create_time, update_time, delete_type, tenant_key) VALUES (681983911359291652, 'taxAgentName', 0, 0, 0, to_date('2022-02-23 17:32:08','yyyy-MM-dd HH24:mi:ss'), to_date('2022-02-23 17:32:08','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_emp_field(id, field_code, sorted_index, can_delete, creator, create_time, update_time, delete_type, tenant_key) VALUES (681983911359291653, 'username', 1, 0, 0, to_date('2022-02-23 17:32:08','yyyy-MM-dd HH24:mi:ss'), to_date('2022-02-23 17:32:08','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_emp_field(id, field_code, sorted_index, can_delete, creator, create_time, update_time, delete_type, tenant_key) VALUES (681983911359291654, 'departmentName', 2, 0, 0, to_date('2022-02-23 17:32:08','yyyy-MM-dd HH24:mi:ss'), to_date('2022-02-23 17:32:08','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams'); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368900, 4, 703459464954929153, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368899, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368902, 4, 703458434280095745, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368901, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368903, 4, 703458558739300353, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368901, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368905, 4, 674914626953093123, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368904, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368906, 4, 674914626953093124, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368904, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368907, 4, 674914626953093127, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368904, 2); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368908, 4, 674916065864646659, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368904, 3); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368910, 4, 704467747234045953, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368909, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368911, 4, 704468391612751873, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368909, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368912, 4, 704468443048992769, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368909, 2); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368913, 4, 704468490269204481, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368909, 3); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368914, 4, 704468528928063488, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 704495325212368909, 4); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (704495325212368915, 4, 703459151591383041, 1, 0, 0, to_date('2022-03-14 11:32:32','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-17 16:14:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312448, 1, 703459151591383041, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312449, 1, 674861648655892480, 1, 1, 0, to_date('2022-03-14 11:32:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312450, 1, 674861768948531201, 1, 1, 0, to_date('2022-03-14 11:32:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312451, 1, 674861880508628992, 1, 1, 0, to_date('2022-03-14 11:32:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 2); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312452, 1, 674920588574261248, 1, 1, 0, to_date('2022-03-14 11:32:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 3); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312453, 1, 674853617092214790, 1, 0, 0, to_date('2022-03-14 11:32:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 4); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312454, 1, 674853617092214791, 1, 0, 0, to_date('2022-03-14 11:32:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 5); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312455, 1, 674914626953093129, 1, 0, 0, to_date('2022-03-14 11:32:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 6); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312456, 1, 703419929857687552, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 7); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312457, 1, 674853617092214792, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312458, 1, 674853617092214793, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312459, 1, 674853617092214795, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 2); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312460, 1, 674853617092214796, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 3); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312461, 1, 700599184238075904, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 4); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312462, 1, 700599446244319233, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 5); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312463, 1, 674853617092214797, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 6); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312464, 1, 697532371614588928, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 7); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312465, 1, 697532667749400576, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 8); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312466, 1, 697536344384012289, 1, 0, 0, to_date('2022-03-18 16:24:49','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 9); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312467, 1, 674853617092214798, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614092, 10); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312468, 1, 674853617092214803, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312469, 1, 674853617092214802, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312470, 1, 674853617092214801, 1, 0, 0, to_date('2022-03-14 11:32:29','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 2); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312471, 1, 674853617092214800, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 3); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312472, 1, 674853617092214799, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 4); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312473, 1, 705641858303836161, 1, 0, 0, to_date('2022-03-17 13:48:51','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 5); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312474, 1, 674853617092214804, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 6); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312475, 1, 674853617092214807, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312476, 1, 674853617092214808, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312477, 1, 674914626953093122, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 2); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312478, 1, 674914626953093123, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 3); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312479, 1, 674914626953093124, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 4); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312480, 1, 674914626953093127, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 5); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312481, 1, 674853617092214805, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 6); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312482, 1, 674853617092214806, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 7); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312483, 1, 674916065864646659, 1, 0, 0, to_date('2022-03-18 16:30:21','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 8); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312484, 1, 674916065864646660, 1, 0, 0, to_date('2022-03-18 16:30:21','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 9); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312485, 1, 674853617092214811, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 0); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312486, 1, 674853617092214809, 1, 0, 0, to_date('2022-03-14 11:32:30','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 1); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312487, 1, 674853617092214810, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 2); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312488, 1, 674853617092214812, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 3); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312489, 1, 674853617092214813, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 4); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312490, 1, 674916065864646661, 1, 1, 0, to_date('2022-03-18 16:33:37','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312491, 1, 674916065864646658, 1, 1, 0, to_date('2022-03-18 16:33:37','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312492, 1, 674853617092214814, 1, 0, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 7); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312493, 1, 674853617092214815, 1, 1, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:23','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614126, 6); +/ + +INSERT into hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312494, 1, 700769462612156416, 1, 1, 0, to_date('2022-03-14 11:32:31','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-18 16:59:24','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614126, 7); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614083, 1, 'Լ˰', 0, ' ', SYSDATE, SYSDATE, 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614092, 1, 'ר۳', 1, ' ', SYSDATE, SYSDATE, 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614103, 1, 'ۼרӿ۳', 2, ' ', to_date('2022-03-11 14:49:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-11 14:49:27','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614110, 1, '۳Ϣ', 3, ' ', to_date('2022-03-11 14:49:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-11 14:49:27','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614119, 1, '˰', 4, ' ', to_date('2022-03-11 14:49:27','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-11 14:49:27','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (703433961629614126, 1, 'Ӧʵ', 5, ' ', to_date('2022-03-11 14:49:28','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-11 14:49:28','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368899, 4, 'Ŀ', 0, ' ', to_date('2022-03-15 17:52:48','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-15 18:14:53','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368901, 4, '뼰˰', 1, ' ', to_date('2022-03-15 17:52:48','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-15 18:14:53','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368904, 4, '۳Ϣ', 2, ' ', to_date('2022-03-15 17:52:48','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-15 18:14:53','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_sob_default_item_group(id, income_category, name, sorted_index, description, create_time, update_time, creator, delete_type, tenant_key) VALUES (704495325212368909, 4, '˰', 3, ' ', to_date('2022-03-15 17:52:48','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-15 18:14:53','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9001, 'ϱ', 1, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9002, 'ҽƱ', 1, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9003, '˱', 1, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9004, 'ʧҵ', 1, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9005, '', 1, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9006, 'ס', 2, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9007, 'ҵ', 3, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ + +INSERT into hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9008, 'ס', 2, 1, '1,2', 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 0, 'all_teams'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202205200203.sql b/resource/sqlupgrade/GS/sql202205200203.sql new file mode 100644 index 000000000..8ebf5b90a --- /dev/null +++ b/resource/sqlupgrade/GS/sql202205200203.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_add_up_situation ADD ( + add_up_illness_medical varchar2(255) NULL , + add_up_tax_savings varchar2(255) NULL , + add_up_infant_care varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_add_up_deduction add ( + add_up_illness_medical varchar2(255) NULL, + add_up_infant_care varchar2(255) NULL +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202205310203.sql b/resource/sqlupgrade/GS/sql202205310203.sql new file mode 100644 index 000000000..9d3350e63 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202205310203.sql @@ -0,0 +1,47 @@ +INSERT INTO hrsa_formula (id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1653993466778, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼרӿ۳.ۼסϢ}', 'addUpDeductions_addUpHousingLoanInterest', 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653993466787, 'ۼסϢ', 1653993466778, 'addUpDeductions_addUpHousingLoanInterest', '{ۼרӿ۳.ۼסϢ}', 'number', 'addUpDeductions', 0, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula ( id , name , description , module , use_for , reference_type , return_type , validate_type , extend_param , formula , formulaRunScript , creator , delete_type , create_time , update_time ) VALUES (1653993837931, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼרӿ۳.ۼס}', 'addUpDeductions_addUpHousingRent', 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653993837947, 'ۼס', 1653993837931, 'addUpDeductions_addUpHousingRent', '{ۼרӿ۳.ۼס}', 'number', 'addUpDeductions', 0, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula ( id , name , description , module , use_for , reference_type , return_type , validate_type , extend_param , formula , formulaRunScript , creator , delete_type , create_time , update_time ) VALUES (1653993954233, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼרӿ۳.ۼƼ}', 'addUpDeductions_addUpContinuingEducation', 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653993954257, 'ۼƼ', 1653993954233, 'addUpDeductions_addUpContinuingEducation', '{ۼרӿ۳.ۼƼ}', 'number', 'addUpDeductions', 0, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula ( id , name , description , module , use_for , reference_type , return_type , validate_type , extend_param , formula , formulaRunScript , creator , delete_type , create_time , update_time ) VALUES (1653994061764, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼרӿ۳.ۼ}', 'addUpDeductions_addUpSupportElderly', 1, 0,to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'),to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var ( id , name , formula_id , field_id , field_name , field_type , source , order_index , creator , delete_type , create_time , update_time ) VALUES (1653994061780, 'ۼ', 1653994061764, 'addUpDeductions_addUpSupportElderly', '{ۼרӿ۳.ۼ}', 'number', 'addUpDeductions', 0, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +update hrsa_sys_salary_item set formula_id = 1653993466778 where id = 674853617092214800; +/ + +update hrsa_sys_salary_item set formula_id = 1653993837931 where id = 674853617092214801; +/ + +update hrsa_sys_salary_item set formula_id = 1653993954233 where id = 674853617092214802; +/ + +update hrsa_sys_salary_item set formula_id = 1653994061764 where id = 674853617092214803; +/ + +update hrsa_salary_item set formula_id = 1653993466778 where sys_salary_item_id = 674853617092214800; +/ + +update hrsa_salary_item set formula_id = 1653993837931 where sys_salary_item_id = 674853617092214801; +/ + +update hrsa_salary_item set formula_id = 1653993954233 where sys_salary_item_id = 674853617092214802; +/ + +update hrsa_salary_item set formula_id = 1653994061764 where sys_salary_item_id = 674853617092214803; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202206071403.sql b/resource/sqlupgrade/GS/sql202206071403.sql new file mode 100644 index 000000000..c54be8e40 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202206071403.sql @@ -0,0 +1,131 @@ +CREATE TABLE hrsa_tax_agent_emp +( + id NUMBER(38,0) primary key NOT NULL, + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '', + tax_agent_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + employee_name varchar2(255) +); +/ + +CREATE TABLE hrsa_tax_agent_emp_change +( + id NUMBER(38,0) primary key NOT NULL, + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '', + tax_agent_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + change_type number DEFAULT 0 , + employee_name varchar2(255) DEFAULT NULL, + module_type NUMBER(4,0) DEFAULT 0 +); +/ + +CREATE TABLE hrsa_tax_agent_admin +( + id NUMBER(38,0) primary key NOT NULL, + tax_agent_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT 0, + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_tax_agent_manage_range +( + id NUMBER(38,0) primary key NOT NULL, + tax_agent_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) DEFAULT 0, + tax_agent_sub_admin_id NUMBER(38,0) DEFAULT 0, + target_type number DEFAULT 1, + target_id NUMBER(38,0) NOT NULL, + employee_status varchar2(100) NOT NULL, + include_type number DEFAULT 1, + creator NUMBER(38,0) DEFAULT '0', + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '', + range_type number DEFAULT 0 +); +/ + +CREATE TABLE hrsa_tax_agent_base +( + id NUMBER(38,0) primary key NOT NULL, + devolution_status NUMBER(11,0) DEFAULT 0 , + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT '0', + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '' +); +/ + +CREATE TABLE hrsa_tax_agent_sub_admin +( + id NUMBER(38,0) primary key NOT NULL, + tax_agent_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + description varchar2(100) , + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT '0', + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '', + remark clob +); +/ + +CREATE TABLE hrsa_tax_agent_sub_admin_emp +( + id NUMBER(38,0) primary key NOT NULL, + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate, + creator NUMBER(38,0) DEFAULT '0', + delete_type number DEFAULT 0 , + tenant_key varchar2(10) DEFAULT '', + tax_agent_id NUMBER(38,0) NOT NULL, + tax_agent_sub_admin_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + employee_name varchar2(255) +); +/ + +ALTER TABLE hrsa_tax_agent add ( + payment_agency varchar2(255) +); +/ + +ALTER TABLE hrsa_salary_sob add ( + tax_agent_id NUMBER(38,0) +); +/ + +INSERT INTO hrsa_tax_agent_base(id, devolution_status, create_time, update_time, creator, delete_type, tenant_key) VALUES (1653303537239, 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 1, 0, 'all_teams'); +/ + +ALTER TABLE hrsa_bill_detail_temp add ( + payment_organization NUMBER(38,0) +); +/ + +ALTER TABLE hrsa_bill_detail add ( + payment_organization NUMBER(38,0) +); +/ + +ALTER TABLE hrsa_bill_batch add ( + payment_organization NUMBER(38,0) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202206090403.sql b/resource/sqlupgrade/GS/sql202206090403.sql new file mode 100644 index 000000000..039aa99b5 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202206090403.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_tax_declaration add ( + income_category number +); +/ + +ALTER TABLE hrsa_tax_declaration_detail add ( + employee_type number +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202206141003.sql b/resource/sqlupgrade/GS/sql202206141003.sql new file mode 100644 index 000000000..8a0e262f9 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202206141003.sql @@ -0,0 +1,44 @@ +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (705641858303836162, 'ۼӤ׶ջ', 'addUpInfantCare', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1655196897860, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (703419929857687552, 'ǰۼ˰', 'addUpTaxFreeIncome', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1655197296054, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (705641858303836161, 'ۼƴҽ', 'addUpIllnessMedical', 1, 7, 1, 1, 0, 2, 2, 2, 0, 1655197430967, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1655196897860, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼרӿ۳.ۼӤ׶ջ}', 'addUpDeductions_addUpInfantCare', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1655197296054, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.£Σ˰}+{ۼ.ۼ˰}', 'salaryItem_taxFreeIncome+addUpSituation_addUpTaxExemptIncome', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1655197430967, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{ۼרӿ۳.ۼƴҽ}', 'addUpDeductions_addUpIllnessMedical', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655196897869, 'ۼӤ׶ջ', 1655196897860, 'addUpDeductions_addUpInfantCare', '{ۼרӿ۳.ۼӤ׶ջ}', 'number', 'addUpDeductions', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655197296059, '£Σ˰', 1655197296054, 'salaryItem_taxFreeIncome', '{нĿ.£Σ˰}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655197296063, 'ۼ˰', 1655197296054, 'addUpSituation_addUpTaxExemptIncome', '{ۼ.ۼ˰}', 'number', 'addUpSituation', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655197430986, 'ۼƴҽ', 1655197430967, 'addUpDeductions_addUpIllnessMedical', '{ۼרӿ۳.ۼƴҽ}', 'number', 'addUpDeductions', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (728615865977528321, 1, 705641858303836162, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614103, 7); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845569, 1, 674853617092214787, 1, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 8); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845572, 1, 674853617092214788, 1, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 9); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845578, 1, 674853617092214789, 1, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 10); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845567, 1, 733975748932845568, 1, 1, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614083, 11); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202206160500.sql b/resource/sqlupgrade/GS/sql202206160500.sql new file mode 100644 index 000000000..de7812981 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202206160500.sql @@ -0,0 +1,41 @@ +delete from SystemRightDetail where rightid =2693; +/ + +delete from SystemRightsLanguage where id =2693; +/ + +delete from SystemRights where id =2693; +/ + +delete from SystemRightToGroup where rightid =2693; +/ + +delete from SystemRightType where id =36; +/ + +delete from SystemRightGroups where id =-22; +/ + +insert into SystemRights (id,rightdesc,righttype,detachable) values (2693,'нȨ','36',0); +/ + +insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2693,8,'Salary management authority','Salary management authority'); +/ + +insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2693,9,'н','н'); +/ + +insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2693,7,'нȨ','нȨ'); +/ + +insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (43969,'нܹԱ','Salary:Chief',2693); +/ + +insert into SystemRightToGroup(rightid,groupid) values (2693,-22); +/ + +insert into SystemRightGroups (id,rightgroupmark, rightgroupname, rightgroupremark) values(-22,'SALARY','нȨ','н'); +/ + +insert into SystemRightType(id,rightTypeName,rightTypeDesc) VALUES (36,'н','н'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202206230403.sql b/resource/sqlupgrade/GS/sql202206230403.sql new file mode 100644 index 000000000..1a84b5a61 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202206230403.sql @@ -0,0 +1,29 @@ +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1655976865885, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.ۼŮ}+{нĿ.ۼסϢ}+{нĿ.ۼס}+{нĿ.ۼƼ}+{нĿ.ۼ}+{нĿ.ۼƴҽ}+{нĿ.ۼӤ׶ջ}', 'salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly+salaryItem_addUpIllnessMedical+salaryItem_addUpInfantCare', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865909, 'ۼ', 1655976865885, 'salaryItem_addUpSupportElderly', '{нĿ.ۼ}', 'number', 'salaryItem', 4, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865913, 'ۼƼ', 1655976865885, 'salaryItem_addUpContinuingEducation', '{нĿ.ۼƼ}', 'number', 'salaryItem', 3, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865917, 'ۼס', 1655976865885, 'salaryItem_addUpHousingRent', '{нĿ.ۼס}', 'number', 'salaryItem', 2, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865921, 'ۼסϢ', 1655976865885, 'salaryItem_addUpHousingLoanInterest', '{нĿ.ۼסϢ}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865924, 'ۼŮ', 1655976865885, 'salaryItem_addUpChildEducation', '{нĿ.ۼŮ}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865929, 'ۼƴҽ', 1655976865885, 'salaryItem_addUpIllnessMedical', '{нĿ.ۼƴҽ}', 'number', 'salaryItem', 5, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1655976865933, 'ۼӤ׶ջ', 1655976865885, 'salaryItem_addUpInfantCare', '{нĿ.ۼӤ׶ջ}', 'number', 'salaryItem', 6, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +update hrsa_sys_salary_item set formula_id = 1655976865885 where id = 674853617092214804; +/ + +update hrsa_salary_item set formula_id = 1655976865885 where sys_salary_item_id = 674853617092214804; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202207110803.sql b/resource/sqlupgrade/GS/sql202207110803.sql new file mode 100644 index 000000000..801b616d4 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202207110803.sql @@ -0,0 +1,22 @@ +CREATE TABLE hrsa_salary_acct_result_report +( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_sob_id NUMBER(38,0) DEFAULT 0, + salary_acct_emp_id varchar2(200) DEFAULT '', + salary_acct_record_id NUMBER(38,0) DEFAULT 0, + employee_id varchar2(200) DEFAULT '', + tax_agent_id NUMBER(38,0) DEFAULT 0, + salary_item_id NUMBER(38,0) DEFAULT 0, + result_value varchar2(1000) DEFAULT '', + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(10) DEFAULT '', + department_id NUMBER(38,0) DEFAULT 0, + subcompany_id NUMBER(38,0) DEFAULT 0, + costcenter_id NUMBER(38,0) DEFAULT 0, + jobtitle_id NUMBER(38,0) DEFAULT 0, + location_id NUMBER(38,0) DEFAULT 0 +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202207120303.sql b/resource/sqlupgrade/GS/sql202207120303.sql new file mode 100644 index 000000000..a1adf5847 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202207120303.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_salary_sys_conf +( + id NUMBER(38,0) primary key NOT NULL, + conf_key varchar2(200) NOT NULL , + conf_value varchar2(500) NOT NULL, + title varchar2(200) , + module varchar2(200) , + order_weight number , + description varchar2(200) , + delete_type number DEFAULT 0 , + create_time date DEFAULT sysdate, + update_time date DEFAULT sysdate +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202207210203.sql b/resource/sqlupgrade/GS/sql202207210203.sql new file mode 100644 index 000000000..18db54e12 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202207210203.sql @@ -0,0 +1,6 @@ +ALTER TABLE hrsa_salary_archive ADD ( + tax_agent_id NUMBER(38,0) NULL , + pay_start_date date NULL , + pay_end_date date NULL +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202208051103.sql b/resource/sqlupgrade/GS/sql202208051103.sql new file mode 100644 index 000000000..d43c31244 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202208051103.sql @@ -0,0 +1,137 @@ +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (700599184238075904, '籣˺ϼ', 'socialSecurityTotal', 1, 7, 1, 1, 0, 2, 2, 2, 7, 1659339100298, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (700599446244319233, '˺ϼ', 'accumulationFundTotal', 1, 7, 1, 1, 0, 2, 2, 2, 7, 1659339063868, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (703458434280095745, '', 'laborIncome', 1, 7, 4, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (703458558739300353, '˰', 'laborTaxFreeIncome', 1, 7, 4, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (703459151591383041, 'ע', 'description', 1, 7, 1, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'string'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (703459464954929153, 'Ŀ', 'incomeItems', 1, 7, 1, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'string'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (704467747234045953, '˰', 'laborSubtraction', 1, 7, 4, 1, 0, 2, 2, 2, 1, 1659340673739, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (704468391612751873, '˰Ӧ˰ö', 'laborTaxableIncome', 1, 7, 4, 1, 0, 2, 2, 2, 1, 1659340916981, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (704468443048992769, '˰˰', 'laborTaxRate', 1, 7, 4, 1, 0, 2, 2, 2, 1, 1659341397524, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (704468490269204481, '˰۳', 'laborQuickDeductionFactor', 1, 7, 4, 1, 0, 2, 2, 2, 1, 1659341564390, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (704468528928063488, '˰Ӧ˰', 'laborTaxPayable', 1, 7, 4, 1, 0, 2, 2, 2, 1, 1659341811881, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (733975748932845568, '˰', 'taxAdjustment', 1, 7, 1, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629570, 'ҵ', 'commercialHealthInsurance4', 1, 7, 4, 0, 0, 2, 2, 2, 8, 1659341909423, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629571, '˰ϱ', 'taxDeferredEndowmentInsurance4', 1, 7, 4, 0, 0, 2, 2, 2, 8, 1659341966905, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629572, '', 'other4', 1, 7, 4, 0, 0, 2, 2, 2, 8, 1659341993723, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629573, '£Σ׼۳ľ', 'allowedDonation4', 1, 7, 4, 0, 0, 2, 2, 2, 8, 1659342041963, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629574, 'ע', 'description4', 1, 7, 4, 1, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'string'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629575, 'ѷнʺϼ', 'issuedTotal', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629576, 'нʺϼ', 'ressueTotal', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, '', 1, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659339063868, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.˺ϼ}', 'welfare_fundPerSum', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659339100298, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{籣.籣˺ϼ}', 'welfare_socialPerSum', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659340673739, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if({нĿ.}-{нĿ.˰}<=4000){800/}else{0.2*({нĿ.}-{нĿ.˰})}', 'if(salaryItem_laborIncome-salaryItem_laborTaxFreeIncome<=4000){800/}else{0.2*(salaryItem_laborIncome-salaryItem_laborTaxFreeIncome)}', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659340916981, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{нĿ.}-{нĿ.˰}-{нĿ.˰}', 'salaryItem_laborIncome-salaryItem_laborTaxFreeIncome-salaryItem_laborSubtraction', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659341397524, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if({нĿ.˰Ӧ˰ö}<=20000){0.2/}else if({нĿ.˰Ӧ˰ö}<=50000){0.3/}else{0.4/}', 'if(salaryItem_laborTaxableIncome<=20000){0.2/}else if(salaryItem_laborTaxableIncome<=50000){0.3/}else{0.4/}', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659341564390, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if({нĿ.˰Ӧ˰ö}<=20000){0/}else if({нĿ.˰Ӧ˰ö}<=50000){2000/}else{7000/}', 'if(salaryItem_laborTaxableIncome<=20000){0/}else if(salaryItem_laborTaxableIncome<=50000){2000/}else{7000/}', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659341811881, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', 'if({нĿ.˰Ӧ˰ö}<=0){0/}else{{нĿ.˰Ӧ˰ö}*{нĿ.˰˰}-{нĿ.˰۳}}', 'if(salaryItem_laborTaxableIncome<=0){0/}else{salaryItem_laborTaxableIncome*salaryItem_laborTaxRate-salaryItem_laborQuickDeductionFactor}', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659341909423, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.ҵ}', 'otherDeduction_businessHealthyInsurance', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659341966905, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.˰ϱ}', 'otherDeduction_taxDelayEndowmentInsurance', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659341993723, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.}', 'otherDeduction_otherDeduction', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1659342041963, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{}', '{˰۳.׼۳ľ}', 'otherDeduction_deductionAllowedDonation', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659339063886, '˺ϼ', 1659339063868, 'welfare_fundPerSum', '{籣.˺ϼ}', 'number', 'welfare', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659339100354, '籣˺ϼ', 1659339100298, 'welfare_socialPerSum', '{籣.籣˺ϼ}', 'number', 'welfare', 2, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659340673751, '', 1659340673739, 'salaryItem_laborIncome', '{нĿ.}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659340673754, '˰', 1659340673739, 'salaryItem_laborTaxFreeIncome', '{нĿ.˰}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659340917032, '', 1659340916981, 'salaryItem_laborIncome', '{нĿ.}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659340917035, '˰', 1659340916981, 'salaryItem_laborTaxFreeIncome', '{нĿ.˰}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659340917039, '˰', 1659340916981, 'salaryItem_laborSubtraction', '{нĿ.˰}', 'number', 'salaryItem', 2, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341397539, '˰Ӧ˰ö', 1659341397524, 'salaryItem_laborTaxableIncome', '{нĿ.˰Ӧ˰ö}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341564447, '˰Ӧ˰ö', 1659341564390, 'salaryItem_laborTaxableIncome', '{нĿ.˰Ӧ˰ö}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341811897, '˰Ӧ˰ö', 1659341811881, 'salaryItem_laborTaxableIncome', '{нĿ.˰Ӧ˰ö}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341811901, '˰˰', 1659341811881, 'salaryItem_laborTaxRate', '{нĿ.˰˰}', 'number', 'salaryItem', 3, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341811904, '˰۳', 1659341811881, 'salaryItem_laborQuickDeductionFactor', '{нĿ.˰۳}', 'number', 'salaryItem', 4, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341909473, 'ҵ', 1659341909423, 'otherDeduction_businessHealthyInsurance', '{˰۳.ҵ}', 'number', 'otherDeduction', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341966920, '˰ϱ', 1659341966905, 'otherDeduction_taxDelayEndowmentInsurance', '{˰۳.˰ϱ}', 'number', 'otherDeduction', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659341993736, '', 1659341993723, 'otherDeduction_otherDeduction', '{˰۳.}', 'number', 'otherDeduction', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1659342041967, '׼۳ľ', 1659342041963, 'otherDeduction_deductionAllowedDonation', '{˰۳.׼۳ľ}', 'number', 'otherDeduction', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202208080403.sql b/resource/sqlupgrade/GS/sql202208080403.sql new file mode 100644 index 000000000..5f653eac0 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202208080403.sql @@ -0,0 +1,53 @@ +Alter table hrsa_bill_detail modify social_payment_base_string varchar2(4000); +/ + +Alter table hrsa_bill_detail modify fund_payment_base_string varchar2(4000); +/ + +Alter table hrsa_bill_detail modify other_payment_base_string varchar2(4000); +/ + +Alter table hrsa_bill_detail modify social_per_json varchar2(4000); +/ + +Alter table hrsa_bill_detail modify fund_per_json varchar2(4000); +/ + +Alter table hrsa_bill_detail modify other_per_json varchar2(4000); +/ + +Alter table hrsa_bill_detail modify social_com_json varchar2(4000); +/ + +Alter table hrsa_bill_detail modify fund_com_json varchar2(4000); +/ + +Alter table hrsa_bill_detail modify other_com_json varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify social_payment_base_string varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify fund_payment_base_string varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify other_payment_base_string varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify social_per_json varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify fund_per_json varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify other_per_json varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify social_com_json varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify fund_com_json varchar2(4000); +/ + +Alter table hrsa_bill_detail_temp modify other_com_json varchar2(4000); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202208240403.sql b/resource/sqlupgrade/GS/sql202208240403.sql new file mode 100644 index 000000000..2a2df6e91 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202208240403.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_social_security_scheme ADD ( + shared_type varchar2(255) NULL , + tax_agent_ids varchar2(500) NULL +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202208240503.sql b/resource/sqlupgrade/GS/sql202208240503.sql new file mode 100644 index 000000000..dbc6bf9fc --- /dev/null +++ b/resource/sqlupgrade/GS/sql202208240503.sql @@ -0,0 +1,16 @@ +CREATE TABLE HRSA_SALARY_ITEM_HIDE ( + ID NUMBER(38,0) NOT NULL, + SALARY_SOB_ID NUMBER(38,0) NOT NULL, + SALARY_ITEM_ID NUMBER(38,0) NOT NULL, + IS_GROUP NUMBER NOT NULL, + ITEM_HIDE NUMBER(38,0) DEFAULT 0, + CREATOR NUMBER(38,0) NOT NULL, + DELETE_TYPE NUMBER DEFAULT 0 NOT NULL, + TENANT_KEY VARCHAR2(255 BYTE) NOT NULL, + CREATE_TIME DATE DEFAULT sysdate NOT NULL, + UPDATE_TIME DATE DEFAULT sysdate +); +/ + +ALTER TABLE HRSA_SALARY_ITEM_HIDE ADD CONSTRAINT SYS_C0024450 PRIMARY KEY ("ID"); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202210080203.sql b/resource/sqlupgrade/GS/sql202210080203.sql new file mode 100644 index 000000000..46d55e2ed --- /dev/null +++ b/resource/sqlupgrade/GS/sql202210080203.sql @@ -0,0 +1,94 @@ +CREATE TABLE hrsa_excel_bill_detail ( + + id NUMBER(20,0) NOT NULL, + + employee_id NUMBER(20,0) NOT NULL, + + bill_month VARCHAR2(30) NOT NULL, + + bill_status NUMBER(11,0) NOT NULL, + + payment_status NUMBER(11,0) NOT NULL, + + supplementary_month VARCHAR2(50) NULL, + + supplementary_projects VARCHAR2(50) NULL, + + resource_from NUMBER(11,0) NOT NULL, + + social_pay_org NUMBER(11,0) NULL, + + social_account VARCHAR2(50) NULL, + + social_scheme_id NUMBER(20,0) NULL, + + social_payment_base_string CLOB NULL, + + fund_pay_org NUMBER(11,0) NULL, + + fund_account VARCHAR2(50) NULL, + + supplement_fund_account VARCHAR2(50) NULL, + + fund_scheme_id NUMBER(11,0) NULL, + + fund_payment_base_string CLOB NULL, + + other_pay_org NUMBER(11,0) NULL, + + other_scheme_id NUMBER(20,0) NULL, + + other_payment_base_string CLOB NULL, + + social_per_json CLOB NULL, + + social_per_sum CLOB NULL, + + fund_per_json CLOB NULL, + + fund_per_sum CLOB NULL, + + other_per_json CLOB NULL, + + other_per_sum CLOB NULL, + + per_sum CLOB NULL, + + social_com_json CLOB NULL, + + social_com_sum CLOB NULL, + + fund_com_json CLOB NULL, + + fund_com_sum CLOB NULL, + + other_com_json CLOB NULL, + + other_com_sum CLOB NULL, + + com_sum CLOB NULL, + + social_sum CLOB NULL, + + fund_sum CLOB NULL, + + other_sum CLOB NULL, + + total CLOB NULL, + + creator NUMBER(20,0) NOT NULL, + + create_time DATE DEFAULT sysdate, + + update_time DATE DEFAULT sysdate, + + delete_type NUMBER(11,0) NOT NULL, + + tenant_key VARCHAR2(255 BYTE), + + payment_organization NUMBER(20,0) NULL, + +PRIMARY KEY ( id ) + +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202210080403.sql b/resource/sqlupgrade/GS/sql202210080403.sql new file mode 100644 index 000000000..f0b71f93f --- /dev/null +++ b/resource/sqlupgrade/GS/sql202210080403.sql @@ -0,0 +1,6 @@ +ALTER TABLE hrsa_salary_archive ADD ( + run_status varchar2(255) NULL , + add_type varchar2(255) NULL , + stop_type varchar2(255) NULL +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202210170203.sql b/resource/sqlupgrade/GS/sql202210170203.sql new file mode 100644 index 000000000..895fcc2f4 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202210170203.sql @@ -0,0 +1,30 @@ +CREATE TABLE hrsa_insurance_base_info ( + + id NUMBER(38,0) NOT NULL, + + employee_id NUMBER(38,0) NOT NULL, + + payment_organization NUMBER(11,0) NULL, + + social_archives_id NUMBER(38,0) NULL, + + fund_archives_id NUMBER(38,0) NULL, + + other_archives_id NUMBER(38,0) NULL, + + tenant_key VARCHAR2(255 BYTE) NOT NULL, + + creator NUMBER(11,0) NOT NULL, + + delete_type NUMBER(11,0) NOT NULL, + + create_time DATE NOT NULL, + + update_time DATE NOT NULL, + + run_status VARCHAR2(20 BYTE) NOT NULL, + +PRIMARY KEY ( id ) + +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202210170303.sql b/resource/sqlupgrade/GS/sql202210170303.sql new file mode 100644 index 000000000..0de41e5bb --- /dev/null +++ b/resource/sqlupgrade/GS/sql202210170303.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_salary_sob_range ADD employee_statuses VARCHAR(255); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202211090103.sql b/resource/sqlupgrade/GS/sql202211090103.sql new file mode 100644 index 000000000..dd4f51ae3 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202211090103.sql @@ -0,0 +1,41 @@ +create table hrsa_special_add_deduction +( +id NUMBER(38, 0) primary key, +employee_id NUMBER(38, 0) not null, +tax_agent_id NUMBER(38, 0) not null, +children_education varchar2(255) default '' , +continuing_education varchar2(255) default '' , +housing_loan_interest varchar2(255) default '' , +housing_rent varchar2(255) default '', +supporting_elder varchar2(255) default '' , +serious_illness_treatment varchar2(255) default '' , +infant_care varchar2(255) default '', +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +creator NUMBER(38, 0), +delete_type NUMBER(11, 0) default 0 , +tenant_key varchar2(10) default '' +); +/ + +create sequence hrsa_special_a_d_id +start with 1 +increment by 1 +nomaxvalue +nocycle +nocache; +/ + +CREATE TRIGGER hrsa_spec_add_dct_trigger +before INSERT ON hrsa_special_add_deduction FOR each ROW WHEN (new.id IS NULL) +BEGIN +SELECT hrsa_special_a_d_id.nextval into:New.id from dual; +END; +/ + +CREATE TRIGGER hrsa_spec_add_dct_time_trigger +before UPDATE ON hrsa_special_add_deduction FOR each ROW WHEN (new.update_time IS NOT NULL) +BEGIN +SELECT sysdate into:new.update_time from dual; +END; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202211090301.sql b/resource/sqlupgrade/GS/sql202211090301.sql new file mode 100644 index 000000000..d35f99180 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202211090301.sql @@ -0,0 +1,119 @@ +delete from HtmlLabelIndex where id = 539971 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 539971,'' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 539971 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539971 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539971 as indexid ,'' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539971 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539971 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539971 as indexid ,'Rule Settings' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539971 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539971 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539971 as indexid ,'ҎtO' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539971 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlModuleLabel where indexId = 539971 and moduleCode = 'HRM' and type = 'label' ; +/ + +insert into HtmlModuleLabel(type,moduleCode,indexId) values ('label','HRM',539971) ; +/ + +delete from HtmlLabelIndex where id = 539970 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 539970,'Ӧ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 539970 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539970 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539970 as indexid ,'Ӧ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539970 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539970 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539970 as indexid ,'Apply Settings' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539970 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539970 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539970 as indexid ,'O' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539970 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlModuleLabel where indexId = 539970 and moduleCode = 'HRM' and type = 'label' ; +/ + +insert into HtmlModuleLabel(type,moduleCode,indexId) values ('label','HRM',539970) ; +/ + +delete from HtmlLabelIndex where id = 539968 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 539968,'' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 539968 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539968 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539968 as indexid ,'' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539968 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539968 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539968 as indexid ,'set up' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539968 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539968 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539968 as indexid ,'O' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539968 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlModuleLabel where indexId = 539968 and moduleCode = 'HRM' and type = 'label' ; +/ + +insert into HtmlModuleLabel(type,moduleCode,indexId) values ('label','HRM',539968) ; +/ + +delete from HtmlLabelIndex where id = 539967 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 539967,'רӿ۳' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 539967 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539967 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539967 as indexid ,'רӿ۳' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539967 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539967 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539967 as indexid ,'Special additional deduction' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539967 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 539967 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 539967 as indexid ,'헸ӿ۳' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 539967 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlModuleLabel where indexId = 539967 and moduleCode = 'HRM' and type = 'label' ; +/ + +insert into HtmlModuleLabel(type,moduleCode,indexId) values ('label','HRM',539967) ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202211090402.sql b/resource/sqlupgrade/GS/sql202211090402.sql new file mode 100644 index 000000000..5306d7b0f --- /dev/null +++ b/resource/sqlupgrade/GS/sql202211090402.sql @@ -0,0 +1,59 @@ +Delete from LeftMenuInfo where id=100183; +/ + +Delete from LeftMenuConfig where infoid=100183; +/ + +call LMConfig_U_ByInfoInsert (2,100181,0); +/ + +call LMInfo_Insert (100183,539970,'','',2,100181,0,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/appconfig' where id = 100183; +/ + +Delete from LeftMenuInfo where id=100182; +/ + +Delete from LeftMenuConfig where infoid=100182; +/ + +call LMConfig_U_ByInfoInsert (2,100181,-1); +/ + +call LMInfo_Insert (100182,539971,'','',2,100181,-1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/sysconfig-1' where id = 100182; +/ + +Delete from LeftMenuInfo where id=100180; +/ + +Delete from LeftMenuConfig where infoid=100180; +/ + +call LMConfig_U_ByInfoInsert (2,100126,0); +/ + +call LMInfo_Insert (100180,539967,'','',2,100126,0,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/dataAcquisition/specialAddDeduction' where id = 100180; +/ + +Delete from LeftMenuInfo where id=100181; +/ + +Delete from LeftMenuConfig where infoid=100181; +/ + +call LMConfig_U_ByInfoInsert (2,100118,9); +/ + +call LMInfo_Insert (100181,539968,'','',2,100118,9,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='' where id = 100181; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202211170503.sql b/resource/sqlupgrade/GS/sql202211170503.sql new file mode 100644 index 000000000..24aec52f8 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202211170503.sql @@ -0,0 +1,8 @@ +alter table HRSA_SALARY_ITEM add SHARED_TYPE number(11) ; +/ + +alter table HRSA_SALARY_ITEM add TAX_AGENT_IDS varchar2(1024); +/ + +ALTER TABLE HRSA_SALARY_ACCT_RECORD ADD LOCK_SALARY_ITEM_IDS varchar2(2000); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202212080903.sql b/resource/sqlupgrade/GS/sql202212080903.sql new file mode 100644 index 000000000..8741ee7ac --- /dev/null +++ b/resource/sqlupgrade/GS/sql202212080903.sql @@ -0,0 +1,69 @@ +CREATE TABLE hrsa_compensation_log ( + + id NUMBER(20,0) NOT NULL, + + payment_agency NUMBER(20,0) NULL, + + payment_organization NUMBER(20,0) NULL, + + employee_id NUMBER(20,0) NULL, + + welfare_type NUMBER(11,0) NULL, + + category_type VARCHAR2(100) NULL, + + country_total VARCHAR2(512) NULL, + + company_total VARCHAR2(512) NULL, + + adjustment_total VARCHAR2(512) NULL, + + adjust_to NUMBER(20,0) NULL, + + bill_month VARCHAR2(30) NULL, + + creator NUMBER(20,0) NULL, + + delete_type NUMBER(11,0) NULL, + + create_time DATE DEFAULT sysdate, + + update_time DATE DEFAULT sysdate, + + tenant_key VARCHAR2(10) NULL, + +PRIMARY KEY ( id ) + +); +/ + +CREATE TABLE hrsa_compensation_config ( + + id NUMBER(20,0) NOT NULL, + + payment_agency NUMBER(20,0) NULL, + + payment_organization NUMBER(20,0) NULL, + + employee_id NUMBER(20,0) NULL, + + welfare_type NUMBER(11,0) NULL, + + category_type VARCHAR2(100) NULL, + + adjust_to NUMBER(20,0) NULL, + + creator NUMBER(20,0) NULL, + + delete_type NUMBER(11,0) NULL, + + create_time DATE DEFAULT sysdate, + + update_time DATE DEFAULT sysdate, + + tenant_key VARCHAR2(10) NULL, + +PRIMARY KEY ( id ) + +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202212081003.sql b/resource/sqlupgrade/GS/sql202212081003.sql new file mode 100644 index 000000000..06ac77fd0 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202212081003.sql @@ -0,0 +1,60 @@ +create table HRSA_SALARY_SEND_RANGE +( + ID NUMBER(38) not null + primary key, + SALARY_SEND_ID NUMBER(38), + GRANT_TYPE VARCHAR2(64), + CREATE_TIME TIMESTAMP(6) default sysdate, + CREATOR NUMBER(38), + UPDATE_TIME TIMESTAMP(6) default sysdate, + DELETE_TYPE NUMBER(11) default 0, + TENANT_KEY VARCHAR2(10) +); +/ + +create sequence HRSA_S_S_R_ID +start with 1 +increment by 1 +nomaxvalue +nocycle +nocache; +/ + +CREATE TRIGGER HRSA_S_S_R_TRIGGER +before INSERT ON HRSA_SALARY_SEND_RANGE FOR each ROW WHEN (NEW.ID IS NULL) +BEGIN +SELECT HRSA_S_S_R_ID.nextval into:NEW.ID from dual; +END; +/ + +create table HRSA_SALARY_SEND_RANGE_OBJ +( + ID NUMBER(38) not null + primary key, + SALARY_SEND_ID NUMBER(38) not null, + SALARY_SEND_RANGE_ID NUMBER(38) not null, + RANGE_TYPE NUMBER(11) not null, + TARGET_TYPE NUMBER(11) not null, + TARGET_ID NUMBER(38) not null, + CREATOR NUMBER(38), + CREATE_TIME DATE default sysdate, + UPDATE_TIME DATE default sysdate, + DELETE_TYPE NUMBER(11) default 0, + TENANT_KEY VARCHAR2(10) +); +/ + +create sequence HRSA_S_S_R_O_ID +start with 1 +increment by 1 +nomaxvalue +nocycle +nocache; +/ + +CREATE TRIGGER HRSA_S_S_R_O_TRIGGER +before INSERT ON HRSA_SALARY_SEND_RANGE_OBJ FOR each ROW WHEN (NEW.ID IS NULL) +BEGIN +SELECT HRSA_S_S_R_O_ID.nextval into:NEW.ID from dual; +END; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202212230103.sql b/resource/sqlupgrade/GS/sql202212230103.sql new file mode 100644 index 000000000..5e461d645 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202212230103.sql @@ -0,0 +1,48 @@ +CREATE TABLE hrsa_salary_sob_back_item ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) DEFAULT NULL NULL, +salary_item_id NUMBER(38,0) DEFAULT NULL NULL, +salary_item_code VARCHAR2(255) DEFAULT NULL NULL, +data_type VARCHAR2(255) DEFAULT NULL NULL, +rounding_mode NUMBER(38,0) DEFAULT NULL NULL, +pattern NUMBER(38,0) DEFAULT NULL NULL, +value_type NUMBER(38,0) DEFAULT NULL NULL, +formula_id NUMBER(38,0) DEFAULT NULL NULL, +back_calc_type NUMBER(38,0) DEFAULT NULL NULL, +tenant_key VARCHAR2(255) DEFAULT NULL NULL, +creator NUMBER(38,0) DEFAULT NULL NULL, +delete_type NUMBER(38,0) DEFAULT NULL NULL, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate +); +/ + +alter table hrsa_salary_acct_record add back_calc_status NUMBER(38,0) null; +/ + +alter table hrsa_salary_acct_result add origin_result_value VARCHAR2(1000) null; +/ + +alter table hrsa_salary_acct_result_report add origin_result_value VARCHAR2(1000) null; +/ + +alter table hrsa_salary_send add salary_acct_type NUMBER(38,0) null; +/ + +alter table hrsa_salary_send add send_status NUMBER(38,0) null; +/ + +alter table hrsa_salary_send_info add salary_acct_type NUMBER(38,0) null; +/ + +alter table hrsa_salary_template add replenish_name VARCHAR2(100) null; +/ + +alter table hrsa_salary_template add replenish_rule VARCHAR2(255) null; +/ + +alter table hrsa_salary_template add replenish_salary_item_setting CLOB null; +/ + +alter table hrsa_acct_result_temp add origin_result_value VARCHAR2(1000) null; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202301310403.sql b/resource/sqlupgrade/GS/sql202301310403.sql new file mode 100644 index 000000000..d3933f433 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202301310403.sql @@ -0,0 +1,92 @@ +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629577, 'ս', 'annualIncome', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629578, 'ս˰', 'annualTaxRate', 1, 7, 1, 0, 0, 2, 2, 2, 0, 1675043440772, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629579, 'ս۳', 'annualQuickDeductionFactor', 1, 7, 1, 0, 0, 2, 2, 2, 0, 1674894163247, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629580, 'սӦ˰', 'annualTax', 1, 7, 1, 0, 0, 2, 2, 2, 0, 1674896933031, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629581, 'Ӧս', 'annualPayable', 1, 7, 1, 0, 0, 2, 2, 2, 0, 1674897014605, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629600, 'ս˰', 'annualTaxFreeIncome', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629601, 'ս', 'annualOther', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629602, '׼۳ľս', 'annualDonateTax', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629603, '˰ս', 'annualTaxSavings', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629604, 'עս', 'annualRemark', 1, 7, 1, 0, 0, 2, 2, 1, 0, 0, ' ', 1, 1, 0, 0, 'all_teams', to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 'string'); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845590, 2, 746777981115629577, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 0); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845591, 2, 746777981115629578, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 1); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845592, 2, 746777981115629579, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 2); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845593, 2, 746777981115629580, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 3); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845595, 2, 746777981115629600, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 4); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845596, 2, 746777981115629601, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 5); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845597, 2, 746777981115629602, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 6); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845598, 2, 746777981115629603, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 7); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845599, 2, 746777981115629604, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 8); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845594, 2, 746777981115629581, 1, 0, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 0, 9); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1674894163247, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{\"sqlReturnKey\":\"\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}', 'if({нĿ.ս}<=36000){0;}else if({нĿ.ս}<=144000){210;}else if({нĿ.ս}<=300000){1410;}else if({нĿ.ս}<=420000){2660;}else if({нĿ.ս}<=660000){4410;}else if({нĿ.ս}<=960000){7160;}else{15160;}', 'if(salaryItem_annualIncome<=36000){0;}else if(salaryItem_annualIncome<=144000){210;}else if(salaryItem_annualIncome<=300000){1410;}else if(salaryItem_annualIncome<=420000){2660;}else if(salaryItem_annualIncome<=660000){4410;}else if(salaryItem_annualIncome<=960000){7160;}else{15160;}', 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1674896933031, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{\"sqlReturnKey\":\"\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}', '{нĿ.ս}*{нĿ.ս˰}-{нĿ.ս۳}', 'salaryItem_annualIncome*salaryItem_annualTaxRate-salaryItem_annualQuickDeductionFactor', 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1674897014605, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{\"sqlReturnKey\":\"\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}', '{нĿ.ս}-{нĿ.սӦ˰}', 'salaryItem_annualIncome-salaryItem_annualTax', 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1675043440772, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{\"sqlReturnKey\":\"\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}', 'if({нĿ.ս}<=0){0;}else if({нĿ.ս}<=36000){0.03;}else if({нĿ.ս}<=144000){0.1;}else if({нĿ.ս}<=300000){0.2;}else if({нĿ.ս}<=420000){0.25;}else if({нĿ.ս}<=660000){0.3;}else if({нĿ.ս}<=960000){0.35;}else{0.45;}', 'if(salaryItem_annualIncome<=0){0;}else if(salaryItem_annualIncome<=36000){0.03;}else if(salaryItem_annualIncome<=144000){0.1;}else if(salaryItem_annualIncome<=300000){0.2;}else if(salaryItem_annualIncome<=420000){0.25;}else if(salaryItem_annualIncome<=660000){0.3;}else if(salaryItem_annualIncome<=960000){0.35;}else{0.45;}', 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1674894163265, 'ս', 1674894163247, 'salaryItem_annualIncome', '{нĿ.ս}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1674896933036, 'ս', 1674896933031, 'salaryItem_annualIncome', '{нĿ.ս}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1674896933041, 'ս˰', 1674896933031, 'salaryItem_annualTaxRate', '{нĿ.ս˰}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1674896933045, 'ս۳', 1674896933031, 'salaryItem_annualQuickDeductionFactor', '{нĿ.ս۳}', 'number', 'salaryItem', 2, 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1674897014622, 'ս', 1674897014605, 'salaryItem_annualIncome', '{нĿ.ս}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1674897014626, 'սӦ˰', 1674897014605, 'salaryItem_annualTax', '{нĿ.սӦ˰}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1675043440796, 'ս', 1675043440772, 'salaryItem_annualIncome', '{нĿ.ս}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss'), to_date('2022-03-28 10:32:59','yyyy-MM-dd HH24:mi:ss')); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202302060801.sql b/resource/sqlupgrade/GS/sql202302060801.sql new file mode 100644 index 000000000..cf85fb637 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202302060801.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 540871 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 540871,'' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 540871 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 540871 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 540871 as indexid ,'' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 540871 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 540871 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 540871 as indexid ,'file management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 540871 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 540871 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 540871 as indexid ,'n' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 540871 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 540869 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 540869,'ֶι' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 540869 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 540869 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 540869 as indexid ,'ֶι' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 540869 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 540869 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 540869 as indexid ,'Field management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 540869 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 540869 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 540869 as indexid ,'ֶι' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 540869 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202302060902.sql b/resource/sqlupgrade/GS/sql202302060902.sql new file mode 100644 index 000000000..183a14737 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202302060902.sql @@ -0,0 +1,44 @@ +Delete from LeftMenuInfo where id=100125; +/ + +Delete from LeftMenuConfig where infoid=100125; +/ + +call LMConfig_U_ByInfoInsert (2,100118,2); +/ + +call LMInfo_Insert (100125,538004,'','',2,100118,2,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='' where id = 100125; +/ + +Delete from LeftMenuInfo where id=100185; +/ + +Delete from LeftMenuConfig where infoid=100185; +/ + +call LMConfig_U_ByInfoInsert (2,100125,0); +/ + +call LMInfo_Insert (100185,540871,'','',2,100125,0,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/salaryFile' where id = 100185; +/ + +Delete from LeftMenuInfo where id=100184; +/ + +Delete from LeftMenuConfig where infoid=100184; +/ + +call LMConfig_U_ByInfoInsert (2,100125,-1); +/ + +call LMInfo_Insert (100184,540869,'','',2,100125,-1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/fieldManagement' where id = 100184; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202302090303.sql b/resource/sqlupgrade/GS/sql202302090303.sql new file mode 100644 index 000000000..d70a2f03a --- /dev/null +++ b/resource/sqlupgrade/GS/sql202302090303.sql @@ -0,0 +1,8 @@ +ALTER TABLE hrsa_scheme_detail ADD payment_cycle NUMBER(11,0) NULL; +/ + +ALTER TABLE hrsa_scheme_detail ADD account_type NUMBER(11,0) NULL; +/ + +ALTER TABLE hrsa_scheme_detail ADD cycle_setting VARCHAR2(255) NULL; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202303130101.sql b/resource/sqlupgrade/GS/sql202303130101.sql new file mode 100644 index 000000000..671629174 --- /dev/null +++ b/resource/sqlupgrade/GS/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/GS/sql202303130202.sql b/resource/sqlupgrade/GS/sql202303130202.sql new file mode 100644 index 000000000..9038f9cd1 --- /dev/null +++ b/resource/sqlupgrade/GS/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/GS/sql202303150403.sql b/resource/sqlupgrade/GS/sql202303150403.sql new file mode 100644 index 000000000..1de44bdc4 --- /dev/null +++ b/resource/sqlupgrade/GS/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/GS/sql202304040503.sql b/resource/sqlupgrade/GS/sql202304040503.sql new file mode 100644 index 000000000..774c84cbb --- /dev/null +++ b/resource/sqlupgrade/GS/sql202304040503.sql @@ -0,0 +1,66 @@ +ALTER TABLE hrsa_other_deduction ADD ( + private_pension varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_add_up_situation ADD ( + add_up_private_pension varchar2(255) NULL +); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629605, 'Ͻ', 'privatePension', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1680746056549, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_sys_salary_item(id, name, code, system_type, category, item_type, use_default, use_in_employee_salary, rounding_mode, pattern, value_type, datasource, formula_id, description, can_edit, can_delete, creator, delete_type, tenant_key, create_time, update_time, data_type) VALUES (746777981115629698, 'ۼƸϽ', 'addUpPrivatePension', 1, 2, 12, 0, 0, 2, 2, 2, 8, 1681201555316, '', 0, 1, 0, 0, 'all_teams', to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 'number'); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1680746056549, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{\"sqlReturnKey\":\"\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}', '{˰۳.Ͻ}', 'otherDeduction_privatePension', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1680746056577, 'Ͻ', 1680746056549, 'otherDeduction_privatePension', '{˰۳.Ͻ}', 'number', 'otherDeduction', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1681201555316, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{\"sqlReturnKey\":\"\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}', '{нĿ.Ͻ}+{ۼ.ۼƸϽ}', 'salaryItem_privatePension+addUpSituation_addUpPrivatePension', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681201555332, 'Ͻ', 1681201555316, 'salaryItem_privatePension', '{нĿ.Ͻ}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681201555338, 'ۼƸϽ', 1681201555316, 'addUpSituation_addUpPrivatePension', '{ۼ.ۼƸϽ}', 'number', 'addUpSituation', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845610, 1, 746777981115629605, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 10); +/ + +INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (733975748932845611, 1, 746777981115629698, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614110, 11); +/ + +INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1681265757380, 'ʽ1', 'ע', 'salary', 'salaryitem', 'formula', 'number', 'number', '{\"datasource\":{\"datasourceId\":\"\"}}', '{нĿ.ǰۼӦ˰ϼ}-{нĿ.ǰۼר۳ϼ}-{нĿ.ǰۼרӿ۳ϼ}-{нĿ.ǰۼ۳ϼ}-{нĿ.ǰۼƼ}-{нĿ.ǰۼ׼۳ľ}-{нĿ.ۼƸϽ}', 'salaryItem_addUpIncome-salaryItem_addUpSpecialDeduction-salaryItem_addUpSpeAddiDeduction-salaryItem_addUpOtherDeduction-salaryItem_addUpSubtraction-salaryItem_addUpAllowedDonation-salaryItem_addUpPrivatePension', 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681265757404, 'ǰۼ׼۳ľ', 1681265757380, 'salaryItem_addUpAllowedDonation', '{нĿ.ǰۼ׼۳ľ}', 'number', 'salaryItem', 5, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681265757408, 'ǰۼƼ', 1681265757380, 'salaryItem_addUpSubtraction', '{нĿ.ǰۼƼ}', 'number', 'salaryItem', 4, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681265757413, 'ǰۼ۳ϼ', 1681265757380, 'salaryItem_addUpOtherDeduction', '{нĿ.ǰۼ۳ϼ}', 'number', 'salaryItem', 3, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681265757417, 'ǰۼרӿ۳ϼ', 1681265757380, 'salaryItem_addUpSpeAddiDeduction', '{нĿ.ǰۼרӿ۳ϼ}', 'number', 'salaryItem', 2, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681265757421, 'ǰۼר۳ϼ', 1681265757380, 'salaryItem_addUpSpecialDeduction', '{нĿ.ǰۼר۳ϼ}', 'number', 'salaryItem', 1, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681265757424, 'ǰۼӦ˰ϼ', 1681265757380, 'salaryItem_addUpIncome', '{нĿ.ǰۼӦ˰ϼ}', 'number', 'salaryItem', 0, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1681265757428, 'ۼƸϽ', 1681265757380, 'salaryItem_addUpPrivatePension', '{нĿ.ۼƸϽ}', 'number', 'salaryItem', 6, 92, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')); +/ + +update hrsa_sys_salary_item set formula_id = 1681265757380 where name = 'ǰۼӦ˰ö'; +/ + +update hrsa_salary_item set formula_id = 1681265757380 where name = 'ǰۼӦ˰ö'; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202304260103.sql b/resource/sqlupgrade/GS/sql202304260103.sql new file mode 100644 index 000000000..55395f986 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202304260103.sql @@ -0,0 +1,2 @@ +update hrsa_sys_salary_item set use_in_employee_salary = 1 where code in ('baseSalary','postSalary'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202304270203.sql b/resource/sqlupgrade/GS/sql202304270203.sql new file mode 100644 index 000000000..65af1f28f --- /dev/null +++ b/resource/sqlupgrade/GS/sql202304270203.sql @@ -0,0 +1,174 @@ +create table hrsa_sub_table +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + sub_table_name varchar2(100) not null, + dimension varchar2(20) not null, + start_month varchar2(10), + end_month varchar2(10), + pay_org_string varchar2(500), + pay_agency_string varchar2(500), + sub_company_string varchar2(500), + depart_string varchar2(500), + grade_string varchar2(500), + position_string varchar2(500), + status_string varchar2(500), + employee_type varchar2(500), + employee_string varchar2(500), + payment_type_string varchar2(100) +); +/ + +create table hrsa_sub_table_item +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + table_id number not null, + item_name varchar2(50) not null, + item_value varchar2(500) not null, + index_value int not null, + total_rule varchar2(500), + count_rule varchar2(500), + unit_type int default 2 +); +/ + +alter table hrsa_sub_table add table_type int; +/ + +alter table hrsa_sub_table modify table_type default 0; +/ + +create table hrsa_salary_stats_dim +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + dim_name varchar2(100), + dim_type varchar2(20), + remark varchar2(500), + setting varchar2(2000), + is_default int, + dim_code varchar2(50) +); +/ + +create table hrsa_salary_stats_report +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + report_name varchar2(100), + dimension varchar2(1000), + tax_agent_setting varchar2(1000), + income_category_setting varchar2(20), + sub_company_setting varchar2(1000), + depart_setting varchar2(1000), + grade_setting varchar2(1000), + position_setting varchar2(1000), + status_setting varchar2(1000), + employee_setting varchar2(1000), + hiredate_setting varchar2(1000), + leavedate_setting varchar2(1000), + salary_start_month date, + salary_end_month date +); +/ + +create table hrsa_salary_statistics_item +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + item_name varchar2(50), + item_value varchar2(1000), + count_rule varchar2(500), + sum_rule varchar2(500), + avg_rule varchar2(500), + max_rule varchar2(500), + min_rule varchar2(500), + median_rule varchar2(500), + index_value int, + unit_type int, + stat_report_id number +); +/ + +create table hrsa_charts_setting +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + table_id number not null, + charts_type int not null, + item_values varchar2(500), + item_col_value varchar2(50) not null, + dimension_range int not null, + item_sort_value varchar2(500), + item_col_sort_value varchar2(50), + sort_type int, + sort_num int +); +/ + +create table hrsa_salary_echarts_setting +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + report_id number not null, + charts_type int not null, + item_values varchar2(500), + item_col_value varchar2(50) not null, + dimension_range int not null, + item_sort_value varchar2(500), + item_col_sort_value varchar2(50), + sort_type int, + sort_num int +); +/ + +alter table hrsa_salary_stats_dim modify dim_type varchar2(30); +/ + +alter table hrsa_salary_stats_report modify income_category_setting varchar2(1000); +/ + +alter table hrsa_salary_stats_report add remark varchar2(100); +/ + +alter table hrsa_salary_stats_report add second_dimension varchar2(100); +/ + +alter table hrsa_salary_stats_report add sort_index varchar2(100); +/ + +alter table hrsa_salary_stats_report add sort_type varchar2(100); +/ + +alter table hrsa_salary_stats_dim add label_id int; +/ + diff --git a/resource/sqlupgrade/GS/sql202304270303.sql b/resource/sqlupgrade/GS/sql202304270303.sql new file mode 100644 index 000000000..a2aec6169 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202304270303.sql @@ -0,0 +1,11 @@ +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 ('salaryItemBrowser', '1', '1', '', 'select * from hrsa_salary_item 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 ('salaryItemBrowser', '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, '', 'name', '', 1, 1, SYS_GUID(), NULL); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (datashowset_id, '', 'name', '2', '', 1, SYS_GUID(), ''); +end; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202304270501.sql b/resource/sqlupgrade/GS/sql202304270501.sql new file mode 100644 index 000000000..5f3f359c9 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202304270501.sql @@ -0,0 +1,23 @@ +delete from HtmlLabelIndex where id = 542781 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 542781,'нͳƱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 542781 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 542781 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 542781 as indexid ,'нͳƱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 542781 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 542781 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 542781 as indexid ,'Salary Statistics Report' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 542781 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 542781 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 542781 as indexid ,'нyӋ' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 542781 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202305050302.sql b/resource/sqlupgrade/GS/sql202305050302.sql new file mode 100644 index 000000000..4264b16d2 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202305050302.sql @@ -0,0 +1,14 @@ +Delete from LeftMenuInfo where id=100187; +/ + +Delete from LeftMenuConfig where infoid=100187; +/ + +call LMConfig_U_ByInfoInsert (2,100118,9); +/ + +call LMInfo_Insert (100187,542781,'','',2,100118,9,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/analysisOfSalaryStatistics' where id = 100187; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202305170903.sql b/resource/sqlupgrade/GS/sql202305170903.sql new file mode 100644 index 000000000..2ab9370a5 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202305170903.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_salary_acct_result_log ( + id NUMBER(38,0) NOT NULL, + datasource NUMBER NOT NULL, + salary_acct_record_id NUMBER(38,0) NOT NULL, + salary_acct_result_id NUMBER(38,0) NOT NULL, + salary_acct_emp_id NUMBER(38,0) NOT NULL, + salary_item_id NUMBER(38,0) NOT NULL, + employee_id NUMBER(38,0) NOT NULL, + operator NUMBER(38,0) NOT NULL, + operate_time DATE NOT NULL, + delete_type NUMBER NOT NULL, + update_time DATE NOT NULL +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202306020403.sql b/resource/sqlupgrade/GS/sql202306020403.sql new file mode 100644 index 000000000..ef3a5bb0b --- /dev/null +++ b/resource/sqlupgrade/GS/sql202306020403.sql @@ -0,0 +1,2 @@ +alter table HRSA_SALARY_ITEM add SORTED_INDEX number(11) null; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202306020603.sql b/resource/sqlupgrade/GS/sql202306020603.sql new file mode 100644 index 000000000..baa13842b --- /dev/null +++ b/resource/sqlupgrade/GS/sql202306020603.sql @@ -0,0 +1,7 @@ +ALTER TABLE HRSA_SALARY_TEMPLATE ADD ( + SMS_STATUS int NULL +); +/ + +UPDATE HRSA_SALARY_TEMPLATE SET MSG_STATUS = 1; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202306080103.sql b/resource/sqlupgrade/GS/sql202306080103.sql new file mode 100644 index 000000000..2ec6df974 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202306080103.sql @@ -0,0 +1,2 @@ +alter table HRSA_TAX_AGENT add SORTED_INDEX number(11) null; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202306200203.sql b/resource/sqlupgrade/GS/sql202306200203.sql new file mode 100644 index 000000000..ffbf0c05d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202306200203.sql @@ -0,0 +1,5 @@ +update hrsa_formula set formula = '{нĿ.£Σ۳ϼ}+{ۼ.ۼ˰۳}' , formulaRunScript='salaryItem_otherDeduction+addUpSituation_addUpOtherDeduction' where id = 1651740238860; +/ + +update hrsa_formula_var set delete_type = 1 where id = 1651740241717; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202306260103.sql b/resource/sqlupgrade/GS/sql202306260103.sql new file mode 100644 index 000000000..0d80216bc --- /dev/null +++ b/resource/sqlupgrade/GS/sql202306260103.sql @@ -0,0 +1,13 @@ +CREATE TABLE hrsa_salary_bill_watermark +( +id NUMBER(38,0) PRIMARY KEY NOT NULL, +watermark_status NUMBER NULL, +watermark_type VARCHAR2(255) NULL, +watermark_setting CLOB NULL, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +creator NUMBER(38,0) NOT NULL, +delete_type NUMBER NOT NULL, +tenant_key VARCHAR2(255) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202307180603.sql b/resource/sqlupgrade/GS/sql202307180603.sql new file mode 100644 index 000000000..9154924fe --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307180603.sql @@ -0,0 +1,4 @@ +alter table hrsa_salary_item + add hide_default NUMBER null; +/ + diff --git a/resource/sqlupgrade/GS/sql202307200603.sql b/resource/sqlupgrade/GS/sql202307200603.sql new file mode 100644 index 000000000..849cc35dc --- /dev/null +++ b/resource/sqlupgrade/GS/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/GS/sql202308080403.sql b/resource/sqlupgrade/GS/sql202308080403.sql new file mode 100644 index 000000000..df4bb57b5 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308080403.sql @@ -0,0 +1,12 @@ +alter table hrsa_salary_sob_item + add rounding_mode NUMBER null; +/ + +alter table hrsa_salary_sob_item + add pattern NUMBER null; +/ + +alter table hrsa_salary_sob_item + add value_type NUMBER null; +/ + diff --git a/resource/sqlupgrade/GS/sql202308080503.sql b/resource/sqlupgrade/GS/sql202308080503.sql new file mode 100644 index 000000000..771c36cba --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308080503.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_salary_bill_item_name( + id NUMBER(38,0) PRIMARY KEY NOT NULL, + salary_template_id NUMBER(38,0) NOT NULL, + salary_item_id NUMBER(38,0) NOT NULL, + salary_item_show_name VARCHAR2(255) NOT NULL, + salary_bill_type NUMBER NOT NULL, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + creator NUMBER(38,0) NOT NULL, + delete_type NUMBER NOT NULL, + tenant_key VARCHAR2(255) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308170403.sql b/resource/sqlupgrade/GS/sql202308170403.sql new file mode 100644 index 000000000..c06c2bd26 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308170403.sql @@ -0,0 +1,9 @@ +update hrsa_salary_sob_item a set rounding_mode = (select rounding_mode from hrsa_salary_item b where b.delete_type=0 and b.id =a.salary_item_id) where a.delete_type=0 and (a.rounding_mode is null or a.rounding_mode=''); +/ + +update hrsa_salary_sob_item a set pattern = (select pattern from hrsa_salary_item b where b.delete_type=0 and b.id =a.salary_item_id) where a.delete_type=0 and (a.pattern is null or a.pattern=''); +/ + +update hrsa_salary_sob_item a set value_type = (select value_type from hrsa_salary_item b where b.delete_type=0 and b.id =a.salary_item_id) where a.delete_type=0 and (a.value_type is null or a.value_type=''); +/ + diff --git a/resource/sqlupgrade/GS/sql202312130203.sql b/resource/sqlupgrade/GS/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/GS/sql202401080103.sql b/resource/sqlupgrade/GS/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/GS/sql202401230403.sql b/resource/sqlupgrade/GS/sql202401230403.sql new file mode 100644 index 000000000..9549b4a38 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202401230403.sql @@ -0,0 +1,8 @@ +CREATE TABLE hrsa_elog_version +( + id NUMBER(38,0) primary key NOT NULL, + mainTable varchar2(255), + version NUMBER(38,0) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202401300303.sql b/resource/sqlupgrade/GS/sql202401300303.sql new file mode 100644 index 000000000..edf082294 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202401300303.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500); +/ + diff --git a/resource/sqlupgrade/GS/sql202402190103.sql b/resource/sqlupgrade/GS/sql202402190103.sql new file mode 100644 index 000000000..ee754d9b3 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202402190103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add feedback_status int; +/ + diff --git a/resource/sqlupgrade/GS/sql202402280703.sql b/resource/sqlupgrade/GS/sql202402280703.sql new file mode 100644 index 000000000..e03280b13 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202402280703.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_salary_stats_report ADD ( + salary_sob_setting varchar2(1000) NULL +); +/ + diff --git a/resource/sqlupgrade/GS/sql202403150103.sql b/resource/sqlupgrade/GS/sql202403150103.sql new file mode 100644 index 000000000..ddd68bf00 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202403150103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_send_info add first_reading_time date; +/ + diff --git a/resource/sqlupgrade/JC/sql202304270203.sql b/resource/sqlupgrade/JC/sql202304270203.sql index 6508455fd..65af1f28f 100644 --- a/resource/sqlupgrade/JC/sql202304270203.sql +++ b/resource/sqlupgrade/JC/sql202304270203.sql @@ -157,77 +157,6 @@ alter table hrsa_salary_stats_dim modify dim_type varchar2(30); alter table hrsa_salary_stats_report modify income_category_setting varchar2(1000); / -create table hrsa_statreportlogs_detail -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - mainid varchar2(36) not null, - dataid varchar2(50) not null, - belongdataid varchar2(50) not null, - tablename varchar2(200) not null, - tablenamelabelid varchar2(50) default '-1' not null, - tablenamedesc varchar2(50) not null, - fieldname varchar2(200) not null, - fieldnamelabelid varchar2(50) default '-1' not null, - newvalue clob not null, - oldvalue clob not null, - newrealvalue clob not null, - oldrealvalue clob not null, - fielddesc varchar2(200) not null, - showorder int not null, - isdetail int default 0 not null -); -/ - -create table hrsa_statreportlogs -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - log_date date not null, - device varchar2(500) not null, - log_operator number not null, - operatorname varchar2(100), - targetid number default '-1' not null, - targetname clob not null, - modulename varchar2(100) not null, - functionname varchar2(100) not null, - interfacename varchar2(100) not null, - requesturl varchar2(200) not null, - requesturi varchar2(200) not null, - operatetype varchar2(50) not null, - operatetypename varchar2(100) not null, - operatedesc varchar2(3000) not null, - params clob not null, - belongmainid varchar2(36) not null, - clientip varchar2(50) not null, - groupid varchar2(50) not null, - groupnamelabel varchar2(1000) not null, - redoservice varchar2(200) not null, - redocontext clob not null, - cancelservice varchar2(200) not null, - cancelcontext clob not null, - totalruntime number default '0' not null, - mainruntime number default '0' not null, - log_result varchar2(100) not null, - fromterminal varchar2(100) not null, - resultdesc clob not null, - old_content varchar2(3000) not null, - link_type varchar2(20) not null, - link_id number default '0' not null, - old_link_id number default '0' not null -); -/ - alter table hrsa_salary_stats_report add remark varchar2(100); / @@ -241,4 +170,5 @@ alter table hrsa_salary_stats_report add sort_type varchar2(100); / alter table hrsa_salary_stats_dim add label_id int; -/ \ No newline at end of file +/ + diff --git a/resource/sqlupgrade/JC/sql202312130203.sql b/resource/sqlupgrade/JC/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/JC/sql202401080103.sql b/resource/sqlupgrade/JC/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/JC/sql202401230403.sql b/resource/sqlupgrade/JC/sql202401230403.sql new file mode 100644 index 000000000..9549b4a38 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202401230403.sql @@ -0,0 +1,8 @@ +CREATE TABLE hrsa_elog_version +( + id NUMBER(38,0) primary key NOT NULL, + mainTable varchar2(255), + version NUMBER(38,0) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202401300303.sql b/resource/sqlupgrade/JC/sql202401300303.sql new file mode 100644 index 000000000..edf082294 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202401300303.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500); +/ + diff --git a/resource/sqlupgrade/JC/sql202402190103.sql b/resource/sqlupgrade/JC/sql202402190103.sql new file mode 100644 index 000000000..ee754d9b3 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202402190103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add feedback_status int; +/ + diff --git a/resource/sqlupgrade/JC/sql202402280703.sql b/resource/sqlupgrade/JC/sql202402280703.sql new file mode 100644 index 000000000..e03280b13 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202402280703.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_salary_stats_report ADD ( + salary_sob_setting varchar2(1000) NULL +); +/ + diff --git a/resource/sqlupgrade/JC/sql202403150103.sql b/resource/sqlupgrade/JC/sql202403150103.sql new file mode 100644 index 000000000..ddd68bf00 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202403150103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_send_info add first_reading_time date; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202304270203.sql b/resource/sqlupgrade/Mysql/sql202304270203.sql index 2aab0b67f..a8f239335 100644 --- a/resource/sqlupgrade/Mysql/sql202304270203.sql +++ b/resource/sqlupgrade/Mysql/sql202304270203.sql @@ -157,76 +157,6 @@ alter table hrsa_salary_stats_dim modify column dim_type varchar(30) alter table hrsa_salary_stats_report modify column income_category_setting varchar(1000) ; -create table hrsa_statreportlogs_detail -( - id bigint primary key comment 'ID' , - create_time datetime comment 'ʱ' , - update_time datetime comment '޸ʱ' , - creator bigint comment 'id' , - delete_type int default 0 comment 'Ƿɾ' , - tenant_key varchar(10) comment '⻧KEY' , - uuid varchar(36) not null comment '־UUID' , - mainid varchar(36) not null comment 'id' , - dataid varchar(50) not null comment 'id' , - belongdataid varchar(50) not null comment 'id' , - tablename varchar(200) not null comment '' , - tablenamelabelid varchar(50) default '-1' not null comment 'labelid' , - tablenamedesc varchar(50) not null comment 'Ӧݿı' , - fieldname varchar(200) not null comment 'ֶ' , - fieldnamelabelid varchar(50) default '-1' not null comment 'ֶlabelid' , - newvalue text not null comment 'ºֵ' , - oldvalue text not null comment 'ǰֵ' , - newrealvalue text not null comment 'ºʾֵ' , - oldrealvalue text not null comment 'ǰʾֵ' , - fielddesc varchar(200) not null comment 'ֶ' , - showorder int(11) not null comment 'ֶ' , - isdetail int(11) default 0 not null comment 'Ƿϸֶ' -) -; - -create table hrsa_statreportlogs -( - id bigint primary key comment 'ID' , - create_time datetime comment 'ʱ' , - update_time datetime comment '޸ʱ' , - creator bigint comment 'id' , - delete_type int default 0 comment 'Ƿɾ' , - tenant_key varchar(10) comment '⻧KEY' , - uuid varchar(36) not null comment '־UUID' , - log_date datetime not null comment '¼ʱ' , - device varchar(500) not null comment 'նϢ' , - log_operator bigint not null comment '' , - operatorname varchar(100) comment '' , - targetid bigint default '-1' not null comment 'Ŀid' , - targetname text not null comment 'Ŀ' , - modulename varchar(100) not null comment 'ģ' , - functionname varchar(100) not null comment '񣨷' , - interfacename varchar(100) not null comment 'ʽӿ' , - requesturl varchar(200) not null comment 'ȫ·' , - requesturi varchar(200) not null comment 'ַ' , - operatetype varchar(50) not null comment '' , - operatetypename varchar(100) not null comment '' , - operatedesc varchar(3000) not null comment 'ϸ˵' , - params text not null comment '漰ز' , - belongmainid varchar(36) not null comment 'uuid' , - clientip varchar(50) not null comment 'IP' , - groupid varchar(50) not null comment '' , - groupnamelabel varchar(1000) not null comment '' , - redoservice varchar(200) not null comment 'ҵӿ' , - redocontext text not null comment '' , - cancelservice varchar(200) not null comment 'ҵӿ' , - cancelcontext text not null comment '' , - totalruntime bigint default '0' not null comment 'ʱ' , - mainruntime bigint default '0' not null comment 'ʱ' , - log_result varchar(100) not null comment '־' , - fromterminal varchar(100) not null comment 'pc web' , - resultdesc text not null comment 'н' , - old_content varchar(3000) not null comment 'ԭ' , - link_type varchar(20) not null comment '' , - link_id bigint default '0' not null comment 'id' , - old_link_id bigint default '0' not null comment 'ԭid' -) -; alter table hrsa_salary_stats_report add remark varchar(100) ; diff --git a/resource/sqlupgrade/Mysql/sql202312130203.sql b/resource/sqlupgrade/Mysql/sql202312130203.sql new file mode 100644 index 000000000..15acb233a --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; diff --git a/resource/sqlupgrade/Mysql/sql202401080103.sql b/resource/sqlupgrade/Mysql/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202401230403.sql b/resource/sqlupgrade/Mysql/sql202401230403.sql new file mode 100644 index 000000000..23e6f1e06 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202401230403.sql @@ -0,0 +1,6 @@ +CREATE TABLE hrsa_elog_version ( + id bigint(0) NOT NULL, + mainTable varchar(255) NULL, + version bigint(0) NULL, + PRIMARY KEY (id) USING BTREE +) ; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202401300303.sql b/resource/sqlupgrade/Mysql/sql202401300303.sql new file mode 100644 index 000000000..847c44d97 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202401300303.sql @@ -0,0 +1 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202402190103.sql b/resource/sqlupgrade/Mysql/sql202402190103.sql new file mode 100644 index 000000000..e4806b3ec --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202402190103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_template add feedback_status int; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202402280703.sql b/resource/sqlupgrade/Mysql/sql202402280703.sql new file mode 100644 index 000000000..1e75d1f02 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202402280703.sql @@ -0,0 +1 @@ +ALTER TABLE hrsa_salary_stats_report ADD COLUMN salary_sob_setting varchar(1000) NULL ; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202403150103.sql b/resource/sqlupgrade/Mysql/sql202403150103.sql new file mode 100644 index 000000000..5d98d2dad --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202403150103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_send_info add first_reading_time datetime; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202304270203.sql b/resource/sqlupgrade/Oracle/sql202304270203.sql index 620dd24cb..f15ad91a6 100644 --- a/resource/sqlupgrade/Oracle/sql202304270203.sql +++ b/resource/sqlupgrade/Oracle/sql202304270203.sql @@ -157,76 +157,6 @@ alter table hrsa_salary_stats_dim modify dim_type varchar2(30) alter table hrsa_salary_stats_report modify income_category_setting varchar2(1000) / -create table hrsa_statreportlogs_detail -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - mainid varchar2(36) not null, - dataid varchar2(50) not null, - belongdataid varchar2(50) not null, - tablename varchar2(200) not null, - tablenamelabelid varchar2(50) default '-1' not null, - tablenamedesc varchar2(50) not null, - fieldname varchar2(200) not null, - fieldnamelabelid varchar2(50) default '-1' not null, - newvalue clob not null, - oldvalue clob not null, - newrealvalue clob not null, - oldrealvalue clob not null, - fielddesc varchar2(200) not null, - showorder int not null, - isdetail int default 0 not null -) -/ - -create table hrsa_statreportlogs -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - log_date date not null, - device varchar2(500) not null, - log_operator number not null, - operatorname varchar2(100), - targetid number default '-1' not null, - targetname clob not null, - modulename varchar2(100) not null, - functionname varchar2(100) not null, - interfacename varchar2(100) not null, - requesturl varchar2(200) not null, - requesturi varchar2(200) not null, - operatetype varchar2(50) not null, - operatetypename varchar2(100) not null, - operatedesc varchar2(3000) not null, - params clob not null, - belongmainid varchar2(36) not null, - clientip varchar2(50) not null, - groupid varchar2(50) not null, - groupnamelabel varchar2(1000) not null, - redoservice varchar2(200) not null, - redocontext clob not null, - cancelservice varchar2(200) not null, - cancelcontext clob not null, - totalruntime number default '0' not null, - mainruntime number default '0' not null, - log_result varchar2(100) not null, - fromterminal varchar2(100) not null, - resultdesc clob not null, - old_content varchar2(3000) not null, - link_type varchar2(20) not null, - link_id number default '0' not null, - old_link_id number default '0' not null -) -/ alter table hrsa_salary_stats_report add remark varchar2(100) / diff --git a/resource/sqlupgrade/Oracle/sql202312130203.sql b/resource/sqlupgrade/Oracle/sql202312130203.sql new file mode 100644 index 000000000..f62d861b8 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202401080103.sql b/resource/sqlupgrade/Oracle/sql202401080103.sql new file mode 100644 index 000000000..fc148da4a --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202401230403.sql b/resource/sqlupgrade/Oracle/sql202401230403.sql new file mode 100644 index 000000000..e0a34b233 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202401230403.sql @@ -0,0 +1,7 @@ +CREATE TABLE hrsa_elog_version +( + id NUMBER(38,0) primary key NOT NULL, + mainTable varchar2(255), + version NUMBER(38,0) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202401300303.sql b/resource/sqlupgrade/Oracle/sql202401300303.sql new file mode 100644 index 000000000..6211d28fa --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202401300303.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202402190103.sql b/resource/sqlupgrade/Oracle/sql202402190103.sql new file mode 100644 index 000000000..a45fcae76 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202402190103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_template add feedback_status int +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202402280703.sql b/resource/sqlupgrade/Oracle/sql202402280703.sql new file mode 100644 index 000000000..a4e99aede --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202402280703.sql @@ -0,0 +1,4 @@ +ALTER TABLE hrsa_salary_stats_report ADD ( + salary_sob_setting varchar2(1000) NULL +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202403150103.sql b/resource/sqlupgrade/Oracle/sql202403150103.sql new file mode 100644 index 000000000..f2ba113a1 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202403150103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_send_info add first_reading_time date +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202206090403.sql b/resource/sqlupgrade/PG/sql202206090403.sql index 679a8cc59..8f5d32f79 100644 --- a/resource/sqlupgrade/PG/sql202206090403.sql +++ b/resource/sqlupgrade/PG/sql202206090403.sql @@ -1,3 +1,3 @@ -ALTER TABLE hrsa_tax_declaration ADD COLUMN income_category int NOT NULL ; +ALTER TABLE hrsa_tax_declaration ADD COLUMN income_category int ; -ALTER TABLE hrsa_tax_declaration_detail ADD COLUMN employee_type int NOT NULL ; \ No newline at end of file +ALTER TABLE hrsa_tax_declaration_detail ADD COLUMN employee_type int ; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202304270203.sql b/resource/sqlupgrade/PG/sql202304270203.sql index 7cbcc5a56..e610687b7 100644 --- a/resource/sqlupgrade/PG/sql202304270203.sql +++ b/resource/sqlupgrade/PG/sql202304270203.sql @@ -162,77 +162,6 @@ alter table hrsa_salary_stats_dim alter dim_type TYPE varchar(30) alter table hrsa_salary_stats_report alter income_category_setting TYPE varchar(1000) ; -create table hrsa_statreportlogs_detail -( - id bigint primary key , - create_time timestamp , - update_time timestamp , - creator bigint , - delete_type int default 0 , - tenant_key varchar(10) , - uuid varchar(36) not null , - mainid varchar(36) not null , - dataid varchar(50) not null , - belongdataid varchar(50) not null , - tablename varchar(200) not null , - tablenamelabelid varchar(50) default '-1' not null , - tablenamedesc varchar(50) not null , - fieldname varchar(200) not null , - fieldnamelabelid varchar(50) default '-1' not null , - newvalue text not null , - oldvalue text not null , - newrealvalue text not null , - oldrealvalue text not null , - fielddesc varchar(200) not null , - showorder int not null , - isdetail int NOT NULL DEFAULT 0 -) -; - -create table hrsa_statreportlogs -( - id bigint primary key , - create_time timestamp , - update_time timestamp , - creator bigint , - delete_type int default 0 , - tenant_key varchar(10) , - uuid varchar(36) not null , - log_date timestamp not null , - device varchar(500) not null , - log_operator bigint not null , - operatorname varchar(100) , - targetid bigint NOT NULL DEFAULT -1 , - targetname text not null , - modulename varchar(100) not null , - functionname varchar(100) not null , - interfacename varchar(100) not null , - requesturl varchar(200) not null , - requesturi varchar(200) not null , - operatetype varchar(50) not null , - operatetypename varchar(100) not null , - operatedesc varchar(3000) not null , - params text not null , - belongmainid varchar(36) not null , - clientip varchar(50) not null , - groupid varchar(50) not null , - groupnamelabel varchar(1000) not null , - redoservice varchar(200) not null , - redocontext text not null , - cancelservice varchar(200) not null , - cancelcontext text not null , - totalruntime bigint NOT NULL DEFAULT 0 , - mainruntime bigint NOT NULL DEFAULT 0 , - log_result varchar(100) not null , - fromterminal varchar(100) not null , - resultdesc text not null , - old_content varchar(3000) not null , - link_type varchar(20) not null , - link_id bigint NOT NULL DEFAULT 0 , - old_link_id bigint NOT NULL DEFAULT 0 -) -; - alter table hrsa_salary_stats_report add remark varchar(100) ; diff --git a/resource/sqlupgrade/PG/sql202312130203.sql b/resource/sqlupgrade/PG/sql202312130203.sql new file mode 100644 index 000000000..9b9630ce6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202401080103.sql b/resource/sqlupgrade/PG/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202401230403.sql b/resource/sqlupgrade/PG/sql202401230403.sql new file mode 100644 index 000000000..23b66fe53 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202401230403.sql @@ -0,0 +1,6 @@ +CREATE TABLE hrsa_elog_version ( + id bigint NOT NULL, + version bigint NOT NULL, + mainTable varchar(255), + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202401300303.sql b/resource/sqlupgrade/PG/sql202401300303.sql new file mode 100644 index 000000000..847c44d97 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202401300303.sql @@ -0,0 +1 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500); \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202402190103.sql b/resource/sqlupgrade/PG/sql202402190103.sql new file mode 100644 index 000000000..e4806b3ec --- /dev/null +++ b/resource/sqlupgrade/PG/sql202402190103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_template add feedback_status int; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202402280703.sql b/resource/sqlupgrade/PG/sql202402280703.sql new file mode 100644 index 000000000..6adc0b3e4 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202402280703.sql @@ -0,0 +1 @@ +alter table hrsa_salary_stats_report add salary_sob_setting VARCHAR(1000) null ; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202403150103.sql b/resource/sqlupgrade/PG/sql202403150103.sql new file mode 100644 index 000000000..4f331b378 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202403150103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_send_info add first_reading_time timestamp; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202304270203.sql b/resource/sqlupgrade/SQLServer/sql202304270203.sql index 953eadd43..52954de04 100644 --- a/resource/sqlupgrade/SQLServer/sql202304270203.sql +++ b/resource/sqlupgrade/SQLServer/sql202304270203.sql @@ -157,77 +157,6 @@ GO alter table hrsa_salary_stats_report alter column income_category_setting nvarchar(1000) GO -create table hrsa_statreportlogs_detail -( - id bigint primary key , - create_time datetime, - update_time datetime, - creator bigint, - delete_type int default 0, - tenant_key nvarchar(10), - uuid nvarchar(36) not null, - mainid nvarchar(36) not null, - dataid nvarchar(50) not null, - belongdataid nvarchar(50) not null, - tablename nvarchar(200) not null, - tablenamelabelid nvarchar(50) default '-1' not null, - tablenamedesc nvarchar(50) not null, - fieldname nvarchar(200) not null, - fieldnamelabelid nvarchar(50) default '-1' not null, - newvalue nvarchar(max) not null, - oldvalue nvarchar(max) not null, - newrealvalue nvarchar(max) not null, - oldrealvalue nvarchar(max) not null, - fielddesc nvarchar(200) not null, - showorder int not null, - isdetail int default 0 not null -) -GO - -create table hrsa_statreportlogs -( - id bigint primary key , - create_time datetime, - update_time datetime, - creator bigint, - delete_type int default 0, - tenant_key nvarchar(10), - uuid nvarchar(36) not null, - log_date datetime not null, - device nvarchar(500) not null, - log_operator bigint not null, - operatorname nvarchar(100), - targetid bigint default '-1' not null, - targetname nvarchar(max) not null, - modulename nvarchar(100) not null, - functionname nvarchar(100) not null, - interfacename nvarchar(100) not null, - requesturl nvarchar(200) not null, - requesturi nvarchar(200) not null, - operatetype nvarchar(50) not null, - operatetypename nvarchar(100) not null, - operatedesc nvarchar(3000) not null, - params nvarchar(max) not null, - belongmainid nvarchar(36) not null, - clientip nvarchar(50) not null, - groupid nvarchar(50) not null, - groupnamelabel nvarchar(1000) not null, - redoservice nvarchar(200) not null, - redocontext nvarchar(max) not null, - cancelservice nvarchar(200) not null, - cancelcontext nvarchar(max) not null, - totalruntime bigint default '0' not null, - mainruntime bigint default '0' not null, - log_result nvarchar(100) not null, - fromterminal nvarchar(100) not null, - resultdesc nvarchar(max) not null, - old_content nvarchar(3000) not null, - link_type nvarchar(20) not null, - link_id bigint default '0' not null, - old_link_id bigint default '0' not null -) -GO - alter table hrsa_salary_stats_report add remark nvarchar(100) GO diff --git a/resource/sqlupgrade/SQLServer/sql202312130203.sql b/resource/sqlupgrade/SQLServer/sql202312130203.sql new file mode 100644 index 000000000..0738202b3 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar(10) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202401080103.sql b/resource/sqlupgrade/SQLServer/sql202401080103.sql new file mode 100644 index 000000000..ff92fddf9 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202401230403.sql b/resource/sqlupgrade/SQLServer/sql202401230403.sql new file mode 100644 index 000000000..16a1bb858 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202401230403.sql @@ -0,0 +1,7 @@ +create table hrsa_elog_version +( + id bigint primary key , + mainTable varchar(255), + version bigint +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202401300303.sql b/resource/sqlupgrade/SQLServer/sql202401300303.sql new file mode 100644 index 000000000..96f40257b --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202401300303.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202402190103.sql b/resource/sqlupgrade/SQLServer/sql202402190103.sql new file mode 100644 index 000000000..b00318264 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202402190103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_template add feedback_status int +go \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202402280703.sql b/resource/sqlupgrade/SQLServer/sql202402280703.sql new file mode 100644 index 000000000..1f0e77403 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202402280703.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_salary_stats_report ADD salary_sob_setting varchar(1000) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202403150103.sql b/resource/sqlupgrade/SQLServer/sql202403150103.sql new file mode 100644 index 000000000..f4fe70321 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202403150103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_send_info add first_reading_time datetime +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202304270203.sql b/resource/sqlupgrade/ST/sql202304270203.sql index 21b752ab7..65af1f28f 100644 --- a/resource/sqlupgrade/ST/sql202304270203.sql +++ b/resource/sqlupgrade/ST/sql202304270203.sql @@ -157,77 +157,6 @@ alter table hrsa_salary_stats_dim modify dim_type varchar2(30); alter table hrsa_salary_stats_report modify income_category_setting varchar2(1000); / -create table hrsa_statreportlogs_detail -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - mainid varchar2(36) not null, - dataid varchar2(50) not null, - belongdataid varchar2(50) not null, - tablename varchar2(200) not null, - tablenamelabelid varchar2(50) default '-1' not null, - tablenamedesc varchar2(50) not null, - fieldname varchar2(200) not null, - fieldnamelabelid varchar2(50) default '-1' not null, - newvalue clob not null, - oldvalue clob not null, - newrealvalue clob not null, - oldrealvalue clob not null, - fielddesc varchar2(200) not null, - showorder int not null, - isdetail int default 0 not null -); -/ - -create table hrsa_statreportlogs -( - id number primary key , - create_time date, - update_time date, - creator number, - delete_type int default 0, - tenant_key varchar2(10), - uuid varchar2(36) not null, - log_date date not null, - device varchar2(500) not null, - log_operator number not null, - operatorname varchar2(100), - targetid number default '-1' not null, - targetname clob not null, - modulename varchar2(100) not null, - functionname varchar2(100) not null, - interfacename varchar2(100) not null, - requesturl varchar2(200) not null, - requesturi varchar2(200) not null, - operatetype varchar2(50) not null, - operatetypename varchar2(100) not null, - operatedesc varchar2(3000) not null, - params clob not null, - belongmainid varchar2(36) not null, - clientip varchar2(50) not null, - groupid varchar2(50) not null, - groupnamelabel varchar2(1000) not null, - redoservice varchar2(200) not null, - redocontext clob not null, - cancelservice varchar2(200) not null, - cancelcontext clob not null, - totalruntime number default '0' not null, - mainruntime number default '0' not null, - log_result varchar2(100) not null, - fromterminal varchar2(100) not null, - resultdesc clob not null, - old_content varchar2(3000) not null, - link_type varchar2(20) not null, - link_id number default '0' not null, - old_link_id number default '0' not null -); -/ - alter table hrsa_salary_stats_report add remark varchar2(100); / diff --git a/resource/sqlupgrade/ST/sql202312130203.sql b/resource/sqlupgrade/ST/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/ST/sql202401080103.sql b/resource/sqlupgrade/ST/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/ST/sql202401230403.sql b/resource/sqlupgrade/ST/sql202401230403.sql new file mode 100644 index 000000000..9549b4a38 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202401230403.sql @@ -0,0 +1,8 @@ +CREATE TABLE hrsa_elog_version +( + id NUMBER(38,0) primary key NOT NULL, + mainTable varchar2(255), + version NUMBER(38,0) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202401300303.sql b/resource/sqlupgrade/ST/sql202401300303.sql new file mode 100644 index 000000000..edf082294 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202401300303.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add mobile_feedback_url varchar(500); +/ + diff --git a/resource/sqlupgrade/ST/sql202402190103.sql b/resource/sqlupgrade/ST/sql202402190103.sql new file mode 100644 index 000000000..ee754d9b3 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202402190103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_template add feedback_status int; +/ + diff --git a/resource/sqlupgrade/ST/sql202402280703.sql b/resource/sqlupgrade/ST/sql202402280703.sql new file mode 100644 index 000000000..e03280b13 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202402280703.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_salary_stats_report ADD ( + salary_sob_setting varchar2(1000) NULL +); +/ + diff --git a/resource/sqlupgrade/ST/sql202403150103.sql b/resource/sqlupgrade/ST/sql202403150103.sql new file mode 100644 index 000000000..ddd68bf00 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202403150103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_send_info add first_reading_time date; +/ + diff --git a/resource/sql/Oracle常见问题.txt b/resource/wiki/Oracle常见问题.txt similarity index 100% rename from resource/sql/Oracle常见问题.txt rename to resource/wiki/Oracle常见问题.txt diff --git a/resource/sql/个人养老金.sql b/resource/wiki/个人养老金.sql similarity index 100% rename from resource/sql/个人养老金.sql rename to resource/wiki/个人养老金.sql diff --git a/resource/sql/人员生成不了档案.sql b/resource/wiki/人员生成不了档案.sql similarity index 100% rename from resource/sql/人员生成不了档案.sql rename to resource/wiki/人员生成不了档案.sql diff --git a/resource/com/customization/salary/CustomSalarySendWrapper.java b/resource/wiki/代码样例/拦截工资单相关接口/com/customization/salary/CustomSalarySendWrapper.java similarity index 100% rename from resource/com/customization/salary/CustomSalarySendWrapper.java rename to resource/wiki/代码样例/拦截工资单相关接口/com/customization/salary/CustomSalarySendWrapper.java diff --git a/resource/sql/删除档案.txt b/resource/wiki/删除档案.txt similarity index 100% rename from resource/sql/删除档案.txt rename to resource/wiki/删除档案.txt diff --git a/resource/wiki/扩展功能/hrmSalaryBillToken.properties b/resource/wiki/扩展功能/hrmSalaryBillToken.properties new file mode 100644 index 000000000..e7762305b --- /dev/null +++ b/resource/wiki/扩展功能/hrmSalaryBillToken.properties @@ -0,0 +1,2 @@ +appid_id= +ip= \ No newline at end of file diff --git a/resource/wiki/扩展功能/hrmSalaryCustom.properties b/resource/wiki/扩展功能/hrmSalaryCustom.properties new file mode 100644 index 000000000..6294cc5c3 --- /dev/null +++ b/resource/wiki/扩展功能/hrmSalaryCustom.properties @@ -0,0 +1 @@ +formulaRunOvertimeThreshold= \ No newline at end of file diff --git a/resource/WEB-INF/prop/hrmSalaryPayroll.properties b/resource/wiki/扩展功能/hrmSalaryPayroll.properties similarity index 78% rename from resource/WEB-INF/prop/hrmSalaryPayroll.properties rename to resource/wiki/扩展功能/hrmSalaryPayroll.properties index ac20aedaa..fa2dafbdf 100644 --- a/resource/WEB-INF/prop/hrmSalaryPayroll.properties +++ b/resource/wiki/扩展功能/hrmSalaryPayroll.properties @@ -1,4 +1,4 @@ -genPdf=1 -hasSign=1 +genPdf=0 +hasSign=0 toPdfToolPath=H:\\tools\\wkhtmltox\\bin\\wkhtmltopdf.exe genPath=D:\\ diff --git a/resource/sql/薪资档案重复.sql b/resource/wiki/薪资档案重复.sql similarity index 100% rename from resource/sql/薪资档案重复.sql rename to resource/wiki/薪资档案重复.sql diff --git a/resource/sql/薪酬开关配置 b/resource/wiki/薪酬开关配置 similarity index 100% rename from resource/sql/薪酬开关配置 rename to resource/wiki/薪酬开关配置 diff --git a/resource/sql/薪酬还原脚本.sql b/resource/wiki/薪酬还原脚本.sql similarity index 98% rename from resource/sql/薪酬还原脚本.sql rename to resource/wiki/薪酬还原脚本.sql index 4ad486304..cf29ff247 100644 --- a/resource/sql/薪酬还原脚本.sql +++ b/resource/wiki/薪酬还原脚本.sql @@ -167,12 +167,6 @@ delete from hrsa_charts_setting where 1=1 delete from hrsa_salary_echarts_setting where 1=1 ; -delete from hrsa_statreportlogs_detail where 1=1 -; - -delete from hrsa_statreportlogs where 1=1 -; - delete from hrsa_salary_bill_watermark where 1=1 ; diff --git a/src/com/api/salary/web/MySalaryShowSetController.java b/src/com/api/salary/web/MySalaryShowSetController.java new file mode 100644 index 000000000..0be912245 --- /dev/null +++ b/src/com/api/salary/web/MySalaryShowSetController.java @@ -0,0 +1,13 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * @Description: 我的薪资福利显示设置 + * @Author: wangxiangzhong + * @Date: 2021-12-08 14:44 + */ +@Path("/bs/hrmsalary/mySalaryShowSet") +public class MySalaryShowSetController extends com.engine.salary.web.MySalaryShowSetController { + +} diff --git a/src/com/engine/salary/action/CopyToPaySIArchiveAction.java b/src/com/engine/salary/action/CopyToPaySIArchiveAction.java new file mode 100644 index 000000000..2fcfb6596 --- /dev/null +++ b/src/com/engine/salary/action/CopyToPaySIArchiveAction.java @@ -0,0 +1,150 @@ +package com.engine.salary.action; + +import cn.hutool.core.util.StrUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; +import com.engine.salary.service.SIArchivesService; +import com.engine.salary.service.impl.SIArchivesServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import weaver.conn.RecordSet; +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.*; +import java.util.stream.Collectors; + +/** + * @Author: sy + * @Description: 拷贝福利档案并置为在缴 + * @Date: 2024/1/29 + **/ +@Slf4j +public class CopyToPaySIArchiveAction implements Action { + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + + private SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class,user); + } + + private String tableName; + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + @Override + public String execute(RequestInfo requestInfo) { + try { + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + + RecordSet rs = new RecordSet(); + + String queryImageId = "select salaryname,processfield from " + tableName + " where workflowid = ?"; + rs.executeQuery(queryImageId, requestInfo.getWorkflowid()); + + List list = new ArrayList<>(); + while (rs.next()) { + String processField = rs.getString("processfield"); + String salaryName = rs.getString("salaryname"); + String value = fieldMap.get(processField); + list.add(new CopyToPaySIArchiveAction.SalaryField(processField, salaryName, value)); + } + List> importData = new ArrayList<>(); + importData.add(SalaryEntityUtil.convert2Map(list, CopyToPaySIArchiveAction.SalaryField::getSalaryName, CopyToPaySIArchiveAction.SalaryField::getValue)); + //操作人 + String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(CopyToPaySIArchiveAction.SalaryField::getValue).orElse("1"); + //增员 + String toCopyTaxAgentName = importData.get(0).get("待复制个税扣缴义务人").toString(); + String toUpdateTaxAgentName = importData.get(0).get("待更新个税扣缴义务人").toString(); + String payStartYearMonth = importData.get(0).getOrDefault("起始缴纳月", "").toString(); + if (StrUtil.isNotBlank(payStartYearMonth) && !SalaryDateUtil.checkYearMonth(payStartYearMonth)) { + requestInfo.getRequestManager().setMessage("起始缴纳月格式有误,正确格式示例为'2021-01'"); + return FAILURE_AND_CONTINUE; + } + + List toCopyTaxAgentPOS = getTaxAgentMapper().listByName(toCopyTaxAgentName); + List toUpdateTaxAgentPOS = getTaxAgentMapper().listByName(toUpdateTaxAgentName); + if(CollectionUtils.isEmpty(toCopyTaxAgentPOS)){ + requestInfo.getRequestManager().setMessage("待复制个税扣缴义务人不存在!"); + return FAILURE_AND_CONTINUE; + } + if(CollectionUtils.isEmpty(toUpdateTaxAgentPOS)){ + requestInfo.getRequestManager().setMessage("待更新个税扣缴义务人不存在!"); + return FAILURE_AND_CONTINUE; + } + Long toCopyTaxAgentId = toCopyTaxAgentPOS.get(0).getId(); + Long toUpdateTaxAgentId = toUpdateTaxAgentPOS.get(0).getId(); + Long employeeId = Long.valueOf(list.stream().filter(f -> "员工id".equals(f.salaryName)).findFirst().map(CopyToPaySIArchiveAction.SalaryField::getValue).orElse("-1")); + User user = new User(Integer.parseInt(uid)); + user.setLanguage(7); + //拷贝福利档案并置为在缴 + Map resultMap = getSIArchivesService(user).copyToPay(toCopyTaxAgentId, toUpdateTaxAgentId, employeeId, payStartYearMonth); + if (!"success".equals(resultMap.get("type").toString())) { + requestInfo.getRequestManager().setMessage(resultMap.get("msg").toString()); + return FAILURE_AND_CONTINUE; + } + + } catch (Exception e) { + log.error("福利档案复制并置为在缴异常", e); + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } + + class SalaryField { + + private String processField; + + private String salaryName; + + private String value; + + public String getProcessField() { + return processField; + } + + public void setProcessField(String processField) { + this.processField = processField; + } + + public String getSalaryName() { + return salaryName; + } + + public void setSalaryName(String salaryName) { + this.salaryName = salaryName; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public SalaryField(String processField, String salaryName, String value) { + this.processField = processField; + this.salaryName = salaryName; + this.value = value; + } + } +} diff --git a/src/com/engine/salary/action/FileSalaryAcctRecordAction.java b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java index 7d6d22fb7..838c4c494 100644 --- a/src/com/engine/salary/action/FileSalaryAcctRecordAction.java +++ b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java @@ -1,12 +1,14 @@ package com.engine.salary.action; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryAcctRecordService; import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import weaver.general.BaseBean; import weaver.general.Util; import weaver.hrm.User; import weaver.interfaces.workflow.action.Action; @@ -59,8 +61,19 @@ public class FileSalaryAcctRecordAction implements Action { } User user = new User(); user.setUid(1); + Long acctRecordId = Long.valueOf(salaryAcctRecordId); + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(acctRecordId); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("薪资核算记录不存在,或已被删除"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() > 1) { + BaseBean baseBean = new BaseBean(); + baseBean.writeLog("核算记录归档action, 该核算记录已经归档:" + salaryAcctRecordPO.getId()); + return SUCCESS; + } try { - getSalaryAcctRecordService(user).file(Long.valueOf(salaryAcctRecordId)); + getSalaryAcctRecordService(user).file(acctRecordId); } catch (Exception e) { requestInfo.getRequestManager().setMessage(e.getMessage()); return FAILURE_AND_CONTINUE; diff --git a/src/com/engine/salary/action/SendSalaryAction.java b/src/com/engine/salary/action/SendSalaryAction.java new file mode 100644 index 000000000..f0f3ef154 --- /dev/null +++ b/src/com/engine/salary/action/SendSalaryAction.java @@ -0,0 +1,118 @@ +package com.engine.salary.action; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.biz.SalarySendInfoBiz; +import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam; +import com.engine.salary.entity.salaryBill.po.SalarySendPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.SalaryBillService; +import com.engine.salary.service.SalarySendService; +import com.engine.salary.service.SalaryTemplateService; +import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import com.engine.salary.service.impl.SalaryBillServiceImpl; +import com.engine.salary.service.impl.SalarySendServiceImpl; +import com.engine.salary.service.impl.SalaryTemplateServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.Property; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Harryxzy + * @ClassName FileSalaryAcctRecordAction + * @date 2023/12/13 9:17 + * @description 工资单发放action + */ +@Slf4j +public class SendSalaryAction implements Action { + + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalarySendService getSalarySendService(User user) { + return ServiceUtil.getService(SalarySendServiceImpl.class, user); + } + + private SalaryTemplateService getSalaryTemplateService(User user) { + return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); + } + + private SalarySendInfoBiz salarySendInfoMapper = new SalarySendInfoBiz(); + + private SalaryBillService getSalaryBillService(User user) { + return ServiceUtil.getService(SalaryBillServiceImpl.class, user); + } + + + /** + * 发放id(核算记录id,工资单id)流程字段名 + */ + private String idFieldName; + + /** + * 根据什么id(核算记录id,工资单id)发工资单 + */ + private String sendBy; + + + @Override + public String execute(RequestInfo requestInfo) { + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + String idStr = fieldMap.get(idFieldName); + if (StringUtils.isBlank(idStr)) { + requestInfo.getRequestManager().setMessage("核算记录id或工资单id不能为空"); + return FAILURE_AND_CONTINUE; + } + User user = new User(); + user.setUid(1); + Long id = Long.valueOf(idStr); + SalarySendPO salarySendPO; + if(!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salaryAcctRecordId")) { + // 根据核算记录id发 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(id); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("薪资核算记录不存在,或已被删除"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() == 1) { + requestInfo.getRequestManager().setMessage("核算记录还未归档,请先归档"); + return FAILURE_AND_CONTINUE; + } + // 获取工资单id + List salarySendPOList = getSalarySendService(user).listSome(SalarySendPO.builder().salaryAccountingId(id).sendStatus(0).build()); + salarySendPO = salarySendPOList.get(0); + } else if (!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salarySendId")) { + // 根据工资单发 + salarySendPO = getSalarySendService(user).getById(id); + } else { + requestInfo.getRequestManager().setMessage("请先维护根据什么id发放工资单的sendBy参数"); + return FAILURE_AND_CONTINUE; + } + + if (salarySendPO == null || salarySendPO.getId() == null) { + requestInfo.getRequestManager().setMessage("工资单不存在或已被删除!"); + return FAILURE_AND_CONTINUE; + } + try { + // 全部发放 + getSalaryBillService(user).grant(SalarySendGrantParam.builder().salarySendId(salarySendPO.getId()).build()); + } catch (Exception e) { + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } +} diff --git a/src/com/engine/salary/action/StayDelToStopSIArchiveAction.java b/src/com/engine/salary/action/StayDelToStopSIArchiveAction.java index c7aa0a8bf..1c75d42c0 100644 --- a/src/com/engine/salary/action/StayDelToStopSIArchiveAction.java +++ b/src/com/engine/salary/action/StayDelToStopSIArchiveAction.java @@ -1,14 +1,18 @@ package com.engine.salary.action; +import cn.hutool.core.util.StrUtil; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.siaccount.EmployeeStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SIArchivesService; import com.engine.salary.service.impl.SIArchivesServiceImpl; +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 lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -84,6 +88,12 @@ public class StayDelToStopSIArchiveAction implements Action { Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() ); Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString()); + String payEndYearMonth = importDataMap.getOrDefault("最后缴纳月", "").toString(); + if (StrUtil.isNotBlank(payEndYearMonth) && !SalaryDateUtil.checkYearMonth(payEndYearMonth)) { + requestInfo.getRequestManager().setMessage("最后缴纳月格式有误,正确格式示例为'2021-01'"); + return FAILURE_AND_CONTINUE; + } + //操作人 String uid = importDataMap.getOrDefault("操作人","1").toString(); User user = new User(Integer.parseInt(uid)); @@ -92,12 +102,17 @@ public class StayDelToStopSIArchiveAction implements Action { if(insuranceArchivesBaseInfoPO == null){ requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在福利档案,请检查后重试!"); return FAILURE_AND_CONTINUE; - } else if(!insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){ + } else if(StrUtil.isBlank(payEndYearMonth) && !insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){ requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工的福利档案状态不是待减员,无法进行减员操作,请检查后重试!"); return FAILURE_AND_CONTINUE; } //减员 - Map resultMap = getSIArchivesService(user).stayDelToStop(Collections.singletonList(insuranceArchivesBaseInfoPO.getId())); + Map resultMap = new HashMap<>(); + if (StrUtil.isBlank(payEndYearMonth)) { + resultMap = getSIArchivesService(user).stayDelToStop(Collections.singletonList(insuranceArchivesBaseInfoPO.getId())); + } else { + resultMap = getSIArchivesService(user).stopWithoutLimit(Collections.singletonList(insuranceArchivesBaseInfoPO.getId()), payEndYearMonth); + } if (resultMap.get("type").toString().equals("fail")) { requestInfo.getRequestManager().setMessage(resultMap.get("msg").toString()); return FAILURE_AND_CONTINUE; diff --git a/src/com/engine/salary/annotation/I18n.java b/src/com/engine/salary/annotation/I18n.java new file mode 100644 index 000000000..ca9b71fd8 --- /dev/null +++ b/src/com/engine/salary/annotation/I18n.java @@ -0,0 +1,20 @@ +package com.engine.salary.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 国际化标识 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface I18n { + +} diff --git a/src/com/engine/salary/biz/AddUpDeductionBiz.java b/src/com/engine/salary/biz/AddUpDeductionBiz.java index 3f25db2d9..9dc1e9348 100644 --- a/src/com/engine/salary/biz/AddUpDeductionBiz.java +++ b/src/com/engine/salary/biz/AddUpDeductionBiz.java @@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; +import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.ibatis.session.SqlSession; @@ -13,8 +14,8 @@ import weaver.conn.mybatis.MyBatisFactory; import weaver.general.BaseBean; import weaver.hrm.User; -import java.util.*; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.List; public class AddUpDeductionBiz extends BaseBean { @@ -33,6 +34,7 @@ public class AddUpDeductionBiz extends BaseBean { AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class); List list = mapper.list(param); list = encryptUtil.decryptList(list, AddUpDeductionDTO.class, user); + SalaryI18nUtil.i18nList(list); return list; } finally { sqlSession.close(); diff --git a/src/com/engine/salary/biz/AddUpSituationBiz.java b/src/com/engine/salary/biz/AddUpSituationBiz.java index 8711d013f..674c04ce8 100644 --- a/src/com/engine/salary/biz/AddUpSituationBiz.java +++ b/src/com/engine/salary/biz/AddUpSituationBiz.java @@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO; import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO; import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; +import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.ibatis.session.SqlSession; @@ -31,7 +32,8 @@ public class AddUpSituationBiz extends BaseBean { try { AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class); List list = mapper.list(param); - return encryptUtil.decryptList(list, AddUpSituationDTO.class, user); + encryptUtil.decryptList(list, AddUpSituationDTO.class, user); + return SalaryI18nUtil.i18nList(list); } finally { sqlSession.close(); } @@ -47,15 +49,15 @@ public class AddUpSituationBiz extends BaseBean { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class); - if(CollectionUtils.isNotEmpty(param.getEmployeeIds())){ + if (CollectionUtils.isNotEmpty(param.getEmployeeIds())) { List addUpSituations = new ArrayList<>(); List> partition = Lists.partition((List) param.getEmployeeIds(), 500); - partition.forEach(l->{ + partition.forEach(l -> { param.setEmployeeIds(l); addUpSituations.addAll(mapper.listSome(param)); }); - return encryptUtil.decryptList(addUpSituations, AddUpSituation.class, user); - }else { + return encryptUtil.decryptList(addUpSituations, AddUpSituation.class, user); + } else { List addUpSituations = mapper.listSome(param); return encryptUtil.decryptList(addUpSituations, AddUpSituation.class, user); } @@ -144,9 +146,6 @@ public class AddUpSituationBiz extends BaseBean { } - - - public void handleImportData(List pos, User user) { if (CollectionUtils.isEmpty(pos)) { return; @@ -205,10 +204,9 @@ public class AddUpSituationBiz extends BaseBean { } - /** - * @description 批量删除数据 * @return void + * @description 批量删除数据 * @author Harryxzy * @date 2022/10/27 22:39 */ diff --git a/src/com/engine/salary/biz/AttendQuoteDataBiz.java b/src/com/engine/salary/biz/AttendQuoteDataBiz.java index 8af27e8ba..f3b456fdf 100644 --- a/src/com/engine/salary/biz/AttendQuoteDataBiz.java +++ b/src/com/engine/salary/biz/AttendQuoteDataBiz.java @@ -4,6 +4,7 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteDataBaseDTO; import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam; import com.engine.salary.entity.datacollection.po.AttendQuoteDataPO; import com.engine.salary.mapper.datacollection.AttendQuoteDataMapper; +import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.ibatis.session.SqlSession; @@ -17,7 +18,8 @@ public class AttendQuoteDataBiz { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { AttendQuoteDataMapper mapper = sqlSession.getMapper(AttendQuoteDataMapper.class); - return mapper.list(param); + List list = mapper.list(param); + return SalaryI18nUtil.i18nList(list); } finally { sqlSession.close(); } diff --git a/src/com/engine/salary/biz/AttendQuoteDataValueBiz.java b/src/com/engine/salary/biz/AttendQuoteDataValueBiz.java index 9096fce51..f80b1aa36 100644 --- a/src/com/engine/salary/biz/AttendQuoteDataValueBiz.java +++ b/src/com/engine/salary/biz/AttendQuoteDataValueBiz.java @@ -31,17 +31,29 @@ public class AttendQuoteDataValueBiz { public List listSome(AttendQuoteDataValuePO param) { + List list = new ArrayList<>(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class); - return mapper.listSome(param); + + List employeeIds = param.getEmployeeIds(); + if (CollectionUtils.isNotEmpty(employeeIds)) { + List> partition = Lists.partition(employeeIds, 100); + partition.forEach(empIds -> { + param.setEmployeeIds(empIds); + list.addAll(mapper.listSome(param)); + }); + } else { + list.addAll(mapper.listSome(param)); + } } finally { sqlSession.close(); } + return list; } public void insertData(List values) { - if(CollectionUtils.isEmpty(values)){ + if (CollectionUtils.isEmpty(values)) { return; } SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); @@ -55,7 +67,7 @@ public class AttendQuoteDataValueBiz { } } - public void deleteByAttendQuoteIds(ArrayList quoteIds) { + public void deleteByAttendQuoteIds(List quoteIds) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class); @@ -68,14 +80,14 @@ public class AttendQuoteDataValueBiz { public void updateDataValue(AttendQuoteDataValuePO po) { - SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try { - AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class); - mapper.updateDataValueByFiledIdAndEmployeeId(po); - sqlSession.commit(); - } finally { - sqlSession.close(); - } + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class); + mapper.updateDataValueByFiledIdAndEmployeeId(po); + sqlSession.commit(); + } finally { + sqlSession.close(); + } } } diff --git a/src/com/engine/salary/biz/EmployBiz.java b/src/com/engine/salary/biz/EmployBiz.java index 9254ccd2e..6ae161449 100644 --- a/src/com/engine/salary/biz/EmployBiz.java +++ b/src/com/engine/salary/biz/EmployBiz.java @@ -13,6 +13,7 @@ import weaver.conn.mybatis.MyBatisFactory; import weaver.general.BaseBean; import java.util.ArrayList; +import java.util.Collections; import java.util.List; public class EmployBiz extends BaseBean { @@ -115,6 +116,24 @@ public class EmployBiz extends BaseBean { } } + public List listByVirtualParams(List virtualQueryParams) { + if (CollectionUtils.isEmpty(virtualQueryParams)) { + return Collections.emptyList(); + } + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); + List emps = new ArrayList<>(); + List> partition = Lists.partition(virtualQueryParams, 100); + partition.forEach(list->{ + emps.addAll(mapper.listByVirtualParams(list)); + }); + return emps; + } finally { + sqlSession.close(); + } + } + public DataCollectionEmployee getEmployeeById(Long employeeId) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { diff --git a/src/com/engine/salary/biz/OtherDeductionBiz.java b/src/com/engine/salary/biz/OtherDeductionBiz.java index 5ff64b224..2684087a2 100644 --- a/src/com/engine/salary/biz/OtherDeductionBiz.java +++ b/src/com/engine/salary/biz/OtherDeductionBiz.java @@ -1,10 +1,16 @@ package com.engine.salary.biz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.mapper.datacollection.OtherDeductionMapper; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.ibatis.session.SqlSession; @@ -170,22 +176,30 @@ public class OtherDeductionBiz extends BaseBean { if (CollectionUtils.isNotEmpty(saveList)) { batchSave(saveList, user); } - // 记录操作日志 -// saveList.addAll(updateList); -// -// if (CollectionUtils.isNotEmpty(saveList)) { -// LoggerContext loggerContext = new LoggerContext(); -// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除")); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除")); -// loggerContext.setNewValueList(saveList); -// loggerContext.setTenant_key(message.getTenantKey()); -// loggerContext.setOperator(message.getUserId().toString()); -// loggerContext.setOperatorName(message.getOpreator()); -// loggerContext.setClientIp(message.getClientIp()); -// addUpDeductionLoggerTemplate.write(loggerContext); -// } + + // 记录日志 + // 根据月份、人员id查出保存的数据 + List empIds = saveList.stream().map(OtherDeductionPO::getEmployeeId).collect(Collectors.toList()); + List insertList = listSome(OtherDeductionPO.builder().declareMonth(po.getDeclareMonth()).employeeIds(empIds).build()); + Map insertMap = SalaryEntityUtil.convert2Map(insertList, p -> p.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(p.getDeclareMonth()) + "-" + p.getEmployeeId()); + saveList.forEach(save -> { + OtherDeductionPO otherDeductionPO = insertMap.get(save.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(save.getDeclareMonth()) + "-" + save.getEmployeeId()); + if (otherDeductionPO != null) { + updateList.add(otherDeductionPO); + } + }); + + if (CollectionUtils.isNotEmpty(updateList)) { + String name = SalaryDateUtil.getFormatYearMonth(po.getDeclareMonth()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel( 0, "其他免税扣除 ") + name); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "导入")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "其他免税扣除") + name); + loggerContext.setNewValueList(updateList); + SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext); + } } diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 47c8f54ea..c9488e15d 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -7,7 +7,6 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; @@ -51,7 +50,7 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.wbi.util.StringUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.math.NumberUtils; @@ -632,11 +631,13 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime(), user); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -720,7 +721,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -743,10 +750,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -788,6 +796,7 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -795,6 +804,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime(), user); if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -877,7 +887,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -900,10 +916,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -946,12 +963,14 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime(), user); if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1037,7 +1056,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1060,10 +1085,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1511,7 +1537,6 @@ public class SIAccountBiz extends Service { } else { accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); } - } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { @@ -1533,11 +1558,13 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime(), user); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -1612,7 +1639,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1627,10 +1660,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1672,6 +1706,7 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -1679,6 +1714,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime(), user); if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -1752,7 +1788,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1767,10 +1809,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1813,12 +1856,14 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime(), user); if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1897,7 +1942,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1912,10 +1963,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1965,6 +2017,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime(), user); diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 5a15fb4f0..937c573eb 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1,5 +1,6 @@ package com.engine.salary.biz; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; @@ -15,8 +16,8 @@ import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.SalaryContext; +import com.engine.salary.common.SalaryContext; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO; @@ -39,6 +40,10 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.enums.OpenEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryFormItemUtil; @@ -49,7 +54,7 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.wrapper.TaxAgentWrapper; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; @@ -68,6 +73,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_AUTO_ADJUST; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM; + /** * @Author weaver_cl @@ -116,6 +124,10 @@ public class SIArchivesBiz extends Service { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * @param welfareType * @param employeeId @@ -269,15 +281,22 @@ public class SIArchivesBiz extends Service { */ public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId, Long paymentOrganization) { Map data = new HashMap<>(16); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + //判断是否要自动调整基数 + SalarySysConfPO welBaseAutoAdjust = getSalarySysConfService(user).getOneByCode(WEL_BASE_AUTO_ADJUST); + boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue()); + switch (welfareType) { case SOCIAL_SECURITY: - data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; case ACCUMULATION_FUND: - data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; case OTHER: - data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; default: } @@ -292,17 +311,47 @@ public class SIArchivesBiz extends Service { * @param operateId * @return */ - public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getOtherPaymentBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getOtherPaymentComBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } } List addGroups = new ArrayList<>(); - List inputItems = buildPaymentBase(user, schemeId, welfareType); + List inputItems = buildPaymentBase(user, schemeId, welfareType, welBaseDiffSign); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543873, "其他福利缴纳基数"), true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } return dataMap; } @@ -314,18 +363,49 @@ public class SIArchivesBiz extends Service { * @param operateId * @return */ - public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getFundPaymentBaseString()) + ? JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getFundPaymentComBaseString()) + ? JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } } + List addGroups = new ArrayList<>(); - List inputItems = buildPaymentBase(user, schemeId, welfareType); + List inputItems = buildPaymentBase(user, schemeId, welfareType, welBaseDiffSign); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543874, "公积金缴纳基数"), true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } return dataMap; } @@ -337,18 +417,48 @@ public class SIArchivesBiz extends Service { * @param operateId * @return */ - public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getSchemePaymentBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getSchemePaymentComBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } } List addGroups = new ArrayList<>(); - List inputItems = buildPaymentBase(user, schemeId, welfareType); + List inputItems = buildPaymentBase(user, schemeId, welfareType, welBaseDiffSign); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543875, "社保缴纳基数"), true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } return dataMap; } @@ -359,14 +469,41 @@ public class SIArchivesBiz extends Service { * @param schemeId * @return */ - public List buildPaymentBase(User user, Long schemeId, Integer welfareType) { + public List buildPaymentBase(User user, Long schemeId, Integer welfareType, boolean welBaseDiffSign) { List inputItems = new ArrayList<>(); if (schemeId == null) { return new ArrayList<>(); } - List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream().collect(Collectors.collectingAndThen( - Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceSchemeDetailPO::getInsuranceId))), ArrayList::new) - ); + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + if (!welBaseDiffSign) { + List perInsuranceIdList = list.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + List moreComList = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue()) && !perInsuranceIdList.contains(f.getInsuranceId())).collect(Collectors.toList()); + if (moreComList.size() > 0) { + list.addAll(moreComList); + } + } + + SICategoryBiz siCategoryBiz = new SICategoryBiz(); + list.forEach(insuranceSchemeDetail -> { + ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); + if (iCategoryPO != null) { +// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()))); + inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()) + , insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit())); + } + }); + return inputItems; + } + + public List buildPaymentComBase(User user, Long schemeId, Integer welfareType) { + List inputItems = new ArrayList<>(); + if (schemeId == null) { + return new ArrayList<>(); + } + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue())).collect(Collectors.toList()); SICategoryBiz siCategoryBiz = new SICategoryBiz(); list.forEach(insuranceSchemeDetail -> { ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); @@ -631,19 +768,19 @@ public class SIArchivesBiz extends Service { * 新增 * * @param param - * @param employeeId + * @param user */ - public void insert(InsuranceArchivesSaveParam param, long employeeId, User user) { + public void insert(InsuranceArchivesSaveParam param, User user) { SalaryAssert.notNull(param.getWelfareType(), SalaryI18nUtil.getI18nLabel(user.getLanguage(),543876, "福利类型为空")); switch (param.getWelfareType()) { case SOCIAL_SECURITY: - socialSave(param, employeeId, user); + socialSave(param, user, welBaseDiffSign); break; case ACCUMULATION_FUND: - fundSave(param, employeeId, user); + fundSave(param, user, welBaseDiffSign); break; case OTHER: - otherSave(param, employeeId, user); + otherSave(param, user, welBaseDiffSign); break; default: throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542456, "福利类型不存在")); @@ -653,9 +790,10 @@ public class SIArchivesBiz extends Service { /** * @param paramReq - * @param employeeId + * @param */ - public void otherSave(InsuranceArchivesSaveParam paramReq, long employeeId, User user) { + public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class); @@ -678,6 +816,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getOtherSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -689,6 +828,7 @@ public class SIArchivesBiz extends Service { encryptUtil.decrypt(oldOtherInfo, InsuranceArchivesOtherSchemePO.class, user); adjustInfo.setAdjustBeforeBaseJson(oldOtherInfo.getOtherPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldOtherInfo.getOtherSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldOtherInfo.getOtherPaymentComBaseString()); //新数据 InsuranceArchivesOtherSchemePO updateOtherInfo = InsuranceArchivesOtherSchemePO.builder() @@ -711,6 +851,14 @@ public class SIArchivesBiz extends Service { if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), user)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543878, "其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class, user); otherSchemeMapper.updateById(updateOtherInfo); //更新base_info表状态 @@ -718,8 +866,9 @@ public class SIArchivesBiz extends Service { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setOtherArchivesId(updateOtherInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { otherSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() @@ -744,9 +893,17 @@ public class SIArchivesBiz extends Service { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), user)) { + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 543878, "其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class, user); otherSchemeMapper.insert(insertOtherInfo); sqlSession.commit(); @@ -780,9 +937,10 @@ public class SIArchivesBiz extends Service { /** * @param paramReq - * @param employeeId + * @param */ - public void fundSave(InsuranceArchivesSaveParam paramReq, long employeeId, User user) { + public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class); @@ -804,6 +962,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getFundSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -815,6 +974,7 @@ public class SIArchivesBiz extends Service { encryptUtil.decrypt(oldFundInfo, InsuranceArchivesFundSchemePO.class, user); adjustInfo.setAdjustBeforeBaseJson(oldFundInfo.getFundPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldFundInfo.getFundSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldFundInfo.getFundPaymentComBaseString()); //新数据 InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder() .id(oldFundInfo.getId()) @@ -835,9 +995,17 @@ public class SIArchivesBiz extends Service { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), user)) { + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543880, "公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class, user); fundSchemeMapper.updateById(updateFundInfo); //更新base_info表状态 @@ -845,8 +1013,9 @@ public class SIArchivesBiz extends Service { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setFundArchivesId(updateFundInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { fundSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() @@ -873,9 +1042,17 @@ public class SIArchivesBiz extends Service { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), user)) { + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 543880, "公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class, user); fundSchemeMapper.insert(insertFundInfo); sqlSession.commit(); @@ -911,10 +1088,10 @@ public class SIArchivesBiz extends Service { /** * @param paramReq - * @param employeeId + * @param */ - public void socialSave(InsuranceArchivesSaveParam paramReq, long employeeId, User user) { - + public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); @@ -941,6 +1118,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getSocialSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -954,6 +1132,7 @@ public class SIArchivesBiz extends Service { encryptUtil.decrypt(oldSocialInfo, InsuranceArchivesSocialSchemePO.class, user); adjustInfo.setAdjustBeforeBaseJson(oldSocialInfo.getSocialPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldSocialInfo.getSocialSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldSocialInfo.getSocialPaymentComBaseString()); //新数据 InsuranceArchivesSocialSchemePO updateSocialInfo = InsuranceArchivesSocialSchemePO.builder() @@ -974,9 +1153,17 @@ public class SIArchivesBiz extends Service { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), user)) { + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543882, "社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class, user); socialSchemeMapper.updateById(updateSocialInfo); //更新base_info表状态 @@ -984,8 +1171,9 @@ public class SIArchivesBiz extends Service { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setSocialArchivesId(updateSocialInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { socialSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder() @@ -1012,9 +1200,17 @@ public class SIArchivesBiz extends Service { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), user)) { + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 543882, "社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class, user); socialSchemeMapper.insert(insertSocialInfo); sqlSession.commit(); @@ -1052,14 +1248,11 @@ public class SIArchivesBiz extends Service { * @param paymentBaseString * @return */ - public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, User user) { + public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { if (primaryId ==null || paymentBaseString == null) { return true; } - //设置缴纳对象和缴费状态 -// Integer paymentScope = 2; -// Integer isPayment = 1; Map paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap().getClass()); if (paymentBaseJson == null) { return true; @@ -1083,7 +1276,7 @@ public class SIArchivesBiz extends Service { return false; } List isPaymentList = insuranceSchemeDetailPOList.stream() - .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); if (isPaymentList.size() > 0) { InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0); @@ -1109,6 +1302,64 @@ public class SIArchivesBiz extends Service { return true; } + + /** + * 校验福利基数是否符合上下限要求,并返回符合要求的数据 + * @param primaryId + * @param paymentBaseString + * @return + */ + public String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { + + if (primaryId ==null || paymentBaseString == null) { + return paymentBaseString; + } + Map paymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + Map newPaymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + if (paymentBaseJson == null) { + return null; + } + + for (Map.Entry entry : paymentBaseJson.entrySet()) { + + //判断福利值是否为空/数字 + if (entry.getValue() == null || entry.getValue().length() == 0) { + continue; + } else if (!isNumeric(entry.getValue())) { + log.info("福利值非数字!"); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + //根据福利方案id、险种id + List insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey())); + log.info("福利方案id: {},, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + if (insuranceSchemeDetailPOList.size() == 0) { + log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + List checkList = insuranceSchemeDetailPOList.stream() + .filter(f -> f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); + if (checkList.size() > 0) { + InsuranceSchemeDetailPO insuranceSchemeDetailPO = checkList.get(0); + encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class); + String lowerLimit = "0.000".equals(insuranceSchemeDetailPO.getLowerLimit()) ? null : insuranceSchemeDetailPO.getLowerLimit(); + String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit(); + if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) { + //数值低于对应福利明细下限 + log.info("社保基数 {} 数值 {} 低于对应福利明细下限 {}!", entry.getKey(), entry.getValue(), lowerLimit); + newPaymentBaseJson.put(entry.getKey(), lowerLimit); + } + if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) { + //数值高于对应福利明细上限 + log.info("社保基数 {} 数值 {} 高于对应福利明细上限 {} !", entry.getKey(), entry.getValue(), upperLimit); + newPaymentBaseJson.put(entry.getKey(), upperLimit); + } + } + } + return JSON.toJSONString(newPaymentBaseJson); + } + /** * 档案列表 *

@@ -1291,7 +1542,6 @@ public class SIArchivesBiz extends Service { * @return */ public List buildWeaTableColumns(List insuranceArchivesEmployeePOS, long operateId) { - List list = new ArrayList<>(); User user = (User) SalaryContext.get().getValue("user"); Map> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS, operateId, user); @@ -1333,6 +1583,8 @@ public class SIArchivesBiz extends Service { * @return */ public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, long operateId, User user) { + + boolean welBaseDiffSign = isDiffWelBase(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); Map> result = new HashMap<>(); @@ -1348,16 +1600,17 @@ public class SIArchivesBiz extends Service { Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(socialList, InsuranceArchivesSocialSchemePO.class, user); -// InsuranceArchivesSocialSchemePO socialItem = socialList.size() != 0 ? socialList.get(0) : null; List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(fundList, InsuranceArchivesFundSchemePO.class, user); -// InsuranceArchivesFundSchemePO fundItem = fundList.size() != 0 ? fundList.get(0) : null; List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(otherList, InsuranceArchivesOtherSchemePO.class, user); -// InsuranceArchivesOtherSchemePO otherItem = otherList.size() != 0 ? otherList.get(0) : null; if (socialList.size() > 0) { for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { @@ -1366,6 +1619,14 @@ public class SIArchivesBiz extends Service { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } } @@ -1376,6 +1637,14 @@ public class SIArchivesBiz extends Service { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } } @@ -1386,11 +1655,20 @@ public class SIArchivesBiz extends Service { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null) .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); @@ -1400,64 +1678,106 @@ public class SIArchivesBiz extends Service { socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - //获取福利险种名(多语言) - String insuranceName = ""; - if(socialCollect.get(Long.valueOf(item)) != null && socialCollect.get(Long.valueOf(item)).getInsuranceName() != null) { + + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + //获取福利险种名(多语言) + String insuranceName = ""; + if(socialCollect.get(Long.valueOf(item)) != null && socialCollect.get(Long.valueOf(item)).getInsuranceName() != null) { // insuranceName = socialCollect.get(Long.valueOf(item)).getLabelId() != null // ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),socialCollect.get(Long.valueOf(item)).getLabelId(),socialCollect.get(Long.valueOf(item)).getInsuranceName()) // : socialCollect.get(Long.valueOf(item)).getInsuranceName(); - //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name - insuranceName = Util.formatMultiLang(socialCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); - } - socialMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name + insuranceName = Util.formatMultiLang(socialCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); + } + socialMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); // socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - } - }); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - //获取福利险种名(多语言) - String insuranceName = ""; - if(fundCollect.get(Long.valueOf(item)) != null && fundCollect.get(Long.valueOf(item)).getInsuranceName() != null) { + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + //获取福利险种名(多语言) + String insuranceName = ""; + if(fundCollect.get(Long.valueOf(item)) != null && fundCollect.get(Long.valueOf(item)).getInsuranceName() != null) { // insuranceName = fundCollect.get(Long.valueOf(item)).getLabelId() != null // ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),fundCollect.get(Long.valueOf(item)).getLabelId(),fundCollect.get(Long.valueOf(item)).getInsuranceName()) // : fundCollect.get(Long.valueOf(item)).getInsuranceName(); - //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name - insuranceName = Util.formatMultiLang(fundCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); - } - fundMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name + insuranceName = Util.formatMultiLang(fundCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); + } + fundMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); // fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - } - }); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - //获取福利险种名(多语言) - String insuranceName = ""; - if(otherCollect.get(Long.valueOf(item)) != null && otherCollect.get(Long.valueOf(item)).getInsuranceName() != null) { + + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + //获取福利险种名(多语言) + String insuranceName = ""; + if(otherCollect.get(Long.valueOf(item)) != null && otherCollect.get(Long.valueOf(item)).getInsuranceName() != null) { // insuranceName = otherCollect.get(Long.valueOf(item)).getLabelId() != null // ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),otherCollect.get(Long.valueOf(item)).getLabelId(),otherCollect.get(Long.valueOf(item)).getInsuranceName()) // : otherCollect.get(Long.valueOf(item)).getInsuranceName(); - //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name - insuranceName = Util.formatMultiLang(otherCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); - } - otherMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name + insuranceName = Util.formatMultiLang(otherCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); + } + otherMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); // otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - } - }); - + } + }); + } // map根据key排序 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() .sorted(Map.Entry.comparingByKey()) @@ -1471,6 +1791,23 @@ public class SIArchivesBiz extends Service { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); @@ -1493,6 +1830,9 @@ public class SIArchivesBiz extends Service { * @return */ public List> buildTableData(List insuranceArchivesEmployeePOS, boolean export) { + + boolean welBaseDiffSign = isDiffWelBase(); + List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -1542,16 +1882,39 @@ public class SIArchivesBiz extends Service { map.put("socialName", insuranceSchemeMapper.querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); map.put("socialEndTime", socialItem.getSocialEndTime()); @@ -1561,16 +1924,39 @@ public class SIArchivesBiz extends Service { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); map.put("fundEndTime", fundItem.getFundEndTime()); @@ -1580,16 +1966,39 @@ public class SIArchivesBiz extends Service { map.put("otherName", insuranceSchemeMapper.querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); } @@ -1612,6 +2021,19 @@ public class SIArchivesBiz extends Service { } return insuranceIdList; } + + public List payInsuranceIds(Long socialSchemeId, Integer paymentScope) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //开启缴纳的 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)) + .map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } + /** * 获取信息提示 */ @@ -1953,6 +2375,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getSocialSchemeId()) .adjustAfterBaseJson(po.getSocialPaymentBaseString()) + .adjustAfterComBaseJson(po.getSocialPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1962,6 +2385,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class, user); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getSocialPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 545749,"社保档案存在冗余数据!")); @@ -1983,6 +2407,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getFundSchemeId()) .adjustAfterBaseJson(po.getFundPaymentBaseString()) + .adjustAfterComBaseJson(po.getFundPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1992,6 +2417,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class, user); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getFundPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 545750,"公积金档案存在冗余数据!")); @@ -2012,6 +2438,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getOtherSchemeId()) .adjustAfterBaseJson(po.getOtherPaymentBaseString()) + .adjustAfterComBaseJson(po.getOtherPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -2021,6 +2448,7 @@ public class SIArchivesBiz extends Service { InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class, user); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getOtherPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 545751,"其他福利档案存在冗余数据!")); @@ -2034,6 +2462,8 @@ public class SIArchivesBiz extends Service { //生成基数调整记录(基数单元未变化则忽略) public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { Date now = new Date(); + boolean welBaseDiffSign = isDiffWelBase(); + List toCreateAdjustHistoryList = new ArrayList<>(); //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2052,6 +2482,7 @@ public class SIArchivesBiz extends Service { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2086,12 +2517,75 @@ public class SIArchivesBiz extends Service { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } } + //如果系统应用设置拆分了个人和公司福利基数,则对adjustBeforeComBaseJson,adjustAfterComBaseJson也进行处理 + if (welBaseDiffSign) { + //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 + if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + for (String key : adjustAfterComBaseMap.keySet()) { + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustAfterBaseValue((String) adjustAfterComBaseMap.get(key)); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + toCreateAdjustHistoryList.add(adjustItem); + } + } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + Map adjustBeforeComBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeComBaseJson(), new TypeReference>() { + }); + Map reDealMap = new HashMap<>(); + if (adjustAfterComBaseMap != null) { + reDealMap.putAll(adjustAfterComBaseMap); + } + if (adjustBeforeComBaseMap != null) { + reDealMap.putAll(adjustBeforeComBaseMap); + } + if (reDealMap.size() >0) { + for (String key : reDealMap.keySet()) { + String beforeValue = (String) adjustBeforeComBaseMap.get(key); + String afterValue = (String) adjustAfterComBaseMap.get(key); + if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) { + continue; + } + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustBeforeBaseValue(beforeValue); + adjustItem.setAdjustAfterBaseValue(afterValue); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope( PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + + toCreateAdjustHistoryList.add(adjustItem); + } + } + + } + } return toCreateAdjustHistoryList; } @@ -2170,4 +2664,12 @@ public class SIArchivesBiz extends Service { list.add(new WeaTableColumn("150px", "操作时间", "operatorTime")); return list; } + + public boolean isDiffWelBase() { + User user = (User) SalaryContext.get().getValue("user"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + + return welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + } } diff --git a/src/com/engine/salary/biz/SICategoryBiz.java b/src/com/engine/salary/biz/SICategoryBiz.java index 5f5c53cbc..7e84f47a6 100644 --- a/src/com/engine/salary/biz/SICategoryBiz.java +++ b/src/com/engine/salary/biz/SICategoryBiz.java @@ -12,6 +12,7 @@ import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.SalaryI18nUtil; import com.mzlion.core.utils.BeanUtils; import org.apache.commons.collections4.CollectionUtils; @@ -48,8 +49,8 @@ public class SICategoryBiz extends Service { BeanUtils.copyProperties(iCategoryPO,iCategoryFormDTO); PaymentScopeEnum[] paymentScopeEnums = SalaryEnumUtil.stringToEnums(iCategoryPO.getPaymentScope(), ","); iCategoryFormDTO.setPaymentScope(paymentScopeEnums); - WelfareTypeEnum welfareTypeEnum = WelfareTypeEnum.parseByValue(iCategoryPO.getWelfareType()); - iCategoryFormDTO.setWelfareType(welfareTypeEnum); + // WelfareTypeEnum welfareTypeEnum = WelfareTypeEnum.parseByValue(iCategoryPO.getWelfareType()); + iCategoryFormDTO.setWelfareType(SalaryEnumUtil.enumMatchByValue(iCategoryPO.getWelfareType(), WelfareTypeEnum.values(), WelfareTypeEnum.class)); iCategoryFormDTO.setInsuranceName("base64_" + Base64Encoder.encode(iCategoryPO.getInsuranceName())); return iCategoryFormDTO; } diff --git a/src/com/engine/salary/biz/SalaryArchiveItemBiz.java b/src/com/engine/salary/biz/SalaryArchiveItemBiz.java index 7aaace98c..638a4ff10 100644 --- a/src/com/engine/salary/biz/SalaryArchiveItemBiz.java +++ b/src/com/engine/salary/biz/SalaryArchiveItemBiz.java @@ -1,11 +1,16 @@ package com.engine.salary.biz; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO; import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemQueryParam; import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustRecordQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.mapper.archive.SalaryArchiveItemMapper; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.SalaryLoggerUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; @@ -13,10 +18,13 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.ibatis.session.SqlSession; import weaver.conn.mybatis.MyBatisFactory; import weaver.hrm.User; +import weaver.hrm.User; import com.engine.core.impl.Service; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; public class SalaryArchiveItemBiz extends Service { public EncryptUtil encryptUtil = new EncryptUtil(); @@ -110,6 +118,7 @@ public class SalaryArchiveItemBiz extends Service { if (CollectionUtils.isEmpty(salaryArchiveItemNews)) { return; } + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { SalaryArchiveItemMapper mapper = sqlSession.getMapper(SalaryArchiveItemMapper.class); @@ -117,6 +126,25 @@ public class SalaryArchiveItemBiz extends Service { List> partition = Lists.partition(salaryArchiveItemNews, 100); partition.forEach(mapper::batchInsert); sqlSession.commit(); + + // 记录日志 + List archiveIdList = salaryArchiveItemNews.stream().map(SalaryArchiveItemPO::getSalaryArchiveId).distinct().collect(Collectors.toList()); + List itemIdList = salaryArchiveItemNews.stream().map(SalaryArchiveItemPO::getSalaryItemId).distinct().collect(Collectors.toList()); + // 查出保存的id + List savePO = mapper.listByParam(SalaryArchiveItemQueryParam.builder().salaryArchivesIds(archiveIdList).salaryItemIds(itemIdList).build()); + encryptUtil.decryptList(savePO, SalaryArchiveItemPO.class); + Map saveMap = SalaryEntityUtil.convert2Map(savePO, p -> p.getSalaryArchiveId() + p.getSalaryItemId() + SalaryDateUtil.getFormatDate(p.getEffectiveTime())); + String operateName = SalaryI18nUtil.getI18nLabel(0, "新增调薪记录"); + salaryArchiveItemNews.forEach(e -> { + SalaryArchiveItemPO archive = saveMap.getOrDefault(e.getSalaryArchiveId() + e.getSalaryItemId() + SalaryDateUtil.getFormatDate(e.getEffectiveTime()), SalaryArchiveItemPO.builder().build()); + SalaryLoggerUtil.recordAddSingleLog(SalaryElogConfig.salaryArchiveItemAdjustLoggerTemplate, + archive.getId(), + operateName + ":" + archive.getId(), + operateName, + operateName, + archive, + user); + }); } finally { sqlSession.close(); } diff --git a/src/com/engine/salary/biz/SpecialAddDeductionBiz.java b/src/com/engine/salary/biz/SpecialAddDeductionBiz.java index 440929bda..f68d2c2ba 100644 --- a/src/com/engine/salary/biz/SpecialAddDeductionBiz.java +++ b/src/com/engine/salary/biz/SpecialAddDeductionBiz.java @@ -1,11 +1,16 @@ package com.engine.salary.biz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionListDTO; import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.SpecialAddDeductionQueryParam; import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.mapper.datacollection.SpecialAddDeductionMapper; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; @@ -46,7 +51,8 @@ public class SpecialAddDeductionBiz extends BaseBean { public List listByParam(SpecialAddDeductionQueryParam param, User user) { List specialAddDeductionListDTOS = mapper().listByParam(param); - return encryptUtil.decryptList(specialAddDeductionListDTOS, SpecialAddDeductionListDTO.class, user); + encryptUtil.decryptList(specialAddDeductionListDTOS, SpecialAddDeductionListDTO.class, user); + return SalaryI18nUtil.i18nList(specialAddDeductionListDTOS); } public List listByTaxAgentIds(List taxAgentIds, User user) { @@ -99,6 +105,23 @@ public class SpecialAddDeductionBiz extends BaseBean { } } + /** + * 条件查询 + * + * @param param + * @return + */ + public List listSome(SpecialAddDeductionPO param) { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + SpecialAddDeductionMapper mapper = sqlSession.getMapper(SpecialAddDeductionMapper.class); + List specialAddDeductionPOS = mapper.listSome(param); + return encryptUtil.decryptList(specialAddDeductionPOS, SpecialAddDeductionPO.class); + } finally { + sqlSession.close(); + } + } + /** * 处理导入数据 @@ -141,6 +164,32 @@ public class SpecialAddDeductionBiz extends BaseBean { if (CollectionUtils.isNotEmpty(saveList)) { batchSave(saveList, user); } + + // 记录操作日志 + // 根据人员id查出保存的数据 + List empIds = saveList.stream().map(SpecialAddDeductionPO::getEmployeeId).collect(Collectors.toList()); + List insertLogList = listSome(SpecialAddDeductionPO.builder().employeeIds(empIds).build()); + Map insertMap = SalaryEntityUtil.convert2Map(insertLogList, p -> p.getTaxAgentId() + "-" + p.getEmployeeId()); + saveList.forEach(save -> { + SpecialAddDeductionPO specialAddDeductionPO = insertMap.get(save.getTaxAgentId() + "-" + save.getEmployeeId()); + if (specialAddDeductionPO != null) { + updateList.add(specialAddDeductionPO); + } + }); + + if (CollectionUtils.isNotEmpty(updateList)) { + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + if(updateList.size() == 1) { + loggerContext.setTargetId(updateList.get(0).getId().toString()); + } + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel( 0, "专项附加扣除 ")); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入专项附加扣除 ")); + loggerContext.setNewValueList(updateList); + SalaryElogConfig.specialAddDeductionLoggerTemplate.write(loggerContext); + } } diff --git a/src/com/engine/salary/cmd/siarchives/SIArchivesTipsCmd.java b/src/com/engine/salary/cmd/siarchives/SIArchivesTipsCmd.java index a983f64be..8a588da6a 100644 --- a/src/com/engine/salary/cmd/siarchives/SIArchivesTipsCmd.java +++ b/src/com/engine/salary/cmd/siarchives/SIArchivesTipsCmd.java @@ -3,9 +3,13 @@ package com.engine.salary.cmd.siarchives; import com.engine.common.biz.AbstractCommonCommand; import com.engine.common.entity.BizLogContext; import com.engine.core.interceptor.CommandContext; -import com.engine.salary.biz.SIArchivesBiz; +import com.engine.salary.mapper.siarchives.SocialSchemeMapper; +import com.engine.salary.util.SalaryAssert; +import org.apache.ibatis.session.SqlSession; +import weaver.conn.mybatis.MyBatisFactory; import weaver.hrm.User; +import java.util.List; import java.util.Map; /** @@ -28,8 +32,16 @@ public class SIArchivesTipsCmd extends AbstractCommonCommand @Override public Map execute(CommandContext commandContext) { - SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); - siArchivesBiz.tips(user); + + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); + List employeeIds = socialSchemeMapper.tips(user); + SalaryAssert.isEmpty(employeeIds, "当前有离职人员档案存在福利缴纳起始月,未维护福利最后缴纳月,请尽快处理"); + + } finally { + sqlSession.close(); + } return null; } } diff --git a/src/com/engine/salary/component/Page.java b/src/com/engine/salary/component/Page.java new file mode 100644 index 000000000..a23215bfb --- /dev/null +++ b/src/com/engine/salary/component/Page.java @@ -0,0 +1,170 @@ +package com.engine.salary.component; + + +import java.util.ArrayList; +import java.util.List; + +public class Page extends ArrayList { + private static final long serialVersionUID = 1L; + + /** + * 页码,从1开始 + */ + private int pageNum; + /** + * 页面大小 + */ + private int pageSize; + /** + * 起始行 + */ + private int startRow; + /** + * 末行 + */ + private int endRow; + /** + * 总数 + */ + private long total; + /** + * 总页数 + */ + private int pages; + /** + * 包含count查询 + */ + private boolean count = true; + /** + * 分页合理化 + */ + private Boolean reasonable; + /** + * 当设置为true的时候,如果pagesize设置为0(或RowBounds的limit=0),就不执行分页,返回全部结果 + */ + private Boolean pageSizeZero; + + public Page() { + super(); + } + + + /** + * int[] rowBounds + * 0 : offset + * 1 : limit + */ + public Page(int[] rowBounds, boolean count) { + super(0); + if (rowBounds[0] == 0 && rowBounds[1] == Integer.MAX_VALUE) { + pageSizeZero = true; + this.pageSize = 0; + } else { + this.pageSize = rowBounds[1]; + this.pageNum = rowBounds[1] != 0 ? (int) (Math.ceil(((double) rowBounds[0] + rowBounds[1]) / rowBounds[1])) : 0; + } + this.startRow = rowBounds[0]; + this.count = count; + this.endRow = this.startRow + rowBounds[1]; + } + + public List getResult() { + return this; + } + + public int getPages() { + return pages; + } + + + public int getEndRow() { + return endRow; + } + + + public int getPageNum() { + return pageNum; + } + + + public int getPageSize() { + return pageSize; + } + + + public int getStartRow() { + return startRow; + } + + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + if (total == -1) { + pages = 1; + return; + } + if (pageSize > 0) { + pages = (int) (total / pageSize + ((total % pageSize == 0) ? 0 : 1)); + } else { + pages = 0; + } + //分页合理化,针对不合理的页码自动处理 + if ((reasonable != null && reasonable) && pageNum > pages) { + pageNum = pages; + calculateStartAndEndRow(); + } + } + + public Boolean getReasonable() { + return reasonable; + } + + + public Boolean getPageSizeZero() { + return pageSizeZero; + } + + + /** + * 计算起止行号 + */ + private void calculateStartAndEndRow() { + this.startRow = this.pageNum > 0 ? (this.pageNum - 1) * this.pageSize : 0; + this.endRow = this.startRow + this.pageSize * (this.pageNum > 0 ? 1 : 0); + } + + public boolean isCount() { + return this.count; + } + + + /** + * 转换为PageInfo + * + * @return + */ + public PageInfo toPageInfo() { + PageInfo pageInfo = new PageInfo(this); + return pageInfo; + } + + + @Override + public String toString() { + return "Page{" + + "count=" + count + + ", pageNum=" + pageNum + + ", pageSize=" + pageSize + + ", startRow=" + startRow + + ", endRow=" + endRow + + ", total=" + total + + ", pages=" + pages + + ", reasonable=" + reasonable + + ", pageSizeZero=" + pageSizeZero + + '}'; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/component/PageInfo.java b/src/com/engine/salary/component/PageInfo.java new file mode 100644 index 000000000..6a630a6e4 --- /dev/null +++ b/src/com/engine/salary/component/PageInfo.java @@ -0,0 +1,380 @@ +package com.engine.salary.component; + + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; + +/** + * 对Page 结果进行包装 + * pageHelper的替代 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class PageInfo implements Serializable { + private static final long serialVersionUID = 1L; + //当前页 + private int pageNum; + //每页的数量 + private int pageSize; + //当前页的数量 + private int size; + + //由于startRow和endRow不常用,这里说个具体的用法 + //可以在页面中"显示startRow到endRow 共size条数据" + + //当前页面第一个元素在数据库中的行号 + private int startRow; + //当前页面最后一个元素在数据库中的行号 + private int endRow; + //总记录数 + private long total; + //总页数 + private int pages; + //结果集 + private List list; + + //前一页 + private int prePage; + //下一页 + private int nextPage; + + //是否为第一页 + private boolean isFirstPage = false; + //是否为最后一页 + private boolean isLastPage = false; + //是否有前一页 + private boolean hasPreviousPage = false; + //是否有下一页 + private boolean hasNextPage = false; + //导航页码数 + private int navigatePages; + //所有导航页号 + private int[] navigatepageNums; + //导航条上的第一页 + private int navigateFirstPage; + //导航条上的最后一页 + private int navigateLastPage; + + public PageInfo() { + } + + /** + * 包装Page对象 + * + * @param list + */ + public PageInfo(List list) { + this(list, 8); + } + + /** + * 包装Page对象 + * + * @param list page结果 + * @param navigatePages 页码数量 + */ + public PageInfo(List list, int navigatePages) { + if (list instanceof Page) { + Page page = (Page) list; + this.pageNum = page.getPageNum(); + this.pageSize = page.getPageSize(); + + this.pages = page.getPages(); + this.list = page; + this.size = page.size(); + this.total = page.getTotal(); + //由于结果是>startRow的,所以实际的需要+1 + if (this.size == 0) { + this.startRow = 0; + this.endRow = 0; + } else { + this.startRow = page.getStartRow() + 1; + //计算实际的endRow(最后一页的时候特殊) + this.endRow = this.startRow - 1 + this.size; + } + } else if (list instanceof Collection) { + this.pageNum = 1; + this.pageSize = list.size(); + + this.pages = 1; + this.list = list; + this.size = list.size(); + this.total = list.size(); + this.startRow = 0; + this.endRow = list.size() > 0 ? list.size() - 1 : 0; + } + if (list instanceof Collection) { + this.navigatePages = navigatePages; + //计算导航页 + calcNavigatepageNums(); + //计算前后页,第一页,最后一页 + calcPage(); + //判断页面边界 + judgePageBoudary(); + } + } + + /** + * 计算导航页 + */ + private void calcNavigatepageNums() { + //当总页数小于或等于导航页码数时 + if (pages <= navigatePages) { + navigatepageNums = new int[pages]; + for (int i = 0; i < pages; i++) { + navigatepageNums[i] = i + 1; + } + } else { //当总页数大于导航页码数时 + navigatepageNums = new int[navigatePages]; + int startNum = pageNum - navigatePages / 2; + int endNum = pageNum + navigatePages / 2; + + if (startNum < 1) { + startNum = 1; + //(最前navigatePages页 + for (int i = 0; i < navigatePages; i++) { + navigatepageNums[i] = startNum++; + } + } else if (endNum > pages) { + endNum = pages; + //最后navigatePages页 + for (int i = navigatePages - 1; i >= 0; i--) { + navigatepageNums[i] = endNum--; + } + } else { + //所有中间页 + for (int i = 0; i < navigatePages; i++) { + navigatepageNums[i] = startNum++; + } + } + } + } + + /** + * 计算前后页,第一页,最后一页 + */ + private void calcPage() { + if (navigatepageNums != null && navigatepageNums.length > 0) { + navigateFirstPage = navigatepageNums[0]; + navigateLastPage = navigatepageNums[navigatepageNums.length - 1]; + if (pageNum > 1) { + prePage = pageNum - 1; + } + if (pageNum < pages) { + nextPage = pageNum + 1; + } + } + } + + /** + * 判定页面边界 + */ + private void judgePageBoudary() { + isFirstPage = pageNum == 1; + isLastPage = pageNum == pages; + hasPreviousPage = pageNum > 1; + hasNextPage = pageNum < pages; + } + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getStartRow() { + return startRow; + } + + public void setStartRow(int startRow) { + this.startRow = startRow; + } + + public int getEndRow() { + return endRow; + } + + public void setEndRow(int endRow) { + this.endRow = endRow; + } + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + @Deprecated + // firstPage就是1, 此函数获取的是导航条上的第一页, 容易产生歧义 + public int getFirstPage() { + return navigateFirstPage; + } + + @Deprecated + public void setFirstPage(int firstPage) { + this.navigateFirstPage = firstPage; + } + + public int getPrePage() { + return prePage; + } + + public void setPrePage(int prePage) { + this.prePage = prePage; + } + + public int getNextPage() { + return nextPage; + } + + public void setNextPage(int nextPage) { + this.nextPage = nextPage; + } + + @Deprecated + // 请用getPages()来获取最后一页, 此函数获取的是导航条上的最后一页, 容易产生歧义. + public int getLastPage() { + return navigateLastPage; + } + + @Deprecated + public void setLastPage(int lastPage) { + this.navigateLastPage = lastPage; + } + + public boolean isIsFirstPage() { + return isFirstPage; + } + + public void setIsFirstPage(boolean isFirstPage) { + this.isFirstPage = isFirstPage; + } + + public boolean isIsLastPage() { + return isLastPage; + } + + public void setIsLastPage(boolean isLastPage) { + this.isLastPage = isLastPage; + } + + public boolean isHasPreviousPage() { + return hasPreviousPage; + } + + public void setHasPreviousPage(boolean hasPreviousPage) { + this.hasPreviousPage = hasPreviousPage; + } + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public int getNavigatePages() { + return navigatePages; + } + + public void setNavigatePages(int navigatePages) { + this.navigatePages = navigatePages; + } + + public int[] getNavigatepageNums() { + return navigatepageNums; + } + + public void setNavigatepageNums(int[] navigatepageNums) { + this.navigatepageNums = navigatepageNums; + } + + public int getNavigateFirstPage() { + return navigateFirstPage; + } + + public int getNavigateLastPage() { + return navigateLastPage; + } + + public void setNavigateFirstPage(int navigateFirstPage) { + this.navigateFirstPage = navigateFirstPage; + } + + public void setNavigateLastPage(int navigateLastPage) { + this.navigateLastPage = navigateLastPage; + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("PageInfo{"); + sb.append("pageNum=").append(pageNum); + sb.append(", pageSize=").append(pageSize); + sb.append(", size=").append(size); + sb.append(", startRow=").append(startRow); + sb.append(", endRow=").append(endRow); + sb.append(", total=").append(total); + sb.append(", pages=").append(pages); + sb.append(", list=").append(list); + sb.append(", prePage=").append(prePage); + sb.append(", nextPage=").append(nextPage); + sb.append(", isFirstPage=").append(isFirstPage); + sb.append(", isLastPage=").append(isLastPage); + sb.append(", hasPreviousPage=").append(hasPreviousPage); + sb.append(", hasNextPage=").append(hasNextPage); + sb.append(", navigatePages=").append(navigatePages); + sb.append(", navigateFirstPage").append(navigateFirstPage); + sb.append(", navigateLastPage").append(navigateLastPage); + sb.append(", navigatepageNums="); + if (navigatepageNums == null) sb.append("null"); + else { + sb.append('['); + for (int i = 0; i < navigatepageNums.length; ++i) + sb.append(i == 0 ? "" : ", ").append(navigatepageNums[i]); + sb.append(']'); + } + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/com/engine/salary/component/PageInterceptor.java b/src/com/engine/salary/component/PageInterceptor.java index 50958baf7..a41d739dd 100644 --- a/src/com/engine/salary/component/PageInterceptor.java +++ b/src/com/engine/salary/component/PageInterceptor.java @@ -1,7 +1,6 @@ package com.engine.salary.component; -import com.github.pagehelper.Page; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.binding.MapperMethod; import org.apache.ibatis.executor.parameter.ParameterHandler; diff --git a/src/com/engine/salary/component/WeaTableColumnGroup.java b/src/com/engine/salary/component/WeaTableColumnGroup.java index dac9a3569..0dcd305af 100644 --- a/src/com/engine/salary/component/WeaTableColumnGroup.java +++ b/src/com/engine/salary/component/WeaTableColumnGroup.java @@ -18,6 +18,11 @@ public class WeaTableColumnGroup extends WeaTableColumn { */ private Integer pattern; + /** + * 字段类型 + */ + private String dataType; + private List children; public WeaTableColumnGroup() { @@ -40,6 +45,13 @@ public class WeaTableColumnGroup extends WeaTableColumn { this.pattern = pattern; } + public WeaTableColumnGroup(String width, String text, String column, String lockStatus, Integer pattern, String dataType) { + super(width, text, column); + this.lockStatus = lockStatus; + this.pattern = pattern; + this.dataType = dataType; + } + public WeaTableColumnGroup(String width, String text, String column, List children) { super(width, text, column); diff --git a/src/com/engine/salary/config/SalaryElogConfig.java b/src/com/engine/salary/config/SalaryElogConfig.java new file mode 100644 index 000000000..7d9f79321 --- /dev/null +++ b/src/com/engine/salary/config/SalaryElogConfig.java @@ -0,0 +1,320 @@ +package com.engine.salary.config; + +import com.engine.hrmelog.util.LoggerTemplate; +import com.engine.hrmelog.util.LoggerTemplateBuilder; + +/** + * elog日志 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalaryElogConfig { + + /** + * 个税税率表 + * + * @return + */ + public final static LoggerTemplate taxRateLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxrate"); + + /** + * 薪资项目 + * + * @return + */ + public static LoggerTemplate salaryItemLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salaryitem"); + + /** + * 个税扣缴义务人 + * + * @return + */ + public static LoggerTemplate taxAgentLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxagent"); + + public static LoggerTemplate siCategoryLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siCategory"); + + public static LoggerTemplate siSchemeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siScheme"); + + public static LoggerTemplate totalSchemeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "totalScheme"); + + /** + * 累计情况 + * + * @return + */ + public static LoggerTemplate addUpSituationLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "addupsituation"); + + /** + * 累计专项附加扣除 + * + * @return + */ + public static LoggerTemplate addUpDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "addupdeduction"); + + /** + * 其他免税扣除 + * + * @return + */ + public static LoggerTemplate otherDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "otherdeduction"); + + /** + * 专项附加扣除 + * + * @return + */ + public static LoggerTemplate specialAddDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "specialAddDeduction"); + + /** + * 减税 + * + * @return + */ + public static LoggerTemplate derateDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "deratededuction"); + + /** + * 税延养老保险 + * + * @return + */ + public static LoggerTemplate endowmentInsuranceLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "endowmentinsurance"); + + /** + * 税延养老保险 + * + * @return + */ + public static LoggerTemplate freeIncomeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "freeincome"); + + /** + * 捐赠免税 + * + * @return + */ + public static LoggerTemplate grantDonationLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "grantdonation"); + + /** + * 捐赠免税 + * + * @return + */ + public static LoggerTemplate healthInsuranceLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "healthinsurance"); + + /** + * 其他免税扣除 + * + * @return + */ + public static LoggerTemplate otherDerateDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "otherderatededuction"); + + /** + * 考勤引用 + * + * @return + */ + public static LoggerTemplate attendQuoteLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "attendquote"); + + /** + * 考勤引用字段管理 + * + * @return + */ + public static LoggerTemplate attendQuoteFieldLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "attendfield"); + + /** + * 考勤引用字段设置 + * + * @return + */ + public static LoggerTemplate attendQuoteFieldSettingLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "attendfieldset"); + + /** + * 薪资账套 + * + * @return + */ + public static LoggerTemplate salarySobLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarysob"); + + /** + * 薪资核算 + * + * @return + */ + public static LoggerTemplate salaryAcctRecordLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "acctrecord"); + /** + * 个税申报表 + * + * @return + */ + public static LoggerTemplate taxDeclarationLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxdecla"); + + /** + * 福利档案 + * + * @return + */ + public static LoggerTemplate siArchivesLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siarchives"); + + /** + * 社保规则 + */ + public static LoggerTemplate archiveRuleLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "archiverule"); + + /** + * 代缴机构 + * + * @return + */ + public static LoggerTemplate paymentAgencyLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "paymentagency"); + + /** + * 福利核算 + * + * @return + */ + public static LoggerTemplate siAccountLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siaccount"); + + /** + * 工资单模板 + * + * @return + */ + public static LoggerTemplate salaryTemplateLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarytemplate"); + + /** + * 工资单发放 + * + * @return + */ + public static LoggerTemplate salarySendLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarysend"); + + /** + * 外部人员 + * + * @return + */ + public static LoggerTemplate extEmployeeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "extemployee"); + + /** + * 薪资档案 + * + * @return + */ + public static LoggerTemplate salaryArchiveLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salaryarchive"); + + /** + * 薪资档案-字段 + * + * @return + */ + public static LoggerTemplate salaryArchiveFieldLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarcfield"); + /** + * 薪资档案-薪资项目调整 + * + * @return + */ + public static LoggerTemplate salaryArchiveItemAdjustLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarcitemadj"); + + /** + * 薪资档案-批量调薪 + * + * @return + */ + public static LoggerTemplate salaryArchiveBatchAdjustLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarcbatadj"); + + /** + * 自定义业务数据设置 + * + * @return + */ + public static LoggerTemplate customDataSetLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "customdataset"); + + /** + * 自定义业务数据 + * + * @return + */ + public static LoggerTemplate customDataLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "customdata"); + + + /** + * 人员报送 + * + * @return + */ + public static LoggerTemplate employeeDeclareLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "empdeclare"); + + /** + * 单位扣款账号 + * + * @return + */ + public static LoggerTemplate withholdAccountLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "whaccount"); + + /** + * 银行报盘 + * + * @return + */ + public static LoggerTemplate bankOfferLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "bankoffer"); + + /** + * 银行报盘模板 + * + * @return + */ + public static LoggerTemplate bankOfferTemplateLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "botemplate"); + + /** + * 薪酬体系标准(岗薪制) + * + * @return + */ + public static LoggerTemplate postSalaryLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "postsalary"); + + /** + * 银行报盘模板 + * + * @return + */ + public static LoggerTemplate taxFreeDetailLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxfreedetail"); + + /** + * 最优年终奖计税方案 + * + * @return + */ + public static LoggerTemplate annualBonusPlanLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "annualplan"); + + /** + * 最优年终奖计税方案-累计情况 + * 最优年终奖计税方案-优化方案详情 + * + * @return + */ + public static LoggerTemplate annualBonusLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "annualbonus"); + + /** + * 我的工资单 + * + * @return + */ + public static LoggerTemplate mySalaryBillLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "mysalarybill"); + + /** + * 我的调薪记录 + * + * @return + */ + public static LoggerTemplate myAdjustRecordLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "myadjustrecord"); + + /** + * 薪酬报表 + * + * @return + */ + public static LoggerTemplate salaryStatReportLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "statreport"); +} diff --git a/src/com/engine/salary/config/SalaryPermissionConfig.java b/src/com/engine/salary/config/SalaryPermissionConfig.java new file mode 100644 index 000000000..7703e9267 --- /dev/null +++ b/src/com/engine/salary/config/SalaryPermissionConfig.java @@ -0,0 +1,194 @@ +//package com.engine.salary.config; +// +//import com.weaver.common.component.permission.container.FrontDataContainer; +//import com.weaver.common.mybatis.permission.config.PermissionConfig; +//import com.weaver.common.mybatis.permission.container.PermissionDataContainer; +//import com.weaver.common.mybatis.permission.model.PermissionModuleSourceBean; +//import com.weaver.common.mybatis.permission.model.PermissionModuleTargetBean; +//import com.weaver.common.mybatis.permission.service.PermissionModuleSourceService; +//import com.weaver.common.mybatis.permission.service.PermissionModuleTargetService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.context.annotation.Configuration; +// +//import javax.annotation.PostConstruct; +// +///** +// * @description: 数据权限配置 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2023/6/7 10:28 +// * @version:v1.0 +// */ +//@Configuration +//public class SalaryPermissionConfig { +// +// @Autowired +// private PermissionConfig permissionConfig; +// @Autowired +// private PermissionModuleSourceService permissionModuleSourceService; +// @Autowired +// private PermissionModuleTargetService permissionModuleTargetService; +// +// public static final String TABLE_NAME = "hrsa"; +// public static final String PERMISSION_ID = "salary_standard_share"; +// +// /** +// * 初始化模块支持的权限类型 +// */ +// @PostConstruct +// public void init() { +// +// // 初始化权限字典数据 +// permissionConfig.initPermissionData(); +// +// // 给permissionId指定sourceType 类型 ,可以是多个 +// PermissionModuleSourceBean permissionModuleSourceBean = new PermissionModuleSourceBean(); +// permissionModuleSourceBean.setPermissionId(PERMISSION_ID); +// permissionModuleSourceBean.setSourceType(1); // 指定资源 +// permissionModuleSourceService.addBySql(permissionModuleSourceBean); +// +// // 给permissionId指定targetType 类型 ,可以是多个 +// PermissionModuleTargetBean resourceTarget = new PermissionModuleTargetBean(); +// resourceTarget.setPermissionId(PERMISSION_ID); +// resourceTarget.setTargetType(1); // 人力资源 +// permissionModuleTargetService.addBySql(resourceTarget); +// +// PermissionModuleTargetBean departmentTarget = new PermissionModuleTargetBean(); +// departmentTarget.setPermissionId(PERMISSION_ID); +// departmentTarget.setTargetType(2); // 部门+安全级别 +// permissionModuleTargetService.addBySql(departmentTarget); +// +// PermissionModuleTargetBean departmentTarget2 = new PermissionModuleTargetBean(); +// departmentTarget2.setPermissionId(PERMISSION_ID); +// departmentTarget2.setTargetType(2001); // 部门+包含兼职部门 +// permissionModuleTargetService.addBySql(departmentTarget2); +// +// PermissionModuleTargetBean departmentTarget3 = new PermissionModuleTargetBean(); +// departmentTarget3.setPermissionId(PERMISSION_ID); +// departmentTarget3.setTargetType(3); // 部门+所有下级部门+安全级别 +// permissionModuleTargetService.addBySql(departmentTarget3); +// +// PermissionModuleTargetBean departmentTarget4 = new PermissionModuleTargetBean(); +// departmentTarget4.setPermissionId(PERMISSION_ID); +// departmentTarget4.setTargetType(3001); // 部门+所有下级部门+包含兼职部门 +// permissionModuleTargetService.addBySql(departmentTarget4); +// +// PermissionModuleTargetBean departmentTarget5 = new PermissionModuleTargetBean(); +// departmentTarget5.setPermissionId(PERMISSION_ID); +// departmentTarget5.setTargetType(3002); // 部门+所有下级部门+包含兼职部门+安全级别 +// permissionModuleTargetService.addBySql(departmentTarget5); +// +// PermissionModuleTargetBean departmentTarget6 = new PermissionModuleTargetBean(); +// departmentTarget6.setPermissionId(PERMISSION_ID); +// departmentTarget6.setTargetType(2002); // 部门+包含兼职部门+安全级别 +// permissionModuleTargetService.addBySql(departmentTarget6); +// +// PermissionModuleTargetBean branchTarget = new PermissionModuleTargetBean(); +// branchTarget.setPermissionId(PERMISSION_ID); +// branchTarget.setTargetType(5); // 分部+安全级别 +// permissionModuleTargetService.addBySql(branchTarget); +// +// PermissionModuleTargetBean branchTarget501 = new PermissionModuleTargetBean(); +// branchTarget501.setPermissionId(PERMISSION_ID); +// branchTarget501.setTargetType(501); // 分部+安全级别 +// permissionModuleTargetService.addBySql(branchTarget501); +// +// PermissionModuleTargetBean branchTarget502 = new PermissionModuleTargetBean(); +// branchTarget502.setPermissionId(PERMISSION_ID); +// branchTarget502.setTargetType(502); // 分部+安全级别+兼职 +// permissionModuleTargetService.addBySql(branchTarget502); +// +// PermissionModuleTargetBean branchTarget2 = new PermissionModuleTargetBean(); +// branchTarget2.setPermissionId(PERMISSION_ID); +// branchTarget2.setTargetType(6); // 分部+所有下级分部+安全级别 +// permissionModuleTargetService.addBySql(branchTarget2); +// +// PermissionModuleTargetBean roleTarget = new PermissionModuleTargetBean(); +// roleTarget.setPermissionId(PERMISSION_ID); +// roleTarget.setTargetType(10); // 角色+角色级别+安全级别 +// permissionModuleTargetService.addBySql(roleTarget); +// +// PermissionModuleTargetBean allPeopleTarget = new PermissionModuleTargetBean(); +// allPeopleTarget.setPermissionId(PERMISSION_ID); +// allPeopleTarget.setTargetType(11); // 所有人+安全级别 +// permissionModuleTargetService.addBySql(allPeopleTarget); +// +// PermissionModuleTargetBean positionTarget = new PermissionModuleTargetBean(); +// positionTarget.setPermissionId(PERMISSION_ID); +// positionTarget.setTargetType(12); // 岗位+指定部门 +// permissionModuleTargetService.addBySql(positionTarget); +// +// PermissionModuleTargetBean positionTarget12001 = new PermissionModuleTargetBean(); +// positionTarget12001.setPermissionId(PERMISSION_ID); +// positionTarget12001.setTargetType(12001); // 岗位+指定部门+安全级别 +// permissionModuleTargetService.addBySql(positionTarget12001); +// +// PermissionModuleTargetBean positionTarget12111 = new PermissionModuleTargetBean(); +// positionTarget12111.setPermissionId(PERMISSION_ID); +// positionTarget12111.setTargetType(12111); // 岗位+指定部门+包含兼职岗位 +// permissionModuleTargetService.addBySql(positionTarget12111); +// +// PermissionModuleTargetBean positionTarget12112 = new PermissionModuleTargetBean(); +// positionTarget12112.setPermissionId(PERMISSION_ID); +// positionTarget12112.setTargetType(12112); // 岗位+指定部门+包含兼职岗位+安全级别 +// permissionModuleTargetService.addBySql(positionTarget12112); +// +// PermissionModuleTargetBean positionTarget1201 = new PermissionModuleTargetBean(); +// positionTarget1201.setPermissionId(PERMISSION_ID); +// positionTarget1201.setTargetType(1201); // 兼职岗位+安全级别 +// permissionModuleTargetService.addBySql(positionTarget1201); +// +// PermissionModuleTargetBean positionTarget2 = new PermissionModuleTargetBean(); +// positionTarget2.setPermissionId(PERMISSION_ID); +// positionTarget2.setTargetType(13); // 岗位+指定分部 +// permissionModuleTargetService.addBySql(positionTarget2); +// +// PermissionModuleTargetBean positionTarget13001 = new PermissionModuleTargetBean(); +// positionTarget13001.setPermissionId(PERMISSION_ID); +// positionTarget13001.setTargetType(13001); // 岗位+指定分部+安全级别 +// permissionModuleTargetService.addBySql(positionTarget13001); +// +// PermissionModuleTargetBean positionTarget13110 = new PermissionModuleTargetBean(); +// positionTarget13110.setPermissionId(PERMISSION_ID); +// positionTarget13110.setTargetType(13110); // 岗位+指定分部+包含兼职岗位 + 安全级别 +// permissionModuleTargetService.addBySql(positionTarget13110); +// +// PermissionModuleTargetBean positionTarget1311 = new PermissionModuleTargetBean(); +// positionTarget1311.setPermissionId(PERMISSION_ID); +// positionTarget1311.setTargetType(1311); // 岗位+总部 +// permissionModuleTargetService.addBySql(positionTarget1311); +// +// PermissionModuleTargetBean positionTarget1312 = new PermissionModuleTargetBean(); +// positionTarget1312.setPermissionId(PERMISSION_ID); +// positionTarget1312.setTargetType(1312); // 岗位+总部+安全级别 +// permissionModuleTargetService.addBySql(positionTarget1312); +// +// PermissionModuleTargetBean positionTarget13111 = new PermissionModuleTargetBean(); +// positionTarget13111.setPermissionId(PERMISSION_ID); +// positionTarget13111.setTargetType(13111); // 岗位+总部+包含兼职岗位 +// permissionModuleTargetService.addBySql(positionTarget13111); +// +// PermissionModuleTargetBean positionTarget13112 = new PermissionModuleTargetBean(); +// positionTarget13112.setPermissionId(PERMISSION_ID); +// positionTarget13112.setTargetType(13112); // 岗位+总部+包含兼职岗位+安全级别 +// permissionModuleTargetService.addBySql(positionTarget13112); +// +// PermissionModuleTargetBean groupTarget = new PermissionModuleTargetBean(); +// groupTarget.setPermissionId(PERMISSION_ID); +// groupTarget.setTargetType(14); // 群组+安全级别 +// permissionModuleTargetService.addBySql(groupTarget); +// +// PermissionModuleTargetBean groupTarget2 = new PermissionModuleTargetBean(); +// groupTarget2.setPermissionId(PERMISSION_ID); +// groupTarget2.setTargetType(1411); // 群组 +// permissionModuleTargetService.addBySql(groupTarget2); +// +// // 创建权限表 +// // 一般模块要创建固定的权限表,类似流程模块可以调用这个接口,其他环境一般没有建表权限,以脚本的形式提供 +// // databaseService.createPermissionTable(TABLE_NAME,PERMISSION_ID); +// +// // 初始化permissionId和权限表的关系 +// FrontDataContainer.permissionFrontDataMap.put(PERMISSION_ID, TABLE_NAME); +// PermissionDataContainer.permissionDataContainer.put(PERMISSION_ID, TABLE_NAME); +// } +//} diff --git a/src/com/engine/salary/constant/SalaryItemConstant.java b/src/com/engine/salary/constant/SalaryItemConstant.java index 26bac736b..217f1d4ea 100644 --- a/src/com/engine/salary/constant/SalaryItemConstant.java +++ b/src/com/engine/salary/constant/SalaryItemConstant.java @@ -20,6 +20,16 @@ public class SalaryItemConstant { */ public static final String RESULT_IMPORT_FIELD_SIGN="_salaryAcctResultImportFieldSign"; + /** + * 社保福利台账导入缓存表头字段key(正常缴纳、补缴) + */ + public static final String SI_ACCOUNT_IMPORT_FIELD_SIGN="_SIAccountImportFieldSign"; + + /** + * 社保福利台账导入缓存表头字段key(补差) + */ + public static final String SI_ACCOUNT_BALANCE_IMPORT_FIELD_SIGN="_SIAccountBalanceImportFieldSign"; + /** * 薪资核算导出缓存表头字段key */ diff --git a/src/com/engine/salary/constant/des.json b/src/com/engine/salary/constant/des.json index fe3b8ce5f..f82a626bd 100644 --- a/src/com/engine/salary/constant/des.json +++ b/src/com/engine/salary/constant/des.json @@ -993,7 +993,7 @@ "name": "IF", "chineseName": "如果条件为真,则...否则...", "description": "如果条件为真,则执行表达式1,为假则执行表达式2。条件中不可嵌套使用IF函数。", - "example": "IF({员工表.年龄} > 60, '退休', '在职')
IF({员工表.年龄} > 60, IF({员工表.性别} = {员工表.性别.女}, '退休', '在职'), '在职')", + "example": "IF({员工表.年龄} > 60, '退休', '在职') ", "result": "'退休'
'在职'", "paramDescs": [ "*条件*(必选)", diff --git a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java index 0fbe29e78..25956b123 100644 --- a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java +++ b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java @@ -4,7 +4,7 @@ import com.engine.salary.entity.agency.dto.PaymentAgencyFormDTO; import com.engine.salary.entity.agency.dto.PaymentAgencyListDTO; import com.engine.salary.entity.agency.po.PaymentAgencyPO; import com.engine.salary.enums.sicategory.DeleteTypeEnum; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import java.time.LocalDateTime; diff --git a/src/com/engine/salary/entity/datacollection/AddUpDeduction.java b/src/com/engine/salary/entity/datacollection/AddUpDeduction.java index dfff6e07e..de14f0bf0 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpDeduction.java +++ b/src/com/engine/salary/entity/datacollection/AddUpDeduction.java @@ -1,7 +1,9 @@ package com.engine.salary.entity.datacollection; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,30 +21,36 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor //hrsa_add_up_deduction +@ElogTransform(name = "累计专项附加扣除") public class AddUpDeduction { /** * 主键id */ + @ElogTransform(name = "主键") private Long id; /** * 人员信息表的主键id */ + @ElogTransform(name = "人员id") private Long employeeId; /** * 个税扣缴义务人的主键id */ + @ElogTransform(name = "个税扣缴义务人id") private Long taxAgentId; /** * 申报月份 */ + @ElogTransform(name = "申报月份") private Date declareMonth; /** * 累计子女教育 */ + @ElogTransform(name = "累计子女教育") @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 542158, dataType = "number") @Encrypt private String addUpChildEducation; @@ -50,6 +58,7 @@ public class AddUpDeduction { /** * 累计继续教育 */ + @ElogTransform(name = "累计继续教育") @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 542159, dataType = "number") @Encrypt private String addUpContinuingEducation; @@ -57,6 +66,7 @@ public class AddUpDeduction { /** * 累计住房贷款利息 */ + @ElogTransform(name = "累计住房贷款利息") @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 542160, dataType = "number") @Encrypt private String addUpHousingLoanInterest; @@ -64,6 +74,7 @@ public class AddUpDeduction { /** * 累计住房租金 */ + @ElogTransform(name = "累计住房租金") @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 542161, dataType = "number") @Encrypt private String addUpHousingRent; @@ -71,6 +82,7 @@ public class AddUpDeduction { /** * 累计赡养老人 */ + @ElogTransform(name = "累计赡养老人") @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 542162, dataType = "number") @Encrypt private String addUpSupportElderly; @@ -78,6 +90,7 @@ public class AddUpDeduction { /** * 累计大病医疗 */ + @ElogTransform(name = "累计大病医疗") @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 542163, dataType = "number") @Encrypt private String addUpIllnessMedical; @@ -85,6 +98,7 @@ public class AddUpDeduction { /** * 累计婴幼儿照护 */ + @ElogTransform(name = "累计婴幼儿照护") @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 537990, dataType = "number") @Encrypt private String addUpInfantCare; @@ -92,26 +106,31 @@ public class AddUpDeduction { /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 创建人 */ + @ElogTransform(name = "创建人") private Long creator; /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform(name = "是否已删除") private Integer deleteType; /** * 租户ID */ + @ElogTransform(name = "租户ID") private String tenantKey; List employeeIds; diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index 830f2e367..7dd5d4a46 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -4,6 +4,7 @@ import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableOperate; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,36 +23,43 @@ import java.util.List; @AllArgsConstructor @SalaryTable(pageId = "a4f83287-e3f9-4275-9527-7d06e54y6238", fields = "id,addUpSubtraction", operates = {@SalaryTableOperate(text = "删除",index = "0")}) //hrsa_add_up_situation +@ElogTransform(name = "往期累计情况") public class AddUpSituation { /** * 主键id */ + @ElogTransform(name = "id") private Long id; /** * 人员信息表的主键id */ + @ElogTransform(name = "创建人id") private Long employeeId; /** * 个税扣缴义务人的主键id */ + @ElogTransform(name = "个税扣缴义务人id") private Long taxAgentId; /** * 税款所属期 */ + @ElogTransform(name = "税款所属期") private Date taxYearMonth; private List taxYearMonthRange; /** * 年份 */ + @ElogTransform(name = "年份") private Integer year; /** * 累计收入额 */ + @ElogTransform(name = "累计收入额") @SalaryFormulaVar(defaultLabel = "累计收入额", labelId = 542230, dataType = "number") @Encrypt private String addUpIncome; @@ -59,6 +67,7 @@ public class AddUpSituation { /** * 累计减除费用 */ + @ElogTransform(name = "累计减除费用") @SalaryFormulaVar(defaultLabel = "累计减除费用", labelId = 542231, dataType = "number") @Encrypt private String addUpSubtraction; @@ -66,6 +75,7 @@ public class AddUpSituation { /** * 累计社保个人合计 */ + @ElogTransform(name = "累计社保个人合计") @SalaryFormulaVar(defaultLabel = "累计社保个人合计", labelId = 542232, dataType = "number") @Encrypt private String addUpSocialSecurityTotal; @@ -73,6 +83,7 @@ public class AddUpSituation { /** * 累计公积金个人合计 */ + @ElogTransform(name = "累计公积金个人合计") @SalaryFormulaVar(defaultLabel = "累计公积金个人合计", labelId = 542233, dataType = "number") @Encrypt private String addUpAccumulationFundTotal; @@ -80,6 +91,7 @@ public class AddUpSituation { /** * 累计子女教育 */ + @ElogTransform(name = "累计子女教育") @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 542158, dataType = "number") @Encrypt private String addUpChildEducation; @@ -87,6 +99,7 @@ public class AddUpSituation { /** * 累计继续教育 */ + @ElogTransform(name = "累计继续教育") @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 542159, dataType = "number") @Encrypt private String addUpContinuingEducation; @@ -94,6 +107,7 @@ public class AddUpSituation { /** * 累计住房贷款利息 */ + @ElogTransform(name = "累计住房贷款利息") @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 542160, dataType = "number") @Encrypt private String addUpHousingLoanInterest; @@ -101,6 +115,7 @@ public class AddUpSituation { /** * 累计住房租金 */ + @ElogTransform(name = "累计住房租金") @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 542161, dataType = "number") @Encrypt private String addUpHousingRent; @@ -108,6 +123,7 @@ public class AddUpSituation { /** * 累计赡养老人 */ + @ElogTransform(name = "累计赡养老人") @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 542162, dataType = "number") @Encrypt private String addUpSupportElderly; @@ -115,6 +131,7 @@ public class AddUpSituation { /** * 累计大病医疗 */ + @ElogTransform(name = "累计大病医疗") @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 542163, dataType = "number") @Encrypt private String addUpIllnessMedical; @@ -122,6 +139,7 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ + @ElogTransform(name = "累计婴幼儿照护") @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 537990, dataType = "number") @Encrypt private String addUpInfantCare; @@ -129,6 +147,7 @@ public class AddUpSituation { /** * 累计婴幼儿照护 */ + @ElogTransform(name = "累计个人养老金") @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 542863, dataType = "number") @Encrypt private String addUpPrivatePension; @@ -136,6 +155,7 @@ public class AddUpSituation { /** * 累计企业(职业)年金及其他福利 */ + @ElogTransform(name = "累计企业(职业)年金及其他福利") @SalaryFormulaVar(defaultLabel = "累计企业(职业)年金及其他福利", labelId = 542234, dataType = "number") @Encrypt private String addUpEnterpriseAndOther; @@ -143,6 +163,7 @@ public class AddUpSituation { /** * 累计其他免税扣除 */ + @ElogTransform(name = "累计其他免税扣除") @SalaryFormulaVar(defaultLabel = "累计其他免税扣除", labelId = 543361, dataType = "number") @Encrypt private String addUpOtherDeduction; @@ -150,6 +171,7 @@ public class AddUpSituation { /** * 累计免税收入 */ + @ElogTransform(name = "累计免税收入") @SalaryFormulaVar(defaultLabel = "累计免税收入", labelId = 542236, dataType = "number") @Encrypt private String addUpTaxExemptIncome; @@ -157,6 +179,7 @@ public class AddUpSituation { /** * 累计准予扣除的捐赠额 */ + @ElogTransform(name = "累计准予扣除的捐赠额") @SalaryFormulaVar(defaultLabel = "累计准予扣除的捐赠额", labelId = 542237, dataType = "number") @Encrypt private String addUpAllowedDonation; @@ -164,6 +187,7 @@ public class AddUpSituation { /** * 累计减免税额 */ + @ElogTransform(name = "累计减免税额") @SalaryFormulaVar(defaultLabel = "累计减免税额", labelId = 542238, dataType = "number") @Encrypt private String addUpTaxSavings; @@ -171,6 +195,7 @@ public class AddUpSituation { /** * 累计已预扣预缴税额 */ + @ElogTransform(name = "累计已预扣预缴税额") @SalaryFormulaVar(defaultLabel = "累计已预扣预缴税额", labelId = 542239, dataType = "number") @Encrypt private String addUpAdvanceTax; @@ -178,16 +203,19 @@ public class AddUpSituation { /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 创建人 */ + @ElogTransform(name = "创建人") private Long creator; /** @@ -198,6 +226,7 @@ public class AddUpSituation { /** * 租户ID */ + @ElogTransform(name = "租户") private String tenantKey; diff --git a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java index 7c45c9d2f..2f4c60104 100644 --- a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java +++ b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection; +import com.engine.salary.annotation.I18n; import com.engine.salary.annotation.SalaryFormulaVar; import lombok.AllArgsConstructor; import lombok.Builder; @@ -34,16 +35,19 @@ public class DataCollectionEmployee { //姓名 @SalaryFormulaVar(defaultLabel = "姓名", labelId = 25034, dataType = "string") + @I18n private String username; //部门 @SalaryFormulaVar(defaultLabel = "部门", labelId = 27511, dataType = "string") + @I18n private String departmentName; @SalaryFormulaVar(defaultLabel = "部门ID", labelId = 22279, dataType = "string") private Long departmentId; //分部名 @SalaryFormulaVar(defaultLabel = "分部", labelId = 33553, dataType = "string") + @I18n private String subcompanyName; @SalaryFormulaVar(defaultLabel = "分部ID", labelId = 513534, dataType = "string") private Long subcompanyid; @@ -56,6 +60,7 @@ public class DataCollectionEmployee { //岗位 @SalaryFormulaVar(defaultLabel = "岗位", labelId = 6086, dataType = "string") + @I18n private String jobtitleName; @SalaryFormulaVar(defaultLabel = "岗位ID", labelId = 544645, dataType = "string") private Long jobtitleId; diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionDTO.java index b8a264c7f..1f74fe941 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionDTO.java @@ -43,6 +43,7 @@ public class AddUpDeductionDTO { @ExcelProperty(index = 0) @SalaryTableColumn(text = "姓名", width = "10%", column = "username") @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) + @I18n private String username; /** @@ -64,6 +65,7 @@ public class AddUpDeductionDTO { @ExcelProperty(index = 2) @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName", labelId = 27511) + @I18n private String departmentName; /** diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java index fcfe30971..542fe5a02 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java @@ -1,10 +1,7 @@ package com.engine.salary.entity.datacollection.dto; import com.cloudstore.eccom.pc.table.WeaTableType; -import com.engine.salary.annotation.Encrypt; -import com.engine.salary.annotation.SalaryTable; -import com.engine.salary.annotation.SalaryTableColumn; -import com.engine.salary.annotation.TableTitle; +import com.engine.salary.annotation.*; import com.engine.salary.util.excel.ExcelProperty; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; @@ -31,6 +28,7 @@ public class AddUpDeductionRecordDTO { private Long employeeId; @ExcelProperty(index = 0) + @I18n private String username; //申报月份 @@ -56,6 +54,7 @@ public class AddUpDeductionRecordDTO { @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName", labelId = 27511) @ExcelProperty(index = 3) + @I18n private String departmentName; //手机号 diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java index 12285f3f5..96e7a67ee 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java @@ -39,6 +39,7 @@ public class AddUpSituationDTO { @SalaryTableColumn(text = "姓名", width = "10%", column = "username") @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) @ExcelProperty(index = 0) + @I18n private String username; // // @SalaryTableColumn(text = "申报月份", width = "10%", column = "username") @@ -59,6 +60,7 @@ public class AddUpSituationDTO { @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName", labelId = 27511) @ExcelProperty(index = 2) + @I18n private String departmentName; //手机号 diff --git a/src/com/engine/salary/entity/datacollection/dto/AttendQuoteDataBaseDTO.java b/src/com/engine/salary/entity/datacollection/dto/AttendQuoteDataBaseDTO.java index e261a0f59..a3b7ea962 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AttendQuoteDataBaseDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AttendQuoteDataBaseDTO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.dto; +import com.engine.salary.annotation.I18n; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -34,11 +35,13 @@ public class AttendQuoteDataBaseDTO { /** * 姓名 */ + @I18n private String username; /** * 部门 */ + @I18n private String departmentName; /** diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java index 9b78f16ac..03fc7634e 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java @@ -37,6 +37,7 @@ public class OtherDeductionListDTO { @SalaryTableColumn(text = "姓名", width = "10%", column = "username") @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) @ExcelProperty(index = 0) + @I18n private String username; //个税扣缴义务人 @@ -54,6 +55,7 @@ public class OtherDeductionListDTO { @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName", labelId = 27511) @ExcelProperty(index = 2) + @I18n private String departmentName; //手机号 diff --git a/src/com/engine/salary/entity/datacollection/dto/SpecialAddDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/SpecialAddDeductionListDTO.java index f77f7d45a..97589deaf 100644 --- a/src/com/engine/salary/entity/datacollection/dto/SpecialAddDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/SpecialAddDeductionListDTO.java @@ -37,6 +37,7 @@ public class SpecialAddDeductionListDTO { @SalaryTableColumn(text = "姓名", width = "10%", column = "username") @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) @ExcelProperty(index = 0) + @I18n private String username; //个税扣缴义务人 @@ -54,6 +55,7 @@ public class SpecialAddDeductionListDTO { @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName", labelId = 27511) @ExcelProperty(index = 2) + @I18n private String departmentName; //手机号 diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionQueryParam.java index bd23b85fa..15cf175d7 100644 --- a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionQueryParam.java +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionQueryParam.java @@ -67,4 +67,7 @@ public class AddUpDeductionQueryParam extends BaseQueryParam { //累计专项附加扣除id(获取明细) private Long accumulatedSpecialAdditionalDeductionId; + + //下载模板时是否带出现有数据 + private boolean hasData; } diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpSituationQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpSituationQueryParam.java index c8fbd1ef6..70998028f 100644 --- a/src/com/engine/salary/entity/datacollection/param/AddUpSituationQueryParam.java +++ b/src/com/engine/salary/entity/datacollection/param/AddUpSituationQueryParam.java @@ -62,4 +62,7 @@ public class AddUpSituationQueryParam extends BaseQueryParam { //累计情况id(获取明细) private Long accumulatedSituationId; + + //下载模板时是否带出现有数据 + private boolean hasData; } diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java index 3f1f0a832..40eb45720 100644 --- a/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java @@ -38,6 +38,8 @@ public class AttendQuoteFieldQueryParam extends BaseQueryParam { //来源。1:自定义、2:考勤模块 private Integer sourceType; + private Integer enableStatus; + /** * 查询where语句 * diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionQueryParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionQueryParam.java index d406380ed..d3683d46b 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDeductionQueryParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionQueryParam.java @@ -58,4 +58,8 @@ public class OtherDeductionQueryParam extends BaseQueryParam { //其他免税扣除id(获取明细) private Long otherTaxExemptDeductionId; + + + //下载模板是否带数据 + private boolean hasData; } diff --git a/src/com/engine/salary/entity/datacollection/param/SpecialAddDeductionQueryParam.java b/src/com/engine/salary/entity/datacollection/param/SpecialAddDeductionQueryParam.java index a9e887bb7..26c478a8c 100644 --- a/src/com/engine/salary/entity/datacollection/param/SpecialAddDeductionQueryParam.java +++ b/src/com/engine/salary/entity/datacollection/param/SpecialAddDeductionQueryParam.java @@ -54,4 +54,7 @@ public class SpecialAddDeductionQueryParam extends BaseQueryParam { //其他免税扣除id(获取明细) private Long specialAddDeductionId; + + //下载模板是否带数据 + private boolean hasData; } diff --git a/src/com/engine/salary/entity/datacollection/po/AttendQuoteDataValuePO.java b/src/com/engine/salary/entity/datacollection/po/AttendQuoteDataValuePO.java index 9e76422f0..b9c8cd84f 100644 --- a/src/com/engine/salary/entity/datacollection/po/AttendQuoteDataValuePO.java +++ b/src/com/engine/salary/entity/datacollection/po/AttendQuoteDataValuePO.java @@ -5,8 +5,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.Collection; import java.util.Date; +import java.util.List; /** * 考勤引用数据值表 @@ -63,6 +63,6 @@ public class AttendQuoteDataValuePO { private String tenantKey; //查询参数 - private Collection employeeIds; + private List employeeIds; } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/po/AttendQuoteFieldPO.java b/src/com/engine/salary/entity/datacollection/po/AttendQuoteFieldPO.java index 80211a702..a237aa48f 100644 --- a/src/com/engine/salary/entity/datacollection/po/AttendQuoteFieldPO.java +++ b/src/com/engine/salary/entity/datacollection/po/AttendQuoteFieldPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -15,54 +16,78 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_attend_quote_field +@ElogTransform( name ="考勤引用字段") public class AttendQuoteFieldPO { /** * 主键 */ + @ElogTransform( name ="主键") private Long id; + /** * 字段名称 */ + @ElogTransform( name ="字段名称") private String fieldName; + /** * 来源。1:自定义、2:考勤模块 */ + @ElogTransform( name ="来源") private Integer sourceType; + /** * 字段类型。1:数值、2:文本 */ + @ElogTransform( name ="字段类型") private Integer fieldType; + /** * 是否启用。0:否、1:是 */ + @ElogTransform( name ="是否启用") private Integer enableStatus; + /** * 编码(对应考勤模块字段) */ + @ElogTransform( name ="编码") private String code; + /** * 备注 */ + @ElogTransform( name ="备注") private String description; + /** * 创建时间 */ + @ElogTransform( name ="创建时间") private Date createTime; + /** * 更新时间 */ + @ElogTransform( name ="更新时间") private Date updateTime; + /** * 创建人 */ + @ElogTransform( name ="创建人") private Long creator; + /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform( name ="是否已删除") private Integer deleteType; + /** * 租户ID */ + @ElogTransform( name ="租户") private String tenantKey; } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/po/AttendQuotePO.java b/src/com/engine/salary/entity/datacollection/po/AttendQuotePO.java index 06baa6acc..133e3f788 100644 --- a/src/com/engine/salary/entity/datacollection/po/AttendQuotePO.java +++ b/src/com/engine/salary/entity/datacollection/po/AttendQuotePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.datacollection.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,66 +17,93 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_attend_quote +@ElogTransform(name = "考勤数据") public class AttendQuotePO { /** * 主键 */ + @ElogTransform(name = "主键") private Long id; /** * 税款所属期 */ + @ElogTransform(name = "税款所属期") private Date salaryYearMonth; /** * 年份 */ + @ElogTransform(name = "年份") private Integer year; + /** * 月份 */ + @ElogTransform(name = "月份") private Integer month; + /** * 薪资账套表的主键id */ + @ElogTransform(name = "薪资账套id") private Long salarySobId; + /** * 来源。1:引用、2:导入 */ + @ElogTransform(name = "来源") private Integer sourceType; + /** * 薪资核算状态。0:未核算、1:已核算 */ + @ElogTransform(name = "薪资核算状态") private Integer salaryAccountingStatus; + /** * 考勤周期 */ + @ElogTransform(name = "考勤周期") private String attendCycle; + /** * 薪资周期 */ + @ElogTransform(name = "薪资周期") private String salaryCycle; + /** * 备注 */ + @ElogTransform(name = "备注") private String description; + /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; + /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; + /** * 创建人 */ + @ElogTransform(name = "创建人") private Long creator; + /** * 是否已删除。0:未删除、1:已删除 */ private Integer deleteType; + /** * 租户ID */ + @ElogTransform(name = "租户") private String tenantKey; //主键id diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index e97d527ea..4217132db 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po; import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,31 +19,37 @@ import java.util.List; @Builder @NoArgsConstructor @AllArgsConstructor +@ElogTransform( name = "其他免税扣除") public class OtherDeductionPO { /** * 主键 */ + @ElogTransform( name="主键id" ) private Long id; /** * 人员信息表的主键id */ + @ElogTransform( name ="人员id") private Long employeeId; /** * 个税扣缴义务人的主键id */ + @ElogTransform( name ="个税扣缴义务人id") private Long taxAgentId; /** * 申报月份 */ + @ElogTransform( name ="税款所属期") private Date declareMonth; /** * 商业健康保险 */ + @ElogTransform( name ="商业健康保险") @SalaryFormulaVar(defaultLabel = "商业健康保险", labelId = 542292, dataType = "number") @Encrypt private String businessHealthyInsurance; @@ -50,6 +57,7 @@ public class OtherDeductionPO { /** * 税延养老保险 */ + @ElogTransform( name ="税延养老保险") @SalaryFormulaVar(defaultLabel = "税延养老保险", labelId = 542293, dataType = "number") @Encrypt private String taxDelayEndowmentInsurance; @@ -57,6 +65,7 @@ public class OtherDeductionPO { /** * 其他 */ + @ElogTransform( name ="其他") @SalaryFormulaVar(defaultLabel = "其他", labelId = 25740, dataType = "number") @Encrypt private String otherDeduction; @@ -64,6 +73,7 @@ public class OtherDeductionPO { /** * 准予扣除的捐赠额 */ + @ElogTransform( name ="准予扣除的捐赠额") @SalaryFormulaVar(defaultLabel = "准予扣除的捐赠额", labelId = 542294, dataType = "number") @Encrypt private String deductionAllowedDonation; @@ -71,6 +81,7 @@ public class OtherDeductionPO { /** * 个人养老金 */ + @ElogTransform( name ="个人养老金") @SalaryFormulaVar(defaultLabel = "个人养老金", labelId = 542295, dataType = "number") @Encrypt private String privatePension; @@ -78,16 +89,19 @@ public class OtherDeductionPO { /** * 创建时间 */ + @ElogTransform( name ="创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform( name ="更新时间") private Date updateTime; /** * 创建人 */ + @ElogTransform( name ="创建人id") private Long creator; /** @@ -98,6 +112,7 @@ public class OtherDeductionPO { /** * 租户ID */ + @ElogTransform( name ="租户") private String tenantKey; private List employeeIds; diff --git a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java index 9aaaa7363..ce5f49f8a 100644 --- a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java @@ -1,12 +1,14 @@ package com.engine.salary.entity.datacollection.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; +import java.util.Collection; import java.util.Date; /** @@ -17,83 +19,103 @@ import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) +@ElogTransform( name = "专项附加扣除" ) public class SpecialAddDeductionPO { + @ElogTransform( name="主键" ) private Long id; /** * 人员信息表的主键id */ + @ElogTransform( name="人员id" ) private Long employeeId; /** * 个税扣缴义务人的主键id */ + @ElogTransform( name="个税扣缴义务人id" ) private Long taxAgentId; /** * 子女教育 */ + @ElogTransform( name="子女教育" ) @Encrypt private String childrenEducation; /** * 继续教育 */ + @ElogTransform( name="继续教育" ) @Encrypt private String continuingEducation; /** * 住房贷款利息 */ + @ElogTransform( name="住房贷款利息" ) @Encrypt private String housingLoanInterest; /** * 住房租金 */ + @ElogTransform( name="住房租金" ) @Encrypt private String housingRent; /** * 赡养老人 */ + @ElogTransform( name="赡养老人" ) @Encrypt private String supportingElder; /** * 大病医疗 */ + @ElogTransform( name="大病医疗" ) @Encrypt private String seriousIllnessTreatment; /** * 婴幼儿照护 */ + @ElogTransform( name="婴幼儿照护" ) @Encrypt private String infantCare; /** * 创建时间 */ + @ElogTransform( name="创建时间" ) private Date createTime; /** * 更新时间 */ + @ElogTransform( name="更新时间" ) private Date updateTime; /** * 创建人 */ + @ElogTransform( name="创建人" ) private Long creator; /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform( name="是否已删除" ) private Integer deleteType; /** * 租户ID */ + @ElogTransform( name="租户" ) private String tenantKey; + + private Collection employeeIds; + + private Collection ids; } \ No newline at end of file diff --git a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java index 71a2e3fc6..837d7ea7f 100644 --- a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java +++ b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.extemp.po; import com.engine.salary.annotation.TableTitle; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,114 +19,167 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_external_employee +@ElogTransform( name = "非系统人员") public class ExtEmpPO { + @ElogTransform(name = "主键id") private Long id; + /** * 姓名 */ @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) + @ElogTransform(name = "姓名") private String username; + /** * 部门 */ @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName", labelId = 27511) + @ElogTransform(name = "部门") private String departmentName; + /** * 部门ID */ + @ElogTransform(name = "部门ID") private Long departmentId; + /** * 分部 */ + @TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName", labelId = 33553) + @ElogTransform(name = "分部") private String subcompanyName; + /** * 分部ID */ + @ElogTransform(name = "分部ID") private Long subcompanyId; + /** * 岗位 */ // @TableTitle(title = "岗位", dataIndex = "jobtitleName", key = "jobtitleName") + @ElogTransform(name = "岗位") private String jobtitleName; + /** * 岗位ID */ + @ElogTransform(name = "岗位ID") private Long jobtitleId; + /** * 入职日期 */ @TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate", labelId = 1516) + @ElogTransform(name = "入职日期") private String companystartdate; + /** * 手机 */ + @ElogTransform(name = "手机") private String mobile; + /** * 状态编码 */ + @ElogTransform(name = "状态编码") private String status; + /** * 工号 */ @TableTitle(title = "工号", dataIndex = "workcode", key = "workcode", labelId = 1933) + @ElogTransform(name = "工号") private String workcode; + /** * 性别 */ + @ElogTransform(name = "性别") private String sex; + /** * 邮件 */ + @ElogTransform(name = "邮件") private String email; + /** * 电话 */ + @ElogTransform(name = "电话") private String telephone; + /** * 职称 */ + @ElogTransform(name = "职称") private String jobcall; + /** * 出生日期 */ + @ElogTransform(name = "出生日期") private String birthday; + /** * 身份证号码 */ + @ElogTransform(name = "身份证号码") private String idNo; + /** * 本人开户的银行卡卡号 */ + @ElogTransform(name = "本人开户的银行卡卡号") private String bankCardNum; + /** * 本人开户的银行卡开户支行全称 */ + @ElogTransform(name = "本人开户的银行卡开户支行全称") private String bankName; + /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform(name = "是否已删除") private Integer deleteType; + /** * 创建人 */ + @ElogTransform(name = "创建人") private Long creator; + /** * 修改人 */ + @ElogTransform(name = "修改人") private Long modifier; + /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; + /** * 修改时间 */ + @ElogTransform(name = "修改时间") private Date updateTime; + /** * 租户ID */ + @ElogTransform(name = "租户ID") private String tenantKey; private Collection ids; diff --git a/src/com/engine/salary/entity/hrm/DeptInfo.java b/src/com/engine/salary/entity/hrm/DeptInfo.java index 12f2f61f9..c9b6876ef 100644 --- a/src/com/engine/salary/entity/hrm/DeptInfo.java +++ b/src/com/engine/salary/entity/hrm/DeptInfo.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.hrm; +import com.engine.salary.annotation.I18n; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -24,6 +25,7 @@ public class DeptInfo { /** * 名称 */ + @I18n private String name; /** diff --git a/src/com/engine/salary/entity/hrm/PositionInfo.java b/src/com/engine/salary/entity/hrm/PositionInfo.java index b88828139..2eb787624 100644 --- a/src/com/engine/salary/entity/hrm/PositionInfo.java +++ b/src/com/engine/salary/entity/hrm/PositionInfo.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.hrm; +import com.engine.salary.annotation.I18n; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -24,6 +25,7 @@ public class PositionInfo { /** * 名称 */ + @I18n private String name; diff --git a/src/com/engine/salary/entity/hrm/SubCompanyInfo.java b/src/com/engine/salary/entity/hrm/SubCompanyInfo.java index 84fb417f9..e9e2637d3 100644 --- a/src/com/engine/salary/entity/hrm/SubCompanyInfo.java +++ b/src/com/engine/salary/entity/hrm/SubCompanyInfo.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.hrm; +import com.engine.salary.annotation.I18n; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -24,5 +25,6 @@ public class SubCompanyInfo { /** * 名称 */ + @I18n private String name; } diff --git a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java index 6a23857a5..5b6c4d2c9 100644 --- a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java +++ b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java @@ -6,7 +6,7 @@ import com.engine.salary.entity.report.po.SalaryAcctResultReportPO; import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTempPO; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -62,7 +62,6 @@ public class SalaryAcctResultReportBO { .collect(Collectors.toList()); } - public static List convert2ReportPO(Collection temps, Map emps) { // Map longDataCollectionEmployeeMap = SalaryEntityUtil.convert2Map(emps, DataCollectionEmployee::getEmployeeId); if (CollectionUtils.isEmpty(temps)) { diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java index bd703622e..6061c6add 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java @@ -369,7 +369,8 @@ public class SalaryBillBO { return; } - content = content.replace("{薪资所属月}", SalaryDateUtil.getFormatYearMonth(salaryBillSendParam.getSalaryDate())); + content = content.replace("\n", "\r\n") + .replace("{薪资所属月}", SalaryDateUtil.getFormatYearMonth(salaryBillSendParam.getSalaryDate())); for (SalaryTemplateSalaryItemListDTO item : salaryBillSendParam.getEmployeeInformation().getItems()) { content = content.replace("{" + item.getName() + "}", item.getSalaryItemValue()); @@ -645,7 +646,7 @@ public class SalaryBillBO { boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString())) || (isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString()) - && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString()))==0); + && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0); if (!isHide) { // 4.2.薪资项目 emailContent.append(""); @@ -725,7 +726,7 @@ public class SalaryBillBO { boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString())) || (isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString()) - && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString()))==0); + && BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0); if (!isHide) { // 4.2.薪资项目 emailContent.append(""); diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java index 90289b8db..873b4f466 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java @@ -79,8 +79,10 @@ public class SalaryTemplateBO { .autoSendDayOfMonth(saveParam.getAutoSendDayOfMonth()) .autoSendTimeOfDay(saveParam.getAutoSendTimeOfDay()) .ackFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0) + .feedbackStatus(saveParam.getFeedbackStatus()?1:0) .autoAckDays(saveParam.getAutoAckDays()) .feedbackUrl(saveParam.getFeedbackUrl()) + .mobileFeedbackUrl(saveParam.getMobileFeedbackUrl()) .createTime(new Date()) .updateTime(new Date()) .creator(employeeId) diff --git a/src/com/engine/salary/entity/salaryBill/dto/MySalaryShowSetDTO.java b/src/com/engine/salary/entity/salaryBill/dto/MySalaryShowSetDTO.java new file mode 100644 index 000000000..7ca948821 --- /dev/null +++ b/src/com/engine/salary/entity/salaryBill/dto/MySalaryShowSetDTO.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.salaryBill.dto; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description: 我的薪资福利显示设置 + * @Author: wangxiangzhong + * @Date: 2023/8/7 13:05 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("工资单确认和反馈") +public class MySalaryShowSetDTO { + + /** + * 是否显示工资单列表 + */ + private Boolean salaryShowStatus; + + /** + * 是否显示社保福利列表 + */ + // private Boolean welfareShowStatus; + + /** + * 是否显示调薪记录列表 + */ + private Boolean adjustShowStatus; + + /** + * 是否显示个税扣缴义务人列 + */ + private Boolean taxAgentShowStatus; +} diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java index 340e97387..15b336d69 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java @@ -18,15 +18,26 @@ import lombok.NoArgsConstructor; public class SalaryBillAckFeedbackDTO { /** - * 工资单确认反馈是否开启。0:否,1:是 + * 工资单确认是否开启。0:否,1:是 */ private String ackStatus; + /** + * 工资单反馈是否开启。0:否,1:是 + */ + private String feedbackStatus; + /** * 反馈地址 */ private String feedBackUrl; + + /** + * 移动端反馈地址 + */ + private String mobileFeedbackUrl; + /** * 超时自动确认天数 */ diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java index 3f76a30a8..93f0ec5e6 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java @@ -82,6 +82,11 @@ public class SalaryTemplateBaseSetDTO { */ private Boolean ackFeedbackStatus; + /** + * 工资单确认反馈状态 + */ + private Boolean feedbackStatus; + /** * 自动确认超时天数 */ @@ -92,4 +97,10 @@ public class SalaryTemplateBaseSetDTO { * */ private String feedbackUrl; + + /** + * 移动端反馈流程地址 + * + */ + private String mobileFeedbackUrl; } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java index 6248c6dc2..3d0c831b1 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java @@ -4,6 +4,7 @@ import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.SalaryTableOperate; import com.engine.salary.annotation.TableTitle; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,36 +23,46 @@ import lombok.NoArgsConstructor; @SalaryTableOperate(index = "2", text = "删除" ), @SalaryTableOperate(index = "3", text = "操作日志" ) }) +@ElogTransform(name = "工资单模板") public class SalaryTemplateListDTO { //主键id @SalaryTableColumn(column = "id", display = false) @TableTitle(title = "id", dataIndex = "id", key = "id",display = false) + @ElogTransform(name = "id") private Long id; //工资单模板名称 @SalaryTableColumn(text = "工资单模板名称", width = "20%", column = "name") @TableTitle(title = "工资单模板名称", dataIndex = "name", key = "name", labelId = 543584) + @ElogTransform(name = "工资单模板名称") private String name; //补发工资单模板名称 @SalaryTableColumn(text = "补发工资单模板名称", width = "20%", column = "replenishName") @TableTitle(title = "补发工资单模板名称", dataIndex = "replenishName", key = "replenishName", labelId = 543585) + @ElogTransform(name = "补发工资单模板名称") private String replenishName; //所属薪资账套 @SalaryTableColumn(text = "所属薪资账套", width = "20%", column = "salarySob") @TableTitle(title = "所属薪资账套", dataIndex = "salarySob", key = "salarySob", labelId = 544387) + @ElogTransform(name = "所属薪资账套") private String salarySob; //默认使用 @SalaryTableColumn(text = "默认使用", width = "20%", column = "useType") @TableTitle(title = "默认使用", dataIndex = "useType", key = "useType", labelId = 543294) + @ElogTransform(name = "默认使用") private String useType; // 备注 @SalaryTableColumn(text = "备注", width = "20%", column = "description") @TableTitle(title = "备注", dataIndex = "description", key = "description", labelId = 545315) + @ElogTransform(name = "备注") private String description; + + // 薪资账套id + private Long salarySobId; } diff --git a/src/com/engine/salary/entity/salaryBill/dto/salaryBillViewingLimitSetting.java b/src/com/engine/salary/entity/salaryBill/dto/salaryBillViewingLimitSetting.java index 34bf14572..8bd3a1ceb 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/salaryBillViewingLimitSetting.java +++ b/src/com/engine/salary/entity/salaryBill/dto/salaryBillViewingLimitSetting.java @@ -25,4 +25,9 @@ public class salaryBillViewingLimitSetting { */ private Integer limitMonth; + /** + * 首次查看后多少分钟不能查看工资单 + */ + private Integer burningAfterReadingMin; + } diff --git a/src/com/engine/salary/entity/salaryBill/param/SalaryBillSalaryItemQueryParam.java b/src/com/engine/salary/entity/salaryBill/param/SalaryBillSalaryItemQueryParam.java index 26c819771..fa5540965 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalaryBillSalaryItemQueryParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalaryBillSalaryItemQueryParam.java @@ -16,6 +16,8 @@ public class SalaryBillSalaryItemQueryParam extends BaseQueryParam { private Long groupId; + private String groupName; + private Boolean isReplenish; private List existSalaryItemIds; diff --git a/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailListQueryParam.java b/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailListQueryParam.java index 59c176d5f..ec7ec4264 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailListQueryParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailListQueryParam.java @@ -47,7 +47,12 @@ public class SalarySendDetailListQueryParam extends BaseQueryParam { private Long taxAgent; // 部门id") - private Long department; + private List departmentIds; + private String departmentIdStr; + + // 分部id + private List subCompanyIds; + private String subCompanyIdStr; // 岗位id") private Long position; diff --git a/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailQueryParam.java b/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailQueryParam.java index ae460401a..37ed6c107 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailQueryParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalarySendDetailQueryParam.java @@ -49,6 +49,9 @@ public class SalarySendDetailQueryParam extends BaseQueryParam { // 部门id") private List departmentIds; + // 分部id + private List subCompanyIds; + // 岗位id") private List positionIds; diff --git a/src/com/engine/salary/entity/salaryBill/param/SalarySendInfoQueryParam.java b/src/com/engine/salary/entity/salaryBill/param/SalarySendInfoQueryParam.java index 73b8da3a9..f1175733a 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalarySendInfoQueryParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalarySendInfoQueryParam.java @@ -50,6 +50,9 @@ public class SalarySendInfoQueryParam extends BaseQueryParam { // 部门id") private List departmentIds; + // 分部id + private List subCompanyIds; + // 岗位id") private List positionIds; @@ -80,6 +83,10 @@ public class SalarySendInfoQueryParam extends BaseQueryParam { // @JsonIgnore private List sendStatuss; + private String departmentIdStr; + + private String subCompanyIdStr; + public static String checkParam(SalarySendInfoQueryParam saveParam, User user) { if (saveParam.getSalarySendId() == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542411, "工资单发放Id必传")); diff --git a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateCopyParam.java b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateCopyParam.java index b33023692..f1d723b27 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateCopyParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateCopyParam.java @@ -25,6 +25,8 @@ public class SalaryTemplateCopyParam { // 模板名称") private String name; + private Long salarySobId; + public static void checkParam(SalaryTemplateCopyParam copyParam, User user) { if (copyParam.getId() == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544148,"id必选")); diff --git a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java index 7c980a28d..a5c672c12 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java @@ -97,10 +97,15 @@ public class SalaryTemplateSaveParam { private List replenishSalaryItemSetting; /** - * 工资单确认反馈状态 + * 工资单确认状态 */ private Boolean ackFeedbackStatus; + /** + * 工资单反馈状态 + */ + private Boolean feedbackStatus; + /** * 自动确认超时天数 */ @@ -111,6 +116,11 @@ public class SalaryTemplateSaveParam { */ private String feedbackUrl; + /** + * 移动端反馈流程地址 + */ + private String mobileFeedbackUrl; + List salaryBillItemNameSetting; public static void checkParam(SalaryTemplateSaveParam saveParam, User user) { diff --git a/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java b/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java index 48f8833b1..8dea3fc47 100644 --- a/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java +++ b/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java @@ -116,4 +116,9 @@ public class SalarySendInfoPO { * 租户ID */ private String tenantKey; + + /** + * 首次查看时间 + */ + private Date firstReadingTime; } diff --git a/src/com/engine/salary/entity/salaryBill/po/SalarySendPO.java b/src/com/engine/salary/entity/salaryBill/po/SalarySendPO.java index 9d857212f..7249346b6 100644 --- a/src/com/engine/salary/entity/salaryBill/po/SalarySendPO.java +++ b/src/com/engine/salary/entity/salaryBill/po/SalarySendPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryBill.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,73 +17,87 @@ import java.util.Date; @AllArgsConstructor ////hrsa_salary_send") ////工资单发放表") +@ElogTransform(name = "工资单发放") public class SalarySendPO { /** * 主键id */ + @ElogTransform(name = "id") private Long id; /** * 薪资所属月 */ + @ElogTransform(name = "薪资所属月") private Date salaryMonth; /** * 薪资核算id */ + @ElogTransform(name = "薪资核算id") private Long salaryAccountingId; /** * 薪资账套id */ + @ElogTransform(name = "薪资账套id") private Long salarySobId; /** * 已发送数量 */ + @ElogTransform(name = "已发送数量") private Integer sendNum; /** * 发送总数 */ + @ElogTransform(name = "发送总数") private Integer sendTotal; /** * 最后发送时间 */ + @ElogTransform(name = "最后发送时间") private Date lastSendTime; /** * 发放状态。0:未冻结、1:已冻结 */ + @ElogTransform(name = "发放状态") private Integer sendStatus; /** * 核算类型。0:正常,1:补发 */ + @ElogTransform(name = "核算类型") private Integer salaryAcctType; /** * 创建人 */ + @ElogTransform(name = "创建人") private Long creator; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform(name = "是否已删除") private Integer deleteType; /** diff --git a/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java b/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java index a428a68ed..825f82759 100644 --- a/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java +++ b/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryBill.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,155 +20,185 @@ import java.util.Date; @AllArgsConstructor ////hrsa_salary_template") ////工资单模板表") +@ElogTransform(name = "工资单模板") public class SalaryTemplatePO { /** * 主键 */ + @ElogTransform(name = "id") private Long id; /** * 名称 */ + @ElogTransform(name = "名称") private String name; /** * 薪资账套表的主键id */ + @ElogTransform(name = "薪资账套id") private Long salarySobId; /** * 使用类型。0:普通、1:默认 */ + @ElogTransform(name = "使用类型") private Integer useType; /** * 备注 */ + @ElogTransform(name = "备注") private String description; /** * 消息中心开启状态。0:关、1:开 ,默认开启 */ + @ElogTransform(name = "消息中心开启状态") private Integer msgStatus; /** * 邮箱开启状态。0:关、1:开,默认关闭 */ + @ElogTransform(name = "邮箱开启状态") private Integer emailStatus; /** * 发送地址:公共邮箱账号id */ + @ElogTransform(name = "邮箱发送地址") private Long sendEmailId; /** * 短信开启状态。0:关、1:开,默认关闭 */ + @ElogTransform(name = "短信开启状态") private Integer smsStatus; /** * 短信模板设置 */ + @ElogTransform(name = "短信模板设置") private String smsSetting; /** * 薪酬水印 */ + @ElogTransform(name = "薪酬水印") private String salaryWatermark; /** * 主题 */ + @ElogTransform(name = "主题") private String theme; /** * 背景图 */ + @ElogTransform(name = "背景图") private String background; /** * 文本内容 */ + @ElogTransform(name = "文本内容") private String textContent; /** * 文本内容显示位置。1:薪资项目前、2:薪资项目后 */ + @ElogTransform(name = "文本内容显示位置") private Integer textContentPosition; /** * 薪资项为空时不显示开启状态。0:关、1:开 */ + @ElogTransform(name = "薪资项为空时不显示开启状态") private Integer salaryItemNullStatus; /** * 薪资项为0时不显示开启状态。0:关、1:开 */ + @ElogTransform(name = "薪资项为0时不显示开启状态") private Integer salaryItemZeroStatus; /** * 薪资项目设置 */ + @ElogTransform(name = "薪资项目设置") private String salaryItemSetting; //=====================补发=================== /** * 补发工资单模板名称 */ + @ElogTransform(name = "补发工资单模板名称") private String replenishName; /** * 补发工资单名单生成规则 */ + @ElogTransform(name = "补发工资单名单生成规则") private String replenishRule; /** * 补发薪资项目设置 */ + @ElogTransform(name = "补发薪资项目设置") private String replenishSalaryItemSetting; /** * 是否启用工资单定时发送。0:未启用、1:已启用 */ + @ElogTransform(name = "是否启用工资单定时发送") private Integer autoSendStatus; /** * 自动发送工资单周期1:本月、2:上月 */ + @ElogTransform(name = "自动发送工资单周期1") private Integer autoSendCycleType; /** * 每月几号自动发送工资单 */ + @ElogTransform(name = "每月几号自动发送工资单") private String autoSendDayOfMonth; /** * 自动发放时间 */ + @ElogTransform(name = "自动发放时间") private String autoSendTimeOfDay; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 创建人 */ + @ElogTransform(name = "创建人") private Long creator; /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform(name = "是否已删除") private Integer deleteType; /** @@ -178,20 +209,36 @@ public class SalaryTemplatePO { /** * 工资单确认反馈状态 */ + @ElogTransform(name = "工资单确认反馈状态") private Integer ackFeedbackStatus; + /** + * 工资单确认反馈状态 + */ + private Integer feedbackStatus; + /** * 自动确认超时天数 */ + @ElogTransform(name = "自动确认超时天数") private Integer autoAckDays; /** * 反馈流程地址 * */ + @ElogTransform(name = "反馈流程地址") private String feedbackUrl; + /** + * 移动端反馈流程地址 + * + */ + @ElogTransform(name = "移动端反馈流程地址") + private String mobileFeedbackUrl; + + private Collection salarySobIds; } diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index 74835472d..8251ea51f 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryacct.bo; +import cn.hutool.core.util.NumberUtil; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.common.LocalDateRange; import com.engine.salary.constant.SalaryFormulaFieldConstant; @@ -18,6 +19,7 @@ import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; +import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.enums.salarysob.SalarySobAdjustRuleTypeEnum; @@ -551,6 +553,10 @@ public class CalculateFormulaVarBO { } // 填充到返回结果集中 employeeMap.forEach((key, po) -> { + // 获取po的状态 + if(po.getStatus() != null && NumberUtil.isNumber(po.getStatus())) { + po.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(po.getStatus()))); + } List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); Map map = JsonUtil.parseMap(po, String.class); formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java index db1fb0fa2..284acccb8 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java @@ -87,7 +87,9 @@ public class SalaryAcctRecordBO { } else if (SalaryAcctRecordStatusEnum.ARCHIVED == salaryAcctRecordStatusEnum && (salarySendMap.get(salaryAcctRecordPO.getId()).equals(Boolean.TRUE)) ){ btnList.add(new WeaTableOperate(SalaryI18nUtil.getI18nLabel(user.getLanguage(),33564, "查看"), null, "3")); btnList.add(new WeaTableOperate(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542637, "重新核算"), null, "5")); - btnList.add(new WeaTableOperate(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542638, "回算"), null, "4")); + if(salaryAcctRecordPO.getBackCalcStatus() == null || salaryAcctRecordPO.getBackCalcStatus() == NumberUtils.INTEGER_ZERO) { + btnList.add(new WeaTableOperate(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542638, "回算"), null, "4")); + } } else { btnList.add(new WeaTableOperate(SalaryI18nUtil.getI18nLabel(user.getLanguage(),33564, "查看"), null, "3")); btnList.add(new WeaTableOperate(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542637, "重新核算"), null, "4")); diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index d8df05ba1..dc0a516e5 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -27,6 +27,7 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.BeanUtils; @@ -172,7 +173,7 @@ public class SalaryAcctResultBO { List columns = Lists.newArrayList(); // 员工信息字段 for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName()), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName(), 0), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); } // 薪资项目分组下的薪资项目 for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { @@ -182,29 +183,29 @@ public class SalaryAcctResultBO { List childrenColumns = Lists.newArrayList(); for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } - WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName()), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); + WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName(), 0), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); columns.add(weaTableColumnWapper); } // 没有分类的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } // 回算的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getBackCalcItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } @@ -422,7 +423,9 @@ public class SalaryAcctResultBO { List salaryBackItemPOS, Map salaryBackItemFormula, Map formulaContentMap, - User user) { + User user, + List lockItems + ) { // 员工信息字段 Map employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee, user); @@ -457,7 +460,7 @@ public class SalaryAcctResultBO { name = Util.formatMultiLang(groupPO.getName(), String.valueOf(user.getLanguage())); List items = groupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, user)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, user, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(groupPO.getId()) @@ -470,7 +473,7 @@ public class SalaryAcctResultBO { List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); if (CollectionUtils.isNotEmpty(noGroupItems)) { List items = noGroupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, user)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, user, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(0L) @@ -541,7 +544,8 @@ public class SalaryAcctResultBO { SalaryItemPO salaryItemPO, Map resultValueMap, Map formulaContentMap, - User user) { + User user, + List lockItems) { SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(Optional.ofNullable(salarySobItemPO).map(SalarySobItemPO::getValueType).orElse(0)); String itemFormulaContent; @@ -569,6 +573,7 @@ public class SalaryAcctResultBO { // .canEdit(Objects.equals(Optional.ofNullable(salaryItemPO).map(SalaryItemPO::getUseInEmployeeSalary).orElse(0), 0)) .canEdit(true) .pattern(salarySobItemPO.getPattern()) + .lockStatus(lockItems.contains(salarySobItemPO.getSalaryItemId()) ? LockStatusEnum.LOCK.getValue() : LockStatusEnum.UNLOCK.getValue()) .build(); } @@ -635,6 +640,34 @@ public class SalaryAcctResultBO { .collect(Collectors.toList()); } + + public static List batchEditConvert2PO(Map salaryAcctResultOldPOMap, + List items, + SalaryAcctEmployeePO salaryAcctEmployee, + Long employeeId) { + if (CollectionUtils.isEmpty(items) || ObjectUtils.isEmpty(salaryAcctEmployee)) { + return Collections.emptyList(); + } + Date now = new Date(); + return items.stream() + .map(e -> SalaryAcctResultPO.builder() + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(e.getSalaryItemId()) + .salaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployee.getId()) + .employeeId(salaryAcctEmployee.getEmployeeId()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .resultValue(StringUtils.trim(e.getResultValue())) + .originResultValue(salaryAcctResultOldPOMap.get(salaryAcctEmployee.getId() + "-" + e.getSalaryItemId())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()) + .collect(Collectors.toList()); + } + public static Map buildEmployeeFieldName(User user) { Field[] declaredFields = SalaryFormulaEmployeeDTO.class.getDeclaredFields(); Map employeeFieldNameMap = Maps.newHashMapWithExpectedSize(declaredFields.length); diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultLogBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultLogBO.java index 985880f3c..f8270bb5b 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultLogBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultLogBO.java @@ -3,7 +3,7 @@ package com.engine.salary.entity.salaryacct.bo; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultLogPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctResultDataSourceEnum; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.lang3.math.NumberUtils; import java.util.ArrayList; diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java index 1929494a9..8fadd2670 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java @@ -71,6 +71,9 @@ public class SalaryAcctResultDetailDTO { // 保留小数位数 private Integer pattern; + + // 锁定状态 + private String lockStatus; } @Data diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java index cfe97aae9..81266c2d3 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java @@ -57,7 +57,7 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { private LocalDateRange dismissDate; //薪资核算人员列表主键id") - private Collection ids; + private List ids; private String workcode; } diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java new file mode 100644 index 000000000..89c06ad5e --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @ClassName SalaryAcctResultBatchUpdateParam + * @author Harryxzy + * @date 2023/12/4 13:48 + * @description 批量更新参数 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SalaryAcctResultBatchUpdateParam { + + //薪资核算记录的id + @DataCheck(require = true, message = "薪资核算记录ID不得为空") + private Long salaryAcctRecordId; + + //薪资项目的Id + @DataCheck(require = true, message = "薪资项目id不得为空") + private Long salaryItemId; + + // 薪资核算人员id + private List idList; + + //薪资项目值 + private String value; + +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index a96780605..65e608227 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.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; @@ -25,28 +26,33 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_salary_acct_emp +@ElogTransform(name = "薪资核算人员") public class SalaryAcctEmployeePO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 薪资核算的id */ + @ElogTransform(name = "核算记录id") @SalaryFormulaVar(defaultLabel = "核算记录id", labelId = 544646, dataType = "number") private Long salaryAcctRecordId; /** * 薪资账套id */ + @ElogTransform(name = "薪资账套id") @SalaryFormulaVar(defaultLabel = "薪资账套id", labelId = 544647, dataType = "number") private Long salarySobId; /** * 人员id */ + @ElogTransform(name = "人员id") @SalaryFormulaVar(defaultLabel = "人员ID", labelId = 128556, dataType = "number") private Long employeeId; @@ -55,43 +61,51 @@ public class SalaryAcctEmployeePO { * * @see DataCollectionEmployeeTypeEnum */ + @ElogTransform(name = "人员类型") private Integer employeeType; /** * 个税扣缴义务人id */ + @ElogTransform(name = "个税扣缴义务人id") @SalaryFormulaVar(defaultLabel = "个税扣缴义务人id", labelId = 544648, dataType = "number") private Long taxAgentId; /** * 薪资所属月 */ + @ElogTransform(name = "薪资所属月") @SalaryFormulaVar(defaultLabel = "薪资所属月", labelId = 542604, dataType = "string") private Date salaryMonth; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; //--------条件---------- @@ -101,6 +115,7 @@ public class SalaryAcctEmployeePO { private Collection taxAgentIds; private Collection salaryAcctRecordIds; + private Collection salarySobIds; private Collection employeeIds; diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java index 9b991f3a1..81db39c56 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryacct.po; import com.engine.salary.common.LocalDateRange; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import lombok.AllArgsConstructor; import lombok.Builder; @@ -25,43 +26,51 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor @Builder +@ElogTransform( name = "薪资核算记录" ) //hrsa_salary_acct_record public class SalaryAcctRecordPO { /** * 主键id */ + @ElogTransform( name = "主键id" ) private Long id; /** * 薪资所属月 */ + @ElogTransform( name = "薪资所属月" ) private Date salaryMonth; /** * 税款所属期 */ + @ElogTransform( name = "税款所属期" ) private Date taxCycle; /** * 薪资账套id */ + @ElogTransform( name = "薪资账套id" ) private Long salarySobId; /** * 核算状态 * @see SalaryAcctRecordStatusEnum */ + @ElogTransform( name = "核算状态" ) private Integer status; /** * 本次核算是账套(salarySobId)在本月(salaryMonth)的第几次核算 */ + @ElogTransform( name = "核算次数" ) private Integer acctTimes; /** * 是否是回算 0:不是回算、1:是回算 */ + @ElogTransform( name = "是否是回算" ) private Integer backCalcStatus; /** @@ -81,31 +90,37 @@ public class SalaryAcctRecordPO { /** * 备注 */ + @ElogTransform( name = "备注" ) private String description; /** * 租户key */ + @ElogTransform( name = "租户key" ) private String tenantKey; /** * 创建人id */ + @ElogTransform( name = "创建人id" ) private Long creator; /** * 是否删除 */ + @ElogTransform( name = "是否删除" ) private Integer deleteType; /** * 创建时间 */ + @ElogTransform( name = "创建时间" ) private Date createTime; /** * 更新时间 */ + @ElogTransform( name = "更新时间" ) private Date updateTime; /** diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java index 92bafa44e..4df634452 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryacct.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,63 +23,75 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //value = "hrsa_salary_acct_result +@ElogTransform( name="薪资核算结果" ) public class SalaryAcctResultPO { /** * 主键id */ + @ElogTransform( name="主键" ) private Long id; /** * 薪资账套id */ + @ElogTransform( name="薪资账套id" ) private Long salarySobId; /** * 薪资项目id */ + @ElogTransform( name="薪资项目id" ) private Long salaryItemId; /** * 薪资核算的id */ + @ElogTransform( name="薪资核算记录id" ) private Long salaryAcctRecordId; /** * 薪资核算人员id */ + @ElogTransform( name="薪资核算人员id" ) private Long salaryAcctEmpId; /** * 人员id */ + @ElogTransform( name="人员id" ) private Long employeeId; /** * 个税扣缴义务人id */ + @ElogTransform( name="个税扣缴义务人id" ) private Long taxAgentId; /** * 计算后的值 */ + @ElogTransform( name="计算后的值" ) @Encrypt private String resultValue; /** * 回算前的值 */ + @ElogTransform( name="回算前的值" ) @Encrypt private String originResultValue; /** * 租户key */ + @ElogTransform( name="租户" ) private String tenantKey; /** * 创建人id */ + @ElogTransform( name="创建人" ) private Long creator; /** @@ -89,11 +102,13 @@ public class SalaryAcctResultPO { /** * 创建时间 */ + @ElogTransform( name="创建时间" ) private Date createTime; /** * 更新时间 */ + @ElogTransform( name="更新时间" ) private Date updateTime; //条件 diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java index e4223529b..dc8ca458b 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java @@ -19,7 +19,7 @@ import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java index 115b2eed5..70c8de479 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java @@ -25,7 +25,7 @@ import com.engine.salary.util.excel.ExcelComment; import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveItemBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveItemBO.java index dce60849a..21a07a571 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveItemBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveItemBO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.salaryarchive.bo; import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustValidDTO; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; +import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -21,6 +22,31 @@ public class SalaryArchiveItemBO { return "SalaryArchiveItemBO{}"; } + public static List buildLogEntity(List salaryArchiveItemSaves) { + List salaryArchiveItemSaveLogs = Lists.newArrayList(); + for (SalaryArchiveItemPO sai : salaryArchiveItemSaves) { + // BeanUtils.copyProperties(sai, saiNew);性能差 + salaryArchiveItemSaveLogs.add(SalaryArchiveItemPO.builder() + .id(sai.getId()) + .salaryArchiveId(sai.getSalaryArchiveId()) + .employeeId(sai.getEmployeeId()) + .effectiveTime(sai.getEffectiveTime()) + .adjustReason(sai.getAdjustReason()) + .salaryItemId(sai.getSalaryItemId()) + .itemValue(sai.getItemValue()) + .description(sai.getDescription()) + .operator(sai.getOperator()) + .operateTime(sai.getOperateTime()) + .createTime(sai.getCreateTime()) + .updateTime(sai.getUpdateTime()) + .creator(sai.getCreator()) + .deleteType(sai.getDeleteType()) + .tenantKey(sai.getTenantKey()) + .build()); + } + return salaryArchiveItemSaveLogs; + } + /** * 构建薪资项目基础信息表单 * diff --git a/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java b/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java index 89c8c03f8..d50faa76d 100644 --- a/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java +++ b/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryarchive.dto; import com.cloudstore.eccom.pc.table.WeaTableType; +import com.engine.salary.annotation.I18n; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableOperate; import com.engine.salary.annotation.TableTitle; @@ -42,6 +43,7 @@ public class SalaryArchiveListDTO { * 姓名 */ @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) + @I18n private String username; /** @@ -55,12 +57,14 @@ public class SalaryArchiveListDTO { * 分部 */ @TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName", labelId = 33553) + @I18n private String subcompanyName; /** * 部门 */ @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName", labelId = 27511) + @I18n private String departmentName; /** diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java index 12a02998d..505ce3264 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -88,4 +89,25 @@ public class SalaryArchiveQueryParam extends BaseQueryParam { */ private boolean extSalaryArchiveList; + + private String payStartDateStartDateStr; + private String payStartDateEndDateStr; + + // 起始发薪日期起 + private Date payStartDateStartDate; + + // 起始发薪日期止 + private Date payStartDateEndDate; + + // 最后发薪日期起 + private String payEndDateStartDateStr; + // 最后发薪日期止 + private String payEndDateEndDateStr; + + // 最后发薪日期起 + private Date payEndDateStartDate; + + // 最后发薪日期止 + private Date payEndDateEndDate; + } diff --git a/src/com/engine/salary/entity/salaryarchive/po/SalaryArchiveItemPO.java b/src/com/engine/salary/entity/salaryarchive/po/SalaryArchiveItemPO.java index 4a3a9306a..782d34348 100644 --- a/src/com/engine/salary/entity/salaryarchive/po/SalaryArchiveItemPO.java +++ b/src/com/engine/salary/entity/salaryarchive/po/SalaryArchiveItemPO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryarchive.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,82 +23,98 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_salary_archive_item +@ElogTransform( name="薪资档案调薪记录" ) public class SalaryArchiveItemPO { /** * 主键id */ + @ElogTransform( name = "主键" ) private Long id; /** * 薪资档案表的主键id */ + @ElogTransform( name = "薪资档案id" ) private Long salaryArchiveId; /** * 人员信息表的主键id */ + @ElogTransform( name = "人员id" ) private Long employeeId; /** * 生效时间 */ + @ElogTransform( name = "生效时间" ) private Date effectiveTime; /** * 调整原因 */ + @ElogTransform( name = "调整原因" ) private String adjustReason; /** * 薪资项目表的主键id */ + @ElogTransform( name = "薪资项目id" ) private Long salaryItemId; /** * 薪资项目值 */ + @ElogTransform( name = "薪资项目值" ) @Encrypt private String itemValue; /** * 备注 */ + @ElogTransform( name = "备注" ) private String description; /** * 操作人 */ + @ElogTransform( name = "操作人" ) private Long operator; /** * 操作时间 */ + @ElogTransform( name = "操作时间" ) private Date operateTime; /** * 创建时间 */ + @ElogTransform( name = "创建时间" ) private Date createTime; /** * 更新时间 */ + @ElogTransform( name = "更新时间" ) private Date updateTime; /** * 创建人 */ + @ElogTransform( name = "创建人" ) private Long creator; /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform( name = "是否已删除" ) private Integer deleteType; /** * 租户ID */ + @ElogTransform( name = "租户" ) private String tenantKey; diff --git a/src/com/engine/salary/entity/salaryarchive/po/SalaryArchivePO.java b/src/com/engine/salary/entity/salaryarchive/po/SalaryArchivePO.java index ec6a4ff51..a1762c54b 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.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveAddTypeEnum; @@ -27,27 +28,32 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor //hrsa_salary_archive +@ElogTransform(name = "薪资档案") public class SalaryArchivePO { /** * 主键id */ + @ElogTransform(name = "主键") private Long id; /** * 人员信息表的主键id */ + @ElogTransform(name = "人员id") private Long employeeId; /** * 起始发薪日期 */ + @ElogTransform(name = "起始发薪日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date payStartDate; /** * 最后发薪日期 */ + @ElogTransform(name = "最后发薪日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date payEndDate; @@ -56,6 +62,7 @@ public class SalaryArchivePO { * * @see SalaryArchiveStatusEnum */ + @ElogTransform(name = "档案状态") private String runStatus; /** @@ -63,6 +70,7 @@ public class SalaryArchivePO { * * @see DataCollectionEmployeeTypeEnum */ + @ElogTransform(name = "人员类型") private Integer employeeType; @@ -71,6 +79,7 @@ public class SalaryArchivePO { * * @see SalaryArchiveAddTypeEnum */ + @ElogTransform(name = "定薪类型") private Integer addType; /** @@ -78,21 +87,25 @@ public class SalaryArchivePO { * * @see */ + @ElogTransform(name = "停薪类型") private Integer stopType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 创建人 */ + @ElogTransform(name = "创建人") private Long creator; /** @@ -103,11 +116,13 @@ public class SalaryArchivePO { /** * 租户ID */ + @ElogTransform(name = "租户") private String tenantKey; /** * 个税扣缴义务人的主键id */ + @ElogTransform(name = "个税扣缴义务人id") private Long taxAgentId; diff --git a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java index 4d98795cd..c1e70af79 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java @@ -136,6 +136,7 @@ public class SalaryItemBO { .description(salaryItemPO.getDescription()) .canDelete(true) .canEdit(openFormulaForcedEditing ||Objects.equals(salaryItemPO.getCanEdit(), NumberUtils.INTEGER_ONE)) + .width(salaryItemPO.getWidth()) .build(); } ).collect(Collectors.toList()); @@ -224,7 +225,8 @@ public class SalaryItemBO { .setCanEdit(salaryItemPO.getCanEdit()) .setTaxAgentIds(salaryItemPO.getTaxAgentIds()) .setSharedType(salaryItemPO.getSharedType()) - .setSortedIndex(salaryItemPO.getSortedIndex()); + .setSortedIndex(salaryItemPO.getSortedIndex()) + .setWidth(salaryItemPO.getWidth()); } /** @@ -279,7 +281,7 @@ public class SalaryItemBO { */ public static SalaryItemPO convert2SalaryItemPO(SalaryItemSaveParam saveParam, Long employeeId) { Date now = new Date(); - long id = dm.jdbc.util.IdGenerator.generate(); + long id = com.engine.salary.util.db.IdGenerator.generate(); SalaryItemPO salaryItemPO = SalaryItemPO.builder() .id(id) .code(IdGenerator.getUUID()) @@ -304,6 +306,7 @@ public class SalaryItemBO { .sharedType(Optional.ofNullable(saveParam.getSharedType()).orElse(0)) .taxAgentIds(saveParam.getTaxAgentIds()) .sortedIndex(saveParam.getSortedIndex()) + .width(saveParam.getWidth()) .build(); // 开启了"薪资档案引用",取值方式固定为输入 // if (Objects.equals(saveParam.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { diff --git a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java index e95330c4d..b28939968 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java @@ -10,7 +10,7 @@ import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.util.SalaryI18nUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java index 5101bf2e4..da0c6d4d5 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java @@ -95,4 +95,7 @@ public class SalaryItemFormDTO { private String taxAgentIds; private Integer sortedIndex; + + // 宽度 + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java index 139569a5e..91a211aad 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java @@ -105,6 +105,9 @@ public class SalaryItemListDTO { @TableTitle(title = "显示顺序",dataIndex = "sortedIndex",key = "sortedIndex", labelId = 128719) private Integer sortedIndex; + // 宽度 + private Integer width; + @SalaryTableColumn(text = "操作", width = "20%", column = "operate") private String operate; } diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index 6da14bd9c..065ec7f32 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -102,4 +102,9 @@ public class SalaryItemSaveParam { * 排序 */ private Integer sortedIndex; + + /** + * 宽度 + */ + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java index 5fb4ba7f0..338b5df0d 100644 --- a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java +++ b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryitem.po; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.SalaryRoundingModeEnum; import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; @@ -25,21 +26,25 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_salary_item +@ElogTransform(name = "薪资项目") public class SalaryItemPO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 名称 */ + @ElogTransform(name = "名称") private String name; /** * 编号 */ + @ElogTransform(name = "编号") private String code; /** @@ -47,26 +52,31 @@ public class SalaryItemPO { * * @see SalarySystemTypeEnum */ + @ElogTransform(name = "是否是系统项目") private Integer systemType; /** * 系统薪资项目的id(是从哪个系统薪资项目复制过来的) */ + @ElogTransform(name = "系统薪资项目的id") private Long sysSalaryItemId; /** * 默认使用。0:默认不适用、1:默认使用 */ + @ElogTransform(name = "默认使用") private Integer useDefault; /** * 薪资档案引用。0:薪资档案未引用、1:薪资档案引用 */ + @ElogTransform(name = "薪资档案引用") private Integer useInEmployeeSalary; /** * 核算时隐藏 */ + @ElogTransform(name = "核算时隐藏") private Integer hideDefault; /** @@ -74,11 +84,13 @@ public class SalaryItemPO { * * @see SalaryRoundingModeEnum */ + @ElogTransform(name = "进位规则") private Integer roundingMode; /** * 保留的小数位数 */ + @ElogTransform(name = "保留的小数位数") private Integer pattern; /** @@ -86,6 +98,7 @@ public class SalaryItemPO { * * @see SalaryValueTypeEnum */ + @ElogTransform(name = "取值方式") private Integer valueType; /** @@ -93,46 +106,55 @@ public class SalaryItemPO { * * @see SalaryDataTypeEnum */ + @ElogTransform(name = "字段类型") private String dataType; /** * 公式 */ + @ElogTransform(name = "公式") private Long formulaId; /** * 备注 */ + @ElogTransform(name = "备注") private String description; /** * 是否可以编辑。0:不可编辑、1:可编辑 */ + @ElogTransform(name = "是否可以编辑") private Integer canEdit; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; // /** @@ -148,20 +170,30 @@ public class SalaryItemPO { /** * 可见性 */ + @ElogTransform(name = "可见性") private Integer sharedType; /** * 可见范围 */ + @ElogTransform(name = "可见范围") private String taxAgentIds; /** * 0不可删除,1可删除 */ + @ElogTransform(name = "是否已经删除") private Integer canDelete; /** * 排序 */ + @ElogTransform(name = "排序") private Integer sortedIndex; + + /** + * 宽度 + */ + @ElogTransform(name = "宽度") + private Integer width; } diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobBackItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobBackItemBO.java index 0c4e527d7..85ac56f7b 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobBackItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobBackItemBO.java @@ -9,7 +9,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobDefaultBackItemPO; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections.CollectionUtils; import weaver.hrm.User; diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobDuplicateBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobDuplicateBO.java index 28f6b8b69..6a64f4912 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobDuplicateBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobDuplicateBO.java @@ -4,7 +4,7 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.salarysob.po.*; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.AllArgsConstructor; import lombok.Data; import org.apache.commons.collections4.CollectionUtils; diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java index a0724a91c..9fc38ff48 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java @@ -160,6 +160,7 @@ public class SalarySobItemAggregateBO { .sortedIndex(salarySobItemPO.getSortedIndex()) .canEdit(openFormulaForcedEditing || Objects.equals(salaryItemPO.getCanEdit(), 1)) .canDelete(openFormulaForcedEditing || salaryItemPO.getCanDelete() == null || Objects.equals(salaryItemPO.getCanDelete(), 1)) + .width(salaryItemPO.getWidth()) .build()); } } diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java index dd34f23b3..d6d43dac2 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -7,7 +7,7 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.Data; import lombok.experimental.Accessors; import org.apache.commons.lang3.math.NumberUtils; diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java index c173ae015..795fdb3a0 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java @@ -110,5 +110,8 @@ public class SalarySobItemDTO { */ private Integer pattern; + // 显示宽度 + private Integer width; + private Integer labelId; } diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeSaveParam.java index ef6834a85..ff2cdd876 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salarysob.param; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.util.valid.DataCheck; @@ -17,23 +18,28 @@ import java.util.List; * @version 1.0 **/ @Data +@ElogTransform( name = "薪资账套人员范围" ) //薪资账套人员范围保存参数") public class SalarySobRangeSaveParam { //薪资账套的id @DataCheck(require = true, message = "薪资账套的ID不允许为空") + @ElogTransform( name = "薪资账套id" ) private Long salarySobId; //是包含还是排除。0:排除、1:包含") @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 1, min = 0, message = "只能选择 关联人员范围/从范围中排除") + @ElogTransform( name = "关联人员范围/从范围中排除" ) private Integer includeType; //对象 @DataCheck(require = true, message = "对象不能为空") + @ElogTransform( name = "对象" ) private List targetParams; //员工状态 @DataCheck(require = true, message = "员工状态不允许为空") + @ElogTransform( name="员工状态" ) private SalaryEmployeeStatusEnum[] employeeStatus; @Data @@ -42,10 +48,12 @@ public class SalarySobRangeSaveParam { //对象类型 @DataCheck(require = true, message = "对象类型不能为空") + @ElogTransform( name="对象类型" ) private TargetTypeEnum targetType; //对象id //@DataCheck(require = true, message = "对象不能为空") + @ElogTransform( name="对象id" ) private Long targetId; //员工状态 -- 导入使用 diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java index fe917dbc2..1ed9a3119 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemGroupPO.java @@ -34,7 +34,7 @@ public class SalarySobItemGroupPO { private Long salarySobId; /** - * 薪资账套的名称 + * 薪资账套中薪资项目分组的名称 */ private String name; diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java index e3167bc23..15704802b 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salarysob.po; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.SalaryRoundingModeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; import lombok.AllArgsConstructor; @@ -23,6 +24,7 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_salary_sob_item +@ElogTransform( name="薪资账套薪资项目" ) public class SalarySobItemPO { /** diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java index 40379477e..0f9569c5e 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salarysob.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -17,77 +18,110 @@ import java.util.Date; @Accessors(chain = true) @NoArgsConstructor @AllArgsConstructor +@ElogTransform( name="薪资账套" ) //hrsa_salary_sob public class SalarySobPO { + /** * 主键id */ + @ElogTransform( name="主键" ) private Long id; + /** * 名称 */ + @ElogTransform( name="名称" ) private String name; /** * 个税扣缴义务人的主键id */ + @ElogTransform( name="个税扣缴义务人id" ) private Long taxAgentId; /** * 应税项目。1:正常工资薪金所得 */ + @ElogTransform( name="薪资类型" ) private Integer incomeCategory; + /** * 薪资周期。1:上上个月、2:上个月、3:本月、4:下个月 */ + @ElogTransform( name="薪资周期" ) private Integer salaryCycleType; + /** * 薪资周期的起始日期 */ + @ElogTransform( name="薪资周期起始日期" ) private Integer salaryCycleFromDay; + /** * 税款所属期。1:上上个月、2:上个月、3:本月、4:下个月 */ + @ElogTransform( name="税款所属期" ) private Integer taxCycleType; + /** * 考勤周期。1:上上个月、2:上个月、3:本月、4:下个月 */ + @ElogTransform( name="考勤周期" ) private Integer attendCycleType; + /** * 考勤周期的起始日期 */ + @ElogTransform( name="考勤周期起始日期" ) private Integer attendCycleFromDay; + /** * 社保福利所属期。1:上上个月、2:上个月、3:本月、4:下个月 */ + @ElogTransform( name="社保福利所属期" ) private Integer socialSecurityCycleType; + /** * 是否禁用。0:正常使用、1:禁用 */ + @ElogTransform( name="是否禁用" ) private Integer disable; + /** * 描述 */ + @ElogTransform( name="描述" ) private String description; + /** * 创建人 */ + @ElogTransform( name="创建人" ) private Long creator; + /** * 创建时间 */ + @ElogTransform( name="创建时间" ) private Date createTime; + /** * 更新时间 */ + @ElogTransform( name="更新时间" ) private Date updateTime; + /** * 是否已删除。0:未删除、1:已删除 */ + @ElogTransform( name="是否已删除" ) private Integer deleteType; + /** * 租户ID */ + @ElogTransform( name="租户" ) private String tenantKey; Collection ids; diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobRangePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobRangePO.java index 1975afd7f..08a1df20f 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobRangePO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobRangePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salarysob.po; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; import lombok.AllArgsConstructor; @@ -23,69 +24,82 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_salary_sob_range", autoResultMap = true) +@ElogTransform(name = "薪资账套关联人员") public class SalarySobRangePO { /** * 主键id */ + @ElogTransform(name="id") private Long id; /** * 薪资账套的id */ + @ElogTransform(name="薪资账套id") private Long salarySobId; /** * 对象类型 * @see TargetTypeEnum */ + @ElogTransform(name="对象类型") private Integer targetType; /** * 对象id */ + @ElogTransform(name="对象id") private Long targetId; /** * 人员状态 * @see SalaryEmployeeStatusEnum */ + @ElogTransform(name="人员状态") private Integer employeeStatus; /** * 人员状态使用逗号分隔 * @see SalaryEmployeeStatusEnum */ + @ElogTransform(name="人员状态") private String employeeStatuses; /** * 是包含还是排除 0:排除、1:包含 */ + @ElogTransform(name="是包含还是排除") private Integer includeType; /** * 租户key */ + @ElogTransform(name="租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name="创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name="是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name="创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name="更新时间") private Date updateTime; Collection ids; diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index 7651effa3..03cbafc96 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -43,7 +43,7 @@ public class InsuranceComparisonResultBO { * 构建福利核算结果列表的表头(线下对比) * */ - public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet, User user) { + public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet, User user, boolean welBaseDiffSign) { List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); @@ -69,21 +69,63 @@ public class InsuranceComparisonResultBO { columns.add(new Column(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 81594, "社保账号"), "socialAccount", "socialAccount")); columns.add(new Column(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542267, "社保方案名称"), "socialSchemeName", "socialSchemeName")); //组装社保基数 - for (ICategoryPO po : socialWelfareList) { - columns.add(new Column(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), po.getId() + "socialBase", po.getId() + "socialBase")); + if (welBaseDiffSign) { + List socialComColumns = Lists.newArrayList(); + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "socialPerBase", po.getId() + "socialPerBase")); + socialComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "socialComBase", po.getId() + "socialComBase")); + } + columns.addAll(socialComColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), po.getId() + "socialBase", po.getId() + "socialBase")); + } } +// for (ICategoryPO po : socialWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); +// } columns.add(new Column(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542268, "公积金账号"), "fundAccount", "fundAccount")); columns.add(new Column(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542269, "公积金方案名称"), "fundSchemeName", "fundSchemeName")); //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - columns.add(new Column(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), po.getId() + "fundBase", po.getId() + "fundBase")); + if (welBaseDiffSign) { + List fundComColumns = Lists.newArrayList(); + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "fundPerBase", po.getId() + "fundPerBase")); + fundComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "fundComBase", po.getId() + "fundComBase")); + } + columns.addAll(fundComColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), po.getId() + "fundBase", po.getId() + "fundBase")); + } } +// for (ICategoryPO po : fundWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); +// } columns.add(new Column(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542270, "补充公积金账号"), "supplementFundAccount", "supplementFundAccount")); columns.add(new Column(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542271, "其他福利方案名称"), "otherSchemeName", "otherSchemeName")); //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - columns.add(new Column(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), po.getId() + "otherBase", po.getId() + "otherBase")); + if (welBaseDiffSign) { + List otherComColumns = Lists.newArrayList(); + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "otherPerBase", po.getId() + "otherPerBase")); + otherComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "otherComBase", po.getId() + "otherComBase")); + } + columns.addAll(otherComColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), po.getId() + "otherBase", po.getId() + "otherBase")); + } } +// for (ICategoryPO po : otherWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); +// } //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { @@ -142,7 +184,7 @@ public class InsuranceComparisonResultBO { * 构建福利核算线下对比结果 * */ - public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS, Map schemeIdNameMap, User user) { + public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS, Map schemeIdNameMap, User user, boolean welBaseDiffSign) { Map> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getEmployeeId); // Map> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode); @@ -194,12 +236,28 @@ public class InsuranceComparisonResultBO { if (excelResultValueList != null && excelResultValueList.size() == 1) { excelAccountExportPO = excelResultValueList.get(0); } - //社保基数,socialPaymentBaseString - welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); - //公积金基数,fundPaymentBaseString - welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); - //其他福利基数,otherPaymentBaseString - welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + if (welBaseDiffSign) { + //社保基数-个人,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "PerBase", 1); + //公积金基数-个人,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "PerBase", 2); + //其他福利基数-个人,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "PerBase", 3); + + //社保基数-公司,socialPaymentComBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentComBaseString(), excelAccountExportPO.getSocialPaymentComBaseString(), "ComBase", 1); + //公积金基数-公司,fundPaymentComBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentComBaseString(), excelAccountExportPO.getFundPaymentComBaseString(), "ComBase", 2); + //其他福利基数-公司,otherPaymentComBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentComBaseString(), excelAccountExportPO.getOtherPaymentComBaseString(), "ComBase", 3); + } else { + //社保基数,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); + //公积金基数,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); + //其他福利基数,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + } //社保个人socialPerJson welfareElementCompare(map, accountExportPO.getSocialPerJson(), excelAccountExportPO.getSocialPerJson(), "Per", 1); //公积金个人fundPerJson diff --git a/src/com/engine/salary/entity/siaccount/dto/InsuranceAcctDetailImportFieldDTO.java b/src/com/engine/salary/entity/siaccount/dto/InsuranceAcctDetailImportFieldDTO.java index 1f3cc912c..4db8801bc 100644 --- a/src/com/engine/salary/entity/siaccount/dto/InsuranceAcctDetailImportFieldDTO.java +++ b/src/com/engine/salary/entity/siaccount/dto/InsuranceAcctDetailImportFieldDTO.java @@ -20,4 +20,8 @@ public class InsuranceAcctDetailImportFieldDTO { //薪资项目名称 private String salaryItemName; + + //是否勾选 + private Boolean checked; + } diff --git a/src/com/engine/salary/entity/siaccount/param/AccountParam.java b/src/com/engine/salary/entity/siaccount/param/AccountParam.java index ceff087e9..34e11c6e5 100644 --- a/src/com/engine/salary/entity/siaccount/param/AccountParam.java +++ b/src/com/engine/salary/entity/siaccount/param/AccountParam.java @@ -42,4 +42,7 @@ public class AccountParam { @DataCheck(require = true,message = "个税扣缴义务人不能为空") private Long paymentOrganization; + // 是否核算后归档 + private boolean fileFlag = false; + } diff --git a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java index 17b926b08..7a9090845 100644 --- a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java +++ b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java @@ -25,5 +25,6 @@ public class ExcelInsuranceImportParam { /** * 账单月份 */ - private String billMonth; + private String billMonth; + private String paymentOrganization; } diff --git a/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java index 2492513cd..b8e56f090 100644 --- a/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java +++ b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java @@ -42,4 +42,8 @@ public class InsuranceAccountDetailParam extends BaseQueryParam { private Long creator; private String workcode; + + private List departmentIds; + + private List subCompanyIds; } diff --git a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java index 4e7889544..9660b8602 100644 --- a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java @@ -101,6 +101,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 公积金方案ID */ @@ -112,6 +118,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -123,6 +135,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java index b3296596e..362815eef 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.siaccount.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -20,94 +21,112 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_bill_batch +@ElogTransform(name = "福利台账主表") public class InsuranceAccountBatchPO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 账单月份 */ + @ElogTransform(name = "账单月份") private String billMonth; /** * 账单状态 0-未归档 1-已归档 */ + @ElogTransform(name = "账单状态") private Integer billStatus; /** * 社保核算人数 */ + @ElogTransform(name = "社保核算人数") private Integer socialNum; /** * 公积金核算人数 */ + @ElogTransform(name = "公积金核算人数") private Integer fundNum; /** * 其他福利核算人数 */ + @ElogTransform(name = "其他福利核算人数") private Integer otherNum; /** * 社保缴费总额(单位+个人) */ @Encrypt + @ElogTransform(name = "社保缴费总额(单位+个人)") private String socialPay; /** * 公积金缴费总额(单位+个人) */ @Encrypt + @ElogTransform(name = "公积金缴费总额(单位+个人)") private String fundPay; /** * 其他福利缴费总额(单位+个人) */ @Encrypt + @ElogTransform(name = "其他福利缴费总额(单位+个人)") private String otherPay; /** * 核算人 */ + @ElogTransform(name = "核算人") private String accountant; /** * 备注 */ + @ElogTransform(name = "备注") private String remarks; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 个税扣缴义务人 */ + @ElogTransform(name = "个税扣缴义务人id") private Long paymentOrganization; diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java index e8f7ce98f..aadf8b4bb 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java @@ -3,6 +3,7 @@ package com.engine.salary.entity.siaccount.po; import com.cloudstore.eccom.pc.table.WeaTableType; import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryTable; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -23,242 +24,308 @@ import java.util.Date; @AllArgsConstructor @SalaryTable(pageId = "2394fba1-1381-428a-8532-4e1e6b86626e", tableType = WeaTableType.CHECKBOX) //hrsa_bill_detail +@ElogTransform(name = "福利台账明细表") public class InsuranceAccountDetailPO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 员工id */ + @ElogTransform(name = "员工id") private Long employeeId; /** * 账单月份 */ + @ElogTransform(name = "账单月份") private String billMonth; /** * 账单状态 0-未归档 1-已归档 */ + @ElogTransform(name = "账单状态") private Integer billStatus; /** * 缴纳状态 */ + @ElogTransform(name = "缴纳状态") private Integer paymentStatus; /** * 补缴月份/退差月份 */ + @ElogTransform(name = "补缴月份/退差月份") private String supplementaryMonth; /** * 补缴项目 */ + @ElogTransform(name = "补缴项目") private String supplementaryProjects; /** * 数据来源 0-系统核算 1-临时数据 */ + @ElogTransform(name = "数据来源") private Integer resourceFrom; /** * 社保缴纳组织 */ + @ElogTransform(name = "社保缴纳组织") private Long socialPayOrg; /** * 社保账号 */ + @ElogTransform(name = "社保账号") private String socialAccount; /** * 公积金缴纳组织 */ + @ElogTransform(name = "公积金缴纳组织") private Long fundPayOrg; /** * 公积金账号 */ + @ElogTransform(name = "公积金账号") private String fundAccount; /** * 补充公积金账号 */ + @ElogTransform(name = "补充公积金账号") private String supplementFundAccount; /** * 其他福利缴纳组织 */ + @ElogTransform(name = "其他福利缴纳组织") private Long otherPayOrg; /** * 社保方案ID */ + @ElogTransform(name = "社保方案ID") private Long socialSchemeId; /** * 社保缴纳基数 */ @Encrypt + @ElogTransform(name = "社保缴纳基数") private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + @ElogTransform(name = "社保缴纳基数——单位") + private String socialPaymentComBaseString; + /** * 公积金方案ID */ + @ElogTransform(name = "公积金方案ID") private Long fundSchemeId; /** * 公积金缴纳基数 */ @Encrypt + @ElogTransform(name = "公积金缴纳基数") private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + @ElogTransform(name = "公积金缴纳基数——单位") + private String fundPaymentComBaseString; + /** * 其他福利方案id */ + @ElogTransform(name = "其他福利方案id") private Long otherSchemeId; /** * 其他福利缴纳基数 */ @Encrypt + @ElogTransform(name = "其他福利缴纳基数") private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + @ElogTransform(name = "其他福利缴纳基数——单位") + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ @Encrypt + @ElogTransform(name = "社保个人缴费明细") private String socialPerJson; /** * 社保个人合计 */ @Encrypt + @ElogTransform(name = "社保个人合计") private String socialPerSum; /** * 公积金个人缴费明细 */ @Encrypt + @ElogTransform(name = "公积金个人缴费明细") private String fundPerJson; /** * 公积金个人合计 */ @Encrypt + @ElogTransform(name = "公积金个人合计") private String fundPerSum; /** * 其他福利个人缴费明细 */ @Encrypt + @ElogTransform(name = "其他福利个人缴费明细") private String otherPerJson; /** * 其他福利个人合计 */ @Encrypt + @ElogTransform(name = "其他福利个人合计") private String otherPerSum; /** * 个人合计 */ @Encrypt + @ElogTransform(name = "个人合计") private String perSum; /** * 社保单位缴费明细 */ @Encrypt + @ElogTransform(name = "社保单位缴费明细") private String socialComJson; /** * 社保单位合计 */ @Encrypt + @ElogTransform(name = "社保单位合计") private String socialComSum; /** * 公积金单位缴费明细 */ + @ElogTransform(name = "公积金单位缴费明细") private String fundComJson; /** * 公积金单位合计 */ + @ElogTransform(name = "公积金单位合计") private String fundComSum; /** * 其他福利单位缴费明细 */ + @ElogTransform(name = "其他福利单位缴费明细") private String otherComJson; /** * 其他福利单位合计 */ + @ElogTransform(name = "其他福利单位合计") private String otherComSum; /** * 单位合计 */ @Encrypt + @ElogTransform(name = "单位合计") private String comSum; /** * 社保合计 */ @Encrypt + @ElogTransform(name = "社保合计") private String socialSum; /** * 公积金合计 */ @Encrypt + @ElogTransform(name = "公积金合计") private String fundSum; /** * 其他福利合计 */ @Encrypt + @ElogTransform(name = "其他福利合计") private String otherSum; /** * 合计 */ @Encrypt + @ElogTransform(name = "合计") private String total; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 个税扣缴义务人 */ + @ElogTransform(name = "个税扣缴义务人") private Long paymentOrganization; } diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java index 50897c6b2..dc8c1c2c0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java @@ -102,6 +102,11 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; /** * 公积金方案ID */ @@ -113,6 +118,12 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -124,6 +135,13 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceCompensationPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceCompensationPO.java index 24ebde645..c4e8b1fe7 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceCompensationPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceCompensationPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.siaccount.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,86 +19,103 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_compensation_log +@ElogTransform(name = "福利台账-调差历史表") public class InsuranceCompensationPO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 缴纳组织 */ + @ElogTransform(name = "缴纳组织") private Long paymentAgency; /** * 个税扣缴义务人 */ + @ElogTransform(name = "个税扣缴义务人id") private Long paymentOrganization; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 员工id */ + @ElogTransform(name = "员工id") private Long employeeId; /** * 统计调差福利 */ + @ElogTransform(name = "统计调差福利") private Integer welfareType; /** * 统计调差福利类型 */ + @ElogTransform(name = "统计调差福利类型") private String categoryType; /** * 国家核算金额 */ + @ElogTransform(name = "国家核算金额") private String countryTotal; /** * 公司核算金额 */ + @ElogTransform(name = "公司核算金额") private String companyTotal; /** * 应调差额 */ + @ElogTransform(name = "应调差额") private String adjustmentTotal; /** * 调差到 */ + @ElogTransform(name = "调差到") private Long adjustTo; /** * 账单月份 */ + @ElogTransform(name = "账单月份") private String billMonth; //---------条件------- diff --git a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java index a96b96aad..710038513 100644 --- a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java +++ b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java @@ -35,6 +35,7 @@ public class InsuranceArchivesBO { .socialStartTime(po.getSocialStartTime()) .schemeAccount(po.getSocialAccount()) .schemePaymentBaseString(po.getSocialPaymentBaseString()) + .schemePaymentComBaseString(po.getSocialPaymentComBaseString()) .underTake(po.getUnderTake() == null ? null : String.valueOf(po.getUnderTake())) .build(); } @@ -52,6 +53,7 @@ public class InsuranceArchivesBO { .fundSchemeId(po.getFundSchemeId()) .paymentOrganization(po.getPaymentOrganization()) .fundPaymentBaseString(po.getFundPaymentBaseString()) + .fundPaymentComBaseString(po.getFundPaymentComBaseString()) .fundStartTime(po.getFundStartTime()) .supplementFundAccount(po.getSupplementFundAccount()) .nonPayment(po.getNonPayment()) @@ -72,6 +74,7 @@ public class InsuranceArchivesBO { .otherName(po.getOtherSchemeId() == null ? null : String.valueOf(po.getOtherSchemeId())) .otherSchemeId(po.getOtherSchemeId()) .otherPaymentBaseString(po.getOtherPaymentBaseString()) + .otherPaymentComBaseString(po.getOtherPaymentComBaseString()) .otherStartTime(po.getOtherStartTime()) .otherEndTime(po.getOtherEndTime()) .paymentOrganization(po.getPaymentOrganization()) diff --git a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java index 8c22ae58f..15a58cef6 100644 --- a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java +++ b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java @@ -7,7 +7,7 @@ import com.engine.salary.enums.siaccount.EmployeeStatusEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java index 259cc3e54..a0c2d57e8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java @@ -70,12 +70,18 @@ public class InsuranceArchivesBaseHistoryDTO { private String adjustAfterBaseJson; + private String adjustBeforeComBaseJson; + + private String adjustAfterComBaseJson; + @TableTitle(title = "对象", dataIndex = "employeeName", key = "employeeName") private String employeeName; @TableTitle(title = "个税扣缴义务人", dataIndex = "paymentOrganizationName", key = "paymentOrganizationName") private String paymentOrganizationName; @TableTitle(title = "福利项名称", dataIndex = "welfareItemName", key = "welfareItemName") private String welfareItemName; + @TableTitle(title = "缴费对象", dataIndex = "paymentScope", key = "paymentScope") + private String paymentScope; @TableTitle(title = "调整前方案", dataIndex = "adjustBeforeSchemeName", key = "adjustBeforeSchemeName") private String adjustBeforeSchemeName; @TableTitle(title = "调整前基数", dataIndex = "adjustBeforeBaseValue", key = "adjustBeforeBaseValue") diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java index f85206c01..4fcfdbcd1 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java @@ -65,4 +65,6 @@ public class InsuranceArchivesFundSchemeDTO { //缴纳基数 private String fundPaymentBaseString; + + private String fundPaymentComBaseString; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java index a3c55fee5..3fa89c1c2 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java @@ -56,5 +56,7 @@ public class InsuranceArchivesOtherSchemeDTO { private String otherPaymentBaseString; + private String otherPaymentComBaseString; + //private WeaForm otherPaymentBase; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java index 1be1afbca..d4fc1dae8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java @@ -59,4 +59,7 @@ public class InsuranceArchivesSocialSchemeDTO { //社保缴纳基数 private String schemePaymentBaseString; + //社保缴纳基数——单位 + private String schemePaymentComBaseString; + } diff --git a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java index 7e4e46fb7..8d086b1ad 100644 --- a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java +++ b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java @@ -23,4 +23,6 @@ public class InsuranceArchivesSaveParam { private String baseForm; private String paymentForm; + + private String paymentComForm; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java index 6939c2258..52d31f804 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java @@ -77,4 +77,6 @@ public class InsuranceArchivesBaseHistoryPO { private Date createTime; private Date updateTime; + + private String paymentScope; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseInfoPO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseInfoPO.java index f05cc309d..0a5dd7b01 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseInfoPO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseInfoPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.siarchives.po; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; @@ -19,65 +20,78 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_insurance_base_info +@ElogTransform(name = "福利档案主表") public class InsuranceArchivesBaseInfoPO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 员工id */ + @ElogTransform(name = "员工id") private Long employeeId; /** * 个税扣缴义务人id */ + @ElogTransform(name = "个税扣缴义务人id") private Long paymentOrganization; /** * 社保档案id */ + @ElogTransform(name = "社保档案id") private Long socialArchivesId; /** * 公积金档案id */ + @ElogTransform(name = "公积金档案id") private Long fundArchivesId; /** * 其他福利档案id */ + @ElogTransform(name = "其他福利档案id") private Long otherArchivesId; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 福利执行状态 */ + @ElogTransform(name = "福利执行状态") private String runStatus; /** @@ -85,6 +99,7 @@ public class InsuranceArchivesBaseInfoPO { * * @see DataCollectionEmployeeTypeEnum */ + @ElogTransform(name = "人员类型") private Integer employeeType; //---------条件------- diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java index 7b333f4e6..e4e9573c4 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.siarchives.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,35 +20,42 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_fund_archives +@ElogTransform(name = "福利档案明细表-公积金信息") public class InsuranceArchivesFundSchemePO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 员工id */ + @ElogTransform(name = "员工id") private Long employeeId; /** * 福利类型 */ + @ElogTransform(name = "福利类型") private Integer welfareType; /** * 暂不缴纳 */ + @ElogTransform(name = "是否暂不缴纳") private Integer nonPayment; /** * 公积金起始缴纳月 */ + @ElogTransform(name = "公积金起始缴纳月") private String fundStartTime; /** * 公积金最后缴纳月 */ + @ElogTransform(name = "公积金最后缴纳月") private String fundEndTime; /** @@ -59,56 +67,75 @@ public class InsuranceArchivesFundSchemePO { /** * 公积金方案id */ + @ElogTransform(name = "公积金方案id") private Long fundSchemeId; /** * 公积金账号 */ + @ElogTransform(name = "公积金账号") private String fundAccount; /** * 补充公积金账号 */ + @ElogTransform(name = "补充公积金账号") private String supplementFundAccount; /** * 公积金缴纳组织 */ + @ElogTransform(name = "公积金缴纳组织") private Long paymentOrganization; /** * 公积金个人实际承担方 */ + @ElogTransform(name = "公积金个人实际承担方") private Integer underTake; /** * 公积金缴纳基数 */ @Encrypt + @ElogTransform(name = "公积金缴纳基数") private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + @ElogTransform(name = "公积金缴纳基数——单位") + private String fundPaymentComBaseString; + + /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java index 76146719d..c8086a1e1 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.siarchives.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,35 +20,42 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_other_archives +@ElogTransform(name = "福利档案明细表-其他福利信息") public class InsuranceArchivesOtherSchemePO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 员工id */ + @ElogTransform(name = "员工id") private Long employeeId; /** * 暂不缴纳 */ + @ElogTransform(name = "是否暂不缴纳") private Integer nonPayment; /** * 福利类型 */ + @ElogTransform(name = "福利类型") private Integer welfareType; /** * 其他福利起始缴纳月 */ + @ElogTransform(name = "其他福利起始缴纳月") private String otherStartTime; /** * 其他福利最后缴纳月 */ + @ElogTransform(name = "其他福利最后缴纳月") private String otherEndTime; /** @@ -59,46 +67,62 @@ public class InsuranceArchivesOtherSchemePO { /** * 其他福利方案id */ + @ElogTransform(name = "其他福利方案id") private Long otherSchemeId; /** * 其他福利缴纳组织 */ + @ElogTransform(name = "其他福利缴纳组织") private Long paymentOrganization; /** * 其他福利个人实际承担方 */ + @ElogTransform(name = "其他福利个人实际承担方") private Integer underTake; /** * 其他福利缴纳基数 */ @Encrypt + @ElogTransform(name = "其他福利缴纳基数") private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + @ElogTransform(name = "其他福利缴纳基数——单位") + private String otherPaymentComBaseString; + /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java index e6f4ff038..a0b4a8b87 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.siarchives.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,36 +20,43 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_social_archives +@ElogTransform(name = "福利档案明细表-社保信息") public class InsuranceArchivesSocialSchemePO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 员工id */ + @ElogTransform(name = "员工id") private Long employeeId; /** * 暂不缴纳 */ + @ElogTransform(name = "是否暂不缴纳") private Integer nonPayment; /** * 福利类型 */ + @ElogTransform(name = "福利类型") private Integer welfareType; /** * 社保起始缴纳月 */ + @ElogTransform(name = "社保起始缴纳月") private String socialStartTime; /** * 社保最后缴纳月 */ + @ElogTransform(name = "社保最后缴纳月") private String socialEndTime; /** @@ -60,51 +68,68 @@ public class InsuranceArchivesSocialSchemePO { /** * 社保方案id */ + @ElogTransform(name = "社保方案id") private Long socialSchemeId; /** * 社保账号 */ + @ElogTransform(name = "社保账号") private String socialAccount; /** * 社保缴纳组织 */ + @ElogTransform(name = "社保缴纳组织") private Long paymentOrganization; /** * 社保个人实际承担方 */ + @ElogTransform(name = "社保个人实际承担方") private Integer underTake; /** * 社保缴纳基数 */ @Encrypt + @ElogTransform(name = "社保缴纳基数") private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + @ElogTransform(name = "社保缴纳基数——单位") + private String socialPaymentComBaseString; + /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; } diff --git a/src/com/engine/salary/entity/sicategory/bo/ICategoryBO.java b/src/com/engine/salary/entity/sicategory/bo/ICategoryBO.java index ae0af9555..8bf7052ac 100644 --- a/src/com/engine/salary/entity/sicategory/bo/ICategoryBO.java +++ b/src/com/engine/salary/entity/sicategory/bo/ICategoryBO.java @@ -5,7 +5,7 @@ import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.enums.sicategory.DataTypeEnum; import com.engine.salary.util.SalaryEnumUtil; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import java.util.Date; import java.util.Objects; diff --git a/src/com/engine/salary/entity/sicategory/dto/ICategoryListDTO.java b/src/com/engine/salary/entity/sicategory/dto/ICategoryListDTO.java index bbb4977e4..125fcc46c 100644 --- a/src/com/engine/salary/entity/sicategory/dto/ICategoryListDTO.java +++ b/src/com/engine/salary/entity/sicategory/dto/ICategoryListDTO.java @@ -49,7 +49,7 @@ public class ICategoryListDTO { @SalaryTableColumn(column = "payment_scope", width = "30%", text = "缴纳对象",transmethod = "com.engine.salary.transmethod.ICategoryTransMethod.getPaymentcopeTypeName") - @TableTitle(title = "缴纳对象",dataIndex = "paymentScopt",key = "paymentScopt", labelId = 543169) + @TableTitle(title = "缴纳对象",dataIndex = "paymentScope",key = "paymentScope", labelId = 543169) private String paymentScope; private String paymentScopeSpan; diff --git a/src/com/engine/salary/entity/sischeme/po/InsuranceSchemeDetailPO.java b/src/com/engine/salary/entity/sischeme/po/InsuranceSchemeDetailPO.java index a65ce19d7..e7ce260f1 100644 --- a/src/com/engine/salary/entity/sischeme/po/InsuranceSchemeDetailPO.java +++ b/src/com/engine/salary/entity/sischeme/po/InsuranceSchemeDetailPO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.sischeme.po; import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -20,114 +21,136 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_scheme_detail +@ElogTransform(name = "福利方案明细") public class InsuranceSchemeDetailPO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 社保方案主表id */ + @ElogTransform(name = "方案主表id") private Long primaryId; /** * 险种id */ + @ElogTransform(name = "福利项id") private Long insuranceId; /** * 生效年月(含) */ + @ElogTransform(name = "生效年月") private String effectiveTime; /** * 失效年月(不含) */ + @ElogTransform(name = "失效年月") private String expirationTime; /** * 是否缴费 0-否 1-是 */ + @ElogTransform(name = "是否缴费") private Integer isPayment; /** * 缴纳对象 */ + @ElogTransform(name = "缴纳对象") private Integer paymentScope; /** * 基数上限 */ @Encrypt + @ElogTransform(name = "基数上限") private String upperLimit; /** * 基数下限 */ @Encrypt + @ElogTransform(name = "基数下限") private String lowerLimit; /** * 缴纳比例 */ + @ElogTransform(name = "缴纳比例") private String paymentProportion; /** * 固定费用 */ @Encrypt + @ElogTransform(name = "固定费用") private String fixedCost; /** * 有效小数位 */ + @ElogTransform(name = "有效小数位") private Integer validNum; /** * 进位规则 */ + @ElogTransform(name = "进位规则") private Integer rententionRule; /** * 缴纳周期,0不进行周期缴纳,1进行周期缴纳 */ + @ElogTransform(name = "是否周期缴纳") private Integer paymentCycle; /** * 核算方式 */ + @ElogTransform(name = "核算方式") private Integer accountType; /** * 缴纳周期规则设置 */ + @ElogTransform(name = "缴纳周期规则设置") private String cycleSetting; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; } diff --git a/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java b/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java index cf97a990f..e832d801d 100644 --- a/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java +++ b/src/com/engine/salary/entity/sischeme/po/InsuranceSchemePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.sischeme.po; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.sicategory.SharedTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; @@ -20,31 +21,37 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_social_security_scheme +@ElogTransform(name = "福利方案") public class InsuranceSchemePO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 缴纳地区 */ + @ElogTransform(name = "缴纳地区") private String paymentArea; /** * 方案名称 */ + @ElogTransform(name = "方案名称") private String schemeName; /** * 缴纳类型 */ + @ElogTransform(name = "缴纳类型") private Integer paymentType; /** * 福利类型 */ + @ElogTransform(name = "福利类型") private Integer welfareType; /** @@ -52,46 +59,55 @@ public class InsuranceSchemePO { * * @see SharedTypeEnum */ + @ElogTransform(name = "共享权限") private String sharedType; /** * 个税扣缴义务人 */ + @ElogTransform(name = "个税扣缴义务人") private String taxAgentIds; /** * 是否启用 0-停用 1-启用 */ + @ElogTransform(name = "是否启用") private Integer isUse; /** * 备注 */ + @ElogTransform(name = "备注") private String remarks; /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** * 是否删除 */ + @ElogTransform(name = "是否删除") private Integer deleteType; /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** * 租户key */ + @ElogTransform(name = "租户key") private String tenantKey; } diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentBO.java index 55f27223b..8b6c054c3 100644 --- a/src/com/engine/salary/entity/taxagent/bo/TaxAgentBO.java +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentBO.java @@ -27,7 +27,7 @@ import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.google.common.base.Joiner; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentManageRangePO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentManageRangePO.java index e2df638d0..ae4c8b9b7 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentManageRangePO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentManageRangePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxagent.po; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentRangeTypeEnum; import lombok.AllArgsConstructor; @@ -23,11 +24,13 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_tax_agent_manage_range +@ElogTransform( name="个税扣缴义务人管理范围" ) public class TaxAgentManageRangePO { /** * 主键id */ + @ElogTransform( name ="主键") private Long id; /** @@ -38,42 +41,51 @@ public class TaxAgentManageRangePO { /** * 个税扣缴义务人的主键id */ + @ElogTransform( name ="个税扣缴义务人id") private Long taxAgentId; /** * 范围类型 * @see TaxAgentRangeTypeEnum */ + @ElogTransform( name ="范围类型") private Integer rangeType; /** * 对象类型 * @see TargetTypeEnum */ + @ElogTransform( name ="对象类型") private Integer targetType; /** * 对象id */ + @ElogTransform( name ="对象id") private Long targetId; /** * 人员状态 */ + @ElogTransform( name ="人员状态") private String employeeStatus; + /** * 是包含还是排除 0:排除、1:包含 */ + @ElogTransform( name ="是包含还是排除 0:排除、1:包含") private Integer includeType; /** * 租户key */ + @ElogTransform( name ="租户key") private String tenantKey; /** * 创建人id */ + @ElogTransform( name ="创建人id") private Long creator; /** @@ -84,11 +96,13 @@ public class TaxAgentManageRangePO { /** * 创建时间 */ + @ElogTransform( name ="创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform( name ="更新时间") private Date updateTime; diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentPO.java index cf3b21096..819bf3aaf 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentPO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxagent.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,26 +23,31 @@ import java.util.Date; @AllArgsConstructor //hrsa_tax_agent") //个税扣缴义务人表") +@ElogTransform(name = "个税扣缴义务人") public class TaxAgentPO { /** * 主键id */ + @ElogTransform(name = "主键id") private Long id; /** * 名称 */ + @ElogTransform(name = "名称") private String name; /** * 代缴机构 */ + // @ElogTransform(name = "代缴机构") private String paymentAgency; /** * 备注 */ + @ElogTransform(name = "备注") private String description; /** @@ -52,6 +58,7 @@ public class TaxAgentPO { /** * 创建人id */ + @ElogTransform(name = "创建人id") private Long creator; /** @@ -62,11 +69,13 @@ public class TaxAgentPO { /** * 创建时间 */ + @ElogTransform(name = "创建时间") private Date createTime; /** * 更新时间 */ + @ElogTransform(name = "更新时间") private Date updateTime; /** diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java index bc9afce5d..2d65b966c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java @@ -22,7 +22,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.Data; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java index 02b5b19be..0e200abbf 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java @@ -13,6 +13,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; import weaver.hrm.User; import java.util.*; @@ -170,9 +171,9 @@ public class TaxDeclarationDetailBO { .setAnnualTaxSavings(fieldCodeKeyFieldValueMap.get(TaxDeclarationDataIndexConstant.ANNUAL_TAX_SAVINGS)) .setAnnualRemark(fieldCodeKeyFieldValueMap.get(TaxDeclarationDataIndexConstant.ANNUAL_REMARK)); if (dto.getEmployeeType() == null || Objects.equals(dto.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { - DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(dto.getEmployeeId()); - taxDeclarationLaborListDTO.setJobNum(simpleEmployee.getWorkcode()) - .setUsername(simpleEmployee.getUsername()) + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.getOrDefault(dto.getEmployeeId(),new DataCollectionEmployee()); + taxDeclarationLaborListDTO.setJobNum(Util.null2String(simpleEmployee.getWorkcode())) + .setUsername(Util.null2String(simpleEmployee.getUsername())) .setCardNum(Optional.ofNullable(simpleEmployee).map(DataCollectionEmployee::getIdNo).orElse(StringUtils.EMPTY)); } else { diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java index 09f341207..7e7f9d46f 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -31,59 +32,69 @@ public class TaxDeclarationAnnualListDTO { text = "工号", width = "10%", column = "jobNum" ) @TableTitle(title ="工号",dataIndex = "jobNum",key = "jobNum", labelId = 1933) + @ExcelHead(title ="工号",dataIndex = "jobNum") private String jobNum; @SalaryTableColumn( text = "姓名", width = "10%", column = "username" ) @TableTitle(title ="姓名",dataIndex = "username",key = "username", labelId = 25034) + @ExcelHead(title ="姓名",dataIndex = "username") private String username; @SalaryTableColumn( text = "证件类型", width = "10%", column = "cardType" ) @TableTitle(title ="证件类型",dataIndex = "cardType",key = "cardType", labelId = 23787) + @ExcelHead(title ="证件类型",dataIndex = "cardType") private String cardType; @SalaryTableColumn( text = "证件号码", width = "10%", column = "cardNum" ) @TableTitle(title ="证件号码",dataIndex = "cardNum",key = "cardNum", labelId = 1839) + @ExcelHead(title ="证件号码",dataIndex = "cardNum") private String cardNum; @SalaryTableColumn( text = "全年一次性奖金额", width = "10%", column = "annualIncome" ) @TableTitle(title ="全年一次性奖金额",dataIndex = "annualIncome",key = "annualIncome", labelId = 544395) + @ExcelHead(title ="全年一次性奖金额",dataIndex = "annualIncome") private String annualIncome; @SalaryTableColumn( text = "免税收入", width = "10%", column = "annualTaxFreeIncome" ) @TableTitle(title ="免税收入",dataIndex = "annualTaxFreeIncome",key = "annualTaxFreeIncome", labelId = 542662) + @ExcelHead(title ="免税收入",dataIndex = "annualTaxFreeIncome") private String annualTaxFreeIncome; @SalaryTableColumn( text = "其他", width = "10%", column = "annualOther" ) @TableTitle(title ="其他",dataIndex = "annualOther",key = "annualOther", labelId = 25740) + @ExcelHead(title ="其他",dataIndex = "annualOther") private String annualOther; @SalaryTableColumn( text = "准予扣除的捐赠额", width = "10%", column = "annualDonateTax" ) @TableTitle(title ="准予扣除的捐赠额",dataIndex = "annualDonateTax",key = "annualDonateTax", labelId = 542294) + @ExcelHead(title ="准予扣除的捐赠额",dataIndex = "annualDonateTax") private String annualDonateTax; @SalaryTableColumn( text = "减免税额", width = "10%", column = "annualTaxSavings" ) @TableTitle(title ="减免税额",dataIndex = "annualTaxSavings",key = "annualTaxSavings", labelId = 542675) + @ExcelHead(title ="减免税额",dataIndex = "annualTaxSavings") private String annualTaxSavings; @SalaryTableColumn( text = "备注", width = "10%", column = "annualRemark" ) @TableTitle(title ="备注",dataIndex = "annualRemark",key = "annualRemark", labelId = 545315) + @ExcelHead(title ="备注",dataIndex = "annualRemark") private String annualRemark; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java index 8ef964ea8..d22d433b3 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -30,78 +31,91 @@ public class TaxDeclarationLaborListDTO { @SalaryTableColumn( text = "工号", width = "10%", column = "jobNum" ) - @TableTitle(title ="工号",dataIndex = "jobNum",key = "jobNum", labelId = 1933) + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum", labelId = 1933) + @ExcelHead(title = "工号", dataIndex = "jobNum") private String jobNum; @SalaryTableColumn( text = "姓名", width = "10%", column = "username" ) - @TableTitle(title ="姓名",dataIndex = "username",key = "username", labelId = 25034) + @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) + @ExcelHead(title = "姓名", dataIndex = "username") private String username; @SalaryTableColumn( text = "证件类型", width = "10%", column = "cardType" ) - @TableTitle(title ="证件类型",dataIndex = "cardType",key = "cardType", labelId = 23787) + @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType", labelId = 23787) + @ExcelHead(title = "证件类型", dataIndex = "cardType") private String cardType; @SalaryTableColumn( text = "证件号码", width = "10%", column = "cardNum" ) - @TableTitle(title ="证件号码",dataIndex = "cardNum",key = "cardNum", labelId = 1839) + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum", labelId = 1839) + @ExcelHead(title = "证件号码", dataIndex = "cardNum") private String cardNum; @SalaryTableColumn( text = "所得项目", width = "10%", column = "incomeItems" ) - @TableTitle(title ="所得项目",dataIndex = "incomeItems",key = "incomeItems", labelId = 544398) + @TableTitle(title = "所得项目", dataIndex = "incomeItems", key = "incomeItems", labelId = 544398) + @ExcelHead(title = "所得项目", dataIndex = "incomeItems") private String incomeItems; @SalaryTableColumn( text = "劳务收入", width = "10%", column = "laborIncome" ) - @TableTitle(title ="劳务收入",dataIndex = "laborIncome",key = "laborIncome", labelId = 544401) + @TableTitle(title = "劳务收入", dataIndex = "laborIncome", key = "laborIncome", labelId = 544401) + @ExcelHead(title = "劳务收入", dataIndex = "laborIncome") private String laborIncome; @SalaryTableColumn( text = "劳务免税收入", width = "10%", column = "laborTaxFreeIncome" ) - @TableTitle(title ="劳务免税收入",dataIndex = "laborTaxFreeIncome",key = "laborTaxFreeIncome", labelId = 544400) + @TableTitle(title = "劳务免税收入", dataIndex = "laborTaxFreeIncome", key = "laborTaxFreeIncome", labelId = 544400) + @ExcelHead(title = "劳务免税收入", dataIndex = "laborTaxFreeIncome") private String laborTaxFreeIncome; @SalaryTableColumn( text = "商业健康保险", width = "10%", column = "commercialHealthInsurance" ) - @TableTitle(title ="商业健康保险",dataIndex = "commercialHealthInsurance",key = "commercialHealthInsurance", labelId = 542292) + @TableTitle(title = "商业健康保险", dataIndex = "commercialHealthInsurance", key = "commercialHealthInsurance", labelId = 542292) + @ExcelHead(title = "商业健康保险", dataIndex = "commercialHealthInsurance") private String commercialHealthInsurance; @SalaryTableColumn( text = "税延养老保险", width = "10%", column = "taxDeferredEndowmentInsurance" ) - @TableTitle(title ="税延养老保险",dataIndex = "taxDeferredEndowmentInsurance",key = "taxDeferredEndowmentInsurance", labelId = 542293) + @TableTitle(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance", key = "taxDeferredEndowmentInsurance", labelId = 542293) + @ExcelHead(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance") private String taxDeferredEndowmentInsurance; @SalaryTableColumn( text = "其他", width = "10%", column = "other" ) - @TableTitle(title ="其他",dataIndex = "other",key = "other", labelId = 25740) + @TableTitle(title = "其他", dataIndex = "other", key = "other", labelId = 25740) + @ExcelHead(title = "其他", dataIndex = "other") private String other; @SalaryTableColumn( text = "准予扣除的捐赠额", width = "10%", column = "allowedDonation" ) - @TableTitle(title ="准予扣除的捐赠额",dataIndex = "allowedDonation",key = "allowedDonation", labelId = 542294) + @TableTitle(title = "准予扣除的捐赠额", dataIndex = "allowedDonation", key = "allowedDonation", labelId = 542294) + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "allowedDonation") private String allowedDonation; @SalaryTableColumn( text = "减免税额", width = "10%", column = "taxDeduction" ) - @TableTitle(title ="减免税额",dataIndex = "taxDeduction",key = "taxDeduction", labelId = 542675) + @TableTitle(title = "减免税额", dataIndex = "taxDeduction", key = "taxDeduction", labelId = 542675) + @ExcelHead(title = "减免税额", dataIndex = "taxDeduction") private String taxDeduction; @SalaryTableColumn( text = "备注", width = "10%", column = "description" ) - @TableTitle(title ="备注",dataIndex = "description",key = "description", labelId = 545315) + @TableTitle(title = "备注", dataIndex = "description", key = "description", labelId = 545315) + @ExcelHead(title = "备注", dataIndex = "description") private String description; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java index 00acb7724..beb46d312 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java @@ -4,6 +4,7 @@ import com.cloudstore.eccom.pc.table.WeaTableType; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -35,101 +36,126 @@ public class TaxDeclarationWageListDTO { @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum", labelId = 1933) @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum", labelId = 1933) + @ExcelHead(title = "工号", dataIndex = "jobNum") private String jobNum; @SalaryTableColumn(text = "姓名", width = "10%", column = "username", labelId = 25034) @TableTitle(title = "姓名", dataIndex = "username", key = "username", labelId = 25034) + @ExcelHead(title = "姓名", dataIndex = "username") private String username; @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType", labelId = 23787) @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType", labelId = 23787) + @ExcelHead(title = "证件类型", dataIndex = "cardType") private String cardType; @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum", labelId = 1839) @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum", labelId = 1839) + @ExcelHead(title = "证件号码", dataIndex = "cardNum") private String cardNum; @SalaryTableColumn(text = "本期收入", width = "10%", column = "income", labelId = 544405) @TableTitle(title = "本期收入", dataIndex = "income", key = "income", labelId = 544405) + @ExcelHead(title = "本期收入", dataIndex = "income") private String income; @SalaryTableColumn(text = "本期免税收入", width = "10%", column = "taxFreeIncome", labelId = 544404) @TableTitle(title = "本期免税收入", dataIndex = "taxFreeIncome", key = "taxFreeIncome", labelId = 544404) + @ExcelHead(title = "本期免税收入", dataIndex = "taxFreeIncome") private String taxFreeIncome; @SalaryTableColumn(text = "基本养老保险费", width = "10%", column = "endowmentInsurance", labelId = 542664) @TableTitle(title = "基本养老保险费", dataIndex = "endowmentInsurance", key = "endowmentInsurance", labelId = 542664) + @ExcelHead(title = "基本养老保险费", dataIndex = "endowmentInsurance") private String endowmentInsurance; @SalaryTableColumn(text = "基本医疗保险费", width = "10%", column = "medicalInsurance", labelId = 542665) @TableTitle(title = "基本医疗保险费", dataIndex = "medicalInsurance", key = "medicalInsurance", labelId = 542665) + @ExcelHead(title = "基本医疗保险费", dataIndex = "medicalInsurance") private String medicalInsurance; @SalaryTableColumn(text = "失业保险费", width = "10%", column = "unemploymentInsurance", labelId = 542666) @TableTitle(title = "失业保险费", dataIndex = "unemploymentInsurance", key = "unemploymentInsurance", labelId = 542666) + @ExcelHead(title = "失业保险费", dataIndex = "unemploymentInsurance") private String unemploymentInsurance; @SalaryTableColumn(text = "住房公积金", width = "10%", column = "housingProvidentFund", labelId = 25141) @TableTitle(title = "住房公积金", dataIndex = "housingProvidentFund", key = "housingProvidentFund", labelId = 25141) + @ExcelHead(title = "住房公积金", dataIndex = "housingProvidentFund") private String housingProvidentFund; @SalaryTableColumn(text = "累计子女教育", width = "10%", column = "addUpChildEducation", labelId = 542158) @TableTitle(title = "累计子女教育", dataIndex = "addUpChildEducation", key = "addUpChildEducation", labelId = 542158) + @ExcelHead(title = "累计子女教育", dataIndex = "addUpChildEducation") private String addUpChildEducation; @SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "addUpHousingLoanInterest", labelId = 542160) @TableTitle(title = "累计住房贷款利息", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest", labelId = 542160) + @ExcelHead(title = "累计住房贷款利息", dataIndex = "addUpHousingLoanInterest") private String addUpHousingLoanInterest; @SalaryTableColumn(text = "累计住房租金", width = "10%", column = "addUpHousingRent", labelId = 542161) @TableTitle(title = "累计住房租金", dataIndex = "addUpHousingRent", key = "addUpHousingRent", labelId = 542161) + @ExcelHead(title = "累计住房租金", dataIndex = "addUpHousingRent") private String addUpHousingRent; @SalaryTableColumn(text = "累计继续教育", width = "10%", column = "addUpContinuingEducation", labelId = 542159) @TableTitle(title = "累计继续教育", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation", labelId = 542159) + @ExcelHead(title = "累计继续教育", dataIndex = "addUpContinuingEducation") private String addUpContinuingEducation; @SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "addUpSupportElderly", labelId = 542162) @TableTitle(title = "累计赡养老人", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly", labelId = 542162) + @ExcelHead(title = "累计赡养老人", dataIndex = "addUpSupportElderly") private String addUpSupportElderly; @SalaryTableColumn(text = "累计大病医疗", width = "10%", column = "addUpIllnessMedical", labelId = 542163) @TableTitle(title = "累计大病医疗", dataIndex = "addUpIllnessMedical", key = "addUpIllnessMedical", labelId = 542163) + @ExcelHead(title = "累计大病医疗", dataIndex = "addUpIllnessMedical") private String addUpIllnessMedical; @SalaryTableColumn(text = "累计3岁以下婴幼儿照护", width = "10%", column = "addUpInfantCare", labelId = 544403) @TableTitle(title = "累计3岁以下婴幼儿照护", dataIndex = "addUpInfantCare", key = "addUpInfantCare", labelId = 544403) + @ExcelHead(title = "累计3岁以下婴幼儿照护", dataIndex = "addUpInfantCare") private String addUpInfantCare; @SalaryTableColumn(text = "累计个人养老金", width = "10%", column = "addUpPrivatePension", labelId = 542863) @TableTitle(title = "累计个人养老金", dataIndex = "addUpPrivatePension", key = "addUpPrivatePension", labelId = 542863) + @ExcelHead(title = "累计个人养老金", dataIndex = "addUpPrivatePension") private String addUpPrivatePension; @SalaryTableColumn(text = "企业(职业)年金", width = "10%", column = "annuity", labelId = 544402) @TableTitle(title = "企业(职业)年金", dataIndex = "annuity", key = "annuity", labelId = 544402) + @ExcelHead(title = "企业(职业)年金", dataIndex = "annuity") private String annuity; @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "commercialHealthInsurance", labelId = 542292) @TableTitle(title = "商业健康保险", dataIndex = "commercialHealthInsurance", key = "commercialHealthInsurance", labelId = 542292) + @ExcelHead(title = "商业健康保险", dataIndex = "commercialHealthInsurance") private String commercialHealthInsurance; @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "taxDeferredEndowmentInsurance", labelId = 542293) @TableTitle(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance", key = "taxDeferredEndowmentInsurance", labelId = 542293) + @ExcelHead(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance") private String taxDeferredEndowmentInsurance; @SalaryTableColumn(text = "其他", width = "10%", column = "other", labelId = 25740) @TableTitle(title = "其他", dataIndex = "other", key = "other", labelId = 25740) + @ExcelHead(title = "其他", dataIndex = "other") private String other; @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "allowedDonation", labelId = 542294) @TableTitle(title = "准予扣除的捐赠额", dataIndex = "allowedDonation", key = "allowedDonation", labelId = 542294) + @ExcelHead(title = "准予扣除的捐赠额", dataIndex = "allowedDonation") private String allowedDonation; @SalaryTableColumn(text = "减免税额", width = "10%", column = "taxDeduction", labelId = 542675) @TableTitle(title = "减免税额", dataIndex = "taxDeduction", key = "taxDeduction", labelId = 542675) + @ExcelHead(title = "减免税额", dataIndex = "taxDeduction") private String taxDeduction; @SalaryTableColumn(text = "备注", width = "10%", column = "description", labelId = 545315) @TableTitle(title = "备注", dataIndex = "description", key = "description", labelId = 545315) + @ExcelHead(title = "备注", dataIndex = "description") private String description; } diff --git a/src/com/engine/salary/enums/OperateTypeEnum.java b/src/com/engine/salary/enums/OperateTypeEnum.java index 07331496f..d715f4618 100644 --- a/src/com/engine/salary/enums/OperateTypeEnum.java +++ b/src/com/engine/salary/enums/OperateTypeEnum.java @@ -2,20 +2,36 @@ package com.engine.salary.enums; import com.engine.salary.util.SalaryI18nUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; + /** - * @Description: 操作类型 - * @Author: wangxiangzhong - * @Date: 2021/11/1 13:17 - */ -public enum OperateTypeEnum { + * 操作类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Getter +@AllArgsConstructor +public enum OperateTypeEnum implements BaseEnum{ ADD("1", SalaryI18nUtil.getI18nLabel(1421, "新增"), 1421), UPDATE("2", SalaryI18nUtil.getI18nLabel(17744, "更新"), 17744), DELETE("4", SalaryI18nUtil.getI18nLabel(535052, "删除"), 535052); + DELETE("3", "删除", 87061), + FILE("4", "归档", 92144), + CANCEL_FILE("5", "取消归档", 145989), + CLEAR("6", "一键清空", 158473), + CALCULATE("7", "核算", 94146), + SYNC("8", "同步", 93950), + EXCEL_IMPORT("9", "导入", 87622), + EXCEL_EXPORT("9", "导出", 87622); - private String value; + private final String value; - private String label; + private final String defaultLabel; private int labelId; @@ -25,12 +41,14 @@ public enum OperateTypeEnum { this.labelId = labelId; } + @Override public String getValue() { return value; } - public String getLabel() { - return label; + @Override + public String getDefaultLabel() { + return defaultLabel; } public int getLabelId() { diff --git a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java index d5e1e0738..3c9eb7a9c 100644 --- a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java +++ b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java @@ -19,6 +19,9 @@ public enum SalaryArchiveItemAdjustReasonEnum implements BaseEnum { ONBOARD("ONBOARD", SalaryI18nUtil.getI18nLabel(16250, "入职"), 16250), PROBATION_REVIEW("PROBATION_REVIEW", SalaryI18nUtil.getI18nLabel(6088, "转正"), 6088), SALARY_ADJUSTMENT("SALARY_ADJUSTMENT", SalaryI18nUtil.getI18nLabel(542686, "调薪"), 542686), + PROMOTION("PROMOTION", "晋升", 85985), + DEMOTION("DEMOTION", "降职", 85985), + JOB_TRANSFER("JOB_TRANSFER", "调岗", 85985), POSITION_OR_SALARY_ADJUSTMENT("POSITION_OR_SALARY_ADJUSTMENT", SalaryI18nUtil.getI18nLabel(542688, "调岗调薪"), 542688), DIMISSION("DIMISSION", SalaryI18nUtil.getI18nLabel(6091, "离职"), 6091), OTHER("OTHER", SalaryI18nUtil.getI18nLabel(25740, "其他"), 25740), diff --git a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveStatusEnum.java b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveStatusEnum.java index 86bf676d8..d94b5be6d 100644 --- a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveStatusEnum.java +++ b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveStatusEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.salaryarchive; import com.engine.salary.util.SalaryI18nUtil; +import java.util.Objects; + /** * 薪资档案状态 *

Copyright: Copyright (c) 2022

@@ -41,4 +43,13 @@ public enum SalaryArchiveStatusEnum { public int getLabelId() { return labelId; } + + public static SalaryArchiveStatusEnum parseByValue(String value) { + for (SalaryArchiveStatusEnum salaryArchiveStatusEnum : SalaryArchiveStatusEnum.values()) { + if (Objects.equals(salaryArchiveStatusEnum.getValue(), value)) { + return salaryArchiveStatusEnum; + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/siaccount/EmployeeStatusEnum.java b/src/com/engine/salary/enums/siaccount/EmployeeStatusEnum.java index 467156213..3fc29ea92 100644 --- a/src/com/engine/salary/enums/siaccount/EmployeeStatusEnum.java +++ b/src/com/engine/salary/enums/siaccount/EmployeeStatusEnum.java @@ -3,6 +3,8 @@ package com.engine.salary.enums.siaccount; import com.engine.salary.enums.BaseEnum; import com.engine.salary.util.SalaryI18nUtil; +import java.util.Objects; + /** * 福利档案人员状态枚举 @@ -46,4 +48,13 @@ public enum EmployeeStatusEnum implements BaseEnum { public String getDefaultLabel() { return this.defaultLable; } + + public static EmployeeStatusEnum parseByValue(String value){ + for (EmployeeStatusEnum employeeStatusEnum : EmployeeStatusEnum.values()) { + if(Objects.equals(employeeStatusEnum.getValue(), value)){ + return employeeStatusEnum; + } + } + return null; + } } diff --git a/src/com/engine/salary/formlua/constant/FormluaConstant.java b/src/com/engine/salary/formlua/constant/FormluaConstant.java index 2ae319a69..eb42f1c0c 100644 --- a/src/com/engine/salary/formlua/constant/FormluaConstant.java +++ b/src/com/engine/salary/formlua/constant/FormluaConstant.java @@ -998,7 +998,7 @@ public class FormluaConstant { " \"name\": \"IF\",\n" + " \"chineseName\": \"如果条件为真,则...否则...\",\n" + " \"description\": \"如果条件为真,则执行表达式1,为假则执行表达式2。条件中不可嵌套使用IF函数。\",\n" + - " \"example\": \"IF({员工表.年龄} > 60, '退休', '在职')
IF({员工表.年龄} > 60, IF({员工表.性别} = {员工表.性别.女}, '退休', '在职'), '在职')\",\n" + + " \"example\": \"IF({员工表.年龄} > 60, '退休', '在职') \",\n" + " \"result\": \"'退休'
'在职'\",\n" + " \"paramDescs\": [\n" + " \"*条件*(必选)\",\n" + diff --git a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java index 474538c3e..9bf25ddae 100644 --- a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java +++ b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java @@ -12,7 +12,7 @@ import java.util.LinkedList; import java.util.List; -@Component + public class ExcelFuncs { protected final Logger logger = LoggerFactory.getLogger(getClass()); final static private String ALLFORM="all"; diff --git a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java index d4e5fcee3..666135c26 100644 --- a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java +++ b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.Map; -@Component + public class FuncDescUtil { protected final Logger logger = LoggerFactory.getLogger(FuncDescUtil.class); Map funcMap = new HashMap(); diff --git a/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java b/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java index 294c0e6a3..066139b02 100644 --- a/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java +++ b/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java @@ -121,7 +121,6 @@ public class SalaryAcctManager extends Service { private SalaryAcctResultTempService getSalaryAcctResultTempService(User user) { return ServiceUtil.getService(SalaryAcctResultTempServiceImpl.class, user); } -// private LoggerTemplate salaryAcctRecordLoggerTemplate; private SIAccountService getSIAccountService(User user) { return ServiceUtil.getService(SIAccountServiceImpl.class, user); diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java index c25f47e55..79f7dcf30 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java @@ -133,4 +133,6 @@ public interface SalaryArchiveMapper { void deleteByIds(@Param("ids")Collection deleteIds); List listPayEndDateIsNull(@Param("ids")List employeeIds); + + List listPayStartDateIsNull(@Param("runStatus")String runStatus); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index 03facc683..0ad41c310 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -183,6 +183,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -264,6 +276,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -346,6 +370,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -686,6 +722,15 @@ + + UPDATE hrsa_salary_archive diff --git a/src/com/engine/salary/mapper/datacollection/AttendQuoteFieldMapper.xml b/src/com/engine/salary/mapper/datacollection/AttendQuoteFieldMapper.xml index 0f3791981..4c1ae10ee 100644 --- a/src/com/engine/salary/mapper/datacollection/AttendQuoteFieldMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/AttendQuoteFieldMapper.xml @@ -357,6 +357,9 @@ WHERE t1.delete_type = 0 + + AND enable_status = #{param.enableStatus} + ORDER BY t1.source_type,t1.id DESC diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.java b/src/com/engine/salary/mapper/datacollection/EmployMapper.java index 17bf9d300..17bf3b1f7 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.java +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.java @@ -51,6 +51,9 @@ public interface EmployMapper { */ List listByParams(@Param("params") Collection queryParams); + List listByVirtualParams(@Param("params") Collection queryParams); + + /** * 多表,详细信息 * @param employeeId @@ -78,6 +81,15 @@ public interface EmployMapper { */ List getDeptInfoList(@Param("departmentIds") List departmentIds); + + /** + * 虚拟部门(其他组织维度) + * @param virtualDepartmentIds + * @return + */ + List getVirtualDeptInfoList(@Param("virtualDepartmentIds") List virtualDepartmentIds); + + /** * 所以分部 * @param subDepartmentIds @@ -85,6 +97,13 @@ public interface EmployMapper { */ List getSubCompanyInfoList(@Param("subDepartmentIds") List subDepartmentIds); + /** + * 虚拟分部 + * @param virtualSubCompanyIds + * @return + */ + List getVirtualSubCompanyInfoList(@Param("virtualSubCompanyIds") List virtualSubCompanyIds); + List listHrmInfoByIdAndName(@Param("param") HrmQueryParam param); List listExtHrmInfoByIdAndName(@Param("param") HrmQueryParam param); @@ -117,4 +136,18 @@ public interface EmployMapper { * @return */ List listByManagerId(@Param("managerId") String managerId); + + /** + * 根据虚拟部门获取人员信息 + * @param virtualDepartmentIds + * @return + */ + List listVirtualEmpByVirtualDepIds(@Param("virtualDepartmentIds") List virtualDepartmentIds); + + /** + * 根据虚拟分部获取人员信息 + * @param virtualSubCompanyIds + * @return + */ + List listVirtualEmpByVirtualSubCompanyIds(@Param("virtualSubCompanyIds") List virtualSubCompanyIds); } \ 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 1cff796fe..ac679e0fa 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -151,6 +151,54 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index 2d377e0ea..0afae02a2 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -464,6 +464,13 @@ + + + + when id=#{item.id} then #{item.updateTime} + + + where id in diff --git a/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.java index 995612ae7..1ab7d778a 100644 --- a/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.java +++ b/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.java @@ -32,4 +32,6 @@ public interface SpecialAddDeductionMapper { @Param("taxAgentId") Long taxAgentId); List listAll(); + + List listSome(SpecialAddDeductionPO specialAddDeduction); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.xml index 1464a979e..ce701f1d9 100644 --- a/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/SpecialAddDeductionMapper.xml @@ -690,4 +690,66 @@ from hrsa_special_add_deduction t1 + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/report/SalaryStatisticsReportMapper.xml b/src/com/engine/salary/mapper/report/SalaryStatisticsReportMapper.xml index d85fc85bd..4b04c8342 100644 --- a/src/com/engine/salary/mapper/report/SalaryStatisticsReportMapper.xml +++ b/src/com/engine/salary/mapper/report/SalaryStatisticsReportMapper.xml @@ -25,6 +25,7 @@ + @@ -58,6 +59,7 @@ , t.tenant_key , t.update_time , t.time_type + , t.salary_sob_setting @@ -242,6 +244,9 @@ tax_agent_setting, + + salary_sob_setting, + tenant_key, @@ -319,6 +324,9 @@ #{taxAgentSetting}, + + #{salarySobSetting}, + #{tenantKey}, @@ -354,6 +362,7 @@ status_setting=#{statusSetting}, sub_company_setting=#{subCompanySetting}, tax_agent_setting=#{taxAgentSetting}, + salary_sob_setting=#{salarySobSetting}, tenant_key=#{tenantKey}, update_time=#{updateTime}, @@ -431,6 +440,9 @@ tax_agent_setting=#{taxAgentSetting}, + + salary_sob_setting=#{salarySobSetting}, + tenant_key=#{tenantKey}, diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index fcc53a473..06d86e035 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -1229,6 +1229,12 @@ #{taxAgentId} + + AND salary_sob_id IN + + #{salarySobId} + + AND salary_month IN diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java index 13229c4f1..c69a4ce49 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java @@ -76,6 +76,6 @@ public interface SalaryAcctResultLogMapper { * @param salaryAcctEmployeeIds * @param lockSalaryItemIds */ - void deleteBySalaryAcctEmpIdExceptItemIds(@Param("salaryAcctEmployeeIds") Collection salaryAcctEmployeeIds, + void deleteBySalaryAcctEmpIdExceptItemIds(@Param("salaryAcctEmployeeIds") List salaryAcctEmployeeIds, @Param("exceptItems") Collection lockSalaryItemIds, @Param("updateTime") Date updateTime); } diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml index 8ba6d8720..69cbeb937 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml @@ -41,6 +41,7 @@ , t.bill_read_status , t.bill_confirm_status , t.send_employee_id + , t.first_reading_time update hrsa_salary_send_info @@ -380,6 +381,13 @@ and t1.send_status in (0, 2) + + + AND e.subcompanyid1 IN + + #{subCompanyId} + + @@ -410,6 +418,12 @@ and t1.send_status in (0, 2) + + + AND e.subcompanyid1 IN + + #{subCompanyId} + @@ -440,7 +454,12 @@ and t1.send_status in (0, 2) - + + AND e.subcompanyid1 IN + + #{subCompanyId} + + @@ -512,6 +531,12 @@ )) + + AND e.subcompanyid1 IN + + #{subCompanyId} + + @@ -619,6 +644,7 @@ hrsa_salary_send_info + first_reading_time = null, send_status = #{po.sendStatus}, @@ -797,6 +823,9 @@ bill_confirm_status=#{billConfirmStatus}, + + first_reading_time=#{firstReadingTime}, + WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml index c78a00525..e3d729fd4 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml @@ -97,7 +97,8 @@ send_total, last_send_time, send_status, - salary_acct_type + salary_acct_type, + creator FROM hrsa_salary_send WHERE delete_type = 0 AND id = #{id} diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index a88ac1600..0d866f7af 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -57,8 +57,10 @@ , t.auto_send_day_of_month , t.auto_send_time_of_day , t.ack_feedback_status + , t.feedback_status , t.auto_ack_days , t.feedback_url + , t.mobile_feedback_url , t.create_time , t.update_time , t.creator @@ -90,8 +92,10 @@ auto_send_day_of_month, auto_send_time_of_day, ack_feedback_status, + feedback_status, auto_ack_days, feedback_url, + mobile_feedback_url, create_time, update_time, creator, @@ -366,7 +370,8 @@ t.replenish_name as replenishName, s.name as salarysob, t.use_type as useType, - t.description + t.description, + t.salary_sob_id from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id where t.delete_type = 0 @@ -398,7 +403,8 @@ t.replenish_name as replenishName, s.name as salarysob, t.use_type as useType, - t.description + t.description, + t.salary_sob_id from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id where t.delete_type = 0 @@ -430,7 +436,8 @@ t.replenish_name as replenishName, s.name as salarysob, t.use_type as useType, - t.description + t.description, + t.salary_sob_id from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id where t.delete_type = 0 @@ -528,12 +535,18 @@ ack_feedback_status=#{ackFeedbackStatus}, + + feedback_status=#{feedbackStatus}, + auto_ack_days=#{autoAckDays}, feedback_url=#{feedbackUrl}, + + mobile_feedback_url=#{mobileFeedbackUrl}, + create_time=#{createTime}, @@ -630,12 +643,18 @@ ack_feedback_status, + + feedback_status, + auto_ack_days, feedback_url, + + mobile_feedback_url, + create_time, @@ -728,12 +747,18 @@ #{ackFeedbackStatus}, + + #{feedbackStatus}, + #{autoAckDays}, #{feedbackUrl}, + + #{mobileFeedbackUrl}, + #{createTime}, @@ -836,12 +861,18 @@ ack_feedback_status, + + feedback_status, + auto_ack_days, feedback_url, + + mobile_feedback_url, + create_time, @@ -934,12 +965,18 @@ #{ackFeedbackStatus}, + + #{feedbackStatus}, + #{autoAckDays}, #{feedbackUrl}, + + #{mobileFeedbackUrl}, + #{createTime}, @@ -956,7 +993,7 @@ #{tenantKey}, - #{sms_setting}, + #{smsSetting}, diff --git a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml index b50d6a15d..5b225759d 100644 --- a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml @@ -52,7 +52,8 @@ t.shared_type, t.tax_agent_ids, t.sorted_index, - t.hide_default + t.hide_default, + t.width @@ -218,6 +219,9 @@ sorted_index, + + width, + @@ -289,6 +293,9 @@ #{sortedIndex}, + + #{width}, + @@ -360,6 +367,9 @@ tax_agent_ids=#{taxAgentIds}, + + width=#{width}, + sorted_index=#{sortedIndex}, WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java index 105c0f636..1129a814f 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java @@ -36,4 +36,8 @@ public interface ExcelInsuranceDetailMapper { * 批量保存 */ void batchSave(@Param("accounts") Collection accounts); + + List listAll(); + + void updateBatchSelective(@Param("list")List excelInsuranceDetailPOS); } diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml index d45fdec16..53c1265b1 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml @@ -69,10 +69,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -114,6 +117,185 @@ + + update hrsa_excel_bill_detail + + + + + + when id = #{item.id} then #{item.socialPaymentComBaseString} + + + + + + + when id = #{item.id} then #{item.fundPaymentComBaseString} + + + + + + + when id = #{item.id} then #{item.otherPaymentComBaseString} + + + + + + + when id = #{item.id} then #{item.socialPaymentBaseString} + + + + + + + when id = #{item.id} then #{item.fundPaymentBaseString} + + + + + + + when id = #{item.id} then #{item.otherPaymentBaseString} + + + + + + + when id = #{item.id} then #{item.socialPerJson} + + + + + + + when id = #{item.id} then #{item.socialPerSum} + + + + + + + when id = #{item.id} then #{item.fundPerJson} + + + + + + + when id = #{item.id} then #{item.fundPerSum} + + + + + + + when id = #{item.id} then #{item.otherPerJson} + + + + + + + when id = #{item.id} then #{item.otherPerSum} + + + + + + + when id = #{item.id} then #{item.perSum} + + + + + + + when id = #{item.id} then #{item.socialComJson} + + + + + + + when id = #{item.id} then #{item.socialComSum} + + + + + + + when id = #{item.id} then #{item.fundComJson} + + + + + + + when id = #{item.id} then #{item.fundComSum} + + + + + + + when id = #{item.id} then #{item.otherComJson} + + + + + + + when id = #{item.id} then #{item.otherComSum} + + + + + + + when id = #{item.id} then #{item.comSum} + + + + + + + when id = #{item.id} then #{item.socialSum} + + + + + + + when id = #{item.id} then #{item.fundSum} + + + + + + + when id = #{item.id} then #{item.otherSum} + + + + + + + when id = #{item.id} then #{item.total} + + + + + where id in + + #{item.id} + + + + @@ -157,7 +394,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -204,7 +442,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -213,7 +454,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.id,jdbcType=DOUBLE}, @@ -259,7 +501,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -269,7 +514,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.id}, @@ -315,7 +561,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java index 60cd71788..7a183297d 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java @@ -50,6 +50,9 @@ public interface InsuranceAccountBatchMapper { */ void updateById(InsuranceAccountBatchPO pos); + InsuranceAccountBatchPO getById(@Param("id") Long id); + + /** * * @param billMonth diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml index 61223c9b0..4b45cb2f3 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml @@ -244,6 +244,15 @@ + + + + + UPDATE hrsa_insurance_base_info diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java index f468b0d45..6ad9fbe78 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java @@ -36,6 +36,13 @@ public interface OtherSchemeMapper { */ List getOtherById(@Param("ids")List ids); + /** + * 根据id获取单条 + * @param id + * @return + */ + InsuranceArchivesOtherSchemePO getOneById(@Param("id")Long id); + /** * 批量删除 * @param singletonList diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index d1a18db07..7885d7358 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -12,6 +12,7 @@ + @@ -31,6 +32,7 @@ , t.payment_organization , t.under_take , t.other_payment_base_string + , t.other_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -78,6 +80,15 @@ + + + UPDATE hrsa_other_archives @@ -129,7 +140,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( @@ -146,7 +158,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -165,7 +178,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) select #{item.otherSchemeId,jdbcType=DOUBLE}, @@ -181,7 +195,8 @@ #{item.nonPayment,jdbcType=INTEGER}, #{item.creator,jdbcType=DOUBLE}, #{item.paymentOrganization,jdbcType=DOUBLE}, - #{item.otherPaymentBaseString,jdbcType=VARCHAR} + #{item.otherPaymentBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -201,7 +216,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{item.otherSchemeId}, @@ -217,7 +233,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -258,6 +275,13 @@ + + + + when id=#{item.id} then #{item.otherPaymentComBaseString} + + + @@ -292,6 +316,7 @@ welfare_type = #{welfareType}, other_payment_base_string = #{otherPaymentBaseString}, + other_payment_com_base_string = #{otherPaymentComBaseString}, other_scheme_id = #{otherSchemeId}, other_end_time = #{otherEndTime}, other_start_time = #{otherStartTime}, @@ -340,7 +365,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{otherSchemeId}, @@ -356,7 +382,8 @@ #{nonPayment}, #{creator}, #{paymentOrganization}, - #{otherPaymentBaseString} + #{otherPaymentBaseString}, + #{otherPaymentComBaseString} ) \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 8472020a2..14bc0be8e 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -13,6 +13,7 @@ + @@ -33,6 +34,7 @@ , t.payment_organization , t.under_take , t.social_payment_base_string + , t.social_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -128,6 +130,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -146,6 +149,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -166,6 +170,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -183,6 +188,7 @@ #{item.welfareType,jdbcType=INTEGER}, #{item.deleteType,jdbcType=INTEGER}, #{item.socialPaymentBaseString,jdbcType=VARCHAR}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, #{item.socialSchemeId,jdbcType=DOUBLE}, #{item.createTime,jdbcType=DATE}, #{item.socialEndTime,jdbcType=VARCHAR}, @@ -204,6 +210,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -221,6 +228,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -921,6 +929,13 @@ + + + + when id=#{item.id} then #{item.socialPaymentComBaseString} + + + @@ -955,6 +970,7 @@ welfare_type = #{welfareType}, social_payment_base_string = #{socialPaymentBaseString}, + social_payment_com_base_string = #{socialPaymentComBaseString}, social_scheme_id = #{socialSchemeId}, social_end_time = #{socialEndTime}, social_start_time = #{socialStartTime}, @@ -994,6 +1010,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -1011,6 +1028,7 @@ #{welfareType}, #{deleteType}, #{socialPaymentBaseString}, + #{socialPaymentComBaseString}, #{socialSchemeId}, #{createTime}, #{socialEndTime}, diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java index 52c98c89d..9af378c42 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java @@ -74,6 +74,8 @@ public interface InsuranceSchemeDetailMapper { List listAll(); + List listBySchemeIds(@Param("schemeIds")Collection schemeIds); + int batchUpdate(@Param("collection") List insuranceSchemeDetailPos); int updateAll(InsuranceSchemeDetailPO insuranceSchemeDetailPo); diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml index dba56d9b9..d4b15075f 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml @@ -270,6 +270,18 @@ WHERE delete_type = 0 + + update hrsa_scheme_detail diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.java b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.java index 7403a8511..11cbfd0b2 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.java +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.java @@ -51,6 +51,8 @@ public interface InsuranceSchemeMapper { */ List listAll(); + List listBySchemeIds(@Param("schemeIds")Collection schemeIds); + /** * 获取名称 diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml index d6a671a92..d70a73724 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeMapper.xml @@ -87,6 +87,17 @@ ORDER BY id DESC + ) JSON.parseArray(po.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); } + if (po.getSalarySobSetting() != null) { + param.setSalarySob(((List) JSON.parseArray(po.getSalarySobSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } // param.setIncomeCategory(((List) JSON.parseArray(po.getIncomeCategorySetting(), Map.class)).stream().map(m -> Integer.valueOf(m.get(key).toString())).collect(Collectors.toList())); if (po.getSubCompanySetting() != null) { param.setSubCompany(((List) JSON.parseArray(po.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); @@ -932,6 +936,16 @@ public class SalaryStatisticsReportBO { return sumDecimal; } + private static String handle4GroupValue(String dimCode, SalaryAcctEmployeePO sa, Map> salaryAcctResultValueMap, SalaryStatisticsItemPO item) { + if (salaryAcctResultValueMap.get(sa.getId()) != null) { + String value = salaryAcctResultValueMap.get(sa.getId()).get(dimCode); + if (StringUtils.isNotBlank(value)) { + return value; + } + } + return ""; + } + /** * 定量-单项式分组list分割 * @@ -960,6 +974,22 @@ public class SalaryStatisticsReportBO { return list.stream().filter(i -> ids.contains(i.getId())).collect(Collectors.toList()); } + public static List listAcctEmpByRationGroupIndividual(String groupIndividual, String dimCode, List list, Map yearMap, Map> salaryAcctResultValueMap, List salaryStatisticsItemList) { + Set ids = Sets.newHashSet(); + + for (SalaryAcctEmployeePO sa : list) { + salaryStatisticsItemList.forEach(item -> { + String value = handle4GroupValue(dimCode, sa, salaryAcctResultValueMap, item); + + if (StrUtil.equals(groupIndividual, value)) { + ids.add(sa.getId()); + } + }); + } + + return list.stream().filter(i -> ids.contains(i.getId())).collect(Collectors.toList()); + } + public static Map checkLoad(List salaryStatisticsItemList) { boolean isNow = false; boolean isLast = false; diff --git a/src/com/engine/salary/report/entity/param/SalaryStatisticsReportDataQueryParam.java b/src/com/engine/salary/report/entity/param/SalaryStatisticsReportDataQueryParam.java index fa1d32dd1..8fe73f9a5 100644 --- a/src/com/engine/salary/report/entity/param/SalaryStatisticsReportDataQueryParam.java +++ b/src/com/engine/salary/report/entity/param/SalaryStatisticsReportDataQueryParam.java @@ -40,6 +40,10 @@ public class SalaryStatisticsReportDataQueryParam extends BaseQueryParam { //个税扣缴义务人配置 private List taxAgent; + //薪资账套配置 + @JsonIgnore + private List salarySob; + @JsonIgnore //收入所得项目配置 private List incomeCategory; diff --git a/src/com/engine/salary/report/entity/param/SalaryStatisticsSearchConditionSaveParam.java b/src/com/engine/salary/report/entity/param/SalaryStatisticsSearchConditionSaveParam.java index ff0bc3964..3884fcf8f 100644 --- a/src/com/engine/salary/report/entity/param/SalaryStatisticsSearchConditionSaveParam.java +++ b/src/com/engine/salary/report/entity/param/SalaryStatisticsSearchConditionSaveParam.java @@ -22,10 +22,10 @@ import java.util.Map; @NoArgsConstructor @AllArgsConstructor public class SalaryStatisticsSearchConditionSaveParam { - //报表id + //报表id private Long id; - //统计维度 + //统计维度 private Long dimension; /** @@ -43,42 +43,45 @@ public class SalaryStatisticsSearchConditionSaveParam { //事件类型 private Integer timeType; - //薪资所属月-开始月 + //薪资所属月-开始月 private Date salaryStartMonth; - //薪资所属月-终止月 + //薪资所属月-终止月 private Date salaryEndMonth; - //个税扣缴义务人配置 + //个税扣缴义务人配置 private List> taxAgent; - //收入所得项目配置 + //薪资账套配置 + private List> salarySob; + + //收入所得项目配置 private List> incomeCategory; - //分部配置 + //分部配置 private List> subCompany; - //部门配置 + //部门配置 private List> department; - //职级配置 + //职级配置 private List> grade; - //岗位配置 + //岗位配置 private List> position; - //人员状态配置 + //人员状态配置 private List> status; - //人员 + //人员 private List> employee; - //入职日期 + //入职日期 private List hiredate; - //离职日期 + //离职日期 private List leavedate; - //统计项列表 + //统计项列表 private List items; } diff --git a/src/com/engine/salary/report/entity/po/SalaryStatisticsItemPO.java b/src/com/engine/salary/report/entity/po/SalaryStatisticsItemPO.java index bcf430d57..5c1b3bb52 100644 --- a/src/com/engine/salary/report/entity/po/SalaryStatisticsItemPO.java +++ b/src/com/engine/salary/report/entity/po/SalaryStatisticsItemPO.java @@ -1,5 +1,6 @@ package com.engine.salary.report.entity.po; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.report.enums.UnitTypeEnum; import lombok.*; @@ -12,22 +13,27 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor @ToString -//hrsa_salary_statistics_item") -//薪酬报表统计子表自定义统计项") +//hrsa_salary_statistics_item +//薪酬报表统计子表自定义统计项 +@ElogTransform(name = "统计项目") public class SalaryStatisticsItemPO implements Serializable { private static final long serialVersionUID = 5335849418826222822L; - //主键id") + //主键id + @ElogTransform(name = "主键id") private Long id; - //统计报表id") + //统计报表id + @ElogTransform(name = "报表id") private Long statReportId; - //统计项名称") + //统计项名称 + @ElogTransform(name = "统计项名称") private String itemName; - //统计项集合") + //统计项集合 + @ElogTransform(name = "统计项集合") private String itemValue; /** @@ -43,7 +49,8 @@ public class SalaryStatisticsItemPO implements Serializable { * } * jsonToString */ - //计数规则") + //计数规则 + @ElogTransform(name = "计数规则") private String countRule; /** @@ -59,7 +66,8 @@ public class SalaryStatisticsItemPO implements Serializable { * } * jsonToString */ - //求和规则") + //求和规则 + @ElogTransform(name = "求和规则") private String sumRule; /** @@ -75,7 +83,8 @@ public class SalaryStatisticsItemPO implements Serializable { * } * jsonToString */ - //平均值规则") + //平均值规则 + @ElogTransform(name = "平均值规则") private String avgRule; /** @@ -91,7 +100,8 @@ public class SalaryStatisticsItemPO implements Serializable { * } * jsonToString */ - //最大值规则") + //最大值规则 + @ElogTransform(name = "最大值规则") private String maxRule; /** @@ -107,7 +117,8 @@ public class SalaryStatisticsItemPO implements Serializable { * } * jsonToString */ - //最小值规则") + //最小值规则 + @ElogTransform(name = "最小值规则") private String minRule; /** @@ -123,7 +134,8 @@ public class SalaryStatisticsItemPO implements Serializable { * } * jsonToString */ - //中位数规则") + //中位数规则 + @ElogTransform(name = "中位数规则") private String medianRule; @@ -132,6 +144,7 @@ public class SalaryStatisticsItemPO implements Serializable { *

* "totalValue":"1", 是否使用 */ + @ElogTransform(name = "最近值是否使用") private String lastRule; /** @@ -141,6 +154,7 @@ public class SalaryStatisticsItemPO implements Serializable { * "totalValue":"1", 是否使用 * } */ + @ElogTransform(name = "最早值是否使用") private String oldRule; /** @@ -150,6 +164,7 @@ public class SalaryStatisticsItemPO implements Serializable { * "totalValue":"1", 是否使用 * } */ + @ElogTransform(name = "出现最多是否使用") private String frequentRule; /** @@ -159,9 +174,11 @@ public class SalaryStatisticsItemPO implements Serializable { * "totalValue":"1", 是否使用 * } */ + @ElogTransform(name = "平铺是否使用") private String tileRule; - //顺序") + //顺序 + @ElogTransform(name = "顺序") private Integer indexValue; /** @@ -169,22 +186,23 @@ public class SalaryStatisticsItemPO implements Serializable { * * @see UnitTypeEnum */ - //统计单位") + //统计单位 + @ElogTransform(name = "统计单位") private Integer unitType; - //创建时间") + //创建时间 private Date createTime; - //更新时间") + //更新时间 private Date updateTime; - //创建人") + //创建人 private Long creator; - //是否删除") + //是否删除 private Integer deleteType; - //租户key") + //租户key private String tenantKey; private Collection ids; diff --git a/src/com/engine/salary/report/entity/po/SalaryStatisticsReportPO.java b/src/com/engine/salary/report/entity/po/SalaryStatisticsReportPO.java index cdf364f62..08061bddd 100644 --- a/src/com/engine/salary/report/entity/po/SalaryStatisticsReportPO.java +++ b/src/com/engine/salary/report/entity/po/SalaryStatisticsReportPO.java @@ -1,5 +1,6 @@ package com.engine.salary.report.entity.po; +import com.engine.hrmelog.annotation.ElogTransform; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,77 +23,108 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_salary_stats_report +@ElogTransform(name = "薪酬统计报表") public class SalaryStatisticsReportPO implements Serializable { private static final long serialVersionUID = 6526480959578343197L; //主键id + @ElogTransform(name = "主键id") private Long id; //报表名称 + @ElogTransform(name = "报表名称") private String reportName; + @ElogTransform(name = "备注") private String remark; + @ElogTransform(name = "二级维度") private String secondDimension; + + @ElogTransform(name = "排序列") private String sortIndex; + + @ElogTransform(name = "排序方式") private String sortType; //时间类型 + @ElogTransform(name = "时间类型") private Integer timeType; //统计维度 + @ElogTransform(name = "统计维度") private String dimension; //薪资所属月-起始 + @ElogTransform(name = "薪资所属月-起始") private Date salaryStartMonth; //薪资所属月-截止 + @ElogTransform(name = "薪资所属月-截止") private Date salaryEndMonth; //个税扣缴义务人配置 + @ElogTransform(name = "个税扣缴义务人配置") private String taxAgentSetting; + //薪资账套配置 + private String salarySobSetting; + //收入所得项目配置 + @ElogTransform(name = "收入所得项目配置") private String incomeCategorySetting; //分部配置 + @ElogTransform(name = "分部配置") private String subCompanySetting; //部门配置 + @ElogTransform(name = "部门配置") private String departSetting; //职级配置 + @ElogTransform(name = "职级配置") private String gradeSetting; //岗位配置 + @ElogTransform(name = "岗位配置") private String positionSetting; //人员状态配置 + @ElogTransform(name = "人员状态配置") private String statusSetting; //人员配置 + @ElogTransform(name = "人员配置") private String employeeSetting; //入职日期配置 + @ElogTransform(name = "入职日期配置") private String hiredateSetting; //离职日期配置 + @ElogTransform(name = "离职日期配置") private String leavedateSetting; //租户key + @ElogTransform(name = "租户key", ignore = true) private String tenantKey; //创建人id + @ElogTransform(name = "创建人id", ignore = true) private Long creator; //是否删除 + @ElogTransform(name = "是否删除", ignore = true) private Integer deleteType; //创建时间 + @ElogTransform(name = "创建时间", ignore = true) private Date createTime; //更新时间 + @ElogTransform(name = "更新时间", ignore = true) private Date updateTime; diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsDimensionServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsDimensionServiceImpl.java index 51be84b2d..4fd707962 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsDimensionServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsDimensionServiceImpl.java @@ -21,7 +21,7 @@ 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 com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsEchartsServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsEchartsServiceImpl.java index f96758c2d..71197f030 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsEchartsServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsEchartsServiceImpl.java @@ -11,7 +11,7 @@ import com.engine.salary.report.service.SalaryStatisticsEchartsService; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java index e4207c1c8..ef339de4a 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java @@ -1,7 +1,10 @@ package com.engine.salary.report.service.impl; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.report.SalaryStatisticsItemMapper; @@ -12,10 +15,11 @@ import com.engine.salary.report.service.SalaryStatisticsItemService; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; -import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; +import org.springframework.beans.BeanUtils; import java.util.*; import java.util.stream.Collectors; @@ -66,15 +70,17 @@ public class SalaryStatisticsItemServiceImpl extends Service implements SalarySt List list = this.listByIds(ids); if (CollectionUtils.isNotEmpty(list)) { getSalaryStatisticsItemMapper().deleteByIds(ids); -// list.forEach(po -> { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(po.getId())); -// loggerContext.setTargetName(po.getItemName()); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),152639, "删除统计项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),152639, "删除统计项目")); -// salaryStatReportLoggerTemplate.write(loggerContext); -// }); + list.forEach(po -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(po.getId())); + loggerContext.setTargetName(po.getItemName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除统计项目")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除统计项目")); + loggerContext.setOldValues(po); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); + }); } return StringUtils.EMPTY; } @@ -130,19 +136,24 @@ public class SalaryStatisticsItemServiceImpl extends Service implements SalarySt getSalaryStatisticsItemMapper().insertIgnoreNull(subTableItemPO); // 记录操作日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(subTableItemPO.getId())); -// loggerContext.setTargetName(subTableItemPO.getItemName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),152643, "新增统计项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),152643, "新增统计项目")); -// salaryStatReportLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(subTableItemPO.getId())); + loggerContext.setTargetName(subTableItemPO.getItemName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增统计项目")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增统计项目")); + loggerContext.setNewValues(subTableItemPO); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); // 更新 } else { SalaryStatisticsItemPO itemPO = this.getById(saveParam.getId()); SalaryAssert.notNull(itemPO, SalaryI18nUtil.getI18nLabel(user.getLanguage(),152591, "统计项目不存在")); Optional.ofNullable(saveParam.getItemName()).ifPresent(itemPO::setItemName); + SalaryStatisticsItemPO oldPO = new SalaryStatisticsItemPO(); + BeanUtils.copyProperties(itemPO, oldPO); + if (Objects.nonNull(saveParam.getUnitType())) { itemPO.setUnitType(saveParam.getUnitType()); } else { @@ -162,13 +173,16 @@ public class SalaryStatisticsItemServiceImpl extends Service implements SalarySt getSalaryStatisticsItemMapper().updateIgnoreNull(itemPO); // 记录操作日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(itemPO.getId())); -// loggerContext.setTargetName(itemPO.getItemName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),152669, "更新统计项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),152669, "更新统计项目")); -// salaryStatReportLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(itemPO.getId().toString()); + loggerContext.setTargetName(itemPO.getItemName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增统计项目")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增统计项目")); + loggerContext.setOldValues(oldPO); + loggerContext.setNewValues(itemPO); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); } return StringUtils.EMPTY; } diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java index 4042de2b5..4248fab9d 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java @@ -32,7 +32,7 @@ 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 com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java index 670aa7884..308e20170 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO; import com.engine.salary.entity.hrm.dto.FieldSetting; @@ -13,6 +15,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; 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.OperateTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.report.SalaryStatisticsReportMapper; import com.engine.salary.report.common.constant.SalaryConstant; @@ -31,13 +34,13 @@ import com.engine.salary.report.util.ReportTimeUtil; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -194,13 +197,16 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary this.getSalaryStatisticsReportMapper().updateIgnoreNull(poNew); // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(poNew.getId())); -// loggerContext.setTargetName(poNew.getReportName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 152565, "更新报表")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 152565, "更新报表")); -// salaryStatReportLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(poNew.getId())); + loggerContext.setTargetName(poNew.getReportName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "更新报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "更新报表")); + loggerContext.setOldValues(po); + loggerContext.setNewValues(poNew); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); } else { List list = listByName(saveParam.getReportName()); if (CollectionUtils.isNotEmpty(list)) { @@ -211,13 +217,15 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary getSalaryStatisticsReportMapper().insertIgnoreNull(poNew); // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(poNew.getId())); -// loggerContext.setTargetName(poNew.getReportName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 152561, "新增报表")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 152561, "新增报表")); -// salaryStatReportLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(poNew.getId())); + loggerContext.setTargetName(poNew.getReportName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增报表")); + loggerContext.setNewValues(poNew); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); } return StringUtils.EMPTY; } @@ -228,11 +236,19 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary if (Objects.isNull(param.getSalaryStartMonth()) || Objects.isNull(param.getSalaryEndMonth())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),100294, "薪资所属月必传")); } - if ((CollectionUtils.isNotEmpty(param.getTaxAgent()) && param.getTaxAgent().size() > 10) || (CollectionUtils.isNotEmpty(param.getIncomeCategory()) && param.getIncomeCategory().size() > 10) || (CollectionUtils.isNotEmpty(param.getSubCompany()) && param.getSubCompany().size() > 10) || (CollectionUtils.isNotEmpty(param.getGrade()) && param.getGrade().size() > 10) || (CollectionUtils.isNotEmpty(param.getPosition()) && param.getPosition().size() > 10) || (CollectionUtils.isNotEmpty(param.getStatus()) && param.getStatus().size() > 10) || (CollectionUtils.isNotEmpty(param.getEmployee()) && param.getEmployee().size() > 10)) { + if ((CollectionUtils.isNotEmpty(param.getTaxAgent()) && param.getTaxAgent().size() > 10) + || (CollectionUtils.isNotEmpty(param.getIncomeCategory()) && param.getIncomeCategory().size() > 10) + || (CollectionUtils.isNotEmpty(param.getSubCompany()) && param.getSubCompany().size() > 10) + || (CollectionUtils.isNotEmpty(param.getGrade()) && param.getGrade().size() > 10) + || (CollectionUtils.isNotEmpty(param.getPosition()) && param.getPosition().size() > 10) + || (CollectionUtils.isNotEmpty(param.getStatus()) && param.getStatus().size() > 10) + || (CollectionUtils.isNotEmpty(param.getEmployee()) && param.getEmployee().size() > 10)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),182014, "统计数据范围条件数量过多")); } SalaryStatisticsReportPO po = getById(param.getId()); + SalaryStatisticsReportPO oldPO = new SalaryStatisticsReportPO(); + BeanUtils.copyProperties(po, oldPO); SalaryAssert.notNull(po, SalaryI18nUtil.getI18nLabel(user.getLanguage(),152563, "报表不存在")); po.setSalaryStartMonth(param.getSalaryStartMonth()); po.setSalaryEndMonth(param.getSalaryEndMonth()); @@ -240,6 +256,9 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary if (param.getTaxAgent() != null) { po.setTaxAgentSetting(JSON.toJSONString(param.getTaxAgent())); } + if (param.getSalarySob() != null) { + po.setSalarySobSetting(JSON.toJSONString(param.getSalarySob())); + } if (param.getIncomeCategory() != null) { po.setIncomeCategorySetting(JSON.toJSONString(param.getIncomeCategory())); } @@ -286,13 +305,16 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary getSalaryStatisticsItemService(user).saveOrUpdateBatch(salaryStatisticsItemList); //记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(po.getId())); -// loggerContext.setTargetName(po.getReportName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),// 152565, "更新报表")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),// 152565, "更新报表")); -// salaryStatReportLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(po.getId())); + loggerContext.setTargetName(po.getReportName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "更新报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更新报表")); + loggerContext.setOldValues(oldPO); + loggerContext.setNewValues(po); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); return StringUtils.EMPTY; } @@ -311,16 +333,17 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary getSalaryStatisticsReportMapper().deleteByIds(deleteIds); //删除薪资项 getSalaryStatisticsItemService(user).deleteByReportIds(deleteIds); -// list.forEach(e -> { -// // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(e.getId())); -// loggerContext.setTargetName(e.getReportName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 153162, "删除报表")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 153162, "删除报表")); -// salaryStatReportLoggerTemplate.write(loggerContext); -// }); + list.forEach(e -> { + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(e.getId())); + loggerContext.setTargetName(e.getReportName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "删除报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "删除报表") + e.getReportName()); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); + }); } Map resultMap = new HashMap<>(2); @@ -353,7 +376,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary po.setCreator(uid); po.setCreateTime(now); po.setUpdateTime(now); - po.setReportName(po.getReportName()+"_copy"); + po.setReportName(po.getReportName() + "_copy"); getSalaryStatisticsReportMapper().insertIgnoreNull(po); @@ -367,6 +390,17 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary return item; }).collect(Collectors.toList()); getSalaryStatisticsItemService(user).saveOrUpdateBatch(itemList); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(po.getId())); + loggerContext.setTargetName(po.getReportName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增报表")); + loggerContext.setNewValues(po); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); } @Override @@ -399,7 +433,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary Map> salaryAcctEmpResultMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); Map> map = new HashMap<>(); salaryAcctEmpResultMap.forEach((k, v) -> { - Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2o(p.getResultValue()), (key1, key2) -> key2)); + Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2String(p.getResultValue()), (key1, key2) -> key2)); map.put(k, collect); }); @@ -415,11 +449,21 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryStartMonth())); param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryEndMonth())); String key = "id"; - param.setTaxAgent(((List) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setSubCompany(((List) JSON.parseArray(reportPO.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setDepart(((List) JSON.parseArray(reportPO.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setEmployee(((List) JSON.parseArray(reportPO.getEmployeeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setHiredate(JSON.parseArray(reportPO.getHiredateSetting(), Date.class)); + if (reportPO.getTaxAgentSetting() != null) { + param.setTaxAgent(((List) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getSubCompanySetting() != null) { + param.setSubCompany(((List) JSON.parseArray(reportPO.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getDepartSetting() != null) { + param.setDepart(((List) JSON.parseArray(reportPO.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getEmployeeSetting() != null) { + param.setEmployee(((List) JSON.parseArray(reportPO.getEmployeeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getHiredateSetting() != null) { + param.setHiredate(JSON.parseArray(reportPO.getHiredateSetting(), Date.class)); + } SalaryStatisticsReportDataQueryParam queryParam = new SalaryStatisticsReportDataQueryParam(); com.mzlion.core.utils.BeanUtils.copyProperties(param, queryParam); // 获取本期报表分权后的核算人员 @@ -435,7 +479,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary List finalSalaryAcctEmpIds = getSalaryAcctResultService(user).listAcctEmpIdByAcctEmpId(salaryAcctEmployeeIds); Map> salaryAcctEmpResultMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); salaryAcctEmpResultMap.forEach((k, v) -> { - Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2o(p.getResultValue()), (key1, key2) -> key2)); + Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), SalaryAcctResultPO::getResultValue, (key1, key2) -> key2)); resultMap.put(k, collect); }); salaryAcctEmployeeIds.stream().forEach(id -> { @@ -463,7 +507,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary Map> salaryAcctEmpResultMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); Map> map = new HashMap<>(); salaryAcctEmpResultMap.forEach((k, v) -> { - Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2o(p.getResultValue()), (key1, key2) -> key2)); + Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2String(p.getResultValue()), (key1, key2) -> key2)); map.put(k, collect); }); @@ -486,12 +530,11 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary String salaryReportConditions = getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_CONDITIONS + id); if (StringUtils.isNotBlank(salaryReportConditions)) { Arrays.asList(salaryReportConditions.split(",")).forEach(paramMd5 -> { - if (StringUtils.isNotBlank(paramMd5)) { - //条件对应的结果 - getSalaryCacheService(user).remove(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5); - } - } - ); + if (StringUtils.isNotBlank(paramMd5)) { + //条件对应的结果 + getSalaryCacheService(user).remove(SalaryCacheKey.SALARY_REPORT_DATA + id + "_" + paramMd5); + } + }); getSalaryCacheService(user).remove(SalaryCacheKey.SALARY_REPORT_CONDITIONS + id); } } @@ -514,14 +557,13 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary List c = new ArrayList<>(); if (StringUtils.isNotBlank(salaryReportConditions)) { Arrays.asList(salaryReportConditions.split(",")).forEach(paramMd5 -> { - if (StringUtils.isNotBlank(paramMd5)) { - Map data = getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5); - Map kv = new HashMap<>(); - kv.put(paramMd5, data); - c.add(kv); - } - } - ); + if (StringUtils.isNotBlank(paramMd5)) { + Map data = getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5); + Map kv = new HashMap<>(); + kv.put(paramMd5, data); + c.add(kv); + } + }); report.add(c); } } @@ -630,7 +672,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary case SalaryStatisticsDimensionConstant.DM_COMPANY_YEAR: return buildCompanyYearRecords(data, salaryAcctResultValueMap); default: - return new PageInfo<>(); + return buildSalaryItemRecords(dimension, data, salaryAcctResultValueMap); } // 定量-组距式分组 } else if (SalaryStatisticsDimensionTypeEnum.RATION_GROUP_SPACING.getValue().equals(dimension.getDimType())) { @@ -1054,16 +1096,14 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary Map> sameEmployeeListMap = data.getSameList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId)); List empIds = accountDetailPOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList()); - Map employeeByIdMap = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds) - .stream() - .collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, o -> o)); + Map employeeByIdMap = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds).stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, o -> o)); //人员维度扩展属性 EmployeeInfoExpandDTO employeeInfoExpandDTO = getSalaryStatisticsDimensionService(user).getExpandFieldSettings("dim_employee"); List fieldSettings = Optional.ofNullable(Optional.ofNullable(employeeInfoExpandDTO).orElse(new EmployeeInfoExpandDTO()).getFieldSettings()).orElse(new ArrayList<>()); Map> expandEmployeeMap = getSalaryEmployeeService(user).expandEmployeeMap(empIds, employeeInfoExpandDTO); - log.info("扩展属性"+expandEmployeeMap); + log.info("扩展属性" + expandEmployeeMap); // List extEmployees = extEmployeeService.listByIdsWithDeleted(accountDetailPOList.stream().filter(e -> EmployeeTypeEnum.EXT_EMPLOYEE.getValue().equals(e.getEmployeeType())).map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList()), data.getTenantKey()); // Map employeeExtByIdMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId, ExtEmployeePO::getUsername); @@ -1074,11 +1114,9 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary Map temp = new HashMap<>(); // temp.put(DM, Objects.nonNull(employeeByIdMap.get(k)) ? employeeByIdMap.get(k) : employeeExtByIdMap.get(k)); temp.put(DM, employeeByIdMap.get(k).getUsername()); - fieldSettings.forEach( - fieldSetting -> { - temp.put(fieldSetting.getField(), expandEmployeeMap.getOrDefault(k,new HashMap<>()).get(fieldSetting.getField())); - } - ); + fieldSettings.forEach(fieldSetting -> { + temp.put(fieldSetting.getField(), expandEmployeeMap.getOrDefault(k, new HashMap<>()).get(fieldSetting.getField())); + }); temp.putAll(SalaryStatisticsReportBO.calculateItem(v, lastEmployeeListMap.get(k), sameEmployeeListMap.get(k), salaryAcctResultValueMap, data.getSalaryStatisticsItemList())); records.add(temp); } else if (StringUtils.equals(dimensionValue, employeeByIdMap.get(k).getUsername())) { @@ -1917,6 +1955,41 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary return result; } + private PageInfo> buildSalaryItemRecords(SalaryStatisticsDimensionPO dimension, SalaryStatisticsReportDataDTO data, Map> salaryAcctResultValueMap) { + + //查询薪资项目存在的种类(维度) + Set dimensionSet = new HashSet<>(); + for (Long k : salaryAcctResultValueMap.keySet()) { + Map map = salaryAcctResultValueMap.get(k); + dimensionSet.add(map.getOrDefault(dimension.getDimCode(), "")); + } + + PageInfo> result = new PageInfo<>(); + List> records = new ArrayList<>(); + + Map empIdYearMap = new HashMap<>(); + Map lastEmpIdYearMap = new HashMap<>(); + Map sameEmpIdYearMap = new HashMap<>(); + + String dimensionValue = data.getDimensionValue(); + dimensionSet.stream().sorted((a, b) -> b.length() - a.length()).forEach(k -> { + if (dimensionValue == null) { + List salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()); + List lastSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, dimension.getDimCode(), data.getLastList(), lastEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()); + List sameSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, dimension.getDimCode(), data.getSameList(), sameEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()); + Map temp = new HashMap<>(); + temp.put(DM, k); + temp.putAll(SalaryStatisticsReportBO.calculateItem(salaryAcctEmployees, lastSalaryAcctEmployees, sameSalaryAcctEmployees, salaryAcctResultValueMap, data.getSalaryStatisticsItemList())); + records.add(temp); + } else if (StringUtils.equals(dimensionValue, k)) { + List salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()); + data.setListByDimensionValue(salaryAcctEmployees); + } + }); + result.setList(records); + return result; + } + // private PageInfo> buildRationGroupSpacing4NoItemRecords(SalaryStatisticsDimensionPO dimension, SalaryStatisticsReportDataDTO data, Map> salaryAcctResultValueMap) { // PageInfo> result = new PageInfo<>(); // List> records = new ArrayList<>(); diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsDimensionWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsDimensionWrapper.java index caf86f7d4..2a2a9b100 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsDimensionWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsDimensionWrapper.java @@ -115,6 +115,7 @@ public class SalaryStatisticsDimensionWrapper extends Service { * @return */ public SalaryStatisticsDimensionFormDTO getFrom(Long id) { + List salaryItemList = salaryItemService(user).listAll(); List statsDimOptions = Lists.newArrayList(); // statsDimOptions.add(new WeaFormOption(SalaryStatisticsDimensionConstant.DM_SEX, SalaryI18nUtil.getI18nLabel(user.getLanguage(),416, "性别"))); @@ -130,12 +131,12 @@ public class SalaryStatisticsDimensionWrapper extends Service { // statsDimOptions.add(new WeaFormOption(SalaryStatisticsDimensionConstant.DM_AGE, SalaryI18nUtil.getI18nLabel(user.getLanguage(),0, "年龄"))); statsDimOptions.add(new WeaFormOption(SalaryStatisticsDimensionConstant.DM_WORK_YEAR, SalaryI18nUtil.getI18nLabel(user.getLanguage(),545742, "工龄"))); statsDimOptions.add(new WeaFormOption(SalaryStatisticsDimensionConstant.DM_COMPANY_YEAR, SalaryI18nUtil.getI18nLabel(user.getLanguage(),545743, "司龄"))); + statsDimOptions.addAll(salaryItemList.stream().map(item -> new WeaFormOption(item.getId().toString(), item.getName())).collect(Collectors.toList())); List groupDimOptions = Lists.newArrayList(); // groupDimOptions.add(new WeaFormOption(SalaryStatisticsDimensionConstant.DM_AGE, SalaryI18nUtil.getI18nLabel(user.getLanguage(),0, "年龄"))); groupDimOptions.add(new WeaFormOption(SalaryStatisticsDimensionConstant.DM_WORK_YEAR, SalaryI18nUtil.getI18nLabel(user.getLanguage(),545742, "工龄"))); groupDimOptions.add(new WeaFormOption(SalaryStatisticsDimensionConstant.DM_COMPANY_YEAR, SalaryI18nUtil.getI18nLabel(user.getLanguage(),545743, "司龄"))); - List salaryItemList = salaryItemService(user).listAll(); groupDimOptions.addAll(salaryItemList.stream() .filter(item -> SalaryDataTypeEnum.NUMBER.getValue().equals(item.getDataType())) .map(item -> new WeaFormOption(item.getId().toString(), item.getName())).collect(Collectors.toList())); diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java index b11bc2a47..887f915b2 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java @@ -10,7 +10,10 @@ import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.component.WeaFormOption; import com.engine.salary.component.WeaTableColumnGroup; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.report.entity.bo.SalaryStatisticsReportBO; @@ -217,6 +220,7 @@ public class SalaryStatisticsReportWrapper extends Service { /** * 复制薪资账套 + * * @param id */ public void duplicate(Long id) { @@ -245,6 +249,7 @@ public class SalaryStatisticsReportWrapper extends Service { data.put("salaryStartMonth", SalaryDateUtil.getFormatYearMonth(po.getSalaryStartMonth())); data.put("salaryEndMonth", SalaryDateUtil.getFormatYearMonth(po.getSalaryEndMonth())); data.put("taxAgent", JSONArray.parseArray(po.getTaxAgentSetting())); + data.put("salarySob", JSONArray.parseArray(po.getSalarySobSetting())); data.put("incomeCategory", JSONArray.parseArray(po.getIncomeCategorySetting())); data.put("subCompany", JSONArray.parseArray(po.getSubCompanySetting())); data.put("department", JSONArray.parseArray(po.getDepartSetting())); @@ -323,7 +328,7 @@ public class SalaryStatisticsReportWrapper extends Service { //报表中缓存的条件 salaryReportConditions = Utils.null2String(getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_CONDITIONS + id)); if (StringUtils.isNotBlank(salaryReportConditions) && salaryReportConditions.contains(paramMd5)) { - return getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5); + return getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_DATA + id + "_" + paramMd5); } } @@ -345,9 +350,10 @@ public class SalaryStatisticsReportWrapper extends Service { resultMap.put("reportId", id); + //设置报表缓存 getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_IDS, salaryReportIds + "," + id); getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_CONDITIONS + id, salaryReportConditions + "," + paramMd5); - getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5, resultMap); + getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_DATA + id + "_" + paramMd5, resultMap); return resultMap; @@ -427,6 +433,17 @@ public class SalaryStatisticsReportWrapper extends Service { map.put("workbook", book); map.put("fileName", sheetName); + // 记录操作日志 + String name = SalaryI18nUtil.getI18nLabel(0, "导出"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(po.getId().toString()); + loggerContext.setTargetName(po.getReportName()); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(name + SalaryI18nUtil.getI18nLabel(0, "薪酬统计报表") + "-" + po.getReportName()); + loggerContext.setUser(user); + SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext); + return map; } diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 51498f653..29d3d58a9 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -78,10 +78,9 @@ public interface AddUpDeductionService { /** * 导出 * - * @param isChief * @param queryParam */ - XSSFWorkbook export(boolean isChief, AddUpDeductionQueryParam queryParam); + XSSFWorkbook export( AddUpDeductionQueryParam queryParam); /** * 导出详情 diff --git a/src/com/engine/salary/service/AttendQuoteService.java b/src/com/engine/salary/service/AttendQuoteService.java index 7e06ec6e5..d871b026c 100644 --- a/src/com/engine/salary/service/AttendQuoteService.java +++ b/src/com/engine/salary/service/AttendQuoteService.java @@ -2,6 +2,7 @@ package com.engine.salary.service; import com.engine.salary.entity.datacollection.dto.AttendQuoteListDTO; import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam; +import com.engine.salary.entity.datacollection.po.AttendQuotePO; import com.engine.salary.util.page.PageInfo; import java.time.YearMonth; @@ -35,4 +36,6 @@ public interface AttendQuoteService { */ Boolean checkOperation(YearMonth salaryYearMonth, Long salarySobId); + AttendQuotePO getById(Long id); + } diff --git a/src/com/engine/salary/service/MySalaryShowSetService.java b/src/com/engine/salary/service/MySalaryShowSetService.java new file mode 100644 index 000000000..3bfea6d7b --- /dev/null +++ b/src/com/engine/salary/service/MySalaryShowSetService.java @@ -0,0 +1,19 @@ +package com.engine.salary.service; + + +import com.engine.salary.entity.salaryBill.dto.MySalaryShowSetDTO; + +/** + * @Description: 我的薪资福利显示设置 + * @Author: wangxiangzhong + * @Date: 2023/8/7 11:15 + */ +public interface MySalaryShowSetService { + + /** + * 获取显示设置 + * + * @return + */ + MySalaryShowSetDTO get(); +} diff --git a/src/com/engine/salary/service/SIAccountService.java b/src/com/engine/salary/service/SIAccountService.java index 99c157855..bd95388a2 100644 --- a/src/com/engine/salary/service/SIAccountService.java +++ b/src/com/engine/salary/service/SIAccountService.java @@ -84,6 +84,13 @@ public interface SIAccountService { */ String save(AccountParam param); + /** + * 新建核算并归档 + * @param param + * @return + */ + String saveAndFile(AccountParam param); + /** * 正常缴纳页核算 * @param saveCommonAccountParam @@ -116,9 +123,9 @@ public interface SIAccountService { /** * 删除补缴人员 - * @param supplementAccountBaseParams + * @param param */ - void deleteSummplementaryAccount(List supplementAccountBaseParams); + void deleteSupplementaryAccount(SaveCommonAccountParam param); /** * 台账归档 @@ -307,5 +314,11 @@ public interface SIAccountService { boolean checkBalance(InsuranceAccountDetailPO po); boolean checkBalancePayInsurance(InsuranceAccountDetailPO po); + + List buildRecords(List list, Map paymentMap); + + void cacheWelfareField(List welfareNames); + + void cacheBalanceWelfareField(List welfareNames); } diff --git a/src/com/engine/salary/service/SIArchivesService.java b/src/com/engine/salary/service/SIArchivesService.java index 3e98c15d3..877355676 100644 --- a/src/com/engine/salary/service/SIArchivesService.java +++ b/src/com/engine/salary/service/SIArchivesService.java @@ -1,17 +1,17 @@ package com.engine.salary.service; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam; import com.engine.salary.entity.siarchives.param.SIArchiveBaseHistoryListParam; -import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; -import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO; +import com.engine.salary.entity.siarchives.po.*; import com.engine.salary.util.page.PageInfo; +import com.google.common.collect.Lists; +import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import java.util.Collection; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @Author weaver_cl @@ -74,6 +74,11 @@ public interface SIArchivesService { */ Map stayDelToStop(Collection ids); + /** + * 批量减员,直接减员,并给予最后缴纳月 + */ + Map stopWithoutLimit(Collection ids, String yearMonth); + /** * 全量减员 */ @@ -89,6 +94,15 @@ public interface SIArchivesService { */ Map stayAddToPay(Collection ids); + /** + * 拷贝福利档案到新的个税扣缴义务人并置为在缴 + * @param toCopyTaxAgentId 被拷贝的福利档案所属个税扣缴义务人id + * @param toUpdateTaxAgentId 被更新的福利档案所属个税扣缴义务人id + * @param employeeId 福利档案所属人员id + * @return + */ + Map copyToPay(Long toCopyTaxAgentId, Long toUpdateTaxAgentId, Long employeeId, String payStartYearMonth); + /** * 待减员页面的删除待办 */ @@ -110,4 +124,40 @@ public interface SIArchivesService { PageInfo getAdjustHistoryList(SIArchiveBaseHistoryListParam param); PageInfo historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param); + + List> buildTableData(List insuranceArchivesEmployeePOS); + + List buildWeaTableColumns(List insuranceArchivesEmployeePOS); + + boolean isDiffWelBase(); + + List payInsuranceIds(Long socialSchemeId, Integer paymentScope); + + List payInsuranceIds(Long socialSchemeId); + + List getSocialByEmployeeIds(List employeeIds); + List getFundByEmployeeIds(List employeeIds); + List getOtherByEmployeeIds(List employeeIds); + + Map buildBatchAccount(List ids, Long paymentOrganization); + + Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope); + + String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope); + + List dealSocialBaseAdjustInfoList(List adjustList, Long creator); + List dealFundBaseAdjustInfoList(List adjustList, Long creator); + List dealOtherBaseAdjustInfoList(List adjustList, Long creator); + + void batchInsertAdjustHistory(List adjustHistoryList); + + List listEndDateIsNull(List employeeIds); + + List listStartDateIsNull(List employeeIds); + + List listInsuranceArchivesSocialSchemeByIds(List ids); + + List listInsuranceArchivesFundSchemeByIds(List ids); + + List listInsuranceArchivesOtherSchemeByIds(List ids); } diff --git a/src/com/engine/salary/service/SICategoryService.java b/src/com/engine/salary/service/SICategoryService.java index dfaa84349..b1c9b37f7 100644 --- a/src/com/engine/salary/service/SICategoryService.java +++ b/src/com/engine/salary/service/SICategoryService.java @@ -3,10 +3,12 @@ package com.engine.salary.service; import com.engine.salary.entity.sicategory.dto.ICategoryDTO; import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO; import com.engine.salary.entity.sicategory.dto.ICategoryListDTO; +import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.util.page.PageInfo; +import java.util.List; import java.util.Map; /** @@ -65,4 +67,8 @@ public interface SICategoryService { Map updateCategoryNameAndPayScope(ICategoryFormDTO iCategoryFormDTO); Map deleteCustomCategory(ICategoryFormDTO iCategoryFormDTO); + + ICategoryPO getICategoryPOByID(Long id); + + List listByName(String insuranceName); } diff --git a/src/com/engine/salary/service/SISchemeService.java b/src/com/engine/salary/service/SISchemeService.java index 5e0b8d8de..e465d2740 100644 --- a/src/com/engine/salary/service/SISchemeService.java +++ b/src/com/engine/salary/service/SISchemeService.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.sischeme.dto.InsuranceSchemeListDTO; import com.engine.salary.entity.sischeme.param.InsuranceSchemeDetailUpdateParam; import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; +import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -80,4 +81,6 @@ public interface SISchemeService { * @param schemeDetailList */ List updateSchemeDetail(List schemeDetailList); + + List listAll(); } diff --git a/src/com/engine/salary/service/SalaryAcctResultLogService.java b/src/com/engine/salary/service/SalaryAcctResultLogService.java index 8edcf222d..81fb3f350 100644 --- a/src/com/engine/salary/service/SalaryAcctResultLogService.java +++ b/src/com/engine/salary/service/SalaryAcctResultLogService.java @@ -68,5 +68,5 @@ public interface SalaryAcctResultLogService { * @param salaryAcctEmployeeIds * @param lockSalaryItemIds */ - void deleteBySalaryAcctEmpIdExceptItemIds(Collection salaryAcctEmployeeIds, Collection lockSalaryItemIds); + void deleteBySalaryAcctEmpIdExceptItemIds(List salaryAcctEmployeeIds, Collection lockSalaryItemIds); } diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index 74c0b9a19..2a04f8e76 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -4,10 +4,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; -import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultUpdateLockStatusParam; +import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.util.page.PageInfo; @@ -214,4 +211,10 @@ public interface SalaryAcctResultService { * @return */ Map sumForWorkflow(SalaryAcctResultQueryParam param); + + /** + * 薪资核算结果批量更新 + * @param param + */ + void batchUpdate(SalaryAcctResultBatchUpdateParam param); } diff --git a/src/com/engine/salary/service/SalaryArchiveService.java b/src/com/engine/salary/service/SalaryArchiveService.java index 60a059bae..5ab2dac29 100644 --- a/src/com/engine/salary/service/SalaryArchiveService.java +++ b/src/com/engine/salary/service/SalaryArchiveService.java @@ -250,4 +250,10 @@ public interface SalaryArchiveService { */ String syncPayStartDate(); + /** + * 根据列表状态获取起始发薪日期为空的薪资档案 + * @param runStatus + * @return + */ + List listPayStartDateIsNull(String runStatus); } diff --git a/src/com/engine/salary/service/SalaryBillBaseSetService.java b/src/com/engine/salary/service/SalaryBillBaseSetService.java index f0d41e8dd..700a10770 100644 --- a/src/com/engine/salary/service/SalaryBillBaseSetService.java +++ b/src/com/engine/salary/service/SalaryBillBaseSetService.java @@ -56,5 +56,11 @@ public interface SalaryBillBaseSetService { */ salaryBillViewingLimitSetting getSalaryBillViewingLimitSetting(); + /** + * 获取首次查看后多少分钟不能查看工资单(0代表一旦查看后无法再次查看) + * @return + */ + Integer getBurningAfterReadingMin(); + } diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index bceeb16fe..45b6509e0 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -30,6 +30,7 @@ public interface SalaryEmployeeService { /** * 获取报表人员字段 + * * @return */ List listAllForReport(); @@ -44,6 +45,7 @@ public interface SalaryEmployeeService { /** * 获取人员信息 + * * @param ids * @return 全量 */ @@ -53,6 +55,7 @@ public interface SalaryEmployeeService { /** * 获取人员信息 + * * @param employeeId * @return 全量 */ @@ -60,6 +63,7 @@ public interface SalaryEmployeeService { /** * 获取人员信息 + * * @param simpleEmployeeIds * @return 简单 */ @@ -74,21 +78,27 @@ public interface SalaryEmployeeService { /** * 筛选导入人员信息可以在人力资源池中匹配到的人员信息 - * @param employeeList 人力资源池 - * @param userName 姓名 + * + * @param confValue 校验方式 + * @param employeeList 人力资源池 + * @param userName 姓名 * @param deparmentName 部门 - * @param mobile 手机号 - * @param workcode 工号 - * @param uid 人员id + * @param mobile 手机号 + * @param workcode 工号 + * @param uid 人员id */ - List matchImportEmployee(List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid); + List matchImportEmployee(String confValue, List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid); String empValidType(); List getDeptInfoList(List departmentIds); + List getVirtualDeptInfoList(List virtualDepartmentIds); + List getSubCompanyInfoList(List subDepartmentIds); + List getVirtualSubCompanyInfoList(List virtualSubDepartmentIds); + List listPositionInfo(List positionIds); List listEmployee(); @@ -97,29 +107,33 @@ public interface SalaryEmployeeService { /** * 根据离职日期获取离职信息 + * * @param formatDate */ Map getResignationMapByDate(String formatDate); /** * 扩展人员信息 + * * @param ids * @param param * @return */ List expandEmployeeInfo(List ids, EmployeeInfoExpandDTO param); - Map> expandEmployeeMap(List ids, EmployeeInfoExpandDTO param); + Map> expandEmployeeMap(List ids, EmployeeInfoExpandDTO param); /** * 保存扩展信息 + * * @param param */ void saveEmployeeExpandFieldSettings(EmployeeInfoExpandDTO param); /** * 获取扩展信息 + * * @param module * @return */ @@ -133,4 +147,16 @@ public interface SalaryEmployeeService { List listByManagerId(Long managerId); List listEmployeeTreeByManagerId(Long managerId, ListstatusList); + + /** + * 根据虚拟部门获取人员信息 + * @param virtualDepartmentIds + */ + List getVirtualEmpByVirtualDepIds(List virtualDepartmentIds); + + /** + * 根据虚拟分部获取人员信息 + * @param virtualSubCompanyIds + */ + List getVirtualEmpByVirtualSubCompanyIds(List virtualSubCompanyIds); } diff --git a/src/com/engine/salary/service/SalaryItemService.java b/src/com/engine/salary/service/SalaryItemService.java index c42079fa3..ba661cc27 100644 --- a/src/com/engine/salary/service/SalaryItemService.java +++ b/src/com/engine/salary/service/SalaryItemService.java @@ -99,7 +99,7 @@ public interface SalaryItemService { * * @param saveParam 保存参数 */ - void save(SalaryItemSaveParam saveParam); + SalaryItemPO save(SalaryItemSaveParam saveParam); /** * 批量保存 @@ -113,7 +113,7 @@ public interface SalaryItemService { * * @param saveParam 更新参数 */ - void update(SalaryItemSaveParam saveParam); + SalaryItemPO update(SalaryItemSaveParam saveParam); /** * 根据主键id删除薪资项目 diff --git a/src/com/engine/salary/service/SalarySendService.java b/src/com/engine/salary/service/SalarySendService.java index 59bcd0e77..510966483 100644 --- a/src/com/engine/salary/service/SalarySendService.java +++ b/src/com/engine/salary/service/SalarySendService.java @@ -226,4 +226,6 @@ public interface SalarySendService { List listJunior(Long uid); List listJuniorTree(Long uid, ListstatusList); + + List listSome(SalarySendPO param); } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index e4272f4e7..d8a4fd81e 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -11,6 +11,8 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.AddUpDeductionBiz; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -27,6 +29,7 @@ import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -43,6 +46,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; +import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -51,6 +55,7 @@ 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.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -64,6 +69,7 @@ import java.util.*; import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** * 累计专项 @@ -129,7 +135,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction conditionItems.add(username); - SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "4"); + SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "57"); departmentName.setInputType("browser"); departmentName.setColSpan(2); departmentName.setFieldcol(16); @@ -264,7 +270,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction String workcode = dto.getJobNum(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null); if (StringUtils.isBlank(userName) && "0".equals(confValue)) { //姓名 不能为空 @@ -385,17 +391,82 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } } //入库 - addUpDeductionBiz.handleImportData(eligibleData, user); + handleImportData(eligibleData, user); apidatas.put("successCount", successCount); apidatas.put("errorCount", errorCount); apidatas.put("errorData", errorData); - } finally { IOUtils.closeQuietly(fileInputStream); } return apidatas; } + public void handleImportData(List pos) { + if (CollectionUtils.isEmpty(pos)) { + return; + } + AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz(); + AddUpDeduction po = pos.get(0); + // 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos); + // 去重(通过记录的唯一条件(申报月份,人员id,个税扣缴义务人id)拼接) + List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new)); + // 查询已有数据 + List list = addUpDeductionBiz.listSome(AddUpDeduction.builder().declareMonth(po.getDeclareMonth()).build()); + // 待修改的 本地已存在则更新【交集】 + List updateList = list.stream().map(m -> { + Optional optional = finalPos.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst(); + AddUpDeduction temp = null; + if (optional.isPresent()) { + temp = optional.get(); + // 换成本地库的id + temp.setId(m.getId()); + } + return temp; + }).filter(Objects::nonNull).collect(Collectors.toList()); + // 待新增的 导入比本地多,则新增【差集(导入 - local)】 + List saveList = finalPos.stream().map(m -> { + Optional optional = list.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst(); + AddUpDeduction temp = null; + if (!optional.isPresent()) { + temp = m; + } + return temp; + }).filter(Objects::nonNull).collect(Collectors.toList()); + + // 修改 + if (CollectionUtils.isNotEmpty(updateList)) { + addUpDeductionBiz.batchUpdate(updateList); + } + // 保存 + if (CollectionUtils.isNotEmpty(saveList)) { + addUpDeductionBiz.batchSave(saveList); + } + + // 记录操作日志 + // 根据月份、人员id查出保存的数据 + List empIds = saveList.stream().map(AddUpDeduction::getEmployeeId).collect(Collectors.toList()); + List insertList = addUpDeductionBiz.listSome(AddUpDeduction.builder().declareMonth(po.getDeclareMonth()).employeeIds(empIds).build()); + Map insertMap = SalaryEntityUtil.convert2Map(insertList, p -> p.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(p.getDeclareMonth()) + "-" + p.getEmployeeId()); + saveList.forEach(save -> { + AddUpDeduction addUpDeduction = insertMap.get(save.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(save.getDeclareMonth()) + "-" + save.getEmployeeId()); + if (addUpDeduction != null) { + updateList.add(addUpDeduction); + } + }); + + if (CollectionUtils.isNotEmpty(updateList)) { + String formatYearMonth = SalaryDateUtil.getFormatYearMonth(po.getDeclareMonth()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除 ") + formatYearMonth); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入累计专项附加扣除 ") + formatYearMonth); + loggerContext.setNewValueList(updateList); + SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext); + } + + } @Override public void editAddUpDeduction(AddUpDeductionRecordParam addUpDeduction) { @@ -410,7 +481,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction throw new SalaryRunTimeException( SalaryI18nUtil.getI18nLabel(user.getLanguage(),542138,"该数据不存在!") ); } Long taxAgentId = byId.getTaxAgentId(); - boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId)); + boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId)); if (!canEdit) { //没有编辑权限 throw new SalaryRunTimeException( SalaryI18nUtil.getI18nLabel(user.getLanguage(),542139,"该个税扣缴义务人无权限编辑此数据!")); @@ -427,9 +498,24 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } } ArrayList updateList = new ArrayList<>(); - AddUpDeduction build = AddUpDeduction.builder().id(addUpDeduction.getId()).addUpChildEducation(addUpDeduction.getAddUpChildEducation()).addUpContinuingEducation(addUpDeduction.getAddUpContinuingEducation()).addUpHousingLoanInterest(addUpDeduction.getAddUpHousingLoanInterest()).addUpHousingRent(addUpDeduction.getAddUpHousingRent()).addUpSupportElderly(addUpDeduction.getAddUpSupportElderly()).addUpIllnessMedical(addUpDeduction.getAddUpIllnessMedical()).addUpInfantCare(addUpDeduction.getAddUpInfantCare()).build(); + AddUpDeduction build = AddUpDeduction.builder().id(addUpDeduction.getId()).addUpChildEducation(addUpDeduction.getAddUpChildEducation()).addUpContinuingEducation(addUpDeduction.getAddUpContinuingEducation()).addUpHousingLoanInterest(addUpDeduction.getAddUpHousingLoanInterest()).addUpHousingRent(addUpDeduction.getAddUpHousingRent()).addUpSupportElderly(addUpDeduction.getAddUpSupportElderly()).addUpIllnessMedical(addUpDeduction.getAddUpIllnessMedical()).addUpInfantCare(addUpDeduction.getAddUpInfantCare()).createTime(new Date()).build(); updateList.add(build); addUpDeductionBiz.batchUpdate(updateList, user); + + // 记录日志 + AddUpDeduction newValue = addUpDeductionBiz.getById(build.getId()); + String name = SalaryI18nUtil.getI18nLabel(0, "编辑"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(addUpDeduction.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + addUpDeduction.getId()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "编辑")); + loggerContext.setOldValues(byId); + loggerContext.setNewValues(newValue); + loggerContext.setUser(user); + SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext); } @Override @@ -440,7 +526,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //税款所属期 String declareMonthStr = addUpDeductionRecordParam.getDeclareMonth(); - if (declareMonthStr .equals("")) { + if (declareMonthStr.equals("")) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542141,"税款所属期不能为空!") ); } // 获取所有个税扣缴义务人 @@ -468,7 +554,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .updateTime(now) .creator((long) user.getUID()) .declareMonth(declareMonth).build(); - boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpDeductionRecordParam.getEmployeeId())); + boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpDeductionRecordParam.getEmployeeId())); if (!employeeSameId) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542131,"员工信息不存在")); } @@ -529,7 +615,20 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction addUpDeduction.setAddUpInfantCare(Util.null2String(addUpDeductionRecordParam.getAddUpInfantCare())); insertData.add(addUpDeduction); //入库 - addUpDeductionBiz.handleImportData(insertData, user); + handleImportData(insertData, user); + } + + private void addLogger4Insert(Integer currentEmployeeId, AddUpDeduction addUpDeduction, String targetName) { + String name = SalaryI18nUtil.getI18nLabel(0, "新增") + SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(addUpDeduction.getId().toString()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(name); + loggerContext.setNewValues(addUpDeduction); + loggerContext.setOperator(currentEmployeeId.toString()); + SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext); } @Override @@ -545,6 +644,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction List salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr); // 判断是否有核算过 List deleteList = new ArrayList<>(); + ArrayList oldAddUpDeductions = new ArrayList<>(); for (int i = 0; i < deleteIds.size(); i++) { Long id = deleteIds.get(i); AddUpDeduction byId = addUpDeductionBiz.getById(id, user); @@ -552,7 +652,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542142,"数据不存在或已被删除!")); } // 判断是否在个税扣缴义务人范围内 - Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst(); + Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst(); if (!first.isPresent()) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542136,"个税扣缴义务人不存在或不在权限范围内")); } @@ -564,8 +664,25 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } } deleteList.add(byId.getId()); + oldAddUpDeductions.add(byId); } addUpDeductionBiz.batchDeleteByIDS(deleteList); + + //记录日志 + if (CollectionUtils.isNotEmpty(oldAddUpDeductions)) { + oldAddUpDeductions.stream().forEach(e -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(e.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + e.getId()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "删除")); + loggerContext.setOldValues(e); + loggerContext.setUser(user); + SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext); + }); + } } @Override @@ -587,7 +704,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction if (deleteParam.getTaxAgentId() != null && (!deleteParam.getTaxAgentId().equals(""))) { // 设置了个税扣缴义务人 Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId()); - boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId)); + boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId)); if (!canDelete) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542136,"个税扣缴义务人不存在或不在权限范围内")); } @@ -611,6 +728,20 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } List deleteIds = list.stream().map(AddUpDeductionDTO::getId).collect(Collectors.toList()); addUpDeductionBiz.batchDeleteByIDS(deleteIds); + + // 记录日志 + Collection finalTaxAgentIds = queryParam.getTaxAgentIds(); + List taxAgentNames = taxAgentList.stream().filter(t -> finalTaxAgentIds.contains(t.getTaxAgentId())) + .map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList()); + String name = declareMonthStr + " " + StringUtils.join(taxAgentNames, ","); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetName(name); + loggerContext.setOperateType(OperateTypeEnum.CLEAR.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "一键清空")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "一键清空:") + name); + SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext); } @Override @@ -636,12 +767,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override public String autoAddAll(Date yearMonth, Boolean isAdmin) { String cacheKey = "addUpDeduction_autoAddAll_processing"; - Object objVal = Util_DataCache.getObjVal( cacheKey); - if(objVal != null){ + Object objVal = Util_DataCache.getObjVal(cacheKey); + if (objVal != null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 544301, "一键累计过于频繁,请稍后再试")); } try { - Util_DataCache.setObjVal(cacheKey,true ); + Util_DataCache.setObjVal(cacheKey, true); //如果是定时任务直接查询所有,isAdmin传true boolean isChief = Boolean.TRUE.equals(isAdmin) || getTaxAgentService(user).isChief((long) user.getUID()); @@ -731,6 +862,31 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .forEach(l -> getAddUpDeductionMapper().insertData((List) l)); Lists.partition(updateList, 100) .forEach(l -> getAddUpDeductionMapper().updateDataAndDeclareMonth((List) l)); + + // 记录日志 + // 根据月份、人员id查出保存的数据 + List empIds = insertList.stream().map(AddUpDeduction::getEmployeeId).collect(Collectors.toList()); + List insertLogList = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(yearMonth).employeeIds(empIds).build()); + Map insertMap = SalaryEntityUtil.convert2Map(insertLogList, p -> p.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(p.getDeclareMonth()) + "-" + p.getEmployeeId()); + insertList.forEach(save -> { + AddUpDeduction addUpDeduction = insertMap.get(save.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(save.getDeclareMonth()) + "-" + save.getEmployeeId()); + if (addUpDeduction != null) { + updateList.add(addUpDeduction); + } + }); + + if (CollectionUtils.isNotEmpty(updateList)) { + String yearMonthStr = SalaryDateUtil.getFormatYearMonth(yearMonth); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "一键累计 " + yearMonthStr)); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "一键累计专项附加扣除")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "一键累计 " + yearMonthStr + " 专项附加扣除")); + loggerContext.setNewValueList(updateList); + SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext); + } + if (!errorMessages.isEmpty()) { String userNames = getSalaryEmployeeService(user) .getEmployeeByIdsAll(errorMessages) @@ -820,14 +976,17 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction Validate.notBlank(imageId, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542127,"imageId为空")); InputStream fileInputStream = null; + try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List addUpDeductions = ExcelParseHelper.parse2Map(fileInputStream, AddUpDeductionDTO.class, 0, 1, 14, "addUpDeductionTemplate.xlsx"); - apidatas.put("preview", addUpDeductions); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0)); + apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0)); + return apidatas; + } finally { IOUtils.closeQuietly(fileInputStream); } - return apidatas; } @@ -925,6 +1084,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //获取操作按钮资源 List> rowList = getExcelRowDetailList(isChief, queryParam); + //获取excel return ExcelUtil.genWorkbook(rowList, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542156,"累计专项附加扣除明细")); } @@ -1029,24 +1189,16 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction SalaryI18nUtil.getI18nLabel(user.getLanguage(),537990, "累计婴幼儿照护") }; - List dataIndexList = Lists.newArrayList("username", "taxAgentName", "departmentName", "mobile", "workcode", "idNo", "hiredate", "billMonth", "supplementaryMonth"); List headerList = Arrays.asList(header); //查询当前申报月份和个税扣缴义务人的累计专项附加扣除表数据 - List> resultMapList = getAddUpDeductionDate(queryParam); - // excel导出的数据 - List> rows = Lists.newArrayListWithExpectedSize(resultMapList.size()); - + List> rows = new ArrayList<>(); rows.add(headerList); - for (Map map : resultMapList) { - List row = Lists.newArrayListWithExpectedSize(headerList.size()); - for (String dataIndex : dataIndexList) { - row.add(map.getOrDefault(dataIndex, StringUtils.EMPTY)); - } - rows.add(row); + if (queryParam.isHasData()) { + List> datas = getLists(queryParam); + rows.addAll(datas); } - // 4.注释 List excelComments = Lists.newArrayList(); excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),30036, "必填"))); @@ -1100,24 +1252,34 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override - public XSSFWorkbook export(boolean isChief, AddUpDeductionQueryParam queryParam) { + public XSSFWorkbook export(AddUpDeductionQueryParam queryParam) { + //excel标题 + List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计婴幼儿照护"); - //获取操作按钮资源 - List> rowList = getExcelRowList(isChief, queryParam); + List> dataRowList = getLists(queryParam); + + List> rowList = new ArrayList<>(); + rowList.add(title); + + rowList.addAll(dataRowList); + + // 记录日志 + String name = SalaryI18nUtil.getI18nLabel(0, "导出"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除")); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + name); + loggerContext.setUser(user); + SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext); //获取excel - return ExcelUtil.genWorkbook(rowList, SalaryI18nUtil.getI18nLabel(user.getLanguage(),538006, "累计专项附加扣除")); + return ExcelUtil.genWorkbookV2(rowList, SalaryI18nUtil.getI18nLabel(user.getLanguage(),538006, "累计专项附加扣除")); } + private List> getLists(AddUpDeductionQueryParam param) { - /** - * 获取excel数据行 - * - * @return 导出数据行集合 - */ - private List> getExcelRowList(boolean isChief, AddUpDeductionQueryParam param) { - Long employeeId = (long) user.getUID(); - + long uid = user.getUID(); //excel标题 List title = Arrays.asList( SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034, "姓名"), @@ -1143,9 +1305,9 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction List list = new AddUpDeductionBiz().list(param, user); // 开启分权并且不是薪酬模块总管理员 - if (getTaxAgentService(user).isOpenDevolution() && !isChief) { - List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); - List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + if (getTaxAgentService(user).isNeedAuth(uid)) { + List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(uid); + List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(uid).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); list = list.stream().filter(f -> // 作为管理员 taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) @@ -1154,11 +1316,10 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction ).collect(Collectors.toList()); } - - final List> dataRowList = Optional.ofNullable(list) + List> dataRowList = Optional.ofNullable(list) .map(List::stream) .map(operatorStream -> operatorStream.map(dto -> { - List cellList = new ArrayList<>(); + List cellList = new ArrayList<>(); cellList.add(Util.null2String(dto.getUsername())); cellList.add(Util.null2String(dto.getTaxAgentName())); cellList.add(Util.null2String(dto.getDepartmentName())); @@ -1176,11 +1337,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction return cellList; }).collect(Collectors.toList())) .orElse(Collections.emptyList()); - - List> rowList = new ArrayList<>(); - rowList.add(title); - rowList.addAll(dataRowList); - return rowList; + return dataRowList; } diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index c1de70cbf..e28dbb125 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -8,6 +8,8 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.AddUpSituationBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -20,6 +22,7 @@ import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; @@ -38,6 +41,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; +import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -45,6 +49,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -60,6 +65,7 @@ import java.util.*; import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; public class AddUpSituationServiceImpl extends Service implements AddUpSituationService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -111,7 +117,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation conditionItems.add(username); - SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "4"); + SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "57"); departmentName.setInputType("browser"); departmentName.setColSpan(2); departmentName.setFieldcol(16); @@ -256,11 +262,21 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public XSSFWorkbook export(AddUpSituationQueryParam queryParam) { - //获取操作按钮资源 - List> rowList = getExcelRowList(queryParam); + // 获取操作按钮资源 + List> rowList = getExcelRowList(queryParam, true); - //获取excel - return ExcelUtil.genWorkbook(rowList, "累计情况"); + // 记录日志 + String name = SalaryI18nUtil.getI18nLabel(0, "导出"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "往期累计情况")); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "往期累计情况") + "-" + name); + loggerContext.setUser(user); + SalaryElogConfig.addUpSituationLoggerTemplate.write(loggerContext); + + // 获取excel + return ExcelUtil.genWorkbookV2(rowList, "累计情况"); } @@ -269,10 +285,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation * * @return 导出数据行集合 */ - private List> getExcelRowList(AddUpSituationQueryParam param) { + private List> getExcelRowList(AddUpSituationQueryParam param, boolean hasData) { long employeeId = user.getUID(); // excel标题 - final List title = Arrays.asList(SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034,"姓名"), + final List title = Arrays.asList(SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034,"姓名"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996,"个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),27511,"部门"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),125238, "手机号"), @@ -296,57 +312,60 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation SalaryI18nUtil.getI18nLabel(user.getLanguage(),542238, "累计减免税额"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),542239, "累计已预扣预缴税额"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),537990,"累计婴幼儿照护"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542863,"累计个人养老金")); - - //排序配置 - OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); - param.setOrderRule(orderRule); - List list = biz.list(param, user); - // 开启分权并且不是薪酬模块总管理员 - if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) { - List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - list = list.stream().filter(f -> - taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - ).collect(Collectors.toList()); - } + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542863, "累计个人养老金")); - final List> dataRowList = Optional.ofNullable(list) - .map(List::stream) - .map(operatorStream -> operatorStream.map(dto -> { - List cellList = new ArrayList<>(); - cellList.add(Util.null2String(dto.getUsername())); - cellList.add(Util.null2String(dto.getTaxAgentName())); - cellList.add(Util.null2String(dto.getDepartmentName())); - cellList.add(Util.null2String(dto.getMobile())); - cellList.add(Util.null2String(dto.getJobNum())); - cellList.add(Util.null2String(dto.getIdNo())); - cellList.add(Util.null2String(dto.getHiredate())); - cellList.add(Util.null2String(dto.getAddUpIncome())); - cellList.add(Util.null2String(dto.getAddUpSubtraction())); - cellList.add(Util.null2String(dto.getAddUpSocialSecurityTotal())); - cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); - cellList.add(Util.null2String(dto.getAddUpChildEducation())); - cellList.add(Util.null2String(dto.getAddUpContinuingEducation())); - cellList.add(Util.null2String(dto.getAddUpHousingLoanInterest())); - cellList.add(Util.null2String(dto.getAddUpHousingRent())); - cellList.add(Util.null2String(dto.getAddUpSupportElderly())); - cellList.add(Util.null2String(dto.getAddUpIllnessMedical())); - cellList.add(Util.null2String(dto.getAddUpEnterpriseAndOther())); - cellList.add(Util.null2String(dto.getAddUpOtherDeduction())); - cellList.add(Util.null2String(dto.getAddUpTaxExemptIncome())); - cellList.add(Util.null2String(dto.getAddUpAllowedDonation())); - cellList.add(Util.null2String(dto.getAddUpTaxSavings())); - cellList.add(Util.null2String(dto.getAddUpAdvanceTax())); - cellList.add(Util.null2String(dto.getAddUpInfantCare())); - cellList.add(Util.null2String(dto.getAddUpPrivatePension())); - return cellList; - }).collect(Collectors.toList())) - .orElse(Collections.emptyList()); - - List> rowList = new ArrayList<>(); + List> rowList = new ArrayList<>(); rowList.add(title); - rowList.addAll(dataRowList); + + if (hasData) { + //排序配置 + OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); + param.setOrderRule(orderRule); + List list = biz.list(param, user); + // 开启分权并且不是薪酬模块总管理员 + if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) { + List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + list = list.stream().filter(f -> + taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) + ).collect(Collectors.toList()); + } + + final List> dataRowList = Optional.ofNullable(list) + .map(List::stream) + .map(operatorStream -> operatorStream.map(dto -> { + List cellList = new ArrayList<>(); + cellList.add(Util.null2String(dto.getUsername())); + cellList.add(Util.null2String(dto.getTaxAgentName())); + cellList.add(Util.null2String(dto.getDepartmentName())); + cellList.add(Util.null2String(dto.getMobile())); + cellList.add(Util.null2String(dto.getJobNum())); + cellList.add(Util.null2String(dto.getIdNo())); + cellList.add(Util.null2String(dto.getHiredate())); + cellList.add(Util.null2String(dto.getAddUpIncome())); + cellList.add(Util.null2String(dto.getAddUpSubtraction())); + cellList.add(Util.null2String(dto.getAddUpSocialSecurityTotal())); + cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); + cellList.add(Util.null2String(dto.getAddUpChildEducation())); + cellList.add(Util.null2String(dto.getAddUpContinuingEducation())); + cellList.add(Util.null2String(dto.getAddUpHousingLoanInterest())); + cellList.add(Util.null2String(dto.getAddUpHousingRent())); + cellList.add(Util.null2String(dto.getAddUpSupportElderly())); + cellList.add(Util.null2String(dto.getAddUpIllnessMedical())); + cellList.add(Util.null2String(dto.getAddUpEnterpriseAndOther())); + cellList.add(Util.null2String(dto.getAddUpOtherDeduction())); + cellList.add(Util.null2String(dto.getAddUpTaxExemptIncome())); + cellList.add(Util.null2String(dto.getAddUpAllowedDonation())); + cellList.add(Util.null2String(dto.getAddUpTaxSavings())); + cellList.add(Util.null2String(dto.getAddUpAdvanceTax())); + cellList.add(Util.null2String(dto.getAddUpInfantCare())); + cellList.add(Util.null2String(dto.getAddUpPrivatePension())); + return cellList; + }).collect(Collectors.toList())) + .orElse(Collections.emptyList()); + + rowList.addAll(dataRowList); + } return rowList; } @@ -383,7 +402,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation SalaryI18nUtil.getI18nLabel(user.getLanguage(),542238, "累计减免税额"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),542239, "累计已预扣预缴税额"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),537990,"累计婴幼儿照护"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542863,"累计个人养老金")); + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542863, "累计个人养老金")); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 @@ -475,89 +494,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public XSSFWorkbook downloadTemplate(AddUpSituationQueryParam queryParam) { - String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542242, "往期累计情况导入模板"); - String[] header = { - SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034, "姓名"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),27511,"部门"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),125238, "手机号"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),1933,"工号"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),1839, "证件号码"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),1516, "入职日期"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542230, "累计收入额"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542231, "累计减除费用"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542232, "累计社保个人合计"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542233, "累计公积金个人合计"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542158,"累计子女教育"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542159,"累计继续教育"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542160,"累计住房贷款利息"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542161,"累计住房租金"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542162,"累计赡养老人"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542163,"累计大病医疗"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542234, "累计企业(职业)年金及其他福利"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),543361, "累计其他免税扣除"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542236, "累计免税收入"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542237, "累计准予扣除的捐赠额"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542238, "累计减免税额"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542239, "累计已预扣预缴税额"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),537990,"累计婴幼儿照护"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542863, "累计个人养老金") - }; - // 2.表头 - List headerList = Arrays.asList(header); - List> rows = new ArrayList<>(); - rows.add(headerList); - -// // 获取累计情况 -// List taxYearMonth = queryParam.getTaxYearMonth(); -// if (CollectionUtils.isNotEmpty(taxYearMonth)) { -// queryParam.setTaxYearMonth(taxYearMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList())); -// queryParam.setTaxYearMonthDate(taxYearMonth.stream().map(e -> e + "-01 00:00:00").map(SalaryDateUtil::dateStrToLocalTime).collect(Collectors.toList())); -// } - - // 开启分权并且不是薪酬模块总管理员 - List list = getAddUpSituationMapper().list(queryParam); - long employeeId = user.getUID(); - if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) { - List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - list = list.stream().filter(f -> - taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - ).collect(Collectors.toList()); - } -// // 人员信息赋值 -// list.forEach(m -> { -// // todo 身份证号 -// m.setIdNo(""); -// }); -// - for (AddUpSituationDTO dto : list) { - List row = new ArrayList<>(); - row.add(Util.null2String(dto.getUsername())); - row.add(Util.null2String(dto.getTaxAgentName())); - row.add(Util.null2String(dto.getDepartmentName())); - row.add(Util.null2String(dto.getMobile())); - row.add(Util.null2String(dto.getJobNum())); - row.add(Util.null2String(dto.getIdNo())); - row.add(Util.null2String(dto.getHiredate())); -// row.add(Util.null2String(dto.getAddUpIncome())); -// row.add(Util.null2String(dto.getAddUpSubtraction())); -// row.add(Util.null2String(dto.getAddUpSocialSecurityTotal())); -// row.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); -// row.add(Util.null2String(dto.getAddUpChildEducation())); -// row.add(Util.null2String(dto.getAddUpContinuingEducation())); -// row.add(Util.null2String(dto.getAddUpHousingLoanInterest())); -// row.add(Util.null2String(dto.getAddUpHousingRent())); -// row.add(Util.null2String(dto.getAddUpSupportElderly())); -// row.add(Util.null2String(dto.getAddUpIllnessMedical())); -// row.add(Util.null2String(dto.getAddUpEnterpriseAndOther())); -// row.add(Util.null2String(dto.getAddUpOtherDeduction())); -// row.add(Util.null2String(dto.getAddUpTaxExemptIncome())); -// row.add(Util.null2String(dto.getAddUpAllowedDonation())); -// row.add(Util.null2String(dto.getAddUpTaxSavings())); -// row.add(Util.null2String(dto.getAddUpAdvanceTax())); -// row.add(Util.null2String(dto.getAddUpInfantCare())); - rows.add(row); - } + String sheetName = SalaryI18nUtil.getI18nLabel(101605, "往期累计情况导入模板"); + // 获取操作按钮资源 + List> rowList = getExcelRowList(queryParam, queryParam.isHasData()); // 4.注释 List excelComments = Lists.newArrayList(); excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),30036, "必填"))); @@ -581,7 +520,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation excelComments.add(new ExcelComment(23, 0, 28, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542164, "输入数字"))); excelComments.add(new ExcelComment(24, 0, 29, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542164, "输入数字"))); - return ExcelUtil.genWorkbookV2(rows, sheetName, excelComments); + return ExcelUtil.genWorkbookV2(rowList, sheetName, excelComments); } @Override @@ -614,12 +553,13 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId)); - List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 25, "template.xlsx"); - apidatas.put("preview", excelDates); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0)); + apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0)); + return apidatas; } finally { IOUtils.closeQuietly(fileInputStream); } - return apidatas; } @@ -652,7 +592,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取已经核算的数据(获取税款所属期下一个月的数据) YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); String nextTaxYearMonthStr = taxYearMonthStr; - if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){ + if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) { nextTaxYearMonth = nextTaxYearMonth.plusMonths(1); nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER); } @@ -712,7 +652,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation String workcode = dto.getJobNum(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null); //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 if (StringUtils.isBlank(userName) && "0".equals(confValue)) { @@ -737,7 +677,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542132,"员工信息不存在或者存在多个员工")); errorData.add(errorMessageMap); errorSum += 1; - }else { + } else { Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; po.setEmployeeId(employeeId); } @@ -788,7 +728,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // } // 判断是否有核算过 - if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12") ) { + if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) { Optional optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())).findFirst(); boolean isExist = list.stream().anyMatch(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())); if (optionalAcctEmp.isPresent() && isExist) { @@ -859,7 +799,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } //入库 - biz.handleImportData(eligibleData, user); + handleImportData(eligibleData, user); apidatas.put("successCount", successCount); apidatas.put("errorCount", errorCount); @@ -871,6 +811,74 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation return apidatas; } + public void handleImportData(List pos) { + if (CollectionUtils.isEmpty(pos)) { + return; + } + AddUpSituationBiz biz = new AddUpSituationBiz(); + AddUpSituation po = pos.get(0); + // 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos); + // 去重(通过记录的唯一条件(申报月份,人员id,个税扣缴义务人id)拼接) + List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new)); + // 查询已有数据 + List list = biz.listSome(AddUpSituation.builder().taxYearMonth(po.getTaxYearMonth()).build()); + // 待修改的 本地已存在则更新【交集】 + List updateList = list.stream().map(m -> { + Optional optional = finalPos.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst(); + AddUpSituation temp = null; + if (optional.isPresent()) { + temp = optional.get(); + // 换成本地库的id + temp.setId(m.getId()); + } + return temp; + }).filter(Objects::nonNull).collect(Collectors.toList()); + // 待新增的 导入比本地多,则新增【差集(导入 - local)】 + List saveList = finalPos.stream().map(m -> { + Optional optional = list.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst(); + AddUpSituation temp = null; + if (!optional.isPresent()) { + temp = m; + } + return temp; + }).filter(Objects::nonNull).collect(Collectors.toList()); + + // 修改 + if (CollectionUtils.isNotEmpty(updateList)) { + biz.batchUpdate(updateList); + } + // 保存 + if (CollectionUtils.isNotEmpty(saveList)) { + batchSave(saveList); + } + + // 记录操作日志 + // 根据月份、人员id查出保存的数据 + List empIds = saveList.stream().map(AddUpSituation::getEmployeeId).collect(Collectors.toList()); + List insertList = biz.listSome(AddUpSituation.builder().taxYearMonth(po.getTaxYearMonth()).employeeIds(empIds).build()); + Map insertMap = SalaryEntityUtil.convert2Map(insertList, p -> p.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(p.getTaxYearMonth()) + "-" + p.getEmployeeId()); + saveList.forEach(save -> { + AddUpSituation addUpSituation = insertMap.get(save.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(save.getTaxYearMonth()) + "-" + save.getEmployeeId()); + if (addUpSituation != null) { + updateList.add(addUpSituation); + } + }); + + if (CollectionUtils.isNotEmpty(updateList)) { + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + if (updateList.size() == 1) { + loggerContext.setTargetId(updateList.get(0).getId().toString()); + } + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "往期累计情况")); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入往期累计情况")); + loggerContext.setNewValueList(updateList); + SalaryElogConfig.addUpSituationLoggerTemplate.write(loggerContext); + } + } + private void checkImportParam(AddUpSituationImportParam importParam) { @@ -890,8 +898,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } /** - * @description 编辑数据 * @return void + * @description 编辑数据 * @author Harryxzy * @date 2022/10/27 21:32 */ @@ -904,12 +912,12 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); AddUpSituation byId = biz.getById(addUpSituationParam.getId(), user); - if(byId == null){ + if (byId == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542138,"该数据不存在!")); } Long taxAgentId = byId.getTaxAgentId(); - boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId)); - if(!canEdit){ + boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId)); + if (!canEdit) { //没有编辑权限 throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542139,"该个税扣缴义务人无权限编辑此数据!")); } @@ -917,14 +925,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取已经核算的数据(获取税款所属期下一个月的数据) YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); String nextTaxYearMonthStr = taxYearMonthStr; - if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){ + if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) { nextTaxYearMonth = nextTaxYearMonth.plusMonths(1); nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER); } List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(nextTaxYearMonthStr); // 判断是否有核算过 - if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) { + if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) { Optional optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpSituationParam.getEmployeeId()) && f.getTaxAgentId().equals(addUpSituationParam.getTaxAgentId())).findFirst(); if (optionalAcctEmp.isPresent()) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542140,"该年月这条数据已经核算过,不可进行编辑!")); @@ -944,11 +952,26 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation .build(); updateList.add(build); biz.batchUpdate(updateList, user); + + // 记录日志 + AddUpSituation newValue = biz.getById(build.getId()); + String name = SalaryI18nUtil.getI18nLabel(0, "编辑"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(newValue.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "往期累计情况") + "-" + newValue.getId()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "往期累计情况") + "-" + SalaryI18nUtil + .getI18nLabel(0, "编辑")); + loggerContext.setOldValues(byId); + loggerContext.setNewValues(newValue); + loggerContext.setUser(user); + SalaryElogConfig.addUpSituationLoggerTemplate.write(loggerContext); } /** - * @description 新建数据 * @return void + * @description 新建数据 * @author Harryxzy * @date 2022/10/27 22:04 */ @@ -991,8 +1014,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpSituationParam.getEmployeeId())); - if(!employeeSameId){ + boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpSituationParam.getEmployeeId())); + if (!employeeSameId) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542131,"员工信息不存在")); } po.setEmployeeId(addUpSituationParam.getEmployeeId()); @@ -1011,7 +1034,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } } - // fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常 + // fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常 // if (openDevolution) { // Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst(); // if (!optionalTaxAgentEmp.isPresent()) { @@ -1080,7 +1103,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation insertList.add(po); //入库 - biz.handleImportData(insertList, user); + handleImportData(insertList, user); } @Override @@ -1098,16 +1121,17 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation String format = salaryMonthDate.atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM")); List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format); // 判断是否有核算过 + List deletePOList = new ArrayList<>(); List deleteList = new ArrayList<>(); - for(int i=0; i first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst(); - if(!first.isPresent()){ + Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst(); + if (!first.isPresent()) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542136,"个税扣缴义务人不存在或不在权限范围内")); } // 判断用户是否存在 @@ -1118,8 +1142,23 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } } deleteList.add(byId.getId()); + deletePOList.add(byId); } biz.batchDeleteByIDS(deleteList); + + // 记录日志 + deletePOList.stream().forEach(po -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(po.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "往期累计情况") + "-" + po.getId()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "往期累计情况") + "-" + SalaryI18nUtil + .getI18nLabel(0, "删除")); + loggerContext.setOldValues(po); + loggerContext.setUser(user); + SalaryElogConfig.addUpSituationLoggerTemplate.write(loggerContext); + }); } @Override @@ -1133,23 +1172,23 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation AddUpSituationBiz biz = new AddUpSituationBiz(); Date declareMonthDate = new Date(); try { - declareMonthDate = (sdf.parse(declareMonthStr+"-01")); - }catch (Exception e){ + declareMonthDate = (sdf.parse(declareMonthStr + "-01")); + } catch (Exception e) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542144,"日期异常")); } AddUpSituation queryParam = null; - if(deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()){ + if (deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()) { // 设置了个税扣缴义务人 Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId()); - boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId)); - if(!canDelete){ + boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId)); + if (!canDelete) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542136,"个税扣缴义务人不存在或不在权限范围内")); } ArrayList tai = new ArrayList<>(); tai.add(taxAgentId); - queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build(); - }else { + queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build(); + } else { queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(taxAgentIds).build(); } @@ -1159,7 +1198,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM")); // 获取已经核算的数据 List employees = getAddUpDeductionService(user).getAccountedEmployeeData(format); - for(AddUpSituation item : list){ + for (AddUpSituation item : list) { if (CollectionUtils.isNotEmpty(employees)) { Optional optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst(); if (optionalAcctEmp.isPresent()) { @@ -1169,6 +1208,20 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } List deleteIds = list.stream().map(AddUpSituation::getId).collect(Collectors.toList()); biz.batchDeleteByIDS(deleteIds); + + // 记录日志 + Collection finalTaxAgentIds = queryParam.getTaxAgentIds(); + List taxAgentNames = taxAgentList.stream().filter(t -> finalTaxAgentIds.contains(t.getTaxAgentId())) + .map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList()); + String name = declareMonthStr + " " + StringUtils.join(taxAgentNames, ","); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(name); + loggerContext.setOperateType(OperateTypeEnum.CLEAR.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "一键清空")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "往期累计情况") + "-" + SalaryI18nUtil + .getI18nLabel(0, "一键清空:") + name); + loggerContext.setUser(user); + SalaryElogConfig.addUpSituationLoggerTemplate.write(loggerContext); } @Override @@ -1181,11 +1234,11 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation ids.add(addUpSituationParam.getId()); AddUpSituationQueryParam build = AddUpSituationQueryParam.builder().ids(ids).build(); List list = biz.recordList(build, user); - if(list == null || list.size()==0){ + if (list == null || list.size() == 0) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542138,"该数据不存在!")); } String taxAgentName = list.get(0).getTaxAgentName(); - if(!taxAgentNames.contains(taxAgentName)){ + if (!taxAgentNames.contains(taxAgentName)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542146,"您无权查看该数据!")); } return list.get(0); diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index eba4e7f2a..d5a3c57fa 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -8,9 +8,14 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.*; +import com.engine.salary.biz.AttendQuoteBiz; +import com.engine.salary.biz.AttendQuoteDataBiz; +import com.engine.salary.biz.AttendQuoteDataValueBiz; +import com.engine.salary.biz.AttendQuoteFieldBiz; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.bo.AttendQuoteDataBO; import com.engine.salary.entity.datacollection.dto.*; @@ -24,6 +29,7 @@ import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -34,10 +40,7 @@ import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.remote.attend.entity.Attend4Salary; import com.engine.salary.remote.attend.service.RemoteAttend4SalaryService; import com.engine.salary.remote.attend.service.impl.RemoteAttend4SalaryServiceImpl; -import com.engine.salary.service.AttendQuoteDataService; -import com.engine.salary.service.AttendQuoteFieldSettingService; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.SalarySobService; +import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; @@ -45,6 +48,7 @@ import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; @@ -55,7 +59,6 @@ import com.engine.salary.util.valid.ValidUtil; import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -104,6 +107,10 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa return ServiceUtil.getService(SalarySobServiceImpl.class, user); } + private AttendQuoteService getAttendQuoteService(User user) { + return ServiceUtil.getService(AttendQuoteServiceImpl.class, user); + } + private AttendQuoteDataMapper getAttendQuoteDataMapper() { return MapperProxyFactory.getProxy(AttendQuoteDataMapper.class); } @@ -265,6 +272,20 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa } rows.add(row); } + + // 记录日志 + AttendQuotePO attendQuotePO = getAttendQuoteService(user).getById(queryParam.getAttendQuoteId()); + SalarySobPO salarySob = getSalarySobService(user).getById(attendQuotePO.getSalarySobId()); + + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(attendQuotePO.getId())); + loggerContext.setTargetName(SalaryDateUtil.getFormatYearMonth(attendQuotePO.getSalaryYearMonth()) + " " + (salarySob != null ? salarySob.getName() : "")); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导出考勤数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "考勤数据")); + SalaryElogConfig.attendQuoteLoggerTemplate.write(loggerContext); + return ExcelUtil.genWorkbookV2(rows, sheetName); } @@ -370,15 +391,30 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa // 6.数据落库处理 handleDataToDB(attendQuote.getId(), pos, values); + // 记录日志 + recordLog(attendQuote); } else { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542251, "暂无考勤数据可以同步")); } - - // todo 记录日志 -// recordLog(attendQuote, currentEmployeeId, currentTenantKey, null); return null; } + private void recordLog(AttendQuotePO attendQuote) { + SalarySobPO salarySob = getSalarySobService(user).getById(attendQuote.getSalarySobId()); + String sourceType = AttendQuoteSourceTypeEnum.getDefaultLabelByValue(attendQuote.getSourceType()); + + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(attendQuote.getId())); + loggerContext.setTargetName(SalaryDateUtil.getFormatYearMonth(attendQuote.getSalaryYearMonth()) + " " + (salarySob != null ? salarySob.getName() : "")); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(sourceType + SalaryI18nUtil.getI18nLabel(0, "考勤数据")); + loggerContext.setOperatedesc(sourceType + SalaryI18nUtil.getI18nLabel(0, "考勤数据")); + loggerContext.setNewValues(attendQuote); + SalaryElogConfig.attendQuoteLoggerTemplate.write(loggerContext); + } + + /** * 获取考勤引用 * @@ -670,7 +706,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa List employeeSameIds = new ArrayList<>(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List emps = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() @@ -770,8 +806,8 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa handleDataToDB(attendQuote.getId(), pos, values); - // todo 记录日志 -// recordLog(attendQuote, message.getUserId(), message.getTenantKey(), message.getClientIp()); + // 记录日志 + recordLog(attendQuote); Map apidatas = new HashMap(); apidatas.put("successCount", successCount); diff --git a/src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java index 9f0f7962e..a67745c9a 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java @@ -5,10 +5,13 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.AttendQuoteFieldBiz; import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; import com.engine.salary.entity.datacollection.param.AttendQuoteFieldQueryParam; import com.engine.salary.entity.datacollection.param.AttendQuoteFieldSaveParam; import com.engine.salary.entity.datacollection.po.AttendQuoteFieldPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.datacollection.AttendQuoteFieldSourceTypeEnum; import com.engine.salary.enums.datacollection.AttendQuoteFieldTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -143,6 +146,17 @@ public class AttendQuoteFieldServiceImpl extends Service implements AttendQuoteF // 保存 biz.save(attendQuoteField); + // 记录日志 + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(attendQuoteField.getId())); + loggerContext.setTargetName(attendQuoteField.getFieldName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建自定义字段")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建自定义字段")); + loggerContext.setNewValues(attendQuoteField); + SalaryElogConfig.attendQuoteFieldLoggerTemplate.write(loggerContext); + return null; } @@ -223,6 +237,18 @@ public class AttendQuoteFieldServiceImpl extends Service implements AttendQuoteF newAttendQuoteField.setUpdateTime(new Date()); // 更新 biz.update(newAttendQuoteField); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(attendQuoteField.getId())); + loggerContext.setTargetName(attendQuoteField.getFieldName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "启用/停用自定义字段")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "启用/停用自定义字段")); + loggerContext.setOldValues(attendQuoteField); + loggerContext.setNewValues(newAttendQuoteField); + SalaryElogConfig.attendQuoteFieldLoggerTemplate.write(loggerContext); return null; } diff --git a/src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java index bb4a59c84..0172cc93b 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java @@ -5,10 +5,10 @@ import com.engine.core.impl.Service; import com.engine.salary.biz.AttendQuoteBiz; import com.engine.salary.biz.AttendQuoteDataBiz; import com.engine.salary.biz.AttendQuoteDataValueBiz; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.entity.datacollection.dto.AttendQuoteListDTO; -import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam; import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam; -import com.engine.salary.entity.datacollection.po.AttendQuoteDataPO; +import com.engine.salary.entity.datacollection.po.AttendQuotePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; @@ -21,6 +21,8 @@ import com.engine.salary.service.TaxAgentService; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.SalaryLoggerUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -121,27 +123,29 @@ public class AttendQuoteServiceImpl extends Service implements AttendQuoteServic // 1.删除未核算的考勤引用 biz.deleteByIds(unAccountingIds); - List attendQuoteDatas = dataBiz.listSome(AttendQuoteDataQueryParam.builder().unAccountingIds(unAccountingIds).build()); + // List attendQuoteDatas = dataBiz.listSome(AttendQuoteDataQueryParam.builder().unAccountingIds(unAccountingIds).build()); // 2.删除考核引用对应的考核数据 dataBiz.deleteByAttendQuoteIds(unAccountingIds); // 3.删除考核数据对应的考核值 - List attendQuoteDataIds = attendQuoteDatas.stream().map(AttendQuoteDataPO::getId).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(attendQuoteDataIds)) { - dataValueBiz.deleteByAttendQuoteDataIds(attendQuoteDataIds); - } + dataValueBiz.deleteByAttendQuoteIds(unAccountingIds); + // List attendQuoteDataIds = attendQuoteDatas.stream().map(AttendQuoteDataPO::getId).collect(Collectors.toList()); + // if (CollectionUtils.isNotEmpty(attendQuoteDataIds)) { + // dataValueBiz.deleteByAttendQuoteDataIds(attendQuoteDataIds); + // } - //todo 日志 -// attendQuotes.forEach(e -> { -// SalaryLoggerUtil.recordDeleteSingleLog(attendQuoteLoggerTemplate, -// e.getId(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 538009, "考勤引用"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100412, "删除考勤引用"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100412, "删除考勤引用") + -// ":[" + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542604, "薪资所属月") + ":" + e.getSalaryYearMonth() + "," + -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 544385, "关联账套") + ":" + e.getSalarySobName() + "]", -// e); -// }); + // 记录日志 + attendQuotes.forEach(e -> { + SalaryLoggerUtil.recordDeleteSingleLog(SalaryElogConfig.attendQuoteLoggerTemplate, + e.getId(), + SalaryI18nUtil.getI18nLabel(0, SalaryDateUtil.getFormatYearMonth(e.getSalaryYearMonth()) + " " + e.getSalarySobName()), + SalaryI18nUtil.getI18nLabel(0, "删除考勤引用"), + SalaryI18nUtil.getI18nLabel(0, "删除考勤引用") + + ":[" + SalaryI18nUtil.getI18nLabel(0, "薪资所属月") + ":" + e.getSalaryYearMonth() + "," + + SalaryI18nUtil.getI18nLabel(0, "关联账套") + ":" + e.getSalarySobName() + "]", + e, + user); + }); return null; } @@ -162,5 +166,11 @@ public class AttendQuoteServiceImpl extends Service implements AttendQuoteServic return isEnableOperation.get(); } - + @Override + public AttendQuotePO getById(Long id) { + if (id == null) { + return null; + } + return getAttendQuoteMapper().getById(id); + } } diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index 273fcd4d3..eeaa73179 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -1,10 +1,11 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.constant.WeaBoolAttr; import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesAccountPO; @@ -16,10 +17,12 @@ import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.service.ColumnBuildService; +import com.engine.salary.service.SIArchivesService; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import org.apache.commons.lang3.StringUtils; import weaver.general.Util; +import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; @@ -32,9 +35,16 @@ import java.util.stream.Collectors; **/ public class ColumnBuildServiceImpl extends Service implements ColumnBuildService { +// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private ICategoryMapper getICategoryMapper() { return MapperProxyFactory.getProxy(ICategoryMapper.class); } + + public SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class, user); + } + @Override public List buildCommonColumnsWithStyle(List pos, Long employeeId, String tenantKey, Integer paymentStatus) { List list = new ArrayList<>(); @@ -139,58 +149,129 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap, Long employeeId, String tenantKey) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if(socialJson!=null){ socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if(fundJson!=null){ fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if(otherJson!=null){ otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"), social + "otherBase"); + } + }); + } + // map根据value排序 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -205,6 +286,24 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); @@ -366,9 +465,10 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic @Override public List buildInspectColumns(List pos, Long paymentOrganization) { List list = new ArrayList<>(); - SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + List employeeIds = pos.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList()); - Map insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization); +// Map insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization); + Map insuranceArchivesAccountPOMap = getSIArchivesService(user).buildBatchAccount(employeeIds, paymentOrganization); Map categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName)); Map> columns = buildInspectTableTitle(new ArrayList<>(insuranceArchivesAccountPOMap.values()), categoryIdNameMap); WeaTableColumn weaTableNameColumn = new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034,"姓名"), "userName"); diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 05f639401..373e5b56c 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -2,6 +2,8 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.extemp.param.ExtEmpImportParam; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; @@ -10,6 +12,7 @@ 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.enums.OperateTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.extemp.ExternalEmployeeMapper; @@ -17,6 +20,7 @@ import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; @@ -27,7 +31,6 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -102,6 +105,17 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { po.setDeleteType(0); getExternalEmployeeMapper().insertIgnoreNull(po); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(po.getId())); + loggerContext.setTargetName(po.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增非系统人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增非系统人员") + ": " + po.getUsername()); + loggerContext.setNewValues(po); + SalaryElogConfig.extEmployeeLoggerTemplate.write(loggerContext); } @Override @@ -123,12 +137,38 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { po.setUpdateTime(now); getExternalEmployeeMapper().updateIgnoreNull(po); + ExtEmpPO byId = getExternalEmployeeMapper().getById(po.getId()); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(byId.getId())); + loggerContext.setTargetName(byId.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑非系统人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑非系统人员") + ": " + byId.getUsername()); + loggerContext.setOldValues(oldPO); + loggerContext.setNewValues(byId); + SalaryElogConfig.extEmployeeLoggerTemplate.write(loggerContext); } @Override public void delete(Collection ids) { if (CollectionUtils.isNotEmpty(ids)) { + List extEmpPOS = getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(ids).build()); ids.forEach(getExternalEmployeeMapper()::delete); + // 记录日志 + extEmpPOS.forEach(extEmployeePO -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(extEmployeePO.getId())); + loggerContext.setTargetName(extEmployeePO.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除非系统人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除非系统人员") + ": " + extEmployeePO.getUsername()); + loggerContext.setOldValues(extEmployeePO); + SalaryElogConfig.extEmployeeLoggerTemplate.write(loggerContext); + }); } } @@ -478,10 +518,32 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { //更新 for(ExtEmpPO po : updateExtEmpPOList) { getExternalEmployeeMapper().updateIgnoreNull(po); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(po.getId())); + loggerContext.setTargetName(po.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入-更新非系统人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入-更新非系统人员") + ": " + po.getUsername()); + loggerContext.setNewValues(po); + SalaryElogConfig.extEmployeeLoggerTemplate.write(loggerContext); } //新建 for(ExtEmpPO po : insertExtEmpPOList) { getExternalEmployeeMapper().insertIgnoreNull(po); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(po.getId())); + loggerContext.setTargetName(po.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入-新增非系统人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入-新增非系统人员") + ": " + po.getUsername()); + loggerContext.setNewValues(po); + SalaryElogConfig.extEmployeeLoggerTemplate.write(loggerContext); } diff --git a/src/com/engine/salary/service/impl/MySalaryShowSetServiceImpl.java b/src/com/engine/salary/service/impl/MySalaryShowSetServiceImpl.java new file mode 100644 index 000000000..57ec01bda --- /dev/null +++ b/src/com/engine/salary/service/impl/MySalaryShowSetServiceImpl.java @@ -0,0 +1,44 @@ +package com.engine.salary.service.impl; + + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salaryBill.dto.MySalaryShowSetDTO; +import com.engine.salary.service.MySalaryShowSetService; +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 lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; +import weaver.hrm.User; + +/** + * @Description: 我的薪资福利显示设置 + * @Author: wangxiangzhong + * @Date: 2023/8/7 11:16 + */ +@Slf4j +public class MySalaryShowSetServiceImpl extends Service implements MySalaryShowSetService { + + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + + /** + * 获取显示设置 + * + * @return + */ + @Override + public MySalaryShowSetDTO get() { + SalarySysConfPO salaryShowStatus = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_SHOW_STATUS); + SalarySysConfPO adjustShowStatus = getSalarySysConfService(user).getOneByCode(SalarySysConstant.ADJUST_SHOW_STATUS); + + return MySalaryShowSetDTO.builder() + .salaryShowStatus(salaryShowStatus == null ? true : NumberUtils.INTEGER_ONE.equals(salaryShowStatus.getConfValue())) + .adjustShowStatus(adjustShowStatus == null ? true : NumberUtils.INTEGER_ONE.equals(adjustShowStatus.getConfValue())) + .build(); + } + +} diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 67125afe6..2bf14cebc 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -5,8 +5,11 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.OtherDeductionBiz; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; +import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; @@ -15,6 +18,7 @@ import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.OtherDeductionMapper; @@ -33,6 +37,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; +import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -41,6 +46,7 @@ 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.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -55,6 +61,7 @@ import java.util.*; import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; public class OtherDeductionServiceImpl extends Service implements OtherDeductionService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -161,12 +168,13 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 12, "OtherDeductionTemplate.xlsx"); - apidatas.put("preview", OtherDeductions); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0)); + apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0)); + return apidatas; } finally { IOUtils.closeQuietly(fileInputStream); } - return apidatas; } @@ -247,7 +255,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List employeeSameIds = new ArrayList<>(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List emps = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() @@ -371,6 +379,78 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return apidatas; } + /** + * 处理导入数据 + * + * @param pos + */ + public void handleImportData(List pos) { + if (CollectionUtils.isEmpty(pos)) { + return; + } + OtherDeductionBiz otherDeductionBiz = new OtherDeductionBiz(); + OtherDeductionPO po = pos.get(0); + // 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos); + // 去重(通过记录的唯一条件(申报月份,人员id,个税扣缴义务人id)拼接) + List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new)); + // 查询已有数据 + List list = otherDeductionBiz.listSome(OtherDeductionPO.builder().declareMonth(po.getDeclareMonth()).build()); + // 待修改的 本地已存在则更新【交集】 + List updateList = list.stream().map(m -> { + Optional optional = finalPos.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst(); + OtherDeductionPO temp = null; + if (optional.isPresent()) { + temp = optional.get(); + // 换成本地库的id + temp.setId(m.getId()); + } + return temp; + }).filter(Objects::nonNull).collect(Collectors.toList()); + // 待新增的 导入比本地多,则新增【差集(导入 - local)】 + List saveList = finalPos.stream().map(m -> { + Optional optional = list.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst(); + OtherDeductionPO temp = null; + if (!optional.isPresent()) { + temp = m; + } + return temp; + }).filter(Objects::nonNull).collect(Collectors.toList()); + + // 修改 + if (CollectionUtils.isNotEmpty(updateList)) { + otherDeductionBiz.batchUpdate(updateList); + } + // 保存 + if (CollectionUtils.isNotEmpty(saveList)) { + otherDeductionBiz.batchSave(saveList); + } + // 记录日志 + // 根据月份、人员id查出保存的数据 + List empIds = saveList.stream().map(OtherDeductionPO::getEmployeeId).collect(Collectors.toList()); + List insertList = otherDeductionBiz.listSome(OtherDeductionPO.builder().declareMonth(po.getDeclareMonth()).employeeIds(empIds).build()); + Map insertMap = SalaryEntityUtil.convert2Map(insertList, p -> p.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(p.getDeclareMonth()) + "-" + p.getEmployeeId()); + saveList.forEach(save -> { + OtherDeductionPO otherDeductionPO = insertMap.get(save.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(save.getDeclareMonth()) + "-" + save.getEmployeeId()); + if (otherDeductionPO != null) { + updateList.add(otherDeductionPO); + } + }); + + if (CollectionUtils.isNotEmpty(updateList)) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + if (updateList.size() == 1) { + loggerContext.setTargetId(updateList.get(0).getId().toString()); + } + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除")); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增其他免税扣除")); + loggerContext.setNewValueList(updateList); + SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext); + } + } + private void checkImportParam(OtherDeductionImportParam importParam) { //excel文件id String imageId = Util.null2String(importParam.getImageId()); @@ -397,10 +477,20 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction public XSSFWorkbook export(OtherDeductionQueryParam param) { //获取操作按钮资源 - List> rowList = getExcelRowList(param); + List> rowList = getExcelRowList(param, true); + + // 记录日志 + String name = SalaryI18nUtil.getI18nLabel(0, "导出"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除")); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除") + "-" + name); + loggerContext.setUser(user); + SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext); //获取excel - return ExcelUtil.genWorkbook(rowList, SalaryI18nUtil.getI18nLabel(user.getLanguage(),538007, "其他免税扣除")); + return ExcelUtil.genWorkbookV2(rowList, SalaryI18nUtil.getI18nLabel(user.getLanguage(),538007, "其他免税扣除")); } @@ -409,10 +499,10 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction * * @return 导出数据行集合 */ - private List> getExcelRowList(OtherDeductionQueryParam param) { + private List> getExcelRowList(OtherDeductionQueryParam param, boolean hasData) { long employeeId = user.getUID(); //excel标题 - List title = Arrays.asList(SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034, "姓名"), + List title = Arrays.asList(SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034, "姓名"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),27511,"部门"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),125238, "手机号"), @@ -424,9 +514,13 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction SalaryI18nUtil.getI18nLabel(user.getLanguage(),25740, "其他"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),542294, "准予扣除的捐赠额"), SalaryI18nUtil.getI18nLabel(user.getLanguage(),542295, "个人养老金")); - //排序配置 - OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); - param.setOrderRule(orderRule); + List> rowList = new ArrayList<>(); + rowList.add(title); + + if (hasData) { + //排序配置 + OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); + param.setOrderRule(orderRule); //申报月份 List declareMonth = param.getDeclareMonth(); @@ -437,6 +531,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List list = getOtherDeductionMapper().list(param); encryptUtil.decryptList(list, OtherDeductionListDTO.class, user); + SalaryI18nUtil.i18nList(list); // 开启分权并且不是薪酬模块总管理员 if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) { List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); @@ -446,30 +541,29 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction ).collect(Collectors.toList()); } + final List> dataRowList = Optional.ofNullable(list) + .map(List::stream) + .map(operatorStream -> operatorStream.map(dto -> { + List cellList = new ArrayList<>(); + cellList.add(Util.null2String(dto.getUsername())); + cellList.add(Util.null2String(dto.getTaxAgentName())); + cellList.add(Util.null2String(dto.getDepartmentName())); + cellList.add(Util.null2String(dto.getMobile())); + cellList.add(Util.null2String(dto.getJobNum())); + cellList.add(Util.null2String(dto.getIdNo())); + cellList.add(Util.null2String(dto.getHiredate())); + cellList.add(Util.null2String(dto.getBusinessHealthyInsurance())); + cellList.add(Util.null2String(dto.getTaxDelayEndowmentInsurance())); + cellList.add(Util.null2String(dto.getOtherDeduction())); + cellList.add(Util.null2String(dto.getDeductionAllowedDonation())); + cellList.add(Util.null2String(dto.getPrivatePension())); + return cellList; + }).collect(Collectors.toList())) + .orElse(Collections.emptyList()); - final List> dataRowList = Optional.ofNullable(list) - .map(List::stream) - .map(operatorStream -> operatorStream.map(dto -> { - List cellList = new ArrayList<>(); - cellList.add(Util.null2String(dto.getUsername())); - cellList.add(Util.null2String(dto.getTaxAgentName())); - cellList.add(Util.null2String(dto.getDepartmentName())); - cellList.add(Util.null2String(dto.getMobile())); - cellList.add(Util.null2String(dto.getJobNum())); - cellList.add(Util.null2String(dto.getIdNo())); - cellList.add(Util.null2String(dto.getHiredate())); - cellList.add(Util.null2String(dto.getBusinessHealthyInsurance())); - cellList.add(Util.null2String(dto.getTaxDelayEndowmentInsurance())); - cellList.add(Util.null2String(dto.getOtherDeduction())); - cellList.add(Util.null2String(dto.getDeductionAllowedDonation())); - cellList.add(Util.null2String(dto.getPrivatePension())); - return cellList; - }).collect(Collectors.toList())) - .orElse(Collections.emptyList()); + rowList.addAll(dataRowList); + } - List> rowList = new ArrayList<>(); - rowList.add(title); - rowList.addAll(dataRowList); return rowList; } @@ -611,9 +705,25 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction .otherDeduction(otherDeductionParam.getOtherDeduction()) .deductionAllowedDonation(otherDeductionParam.getDeductionAllowedDonation()) .privatePension(otherDeductionParam.getPrivatePension()) + .updateTime(new Date()) .build(); updateList.add(build); OtherDeductionBiz.batchUpdate(updateList, user); + + // 记录日志 + OtherDeductionPO newValue = OtherDeductionBiz.getById(build.getId()); + String name = SalaryI18nUtil.getI18nLabel(0, "编辑"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(newValue.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除") + "-" + newValue.getId()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "编辑")); + loggerContext.setOldValues(byId); + loggerContext.setNewValues(newValue); + loggerContext.setUser(user); + SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext); } @Override @@ -698,7 +808,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } insertData.add(po); //入库 - OtherDeductionBiz.handleImportData(insertData, user); + handleImportData(insertData, user); } @Override @@ -714,6 +824,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); // 判断是否有核算过 List deleteList = new ArrayList<>(); + List resultList = new ArrayList<>(); for (int i = 0; i < deleteIds.size(); i++) { Long id = deleteIds.get(i); OtherDeductionPO byId = otherDeductionBiz.getById(id, user); @@ -733,8 +844,22 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } deleteList.add(byId.getId()); + resultList.add(byId); } otherDeductionBiz.batchDeleteByIDS(deleteList); + // 记录日志 + resultList.stream().forEach(r -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(r.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除") + "-" + r.getId()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "删除")); + loggerContext.setOldValues(r); + loggerContext.setUser(user); + SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext); + }); } @Override @@ -781,6 +906,20 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } List deleteIds = list.stream().map(OtherDeductionPO::getId).collect(Collectors.toList()); otherDeductionBiz.batchDeleteByIDS(deleteIds); + + // 记录日志 + Collection finalTaxAgentIds = queryParam.getTaxAgentIds(); + List taxAgentNames = taxAgentList.stream().filter(t -> finalTaxAgentIds.contains(t.getTaxAgentId())) + .map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList()); + String name = declareMonthStr + " " + StringUtils.join(taxAgentNames, ","); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(name); + loggerContext.setOperateType(OperateTypeEnum.CLEAR.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "一键清空")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "一键清空:") + name); + loggerContext.setUser(user); + SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext); } @Override @@ -865,30 +1004,39 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction getOtherDeductionBiz().batchSave(insertInfo, user); getOtherDeductionBiz().batchUpdate(updatetInfo, user); + + //记录日志 + // 根据月份、人员id查出保存的数据 + List empIds = insertInfo.stream().map(OtherDeductionPO::getEmployeeId).collect(Collectors.toList()); + List insertList = getOtherDeductionBiz().listSome(OtherDeductionPO.builder().declareMonth(SalaryDateUtil.stringToDate(param.getDeclareMonth())).employeeIds(empIds).build()); + Map insertMap = SalaryEntityUtil.convert2Map(insertList, p -> p.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(p.getDeclareMonth()) + "-" + p.getEmployeeId()); + insertList.forEach(save -> { + OtherDeductionPO otherDeductionPO = insertMap.get(save.getTaxAgentId() + "-" + SalaryDateUtil.getFormatYearMonth(save.getDeclareMonth()) + "-" + save.getEmployeeId()); + if (otherDeductionPO != null) { + updatetInfo.add(otherDeductionPO); + } + }); + + if (CollectionUtils.isNotEmpty(updatetInfo)) { + String yearMonthStr = SalaryDateUtil.getFormatYearMonth(lastMonth.toLocalDate()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "沿用上月 " + yearMonthStr)); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "沿用上月其他免税扣除")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "沿用上月 " + yearMonthStr + " 其他免税扣除")); + loggerContext.setNewValueList(updatetInfo); + SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext); + } return ""; } @Override public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam param) { // 1.工作簿名称 - String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542298, "其他免税扣除导入模板"); - String[] header = { - SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034, "姓名"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),27511,"部门"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),125238, "手机号"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),1933,"工号"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),1839, "证件号码"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),1516, "入职日期"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542292, "商业健康保险"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542293, "税延养老保险"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),25740, "其他"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542294, "准予扣除的捐赠额") - }; - // 2.表头 - List> rows = new ArrayList<>(); - List headerList = Arrays.asList(header); - rows.add(headerList); + String sheetName = SalaryI18nUtil.getI18nLabel(101604, "其他免税扣除导入模板"); + //获取操作按钮资源 + List> rowList = getExcelRowList(param, param.isHasData()); // 4.注释 List excelComments = Lists.newArrayList(); @@ -898,8 +1046,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction excelComments.add(new ExcelComment(8, 0, 11, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542164, "输入数字"))); excelComments.add(new ExcelComment(9, 0, 12, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542164, "输入数字"))); excelComments.add(new ExcelComment(10, 0, 13, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542164, "输入数字"))); + excelComments.add(new ExcelComment(11, 0, 14, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); - XSSFWorkbook book = ExcelUtil.genWorkbookV2(rows, sheetName, excelComments); + XSSFWorkbook book = ExcelUtil.genWorkbookV2(rowList, sheetName, excelComments); return book; } diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 7c48f7ce8..0c27fecea 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -1,9 +1,9 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO; @@ -15,10 +15,12 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.RecordsBuildService; +import com.engine.salary.service.SIArchivesService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryDateUtil; @@ -60,8 +62,16 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } +// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + + public SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class, user); + } + @Override public List> buildCommonRecords(List list, Long employeeId) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); List> result = new ArrayList<>(); if (CollectionUtils.isEmpty(list)) { return result; @@ -102,34 +112,139 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ record.put("socialAccount", item.getSocialAccount()); record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId())); - if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString()) || StringUtils.isNotEmpty(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", (String) v); +// if(socialJson!=null){ +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("fundAccount", item.getFundAccount()); record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); - if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", (String) v); + if (StringUtils.isNotEmpty(item.getFundPaymentBaseString()) || StringUtils.isNotEmpty(item.getFundPaymentComBaseString())) { + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if(fundJson!=null){ +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId())); - if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", (String) v); + if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString()) || StringUtils.isNotEmpty(item.getOtherPaymentComBaseString())) { + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if(otherJson!=null){ +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } if (StringUtils.isNotEmpty(item.getSocialPerJson())) { @@ -213,7 +328,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ @Override public List> buildInspectRecords(List list, Long paymentOrganization) { List> result = new ArrayList<>(); - SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + if (CollectionUtils.isEmpty(list)) { return result; } @@ -227,7 +342,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return result; } Map collect = employeeByIds.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity())); - Map insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization); +// Map insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization); + Map insuranceArchivesAccountPOMap = getSIArchivesService(user).buildBatchAccount(employeeIds, paymentOrganization); list.forEach(item -> { Map record = new HashMap<>(); DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId()) == null ? new DataCollectionEmployee() : collect.get(item.getEmployeeId()); diff --git a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java index 450c62fb6..d70d5717f 100644 --- a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java @@ -478,7 +478,7 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic } private List attendData2FormulaVar(SalaryFormulaReferenceEnum referenceEnum) { - List fields = getAttendQuoteFieldMapper().list(AttendQuoteFieldQueryParam.builder().build()); + List fields = getAttendQuoteFieldMapper().list(AttendQuoteFieldQueryParam.builder().enableStatus(1).build()); if (CollectionUtils.isEmpty(fields)) { return null; } diff --git a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java index c48a48dcd..b1e087a73 100644 --- a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java @@ -18,19 +18,19 @@ import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; import com.engine.salary.service.SIAComparisonResultService; +import com.engine.salary.service.SIArchivesService; import com.engine.salary.service.SISchemeService; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; -import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; -import com.wbi.util.Util; import org.apache.commons.lang3.BooleanUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; @@ -46,6 +46,8 @@ import java.util.stream.Collectors; public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService { private EncryptUtil encryptUtil = new EncryptUtil(); +// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private InsuranceExportMapper getInsuranceExportMapper() { return MapperProxyFactory.getProxy(InsuranceExportMapper.class); } @@ -70,6 +72,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar return ServiceUtil.getService(SISchemeServiceImpl.class, user); } + public SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class, user); + } + /** * 根据列表查询条件查询线下对比结果(分页) */ @@ -132,7 +138,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542315, "线下对比结果"); - return ExcelUtil.genWorkbookV2(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -141,6 +147,8 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar */ private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -201,10 +209,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); //3-构建福利核算对比结果列表表头 - List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet, user); + List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet, welBaseDiffSign, user); //4-通过线上线下两份数据获得对比结果 Map schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap(); - List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap, user); + List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap, welBaseDiffSign, user); // 系统值和线下值一致的人员 if (queryParam.isOnlyDiffEmployee()) { @@ -228,7 +236,8 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar } private Set welfareInfo() { - +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); Set info = new HashSet<>(); List listAll = getICategoryMapper().listAll(); @@ -236,18 +245,37 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList()); List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList()); - //组装社保基数 - for (ICategoryPO po : socialWelfareList) { - info.add(po.getId() + "socialBase"); - } - //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - info.add(po.getId() + "fundBase"); - } - //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - info.add(po.getId() + "otherBase"); + if (welBaseDiffSign) { + //组装社保基数 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialPerBase"); + info.add(po.getId() + "socialComBase"); + } + //组装公积金基数 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundPerBase"); + info.add(po.getId() + "fundComBase"); + } + //组装其他福利基数 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherPerBase"); + info.add(po.getId() + "otherComBase"); + } + } else { + //组装社保基数 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialBase"); + } + //组装公积金基数 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundBase"); + } + //组装其他福利基数 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherBase"); + } } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelfareList) { info.add(po.getId() + "socialPer"); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 2e8798c9e..89b1d15e2 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1,51 +1,49 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionOption; import com.api.formmode.mybatis.util.SqlProxyHandle; +import com.cloudstore.dev.api.util.Util_DataCache; import com.cloudstore.eccom.pc.table.*; import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.*; +import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.constant.SalaryItemConstant; 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.bo.InsuranceAccountBO; -import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO; -import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO; -import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; -import com.engine.salary.entity.siaccount.dto.InsuranceAcctDetailImportFieldDTO; +import com.engine.salary.entity.siaccount.dto.*; import com.engine.salary.entity.siaccount.param.*; -import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO; -import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; -import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; -import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO; -import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; -import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO; -import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO; -import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; +import com.engine.salary.entity.siaccount.po.*; +import com.engine.salary.entity.siarchives.po.*; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.siexport.param.InsuranceExportParam; import com.engine.salary.entity.siexport.po.AccountExportPO; 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.OperateTypeEnum; 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.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.InsuranceExportMapper; -import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper; -import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; -import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; -import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper; +import com.engine.salary.mapper.datacollection.EmployMapper; +import com.engine.salary.mapper.siaccount.*; import com.engine.salary.mapper.siarchives.FundSchemeMapper; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; +import com.engine.salary.mapper.siarchives.OtherSchemeMapper; import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; @@ -53,18 +51,18 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; +import com.engine.salary.sys.constant.SalarySysConstant; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; +import com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryFormItemUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -73,8 +71,12 @@ import com.engine.salary.wrapper.SalaryFormulaWrapper; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.mzlion.core.utils.BeanUtils; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; +import com.wbi.util.StringUtil; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang.math.NumberUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; @@ -85,9 +87,11 @@ import weaver.hrm.User; import java.io.InputStream; import java.math.BigDecimal; +import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -101,11 +105,11 @@ import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; * @Date 2022/4/11 * @Version V1.0 **/ +@Slf4j public class SIAccountServiceImpl extends Service implements SIAccountService { -// private SIAccountBiz siAccountBiz = new SIAccountBiz(); - private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); +// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); private EncryptUtil encryptUtil = new EncryptUtil(); @@ -113,9 +117,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return ServiceUtil.getService(RecordsBuildServiceImpl.class, user); } - public SIAccountBiz getSiAccountBiz(User user) { - return ServiceUtil.getService(SIAccountBiz.class, user); - } +// public SIAccountBiz getSiAccountBiz(User user) { +// return ServiceUtil.getService(SIAccountBiz.class, user); +// } public ColumnBuildService getColumnBuildService(User user) { return ServiceUtil.getService(ColumnBuildServiceImpl.class, user); @@ -149,7 +153,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return MapperProxyFactory.getProxy(TaxAgentMapper.class); } - SICategoryBiz siCategoryBiz = new SICategoryBiz(); +// SICategoryBiz siCategoryBiz = new SICategoryBiz(); private SalarySysConfMapper getSalarySysConfMapper() { return SqlProxyHandle.getProxy(SalarySysConfMapper.class); @@ -179,6 +183,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return MapperProxyFactory.getProxy(FundSchemeMapper.class); } + private OtherSchemeMapper getOtherSchemeMapper() { + return MapperProxyFactory.getProxy(OtherSchemeMapper.class); + } + private TaxAgentBiz taxAgentBiz = new TaxAgentBiz(); private ICategoryMapper getICategoryMapper() { @@ -209,11 +217,36 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return (SIBalanceService) ServiceUtil.getService(SIBalanceServiceImpl.class, user); } + private ProgressService getSalaryAcctProgressService(User user) { + return ServiceUtil.getService(ProgressServiceImpl.class, user); + } + + private SIAccountDetailTempMapper getSIAccountDetailTempMapper() { + return MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class); + } + + private InsuranceCompensationMapper getInsuranceCompensationMapper() { + return MapperProxyFactory.getProxy(InsuranceCompensationMapper.class); + } + + private SIAccountUtilMapper getSIAccountUtilMapper() { + return MapperProxyFactory.getProxy(SIAccountUtilMapper.class); + } + + public SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class, user); + } + + private EmployMapper getEmployMapper() { + return MapperProxyFactory.getProxy(EmployMapper.class); + } + @Override public Map listPage(InsuranceAccountBatchParam queryParam) { Long employeeId = (long) user.getUID(); Map datas = new HashMap<>(); + List paymentOrganizationIds = queryParam.getTaxAgents(); // 分权逻辑 Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); if (needAuth) { @@ -223,12 +256,16 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //防止普通用户查询 queryParam.setTaxAgents(Collections.singletonList(-1L)); } else { + if (paymentOrganizationIds != null && paymentOrganizationIds.size() > 0) { + taxAgents.retainAll(paymentOrganizationIds); + } queryParam.setTaxAgents(taxAgents); } } //福利台账列表 - PageInfo pageInfo = getSiAccountBiz(user).listPage(queryParam); +// PageInfo pageInfo = getSiAccountBiz(user).listPage(queryParam); + PageInfo pageInfo = siBatchListPage(queryParam); Collection insuranceAccountBatchPOS = pageInfo.getList(); List insuranceAccountBatchListDTOS = InsuranceAccountBO.buildAccountBatchDTOList(insuranceAccountBatchPOS); @@ -297,7 +334,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map datas = new HashMap<>(); //正常缴纳列表 - PageInfo pageInfo = getSiAccountBiz(user).listCommonPage(queryParam); +// PageInfo pageInfo = getSiAccountBiz(user).listCommonPage(queryParam); + PageInfo pageInfo = siBatchListCommonPage(queryParam); List insuranceAccountDetailPOS = pageInfo.getList(); //数据组装 @@ -488,7 +526,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); //系统人员核算明细 List list = getInsuranceAccountDetailMapper().list(queryParam); //非系统人员核算明细 @@ -562,64 +599,93 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public String save(AccountParam param) { - ValidUtil.doValidator(param); - - Long employeeId = (long) user.getUID(); - String lastName = user.getLastname(); - return getSiAccountBiz(user).save(param.isFlag(), param, employeeId, lastName); +// ValidUtil.doValidator(param); +// +// Long employeeId = (long) user.getUID(); +// String lastName = user.getLastname(); +// return getSiAccountBiz(user).save(param.isFlag(), param, employeeId, lastName); + return saveAndFile(param); } @Override public void commonAccount(SaveCommonAccountParam param) { - ValidUtil.doValidator(param); - - Long employeeId = (long) user.getUID(); - String currentUserName = user.getLastname(); - getSiAccountBiz(user).saveCommonAccount(param, employeeId, currentUserName); +// ValidUtil.doValidator(param); +// +// Long employeeId = (long) user.getUID(); +// String currentUserName = user.getLastname(); +// getSiAccountBiz(user).saveCommonAccount(param, employeeId, currentUserName); + siSaveCommonAccount(param); } @Override public void delete(AccountParam accountParam) { Long employeeId = (long) user.getUID(); - getSiAccountBiz(user).delete(accountParam, employeeId); +// getSiAccountBiz(user).delete(accountParam, employeeId); + siDelete(accountParam); } @Override public void saveCommonAccount(SaveCommonAccountParam accountParam) { - Long employeeId = (long) user.getUID(); - String currentUserName = user.getLastname(); - getSiAccountBiz(user).saveCommonAccount(accountParam, employeeId, currentUserName); +// Long employeeId = (long) user.getUID(); +// String currentUserName = user.getLastname(); +// getSiAccountBiz(user).saveCommonAccount(accountParam, employeeId, currentUserName); + siSaveCommonAccount(accountParam); + } + + /** + * 福利台账正常缴纳页-核算 + */ + public void siSaveCommonAccount(SaveCommonAccountParam param) { + ValidUtil.doValidator(param); + + List collect; + SalaryAssert.notEmpty(param.getIncludes(), SalaryI18nUtil.getI18nLabel(100466, "参数为空")); + SalaryAssert.notNull(param.getBillMonth(), SalaryI18nUtil.getI18nLabel(100467, "账单月为空")); + if (CollectionUtils.isNotEmpty(param.getExcludes())) { + collect = param.getIncludes().stream().filter(item -> !param.getExcludes().contains(item)).collect(Collectors.toList()); + } else { + collect = param.getIncludes(); + } + SalaryAssert.notEmpty(collect, SalaryI18nUtil.getI18nLabel(99920, "无核算人员")); + AccountParam accountParam = new AccountParam(); + accountParam.setBillMonth(param.getBillMonth()); + accountParam.setIds(collect); + siAccounting(accountParam); } @Override public void saveSupplementaryAccount(SaveSupplementaryAccountParam saveSupplementaryAccountParam) { ValidUtil.doValidator(saveSupplementaryAccountParam); - Long employeeId = (long) user.getUID(); - String currentUserName = user.getLastname(); - getSiAccountBiz(user).saveSupplementaryAccount(saveSupplementaryAccountParam, employeeId, currentUserName); +// Long employeeId = (long) user.getUID(); +// String currentUserName = user.getLastname(); +// getSiAccountBiz(user).saveSupplementaryAccount(saveSupplementaryAccountParam, employeeId, currentUserName); + siSaveSupplementaryAccount(saveSupplementaryAccountParam); } @Override public void deleteCommonAccount(SaveCommonAccountParam param) { ValidUtil.doValidator(param); - Long employeeId = (long) user.getUID(); - String currentUserName = user.getLastname(); - getSiAccountBiz(user).deleteCommonAccount(param, employeeId, currentUserName); +// Long employeeId = (long) user.getUID(); +// String currentUserName = user.getLastname(); +// getSiAccountBiz(user).deleteCommonAccount(param, employeeId, currentUserName); + siDeleteCommonAccount(param); } @Override - public void deleteSummplementaryAccount(List supplementAccountBaseParams) { - Long employeeId = (long) user.getUID(); - String currentUserName = user.getLastname(); - getSiAccountBiz(user).deleteSupplementaryAccount(supplementAccountBaseParams, employeeId, currentUserName); + public void deleteSupplementaryAccount(SaveCommonAccountParam param) { +// Long employeeId = (long) user.getUID(); +// String currentUserName = user.getLastname(); +// getSiAccountBiz(user).deleteSupplementaryAccount(supplementAccountBaseParams, employeeId, currentUserName); + siDeleteSupplementaryAccount(param); } @Override public void file(AccountParam accountParam) { - Long employeeId = (long) user.getUID(); - String billMonth = accountParam.getBillMonth(); - getSiAccountBiz(user).file(billMonth, employeeId, accountParam.getPaymentOrganization()); +// Long employeeId = (long) user.getUID(); +// String billMonth = accountParam.getBillMonth(); +// getSiAccountBiz(user).file(billMonth, employeeId, accountParam.getPaymentOrganization()); + siFile(accountParam.getBillMonth(), accountParam.getPaymentOrganization()); } @Override @@ -710,13 +776,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { PageInfo pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), insuranceArchivesEmployeePOS, InsuranceArchivesEmployeePO.class); - List> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS); +// List> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS); + List> records = getSIArchivesService(user).buildTableData(insuranceArchivesEmployeePOS); PageInfo> pageInfos = new PageInfo<>(records); pageInfos.setTotal(pageInfo.getTotal()); pageInfos.setPageNum(param.getCurrent()); pageInfos.setPageSize(param.getPageSize()); - List weaTableColumns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS, employeeId); +// List weaTableColumns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS, employeeId); + List weaTableColumns = getSIArchivesService(user).buildWeaTableColumns(insuranceArchivesEmployeePOS); WeaTable table = new WeaTable(); table.setPageUID(UUID.randomUUID().toString()); @@ -758,10 +826,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public void accountInspect(InspectAccountParam param) { - Long employeeId = (long) user.getUID(); +// Long employeeId = (long) user.getUID(); ValidUtil.doValidator(param); - String currentUserName = user.getLastname(); - getSiAccountBiz(user).accountInspect(param.getIds(), param.getBillMonth(), employeeId, currentUserName, param.getPaymentOrganization()); +// String currentUserName = user.getLastname(); +// getSiAccountBiz(user).accountInspect(param.getIds(), param.getBillMonth(), employeeId, currentUserName, param.getPaymentOrganization()); + accountInspect(param.getIds(), param.getBillMonth(), param.getPaymentOrganization()); } @Override @@ -885,7 +954,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public PageInfo overView(InsuranceAccountDetailParam queryParam) { - PageInfo pageInfos = getSiAccountBiz(user).overView(queryParam); +// PageInfo pageInfos = getSiAccountBiz(user).overView(queryParam); + PageInfo pageInfos = siOverView(queryParam); return pageInfos; } @@ -1480,13 +1550,29 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public void socialSecurityBenefitsRecalculate(InsuranceAccountBatchPO param) { //fixme 重新核算的校验逻辑 1、先取台账对应扣缴义务人下的所有账套 2、取账套下所有核算记录 3、判断核算记录有没有使用对应月份的福利台账 - int num = getSiAccountBiz(user).checkIfBusinessaccounting(param); +// int num = getSiAccountBiz(user).checkIfBusinessaccounting(param); + int num = checkIfBusinessAccounting(param); //表示已经被核算过不能重新核算 if (num > 0) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544192, "已被薪酬核算给核算过,无法重新核算!")); } param.setBillStatus(0); - getSiAccountBiz(user).updateById(param); +// getSiAccountBiz(user).updateById(param); + updateById(param); + //记录操作日志 + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getById(param.getId()); + encryptUtil.decrypt(targetPO, InsuranceAccountBatchPO.class); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + targetPO.getId()); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账-重新核算")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账-重新核算") + + ": " + taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } /** @@ -1682,7 +1768,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, dataValue, deparmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -1764,12 +1850,30 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { encryptUtil.encryptList(updateInsuranceAccountDetailList, InsuranceAccountDetailPO.class, user); //更新 for(InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) { - getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po); +// getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po); + updateByEmployeeIdAndBillMonth(po); } //刷新hrsa_bill_batch中数据统计信息 if (updateInsuranceAccountDetailList.size() > 0) { refreshBillBatch(updateInsuranceAccountDetailList.get(0).getPaymentOrganization(), updateInsuranceAccountDetailList.get(0).getBillMonth()); + //记录操作日志 + PaymentStatusEnum targetEnum = SalaryEnumUtil.enumMatchByValue(updateInsuranceAccountDetailList.get(0).getPaymentStatus(), PaymentStatusEnum.values(), PaymentStatusEnum.class); + encryptUtil.decryptList(updateInsuranceAccountDetailList, InsuranceAccountDetailPO.class); + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(updateInsuranceAccountDetailList.get(0).getBillMonth(), updateInsuranceAccountDetailList.get(0).getPaymentOrganization()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-导入") + + SalaryI18nUtil.getI18nLabel(targetEnum.getLabelId(), targetEnum.getDefaultLabel())); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-导入" + + SalaryI18nUtil.getI18nLabel(targetEnum.getLabelId(), targetEnum.getDefaultLabel())) + + ":" + taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + updateInsuranceAccountDetailList.forEach(loggerContext::setNewValues); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } apidatas.put("successCount", successCount); @@ -2018,6 +2122,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { ICategoryPO targetCategory = categoryNameMap.get(targetWelfareName); if (targetCategory != null) { ICategoryPO iCategoryPO = targetCategory; +// List categoryPOList = siCategoryBiz.listByName(entry.getKey().substring(0, keyName.length() - 2)); + List categoryPOList = getSICategoryService(user).listByName(entry.getKey().substring(0, keyName.length() - 2)); + if (categoryPOList.size() == 1) { + ICategoryPO iCategoryPO = categoryPOList.get(0); welfareType = iCategoryPO.getWelfareType(); if (SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人").equals(payScope)) { @@ -2273,7 +2381,80 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { */ @Override public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) { + Map> welColumnMap = createWelColumnMap(param); + List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), + SalaryI18nUtil.getI18nLabel(86185, "部门"), + SalaryI18nUtil.getI18nLabel(86186, "手机号"), + SalaryI18nUtil.getI18nLabel(86317, "工号"), + SalaryI18nUtil.getI18nLabel(86187, "员工状态"), + SalaryI18nUtil.getI18nLabel(100377, "数据来源"), + SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")); + headerList.add(SalaryI18nUtil.getI18nLabel(91324, "社保账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")); + //组装社保基数 + if (welColumnMap.get("socialBase") != null) { + headerList.addAll(welColumnMap.get("socialBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")); + //组装公积金基数 + if (welColumnMap.get("fundBase") != null) { + headerList.addAll(welColumnMap.get("fundBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")); + //组装其他福利基数 + if (welColumnMap.get("otherBase") != null) { + headerList.addAll(welColumnMap.get("otherBase")); + } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) + if (welColumnMap.get("socialPer") != null) { + headerList.addAll(welColumnMap.get("socialPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计")); + //住房公积金个人、补充住房公积金个人 + if (welColumnMap.get("fundPer") != null) { + headerList.addAll(welColumnMap.get("fundPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计")); + //其他个人(比如企业年金个人) + if (welColumnMap.get("otherPer") != null) { + headerList.addAll(welColumnMap.get("otherPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100393, "个人合计")); + //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) + if (welColumnMap.get("socialCom") != null) { + headerList.addAll(welColumnMap.get("socialCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计")); + //住房公积金单位、补充住房公积金单位 + if (welColumnMap.get("fundCom") != null) { + headerList.addAll(welColumnMap.get("fundCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计")); + //其他单位(比如企业年金单位) + if (welColumnMap.get("otherCom") != null) { + headerList.addAll(welColumnMap.get("otherCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100397, "单位合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100398, "社保合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100399, "公积金合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100400, "其他福利合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(93278, "合计")); + + List> rows = new ArrayList<>(); + rows.add(headerList); + String sheetName = "福利核算-线下对比导入模板"; + + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); + } + + public Map> createWelColumnMap(InsuranceAccountDetailParam param) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); //查询线上福利核算记录 InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); insuranceExportParam.setBillMonth(param.getBillMonth()); @@ -2317,77 +2498,240 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); - List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034,"姓名"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),27511,"部门"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),125238, "手机号"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),1933,"工号"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),15890, "员工状态"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),28006, "数据来源"), - SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),81594, "社保账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542267, "社保方案名称")); -// "失业保险申报基数" -// "生育保险申报基数" -// "养老保险申报基数" -// "医疗保险申报基数" -// "工伤保险申报基数" - for (ICategoryPO po : socialWelfareList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + //组装社保基数 + List socialBaseColumns = new ArrayList<>(); + List socialPerBaseColumns = new ArrayList<>(); + List socialComBaseColumns = Lists.newArrayList(); + if (welBaseDiffSign) { + for (ICategoryPO po : socialWelfareList) { + socialPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + socialComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + socialBaseColumns.addAll(socialPerBaseColumns); + socialBaseColumns.addAll(socialComBaseColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + socialBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542268, "公积金账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542269, "公积金方案名称")); + //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + List fundBaseColumns = new ArrayList<>(); + List fundPerBaseColumns = Lists.newArrayList(); + List fundComBaseColumns = Lists.newArrayList(); + if (welBaseDiffSign) { + for (ICategoryPO po : fundWelfareList) { + fundPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + fundComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + fundBaseColumns.addAll(fundPerBaseColumns); + fundBaseColumns.addAll(fundComBaseColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + fundBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542270, "补充公积金账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542271, "其他福利方案名称")); + //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + List otherBaseColumns = new ArrayList<>(); + List otherPerBaseColumns = new ArrayList<>(); + List otherComBaseColumns = Lists.newArrayList(); + if (welBaseDiffSign) { + for (ICategoryPO po : otherWelfareList) { + otherPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + otherComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + otherBaseColumns.addAll(otherPerBaseColumns); + otherBaseColumns.addAll(otherComBaseColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + otherBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } + + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) + List socialPerColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelPerList) { + socialPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //住房公积金个人、补充住房公积金个人 + List fundPerColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelPerList) { + fundPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //其他个人(比如企业年金个人) + List otherPerColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelPerList) { + otherPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) + List socialComColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelComList) { + socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + //住房公积金单位、补充住房公积金单位 + List fundComColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelComList) { + fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + + //其他单位(比如企业年金单位) + List otherComColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelComList) { + otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + + Map> welColumnMap = new HashMap<>(); + welColumnMap.put("socialPerBase", socialPerBaseColumns); + welColumnMap.put("fundPerBase", fundPerBaseColumns); + welColumnMap.put("otherPerBase", otherPerBaseColumns); + welColumnMap.put("socialComBase", socialComBaseColumns); + welColumnMap.put("fundComBase", fundComBaseColumns); + welColumnMap.put("otherComBase", otherComBaseColumns); + welColumnMap.put("socialBase", socialBaseColumns); + welColumnMap.put("fundBase", fundBaseColumns); + welColumnMap.put("otherBase", otherBaseColumns); + welColumnMap.put("socialPer", socialPerColumns); + welColumnMap.put("fundPer", fundPerColumns); + welColumnMap.put("otherPer", otherPerColumns); + welColumnMap.put("socialCom", socialComColumns); + welColumnMap.put("fundCom", fundComColumns); + welColumnMap.put("otherCom", otherComColumns); + return welColumnMap; + } + + + public Map welColumnNameCodeMap(InsuranceAccountDetailParam param) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); + //查询线上福利核算记录 + InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); + insuranceExportParam.setBillMonth(param.getBillMonth()); + insuranceExportParam.setPaymentOrganization(param.getPaymentOrganization()); + List accountExportPOS = getInsuranceExportMapper().exportAccount(param.getPaymentStatus(), insuranceExportParam); + + //整理线上核算记录相关的福利方案,并以此整理需要对比的福利项类别数据 + Set welfareSchemeIds = new HashSet<>(); + accountExportPOS.forEach(f -> { + welfareSchemeIds.add(f.getSocialSchemeId()); + welfareSchemeIds.add(f.getFundSchemeId()); + welfareSchemeIds.add(f.getOtherSchemeId()); + }); + List insuranceSchemeDetailPos = getInsuranceSchemeDetailMapper().listAll(); + List insuranceBaseIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insurancePerPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 2) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insuranceComPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + Set insuranceBaseSet = new HashSet<>(insuranceBaseIds); + Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); + Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); + + List listAll = getICategoryMapper().listAll(); + List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelComList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + + //组装社保基数 + Map result = new HashMap<>(); + if (welBaseDiffSign) { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "socialPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "socialComBase"); + } + } else { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialBase"); + } + } + + //组装公积金基数 + if (welBaseDiffSign) { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "fundPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "fundComBase"); + } + } else { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundBase"); + } + } + + //组装其他福利基数 + if (welBaseDiffSign) { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "otherPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "otherComBase"); + } + } else { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherBase"); + } + } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人")); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "socialPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542272, "社保个人合计")); //住房公积金个人、补充住房公积金个人 for (ICategoryPO po : fundWelPerList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人")); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "fundPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542273, "公积金个人合计")); //其他个人(比如企业年金个人) for (ICategoryPO po : otherWelPerList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人")); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "otherPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542274, "其他福利个人合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542275, "个人合计")); //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) for (ICategoryPO po : socialWelComList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),1329, "单位")); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "socialCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542276, "社保单位合计")); //住房公积金单位、补充住房公积金单位 for (ICategoryPO po : fundWelComList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),1329, "单位")); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "fundCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542277, "公积金单位合计")); + //其他单位(比如企业年金单位) for (ICategoryPO po : otherWelComList) { - headerList.add(getInsuranceNameI18(po, user) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),1329, "单位")); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "otherCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542278, "其他福利单位合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542279, "单位合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542280, "社保合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542281, "公积金合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542282, "其他福利合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),358, "合计")); - List> rows = new ArrayList<>(); - rows.add(headerList); - String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542458,"福利核算-线下对比导入模板"); - - return ExcelUtil.genWorkbookV2(rows, sheetName); + return result; } public String getInsuranceNameI18(ICategoryPO iCategoryPO, User user) { @@ -2451,6 +2795,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } String billMonth = importParam.getBillMonth(); + +// Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() +// .billMonth(billMonth) +// .paymentOrganization(importParam.getPaymentOrganization()) +// .paymentStatus(PaymentStatusEnum.COMMON.getValue()) +// .build()); + Map welColumnNameCodeMap = new HashMap<>(); //存储待更新的InsuranceAccountDetailPO数据 List addCompareList = new ArrayList<>(); //记录待删除hrsa_excel_bill_detail.id @@ -2473,6 +2824,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (taxAgentPoList.size() == 1) { paymentOrganization = taxAgentPoList.get(0).getId(); + welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() + .billMonth(billMonth) + .paymentOrganization(paymentOrganization.toString()) + .paymentStatus(PaymentStatusEnum.COMMON.getValue()) + .build()); } else { isError = true; Map errorMessageMap = Maps.newHashMap(); @@ -2503,7 +2859,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, dataValue, deparmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -2546,7 +2902,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { idList.addAll(ids); } //拼装待更新数据 - addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map)); + addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map, welColumnNameCodeMap)); } @@ -2585,7 +2941,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { * @param billMonth 对比的账单月份 * @param baseMap excel导入的对比数据 */ - private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap) { + private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap, Map welColumnNameCodeMap) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); ExcelInsuranceDetailPO excelInsuranceDetailPO = new ExcelInsuranceDetailPO(); excelInsuranceDetailPO.setId(IdGenerator.generate()); @@ -2601,6 +2959,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map fundPaymentBaseMap = new HashMap<>(); Map otherPaymentBaseMap = new HashMap<>(); + Map socialPaymentComBaseMap = new HashMap<>(); + Map fundPaymentComBaseMap = new HashMap<>(); + Map otherPaymentComBaseMap = new HashMap<>(); + //筛选出福利核算项 Map toDealMap = baseMap.entrySet().stream() @@ -2614,122 +2976,24 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); for(Map.Entry entry : toDealMap.entrySet()) { - //判断元素是否属于福利类 - String keyName = entry.getKey(); - //获取元素名后缀,方便之后判断“个人”或“单位”或者“基数” - String per = SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人"); - String com = SalaryI18nUtil.getI18nLabel(user.getLanguage(),1329, "单位"); - String base = SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"); - int maxLen = Math.max(per.length(), Math.max(com.length(), base.length())); - int minLen = Math.min(per.length(), Math.min(com.length(), base.length())); - String payScope = ""; - if (keyName.length() >= minLen && keyName.length() <= maxLen) { - String checkStr = keyName.substring(keyName.length() - minLen); - if (checkStr.contains(per)) { - payScope = per; - } - if (checkStr.contains(com)) { - payScope = com; - } - if (checkStr.contains(base)) { - payScope = base; - } - - } else if (keyName.length() > maxLen){ - String checkStr = keyName.substring(keyName.length() - maxLen); - if (checkStr.contains(per)) { - payScope = per; - } - if (checkStr.contains(com)) { - payScope = com; - } - if (checkStr.contains(base)) { - payScope = base; - } - } - - //获取福利类型 - Integer welfareType; - //根据元素名后缀,区分截取内容 - String targetWelfareName = ""; - int targetSubLen = 0; - if (payScope.equals(base)) { - targetSubLen = SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数").length(); - targetWelfareName = entry.getKey().substring(0, keyName.length() - targetSubLen); - } else if (payScope.equals(per)){ - targetSubLen = SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人").length(); - targetWelfareName = entry.getKey().substring(0, keyName.length() - targetSubLen); - } else if (payScope.equals(com)){ - targetSubLen = SalaryI18nUtil.getI18nLabel(user.getLanguage(), 1329, "单位").length(); - targetWelfareName = entry.getKey().substring(0, keyName.length() - targetSubLen); - } +// //判断元素是否属于福利类 +// String keyName = entry.getKey(); +// //获取元素名后缀,方便之后判断“个人”或“单位”或者“基数” +// String payScope = keyName.substring(keyName.length() - 2); +// //获取福利类型 +// Integer welfareType; +// //根据元素名后缀,区分截取内容 +// String targetWelfareName; +// if ("基数".equals(payScope)) { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 4); +// } else { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 2); +// } // List categoryPOList = siCategoryBiz.listByName(targetWelfareName); - //获取福利险种id-map集合 - List iCategoryPOList = getICategoryMapper().listAll(); - Map categoryNameMap = new LinkedHashMap(); - for (ICategoryPO iCategoryPO : iCategoryPOList) { - //获取险种名称(多语言) - String insuranceName = ""; - if(iCategoryPO.getInsuranceName() != null) { -// insuranceName = iCategoryPO.getLabelId() != null -// ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),iCategoryPO.getLabelId(),iCategoryPO.getInsuranceName()) -// : iCategoryPO.getInsuranceName(); - //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name - insuranceName = Util.formatMultiLang(iCategoryPO.getInsuranceName(), String.valueOf(user.getLanguage())); - categoryNameMap.put(insuranceName, iCategoryPO); - } - } - - ICategoryPO targetCategory = categoryNameMap.get(targetWelfareName); - if (targetCategory != null) { - ICategoryPO iCategoryPO = targetCategory; - welfareType = iCategoryPO.getWelfareType(); - - if (payScope.equals(per)) { - switch (welfareType) { - case 1: - socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542456, "福利类型不存在")); - } - } - if (payScope.equals(com)) { - switch (welfareType) { - case 1: - socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542456, "福利类型不存在")); - } - } - if (payScope.equals(base)) { - switch (welfareType) { - case 1: - socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542456, "福利类型不存在")); - } - } +// if (categoryPOList.size() == 1) { +// ICategoryPO iCategoryPO = categoryPOList.get(0); +// welfareType = iCategoryPO.getWelfareType(); +// // switch (payScope) { // case "个人": // switch (welfareType) { @@ -2743,7 +3007,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); // break; // default: -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542456, "福利类型不存在")); +// throw new SalaryRunTimeException("福利类型不存在"); // } // break; // case "单位": @@ -2758,7 +3022,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); // break; // default: -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542456, "福利类型不存在")); +// throw new SalaryRunTimeException("福利类型不存在"); // } // break; // case "基数": @@ -2773,12 +3037,96 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); // break; // default: -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542456, "福利类型不存在")); +// throw new SalaryRunTimeException("福利类型不存在"); // } // break; // } - } +// } + if (welColumnNameCodeMap.get(entry.getKey()) != null) { + String code = welColumnNameCodeMap.get(entry.getKey()); + if (welBaseDiffSign) { + if (code.contains("socialPerBase")) { + code = code.replace("socialPerBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("socialComBase")) { + code = code.replace("socialComBase", ""); + socialPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPerBase")) { + code = code.replace("fundPerBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundComBase")) { + code = code.replace("fundComBase", ""); + fundPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPerBase")) { + code = code.replace("otherPerBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherComBase")) { + code = code.replace("otherComBase", ""); + otherPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + } else { + if (code.contains("socialBase")) { + code = code.replace("socialBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundBase")) { + code = code.replace("fundBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherBase")) { + code = code.replace("otherBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + } + + + if (code.contains("socialPer") && !code.contains("socialPerBase")) { + code = code.replace("socialPer", ""); + socialPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPer") && !code.contains("fundPerBase")) { + code = code.replace("fundPer", ""); + fundPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPer") && !code.contains("otherPerBase")) { + code = code.replace("otherPer", ""); + otherPerMap.put(code, entry.getValue().toString()); + continue; + } + + if (code.contains("socialCom") && !code.contains("socialComBase")) { + code = code.replace("socialCom", ""); + socialComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundCom") && !code.contains("fundComBase")) { + code = code.replace("fundCom", ""); + fundComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherCom") && !code.contains("otherComBase")) { + code = code.replace("otherCom", ""); + otherComMap.put(code, entry.getValue().toString()); + continue; + } + } } //设置社保个人和公司缴纳明细 @@ -2795,6 +3143,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { excelInsuranceDetailPO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBaseMap)); excelInsuranceDetailPO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBaseMap)); + excelInsuranceDetailPO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBaseMap)); + excelInsuranceDetailPO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBaseMap)); + excelInsuranceDetailPO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBaseMap)); + //组装新的insuranceAccountDetailPO对象数据 excelInsuranceDetailPO.setEmployeeId(employeeId); excelInsuranceDetailPO.setBillMonth(billMonth); @@ -3015,7 +3367,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { for (Map.Entry entry : toDealMap.entrySet()) { //获取福利项信息 - ICategoryPO iCategoryPO = siCategoryBiz.getByID(Long.valueOf(entry.getKey())); +// ICategoryPO iCategoryPO = siCategoryBiz.getByID(Long.valueOf(entry.getKey())); + ICategoryPO iCategoryPO = getSICategoryService(user).getICategoryPOByID(Long.valueOf(entry.getKey())); if (iCategoryPO != null) { //获取险种名称(多语言) String insuranceName = ""; @@ -3047,6 +3400,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } encryptUtil.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class, user); + InsuranceAccountDetailPO oldTargetPO = new InsuranceAccountDetailPO(); + BeanUtils.copyProperties(insuranceAccountDetailPO, oldTargetPO); + accountSocialByData(insuranceAccountDetailPO, param); accountFundByData(insuranceAccountDetailPO, param); accountOtherByData(insuranceAccountDetailPO, param); @@ -3057,6 +3413,25 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //刷新_bill_batch表中的统计信息 refreshBillBatch(insuranceAccountDetailPO.getPaymentOrganization(), insuranceAccountDetailPO.getBillMonth()); + //记录操作日志 + PaymentStatusEnum targetEnum = SalaryEnumUtil.enumMatchByValue(insuranceAccountDetailPO.getPaymentStatus(), PaymentStatusEnum.values(), PaymentStatusEnum.class); + encryptUtil.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class); + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(insuranceAccountDetailPO.getBillMonth(), insuranceAccountDetailPO.getPaymentOrganization()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(insuranceAccountDetailPO.getEmployeeId()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-编辑") + + SalaryI18nUtil.getI18nLabel(targetEnum.getLabelId(), targetEnum.getDefaultLabel())); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-编辑" + + SalaryI18nUtil.getI18nLabel(targetEnum.getLabelId(), targetEnum.getDefaultLabel())) + + ":" + taxAgentInfo.getName() + "-" + targetPO.getBillMonth() + "-" + empInfo.getUsername()); + loggerContext.setOldValues(oldTargetPO); + loggerContext.setNewValues(insuranceAccountDetailPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } public void accountFundByData(InsuranceAccountDetailPO insuranceAccountDetailPO, EditAccountDetailParam baseParam) { @@ -3356,7 +3731,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, name, departmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, name, departmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -3462,8 +3837,23 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { encryptUtil.encryptList(updateInsuranceAccountDetailList, InsuranceAccountDetailPO.class, user); //更新 for(InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) { - getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po); +// getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po); + updateByEmployeeIdAndBillMonth(po); } + //记录操作日志 + encryptUtil.decryptList(updateInsuranceAccountDetailList, InsuranceAccountDetailPO.class); + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, paymentOrganization); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-补差导入更新")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-补差导入更新") + + ":" + taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + updateInsuranceAccountDetailList.forEach(loggerContext::setNewValues); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } if (createInsuranceAccountDetailList.size() > 0) { paymentOrganization = createInsuranceAccountDetailList.get(0).getPaymentOrganization(); @@ -3476,6 +3866,20 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //新增 List> createPartition = Lists.partition((List) createInsuranceAccountDetailList, 20); createPartition.forEach(getInsuranceAccountDetailMapper()::batchSaveAccountDetails); + //记录操作日志 + encryptUtil.decryptList(createInsuranceAccountDetailList, InsuranceAccountDetailPO.class); + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, paymentOrganization); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-补差导入新增")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-补差导入新增") + + ":" + taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + createInsuranceAccountDetailList.forEach(loggerContext::setNewValues); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } //刷新bill_batch表中统计信息 @@ -3500,7 +3904,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 正常缴纳列表 queryParam.setPageSize(10000000); - PageInfo pageInfo = getSiAccountBiz(user).listCommonPage(queryParam); +// PageInfo pageInfo = getSiAccountBiz(user).listCommonPage(queryParam); + PageInfo pageInfo = siBatchListCommonPage(queryParam); List insuranceAccountDetailPOS = pageInfo.getList(); // 数据组装 List> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId); @@ -3609,7 +4014,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); //系统人员核算明细 List list = getInsuranceAccountDetailMapper().list(queryParam); //非系统人员核算明细 @@ -4138,4 +4542,1954 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString()); return insuranceAccountDetailPO; } + /*****以下代码为SIAccountBiz中逻辑迁移,旨在减少Biz类的使用*****/ + + /** + * 新建核算并归档 + * @param param + * @return + */ + @Override + public String saveAndFile(AccountParam param) { + ValidUtil.doValidator(param); + if (param.isFlag()) { + InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization()); + insuranceAccountBatchPO = encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + SalaryAssert.isNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel(0, "所属月份存在核算数据")); + + InsuranceAccountBatchPO build = InsuranceAccountBatchPO.builder() + .paymentOrganization(param.getPaymentOrganization()) + .accountant(user.getLastname()) + .billMonth(param.getBillMonth()) + .billStatus(BillStatusEnum.NOT_ARCHIVED.getValue()) + .remarks(param.getRemarks()) + .creator((long) user.getUID()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .createTime(new Date()) + .updateTime(new Date()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .paymentOrganization(param.getPaymentOrganization()) + .socialPay("0") + .fundPay("0") + .otherPay("0") + .build(); + encryptUtil.encrypt(build, InsuranceAccountBatchPO.class); + getInsuranceAccountBatchMapper().insert(build); + //记录操作日志 + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization()); + encryptUtil.decrypt(targetPO, InsuranceAccountBatchPO.class); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增福利台账")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增福利台账") + + ":" + taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + } + try { + List employeeIds = getInsuranceAccountDetailMapper().selectEmpByPaymentOrg(param.getPaymentOrganization()); + if (CollectionUtils.isEmpty(employeeIds)) { + List list = Lists.newArrayList(getInsuranceAccountDetailMapper().queryNormalListByBillMonth(param.getBillMonth(), param.getPaymentOrganization())); + encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); + if (CollectionUtils.isNotEmpty(list)) { + list.stream().forEach(f -> { + getInsuranceAccountDetailMapper().deleteById(f.getId()); + }); + } + } + SalaryAssert.notEmpty(employeeIds, SalaryI18nUtil.getI18nLabel(0, "没有需要核算的人员")); +// AccountParam selectParam = new AccountParam(); +// selectParam.setBillMonth(param.getBillMonth()); +// selectParam.setPaymentOrganization(param.getPaymentOrganization()); + ExecutorService taskExecutor = Executors.newCachedThreadPool(); + taskExecutor.execute(() -> { + siAccounting(param); + if (param.isFileFlag()) { + siFile(param.getBillMonth(), param.getPaymentOrganization()); + } + }); + } catch (Exception e) { + // 回滚 + List list = Lists.newArrayList(getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization())); + list = encryptUtil.decryptList(list, InsuranceAccountBatchPO.class); + if (CollectionUtils.isNotEmpty(list)) { + list.stream().forEach(f -> { + getInsuranceAccountBatchMapper().deleteById(f.getId()); + }); + } + throw new SalaryRunTimeException(e.getMessage()); + } + return String.valueOf(user.getUID()); + } + + + public void siAccounting(AccountParam param) { + //福利核算进度 + ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth()); + if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.isStatus() && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) { + return; + } + + log.info("开始核算,当前操作人为:{}", user.getLastname()); + log.info("核算时间:{}, 核算月份:{}, 个税扣缴义务人:{}, 是否首次核算:{}", new Date(), param.getBillMonth(), param.getPaymentOrganization(), param.isFlag()); + try { + List ids; + List validIds = new ArrayList<>(); + if (CollectionUtils.isEmpty(param.getIds())) { + List empIds = getInsuranceAccountDetailMapper().selectEmpByPaymentOrg(param.getPaymentOrganization()); + // 获取薪资核算人员规则 + SalarySysConfPO salaryAcctEmployeeRule = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ACCT_EMPLOYEE_RULE); + List status = new ArrayList<>(); + if(Objects.isNull(salaryAcctEmployeeRule) || StringUtils.equals(salaryAcctEmployeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue()) ){ + // 包含停缴 + status = Arrays.asList(EmployeeStatusEnum.PAYING.getValue(),EmployeeStatusEnum.STAY_DEL.getValue(), + EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()); + }else{ + status = Arrays.asList(EmployeeStatusEnum.PAYING.getValue(),EmployeeStatusEnum.STAY_DEL.getValue()); + } + List finalStatus = status; + //过滤出需要核算的人员,即福利档案基础信息表中runStatus为正在缴纳和待减员的人员 + List baseInfoPOList = getInsuranceBaseInfoMapper().listAll(); + List canAccountIds = baseInfoPOList.stream() + .filter(f->f.getPaymentOrganization().equals(param.getPaymentOrganization()) + && (finalStatus.contains(f.getRunStatus()) )) + .map(InsuranceArchivesBaseInfoPO::getEmployeeId) + .collect(Collectors.toList()); + + //20231122逻辑优化,过滤出不在起始缴纳月和最后缴纳月区间的人员 + List empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth()); + empIds = empIds.stream().filter(f->canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); + +// List socials = siArchivesBiz.getSocialByEmployeeIds(empIds); + List socials = getSIArchivesService(user).getSocialByEmployeeIds(empIds); + //过滤出目标个税扣缴义务人相关信息 + socials = socials.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList()); + List emp1 = socials.stream() + .filter(s -> !(StringUtils.isBlank(s.getSocialEndTime()) && StringUtils.isBlank(s.getSocialStartTime())) && + (StringUtils.isBlank(s.getSocialEndTime()) || (SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01")))) ) + .map(InsuranceArchivesSocialSchemePO::getEmployeeId) + .collect(Collectors.toList()); + +// List funds = siArchivesBiz.getFundByEmployeeIds(empIds); + List funds = getSIArchivesService(user).getFundByEmployeeIds(empIds); + //过滤出目标个税扣缴义务人相关信息 + funds = funds.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList()); + List emp2 = funds.stream() + .filter(s -> !(StringUtils.isBlank(s.getFundStartTime()) && StringUtils.isBlank(s.getFundEndTime())) && + (StringUtils.isBlank(s.getFundEndTime()) || (SalaryDateUtil.stringToDate(s.getFundEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getFundEndTime() + "-01"))))) + .map(InsuranceArchivesFundSchemePO::getEmployeeId) + .collect(Collectors.toList()); + +// List others = siArchivesBiz.getOtherByEmployeeIds(empIds); + List others = getSIArchivesService(user).getOtherByEmployeeIds(empIds); + //过滤出目标个税扣缴义务人相关信息 + others = others.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList()); + List emp3 = others.stream() + .filter(s -> !(StringUtils.isBlank(s.getOtherStartTime()) && StringUtils.isBlank(s.getOtherEndTime())) && + (StringUtils.isBlank(s.getOtherEndTime()) || (SalaryDateUtil.stringToDate(s.getOtherEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getOtherEndTime() + "-01"))))) + .map(InsuranceArchivesOtherSchemePO::getEmployeeId) + .collect(Collectors.toList()); + validIds.addAll(emp1); + validIds.addAll(emp2); + validIds.addAll(emp3); + + List finalValidIds = validIds.stream().distinct().collect(Collectors.toList()); + ids = empIds.stream().filter(finalValidIds::contains).collect(Collectors.toList()); + } else { + ids = param.getIds(); + } + + // 初始化进度 + ProgressDTO initProgress = new ProgressDTO() + .setTitle(SalaryI18nUtil.getI18nLabel(0, "核算中")) + .setTitleLabelId(97515L) + .setTotalQuantity(ids.size()) + .setCalculatedQuantity(NumberUtils.INTEGER_ZERO) + .setProgress(BigDecimal.ZERO) + .setStatus(true) + .setMessage(StringUtils.EMPTY); + getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), initProgress); + + if (CollectionUtils.isEmpty(ids)) { + getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true); + return; + } + + log.info("开始生成福利核算数据,待处理人员数量:{}", ids.size()); + siCommonAccount(param.getBillMonth(), ids, param.getPaymentOrganization()); + log.info("福利核算数据生成完毕,开始数据处理"); + + handleData(ids, param); + log.info("福利核算数据处理完毕!"); + + List> partition = Lists.partition((List) ids, 100); + partition.forEach(part -> { + getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, param.getBillMonth(), param.getPaymentOrganization()); + }); + log.info("更新福利核算进度······"); + getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true); + log.info("福利核算进度完成!"); + } catch (Exception e) { + log.error("account run fail", e); + getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel(0, "福利核算出错") + ": " + e.getMessage()); + + List list = Lists.newArrayList(getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization())); + if (CollectionUtils.isNotEmpty(list)) { + list.stream().forEach(f -> { + getInsuranceAccountBatchMapper().deleteById(f.getId()); + }); + } + + } + + } + + public void siCommonAccount(String billMonth, List ids, Long paymentOrganization) { + +// Map insuranceArchivesAccountPOS = siArchivesBiz.buildBatchAccount(ids, paymentOrganization); + Map insuranceArchivesAccountPOS = getSIArchivesService(user).buildBatchAccount(ids, paymentOrganization); + List list = new ArrayList<>(); + int count = 0; + for (Map.Entry entry : insuranceArchivesAccountPOS.entrySet()) { + Long k = entry.getKey(); + InsuranceArchivesAccountPO v = entry.getValue(); + InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); + insuranceAccountDetailPO.setBillMonth(billMonth); + insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue()); + insuranceAccountDetailPO.setCreator((long) user.getUID()); + insuranceAccountDetailPO.setCreateTime(new Date()); + insuranceAccountDetailPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + insuranceAccountDetailPO.setEmployeeId(k); + insuranceAccountDetailPO.setUpdateTime(new Date()); + insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.COMMON.getValue()); + insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.SYSTEM.getValue()); + insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + insuranceAccountDetailPO.setPaymentOrganization(paymentOrganization); + + //核算社保 + accountSocial(insuranceAccountDetailPO, v, billMonth); + //核算公积金 + accountFund(insuranceAccountDetailPO, v, billMonth); + //核算其他福利 + accountOther(insuranceAccountDetailPO, v, billMonth); + //计算合计 + account(insuranceAccountDetailPO); + //临时表PO + InsuranceAccountDetailTempPO insuranceAccountDetailTempPO = new InsuranceAccountDetailTempPO(); + BeanUtils.copyProperties(insuranceAccountDetailPO, insuranceAccountDetailTempPO); + list.add(insuranceAccountDetailTempPO); + count++; + + if (count % 50 == 0 || count >= ids.size()) { + if (count >= ids.size()) { + getSalaryAcctProgressService(user).updateProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth, BigDecimal.valueOf(0.99), false); + log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth)); + } else { + getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + billMonth, count >= ids.size() ? count % 50 : 50); + log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth)); + } + + } + + } + //临时表入库前先对(可能存在的)历史数据进行删除 + List> partition = Lists.partition((List) ids, 100); + partition.forEach(part -> { + getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization); + }); + //临时表数据入库 + if (CollectionUtils.isNotEmpty(list)) { + encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class); + List> lists = splitList(list, 40); + lists.forEach(subList -> { + getSIAccountDetailTempMapper().batchSaveAccountTempDetails(subList); + }); + } + + } + + public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); + if (accountPO.getOther() != null) { + InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); + insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); + insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); + insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); + //判断是否在起始缴纳月和最后缴纳月之间 + Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); + if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(otherPO.getOtherSchemeId()); + encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); + //方案中包含的需要缴纳其他的个人福利 + int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; + Map otherPerson = detailPOS.stream() + .filter(item -> Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) + && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesPerson = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + //需要核算其他的福利id 个人 + List needArchivesPerson = new ArrayList<>(); + if (archivesPerson != null) { + archivesPerson.forEach((id, value) -> { + if (otherPerson.containsKey(Long.valueOf(id))) { + needArchivesPerson.add(Long.valueOf(id)); + } + }); + } + //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 + if(otherPerson.size() > 0) { + otherPerson.forEach((id, object) -> { + if (!needArchivesPerson.contains(id)) { + needArchivesPerson.add(id); + } + }); + } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(otherPerson, billMonth, otherPO.getOtherStartTime()); + + List otherPer = new ArrayList<>(); + Map otherPerJsonMap = new HashMap<>(); + needArchivesPerson.stream().forEach(e -> { + InsuranceSchemeDetailPO po = otherPerson.get(e); + BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesPerson) || StringUtils.isBlank(archivesPerson.get(String.valueOf(e)))) ? "0" : archivesPerson.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (po.getPaymentCycle() != null && po.getPaymentCycle() == 1) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + otherPerJsonMap.put(String.valueOf(e), result.toPlainString()); + otherPer.add(result); + }); + insuranceAccountDetailPO.setOtherPerJson(JSON.toJSONString(otherPerJsonMap)); + BigDecimal otherPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : otherPer) { + otherPerSum = otherPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setOtherPerSum(otherPerSum.toPlainString()); + + //方案中包含的需要缴纳公积金的单位福利 + Map otherCom = detailPOS.stream() + .filter( + item -> Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue()) + && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } + //需要核算其他的福利id 单位 + List needArchivesCom = new ArrayList<>(); + if (archivesCom != null) { + archivesCom.forEach((id, value) -> { + if (otherCom.containsKey(Long.valueOf(id))) { + needArchivesCom.add(Long.valueOf(id)); + } + }); + } + //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 + if(otherCom.size() > 0) { + otherCom.forEach((id, object) -> { + if (!needArchivesCom.contains(id)) { + needArchivesCom.add(id); + } + }); + } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(otherCom, billMonth, otherPO.getOtherStartTime()); + + List otherComList = new ArrayList<>(); + Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; + needArchivesCom.stream().forEach(e -> { + InsuranceSchemeDetailPO po = otherCom.get(e); + BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (Objects.equals(po.getPaymentCycle(), 1)) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + otherComJsonMap.put(String.valueOf(e), result.toPlainString()); + otherComList.add(result); + }); + insuranceAccountDetailPO.setOtherComJson(JSON.toJSONString(otherComJsonMap)); + BigDecimal otherComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : otherComList) { + otherComSum = otherComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString()); + } + } + return insuranceAccountDetailPO; + } + + + public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); + if (accountPO.getFund() != null) { + InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); + insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); + insuranceAccountDetailPO.setFundAccount(fundPO.getFundAccount()); + insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); + insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); + insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); + //判断是否在起始缴纳月和最后缴纳月之间 + Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); + if ((NonPaymentEnum.YES.getValue().equals(fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(fundPO.getFundSchemeId()); + encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); + //方案中包含的需要缴纳社保的个人福利 + int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; + Map fundperson = detailPOS.stream() + .filter(item -> Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) + && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesPerson = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + //需要核算公积金的福利id 个人 + List needArchivesPerson = new ArrayList<>(); + if (archivesPerson != null) { + archivesPerson.forEach((id, value) -> { + if (fundperson.containsKey(Long.valueOf(id))) { + needArchivesPerson.add(Long.valueOf(id)); + } + }); + } + //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 + if(fundperson.size() > 0) { + fundperson.forEach((id, object) -> { + if (!needArchivesPerson.contains(id)) { + needArchivesPerson.add(id); + } + }); + } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(fundperson, billMonth, fundPO.getFundStartTime()); + + List fundPer = new ArrayList<>(); + Map fundPerJsonMap = new HashMap<>(); + needArchivesPerson.stream().forEach(e -> { + InsuranceSchemeDetailPO po = fundperson.get(e); + BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesPerson) || StringUtils.isBlank(archivesPerson.get(String.valueOf(e)))) ? "0" : archivesPerson.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (Objects.equals(po.getPaymentCycle(), 1)) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + fundPerJsonMap.put(String.valueOf(e), result.toPlainString()); + fundPer.add(result); + }); + insuranceAccountDetailPO.setFundPerJson(JSON.toJSONString(fundPerJsonMap)); + BigDecimal funPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : fundPer) { + funPerSum = funPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setFundPerSum(funPerSum.toPlainString()); + + //方案中包含的需要缴纳公积金的单位福利 + Map fundCom = detailPOS.stream() + .filter(item -> Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue()) + && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } + //需要核算公积金的福利id 单位 + List needArchivesCom = new ArrayList<>(); + if (archivesCom != null) { + archivesCom.forEach((id, value) -> { + if (fundCom.containsKey(Long.valueOf(id))) { + needArchivesCom.add(Long.valueOf(id)); + } + }); + } + //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 + if(fundCom.size() > 0) { + fundCom.forEach((id, object) -> { + if (!needArchivesCom.contains(id)) { + needArchivesCom.add(id); + } + }); + } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(fundCom, billMonth, fundPO.getFundStartTime()); + + List fundComList = new ArrayList<>(); + Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; + needArchivesCom.stream().forEach(e -> { + InsuranceSchemeDetailPO po = fundCom.get(e); + BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (Objects.equals(po.getPaymentCycle(), 1)) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + fundComJsonMap.put(String.valueOf(e), result.toPlainString()); + fundComList.add(result); + }); + insuranceAccountDetailPO.setFundComJson(JSON.toJSONString(fundComJsonMap)); + BigDecimal fundComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : fundComList) { + fundComSum = fundComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setFundComSum(fundComSum.toPlainString()); + } + } + return insuranceAccountDetailPO; + } + + + public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); + if (accountPO.getSocial() != null) { + InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); + insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); + insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); + insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); + insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); + //判断是否在起始缴纳月和最后缴纳月之间 + Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); + if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId()); + encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); + //方案中包含的需要缴纳社保的个人福利 + int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; + Map schemeperson = detailPOS.stream() + .filter(item -> + Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && + Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) && + (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1"))) + ) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesPerson = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + //需要核算社保的福利id 个人 + List needArchivesPerson = new ArrayList<>(); + if (archivesPerson != null) { + archivesPerson.forEach((id, value) -> { + if (schemeperson.containsKey(Long.valueOf(id))) { + needArchivesPerson.add(Long.valueOf(id)); + } + }); + } + //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 + if(schemeperson.size() > 0) { + schemeperson.forEach((id, object) -> { + if (!needArchivesPerson.contains(id)) { + needArchivesPerson.add(id); + } + }); + } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeperson, billMonth, socialPO.getSocialStartTime()); + + List socialPer = new ArrayList<>(); + Map socialPerJsonMap = new HashMap<>(); + needArchivesPerson.forEach(e -> { + InsuranceSchemeDetailPO po = schemeperson.get(e); + BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesPerson) || StringUtils.isBlank(archivesPerson.get(String.valueOf(e)))) ? "0" : archivesPerson.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (Objects.equals(po.getPaymentCycle(), 1)) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + socialPerJsonMap.put(String.valueOf(e), result.toPlainString()); + socialPer.add(result); + }); + insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerJsonMap)); + BigDecimal socialPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialPer) { + socialPerSum = socialPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString()); + //方案中包含的需要缴纳社保的单位福利 + Map schemeCom = detailPOS.stream() + .filter(item -> Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue()) && + (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } + //需要核算社保的福利id 单位 + List needArchivesCom = new ArrayList<>(); + if (archivesCom != null) { + archivesCom.forEach((id, value) -> { + if (schemeCom.containsKey(Long.valueOf(id))) { + needArchivesCom.add(Long.valueOf(id)); + } + }); + } + //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 + if(schemeCom.size() > 0) { + schemeCom.forEach((id, object) -> { + if (!needArchivesCom.contains(id)) { + needArchivesCom.add(id); + } + }); + } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeCom, billMonth, socialPO.getSocialStartTime()); + + List socialCom = new ArrayList<>(); + Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; + needArchivesCom.stream().forEach(e -> { + InsuranceSchemeDetailPO po = schemeCom.get(e); + BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (Objects.equals(po.getPaymentCycle(), 1)) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + sociaComJsonMap.put(String.valueOf(e), result.toPlainString()); + socialCom.add(result); + + }); + insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(sociaComJsonMap)); + BigDecimal socialComSum = new BigDecimal("0"); + for (BigDecimal decimal : socialCom) { + socialComSum = socialComSum.add(decimal); + } + insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString()); + } + + } + return insuranceAccountDetailPO; + } + + /** + * 对于核算月和福利起始缴纳月处于同年时,要避免根据周期缴纳福利费用时,可能出现的多余费用缴纳情况 + * @param schemeDetail 福利方案明细 + * @param billMonth 核算月 + * @param startMonth 福利起始缴纳月 + * @return + */ + public Map checkCycleSettingWithStartMonth(Map schemeDetail, String billMonth, String startMonth) { + String billYear = billMonth.substring(0,4); + if (StringUtils.isNotBlank(startMonth) && billYear.equals(startMonth.substring(0,4))) { + int startMonthIndex = Integer.parseInt(startMonth.split("-")[1]) - 1; + schemeDetail.forEach((k, v) -> { + if (v.getPaymentCycle() != null && v.getPaymentCycle().equals(1) && startMonthIndex != 0) { + StringBuilder newCycleSetting = new StringBuilder(v.getCycleSetting()); + newCycleSetting.setCharAt(startMonthIndex - 1, '1'); + v.setCycleSetting(newCycleSetting.toString()); + } + }); + + } + return schemeDetail; + } + + private List> splitList(List list, int groupSize) { + int length = list.size(); + // 计算可以分成多少组 + int num = (length + groupSize - 1) / groupSize; + List> newList = new ArrayList<>(num); + for (int i = 0; i < num; i++) { + // 开始位置 + int fromIndex = i * groupSize; + // 结束位置 + int toIndex = (i + 1) * groupSize < length ? (i + 1) * groupSize : length; + newList.add(list.subList(fromIndex, toIndex)); + } + return newList; + } + + /** + * 根据个税扣缴义务人和账单月,获取三类福利档案中符合缴纳开始结束月区间的人员id + * @param paymentOrganization + * @param billMonth + * @return + */ + public List listCanPayEmpIds(Long paymentOrganization, String billMonth) { + List listCanPayEmpIds = new ArrayList<>(); + //社保档案中可进行缴纳的人员 + List socialCanPayEmpIds = getSocialSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth); + //公积金档案中可进行缴纳的人员 + List fundCanPayEmpIds = getFundSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth); + //其他福利档案中可进行缴纳的人员 + List otherCanPayEmpIds = getOtherSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth); + if (socialCanPayEmpIds != null && socialCanPayEmpIds.size() > 0) { + listCanPayEmpIds.addAll(socialCanPayEmpIds); + } + if (fundCanPayEmpIds != null && fundCanPayEmpIds.size() > 0) { + listCanPayEmpIds.addAll(fundCanPayEmpIds); + } + if (otherCanPayEmpIds != null && otherCanPayEmpIds.size() > 0) { + listCanPayEmpIds.addAll(otherCanPayEmpIds); + } + //去重 + listCanPayEmpIds = listCanPayEmpIds.stream().distinct().collect(Collectors.toList()); + return listCanPayEmpIds; + } + + private void handleData(List ids, AccountParam param) { + String billMonth = param.getBillMonth(); + try { + List list = new ArrayList<>(); + List> partitionDetailTempInfo = Lists.partition((List) ids, 100); + partitionDetailTempInfo.forEach(part -> list.addAll( + getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(part, billMonth, param.getPaymentOrganization()))); + + encryptUtil.decryptList(list, InsuranceAccountDetailTempPO.class); + Integer paymentStatus = 0; + log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量:{}", list.size()); + List> partitionIds = Lists.partition((List) ids, 100); + log.info("bill_detail入库前删除数据数量:{}", ids.size()); + for (List part : partitionIds) { + getInsuranceAccountDetailMapper().batchDelAccountDetails(part, billMonth, param.getPaymentOrganization(), paymentStatus); + + //删除账单月份+个税扣缴义务人+人员id下的调差数据 + getInsuranceCompensationMapper().deleteByBillMonthPayOrgEmpIds(InsuranceCompensationPO.builder() + .billMonth(billMonth) + .paymentOrganization(param.getPaymentOrganization()) + .employeeIds(part) + .build()); + } + + //生成bill_detail入库数据 + List collect = list.stream().map(item -> { + InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); + BeanUtils.copyProperties(item, insuranceAccountDetailPO); + return insuranceAccountDetailPO; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect)) { + log.info("bill_detail入库数据数量:{}", collect.size()); + batchSaveAccountInspectDetail(collect); + encryptUtil.encryptList(collect, InsuranceAccountDetailPO.class); + List> lists = splitDetailList(collect, 20); + lists.forEach(subList -> { + getInsuranceAccountDetailMapper().batchSaveAccountDetails(subList); + }); + updateBatchAccount(param); + } + } catch (Exception e) { + log.error("福利核算数据处理失败", e); + getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel(0, "福利核算出错") + ": " + e.getMessage()); + throw e; + } + } + + public void batchSaveAccountInspectDetail(List list) { + List insuranceAccountInspectAllPOS = accountInspect(list, true); + batchDelInspectDetail(insuranceAccountInspectAllPOS); + List insuranceAccountInspectPOS = accountInspect(list, false); + if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) { + batchSaveInspectDetail(insuranceAccountInspectPOS); + } + } + public void batchDelInspectDetail(List list) { + List> lists = Lists.partition(list, 100); + lists.forEach(getInsuranceAccountInspectMapper()::batchDelInspectDetails); + + } + + public void batchSaveInspectDetail(List list) { + List> lists = Lists.partition(list, 100); + lists.forEach(getInsuranceAccountInspectMapper()::batchSaveInspectDetails); + } + + public List accountInspect(List list, boolean isAll) { + List insuranceAccountInspectPOS = new ArrayList<>(); + for (InsuranceAccountDetailPO e : list) { + if (isAll || detailCheck(e.getSocialPerJson()) || detailCheck(e.getSocialComJson()) + || detailCheck(e.getFundPerJson()) || detailCheck(e.getFundComJson()) + || detailCheck(e.getOtherPerJson()) || detailCheck(e.getOtherComJson())) { + InsuranceAccountInspectPO insuranceAccountInspectPO = InsuranceAccountInspectPO.builder().build(); + insuranceAccountInspectPO.setSupplementaryProjects(e.getSupplementaryProjects()); + insuranceAccountInspectPO.setInspectStatus(InspectStatusEnum.IGNORE.getValue()); + insuranceAccountInspectPO.setBillMonth(e.getBillMonth()); + insuranceAccountInspectPO.setCreator(e.getCreator()); + insuranceAccountInspectPO.setCreateTime(new Date()); + insuranceAccountInspectPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + insuranceAccountInspectPO.setEmployeeId(e.getEmployeeId()); + insuranceAccountInspectPO.setPaymentStatus(e.getPaymentStatus()); + insuranceAccountInspectPO.setSupplementaryMonth(e.getSupplementaryMonth()); + insuranceAccountInspectPO.setTenantKey(e.getTenantKey()); + insuranceAccountInspectPO.setUpdateTime(new Date()); + insuranceAccountInspectPOS.add(insuranceAccountInspectPO); + } + } + return insuranceAccountInspectPOS; + } + + public boolean detailCheck(String baseString) { + if (StringUtils.isEmpty(baseString)) { + return false; + } + Map baseStringMap = JSON.parseObject(baseString, new TypeReference>() { + }); + if (baseStringMap == null || baseStringMap.size() == 0) { + return false; + } + return baseStringMap.values().stream().anyMatch(item -> StringUtils.isEmpty(item) || Pattern.matches("^([0].?[0]*)$", item)); + + } + + private List> splitDetailList(List list, int groupSize) { + int length = list.size(); + // 计算可以分成多少组 + int num = (length + groupSize - 1) / groupSize; + List> newList = new ArrayList<>(num); + for (int i = 0; i < num; i++) { + // 开始位置 + int fromIndex = i * groupSize; + // 结束位置 + int toIndex = (i + 1) * groupSize < length ? (i + 1) * groupSize : length; + newList.add(list.subList(fromIndex, toIndex)); + } + return newList; + } + + /** + * 更新台账接口 + */ + public void updateBatchAccount(AccountParam param) { + String billMonth = param.getBillMonth(); + + List insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(billMonth, param.getPaymentOrganization()); + Map> map = insuranceAccountDetailPOS.stream().filter(item -> item.getEmployeeId() != null) + .collect(Collectors.groupingBy(InsuranceAccountDetailPO::getEmployeeId)); + int socialAccountPerson = 0; + int funcAccountPerson = 0; + int otherAccountPerson = 0; + BigDecimal socialSum = new BigDecimal("0"); + BigDecimal fundSum = new BigDecimal("0"); + BigDecimal otherSum = new BigDecimal("0"); + for (Map.Entry> entry : map.entrySet()) { + List v = entry.getValue(); + BigDecimal socialTemp = new BigDecimal("0"); + BigDecimal fundTemp = new BigDecimal("0"); + BigDecimal otherTemp = new BigDecimal("0"); + encryptUtil.decryptList(v, InsuranceAccountDetailPO.class); + boolean socialPersonFlag = false; + boolean fundPersonFlag = false; + boolean otherPersonFlag = false; + for (InsuranceAccountDetailPO item : v) { + // 判断社保是否为0 + socialPersonFlag = (StringUtils.isBlank(item.getSocialSum()) || SalaryEntityUtil.StringEqZERO(item.getSocialSum())); + BigDecimal socialPerson = socialPersonFlag ? new BigDecimal("0") : new BigDecimal(item.getSocialSum()); + fundPersonFlag = (StringUtils.isBlank(item.getFundSum()) || SalaryEntityUtil.StringEqZERO(item.getFundSum())); + BigDecimal fundPerson = fundPersonFlag ? new BigDecimal("0") : new BigDecimal(item.getFundSum()); + otherPersonFlag = (StringUtils.isBlank(item.getOtherSum()) || SalaryEntityUtil.StringEqZERO(item.getOtherSum())); + BigDecimal otherPerson = otherPersonFlag ? new BigDecimal("0") : new BigDecimal(item.getOtherSum()); + socialTemp = socialTemp.add(socialPerson); + fundTemp = fundTemp.add(fundPerson); + otherTemp = otherTemp.add(otherPerson); + if (!socialPersonFlag && !item.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue())) { + socialAccountPerson += 1; + } + if (!fundPersonFlag && !item.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue())) { + funcAccountPerson += 1; + } + if (!otherPersonFlag && !item.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue())) { + otherAccountPerson += 1; + } + } + + if (!"0".equals(socialTemp.toPlainString())) { + socialSum = socialSum.add(socialTemp); + } + if (!"0".equals(fundTemp.toPlainString())) { + fundSum = fundSum.add(fundTemp); + } + if (!"0".equals(otherTemp.toPlainString())) { + otherSum = otherSum.add(otherTemp); + } + } + InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, param.getPaymentOrganization()); + encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + + insuranceAccountBatchPO.setAccountant(user.getLastname()); + insuranceAccountBatchPO.setUpdateTime(new Date()); + insuranceAccountBatchPO.setSocialPay(socialSum.toPlainString()); + insuranceAccountBatchPO.setSocialNum(socialAccountPerson); + insuranceAccountBatchPO.setFundNum(funcAccountPerson); + insuranceAccountBatchPO.setFundPay(fundSum.toPlainString()); + insuranceAccountBatchPO.setOtherNum(otherAccountPerson); + insuranceAccountBatchPO.setOtherPay(otherSum.toPlainString()); + encryptUtil.encrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + getInsuranceAccountBatchMapper().updateById(insuranceAccountBatchPO); + //记录操作日志 + encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(insuranceAccountBatchPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(insuranceAccountBatchPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + insuranceAccountBatchPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更新福利台账")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更新福利台账") + + ":" + taxAgentInfo.getName() + "-" + insuranceAccountBatchPO.getBillMonth()); + loggerContext.setNewValues(insuranceAccountBatchPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + } + + public void siFile(String billMonth, Long paymentOrganization) { + + //开始归档数据 + InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillStatus(billMonth, BillStatusEnum.NOT_ARCHIVED.getValue(), paymentOrganization); + encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + SalaryAssert.notNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel(0, "月份账单不存在")); + SalaryAssert.isFalse(Objects.equals(insuranceAccountBatchPO.getBillStatus(), BillStatusEnum.ARCHIVED.getValue()), SalaryI18nUtil.getI18nLabel(0, "月份账单已归档")); + insuranceAccountBatchPO.setBillStatus(BillStatusEnum.ARCHIVED.getValue()); + encryptUtil.encrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + getInsuranceAccountBatchMapper().updateById(insuranceAccountBatchPO); + //记录操作日志 + encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(insuranceAccountBatchPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + insuranceAccountBatchPO.getId()); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + insuranceAccountBatchPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账-归档")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账-归档") + + ": " + taxAgentInfo.getName() + "-" + insuranceAccountBatchPO.getBillMonth()); + loggerContext.setNewValues(insuranceAccountBatchPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + } + + + public PageInfo siBatchListPage(InsuranceAccountBatchParam queryParam) { + List list = getInsuranceAccountBatchMapper().list(queryParam); + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + list, InsuranceAccountBatchPO.class); + encryptUtil.decryptList(page.getList(), InsuranceAccountBatchPO.class); + return page; + } + + public PageInfo siBatchListCommonPage(InsuranceAccountDetailParam queryParam) { + queryParam.setPaymentStatus(PaymentStatusEnum.COMMON.getValue()); + //排序配置 + OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); + queryParam.setOrderRule(orderRule); + //系统人员福利台账明细 + List list = getInsuranceAccountDetailMapper().list(queryParam); + //非系统各人员台账明细 + List extList = getInsuranceAccountDetailMapper().extList(queryParam); + list.addAll(extList); + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + list, InsuranceAccountDetailPO.class); + encryptUtil.decryptList(pageInfo.getList(), InsuranceAccountDetailPO.class); + return pageInfo; + } + + public void siDelete(AccountParam param) { + InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization()); + encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); + SalaryAssert.notNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel(0, "参数错误")); +// 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("个税扣缴义务人为空"); +// } + getInsuranceAccountBatchMapper().deleteById(insuranceAccountBatchPO.getId()); + getInsuranceAccountDetailMapper().batchDeleteNotFile(param.getBillMonth(), param.getPaymentOrganization()); + //删除账单月份+个税扣缴义务人下的调差数据 + getInsuranceCompensationMapper().deleteByBillMonthAndPayOrg(param.getBillMonth(), param.getPaymentOrganization()); + //记录操作日志 + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(insuranceAccountBatchPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(insuranceAccountBatchPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + insuranceAccountBatchPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除福利台账")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除福利台账") + + ":" + taxAgentInfo.getName() + "-" + insuranceAccountBatchPO.getBillMonth()); + loggerContext.setNewValues(insuranceAccountBatchPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + } + + public void siSaveSupplementaryAccount(SaveSupplementaryAccountParam param) { + if (StringUtils.isBlank(param.getBillMonth()) || CollectionUtils.isEmpty(param.getBillMonthList()) || CollectionUtils.isEmpty(param.getProjects()) + || CollectionUtils.isEmpty(param.getIncludes())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "参数错误")); + } + //需要补缴的月份 + if (param.getBillMonthList().contains(param.getBillMonth())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "当前月走正常缴纳")); + } + //需要补缴的员工id + List employeeIds = param.getIncludes(); + if (CollectionUtils.isNotEmpty(param.getExcludes())) { + employeeIds = employeeIds.stream().filter(item -> !param.getExcludes().contains(item)).collect(Collectors.toList()); + } + //校验补缴人员是否存在福利档案基础信息,并且runStatus处于正在缴纳或者待减员 + List insuranceBaseInfoList = getInsuranceBaseInfoMapper().getSocialByPaymentOrganization(param.getPaymentOrganization()); + List finalEmployeeIds = employeeIds; + List filterList = insuranceBaseInfoList.stream().filter(e -> { + for (Long uId : finalEmployeeIds) { + if (e.getEmployeeId().equals(uId) && (e.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()) || e.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()))) { + return true; + } + } + return false; + }).collect(Collectors.toList()); + if (filterList.size() != employeeIds.size()) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补缴人员中存在未设置福利档案人员或相关人员不在福利在缴人员中,不可新建补缴信息!")); + } + //20231122逻辑优化,过滤出不在起始缴纳月和最后缴纳月区间的人员 + List empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth()); + employeeIds = employeeIds.stream().filter(f -> empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); + + SalaryAssert.notEmpty(employeeIds, SalaryI18nUtil.getI18nLabel(0, "无核算人员")); + List baseList = new ArrayList<>(); + employeeIds.stream().forEach(id -> { + param.getBillMonthList().stream().forEach(month -> { + SupplementAccountBaseParam supplementAccountBaseParam = SupplementAccountBaseParam.builder() + .supplementaryMonth(month) + .employeeId(id) + .paymentOrganization(param.getPaymentOrganization()) + .projects(param.getProjects()) + .billMonth(param.getBillMonth()) + .supplementType(param.getSupplementType()) + .build(); + if ("2".equals(param.getSupplementType())) { + supplementAccountBaseParam.setSocialPaymentBaseString(param.getSocialPaymentBaseString()); + supplementAccountBaseParam.setFundPaymentBaseString(param.getFundPaymentBaseString()); + supplementAccountBaseParam.setOtherPaymentBaseString(param.getOtherPaymentBaseString()); + } else if("3".equals(param.getSupplementType())) { + supplementAccountBaseParam.setSocialPaymentPerString(param.getSocialPaymentPerString()); + supplementAccountBaseParam.setSocialPaymentComString(param.getSocialPaymentComString()); + supplementAccountBaseParam.setFundPaymentPerString(param.getFundPaymentPerString()); + supplementAccountBaseParam.setFundPaymentComString(param.getFundPaymentComString()); + supplementAccountBaseParam.setOtherPaymentPerString(param.getOtherPaymentPerString()); + supplementAccountBaseParam.setOtherPaymentComString(param.getOtherPaymentComString()); + } + baseList.add(supplementAccountBaseParam); + }); + }); + //核算开始 + accountSupplement(baseList, employeeIds, param.getPaymentOrganization()); + + updateBatchAccount(AccountParam.builder().billMonth(param.getBillMonth()).paymentOrganization(param.getPaymentOrganization()).build()); + } + + /** + * @param baseList 员工id-账单月份-补缴月份(单挑)-补缴项 集合 + * @param employeeIds 需要补缴的员工id + * @return + */ + public String accountSupplement(List baseList, List employeeIds, Long paymentOrganization) { + //(k,v) k-员工id v-员工对应的福利档案数据 +// Map longInsuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization); + Map longInsuranceArchivesAccountPOMap = getSIArchivesService(user).buildBatchAccount(employeeIds, paymentOrganization); + //核算结果集 + List pos = new ArrayList<>(); + baseList.forEach(baseParam -> { + //判断人员id+账单月份+补缴月份在表中的唯一性 + List supplementList = getInsuranceAccountDetailMapper().querySupplementList(baseParam.getBillMonth(), baseParam.getPaymentOrganization(), baseParam.getEmployeeId(), baseParam.getSupplementaryMonth()); + if (supplementList.size() > 0) { + throw new SalaryRunTimeException("当前人员和账单月份已存在该补缴月份的数据!无法再次创建!"); + } + InsuranceAccountDetailPO insuranceAccountDetailPO = accountSingleEmployeeBill(baseParam, longInsuranceArchivesAccountPOMap.get(baseParam.getEmployeeId())); + pos.add(insuranceAccountDetailPO); + }); + batchSaveSupplementAccount(pos); + return SalaryI18nUtil.getI18nLabel(0, "核算完成,数据保存成功"); + } + + public InsuranceAccountDetailPO accountSingleEmployeeBill(SupplementAccountBaseParam baseParam, InsuranceArchivesAccountPO accountPO) { + InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); + List projects = baseParam.getProjects(); + insuranceAccountDetailPO.setBillMonth(baseParam.getBillMonth()); + insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue()); + insuranceAccountDetailPO.setCreator((long) user.getUID()); + insuranceAccountDetailPO.setCreateTime(new Date()); + insuranceAccountDetailPO.setUpdateTime(new Date()); + insuranceAccountDetailPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + insuranceAccountDetailPO.setId(IdGenerator.generate()); + insuranceAccountDetailPO.setEmployeeId(baseParam.getEmployeeId()); + insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.REPAIR.getValue()); + insuranceAccountDetailPO.setSupplementaryMonth(baseParam.getSupplementaryMonth()); + insuranceAccountDetailPO.setPaymentOrganization(baseParam.getPaymentOrganization()); + insuranceAccountDetailPO.setSupplementaryProjects( + String.join(",", + baseParam.getProjects() == null ? new ArrayList<>() : baseParam.getProjects().stream().map(String::valueOf).collect(Collectors.toList()))); + insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.SYSTEM.getValue()); + //缴纳组织=个税扣缴义务人 + insuranceAccountDetailPO.setSocialPayOrg(baseParam.getPaymentOrganization()); + if (projects.contains(ProjectTypeEnum.ALL.getValue())) { + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getSocial() != null) { + accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString()); + } + if (accountPO.getFund() != null) { + accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString()); + } + if (accountPO.getOther() != null) { + accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString()); + } + accountSocial(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + accountOther(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } else if ("3".equals(baseParam.getSupplementType())) { + accountSupSocialByData(insuranceAccountDetailPO, baseParam); + accountSupFundByData(insuranceAccountDetailPO, baseParam); + accountSupOtherByData(insuranceAccountDetailPO, baseParam); + } else { + accountSocial(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + accountOther(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } + + return account(insuranceAccountDetailPO); + } + if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getSocial() != null) { + accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString()); + } + accountSocial(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } else if ("3".equals(baseParam.getSupplementType())) { + accountSupSocialByData(insuranceAccountDetailPO, baseParam); + } else { + accountSocial(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } + + } + if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { + List ids = new ArrayList<>(); + List list = getICategoryMapper().listByDataType(DataTypeEnum.SYSTEM.getValue()); + + if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) { + ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(0, "养老保险").equals(item.getInsuranceName())).findFirst() + .get(); + ids.add(insuranceCategoryPO.getId()); + } + if (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue())) { + ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(0, "医疗保险").equals(item.getInsuranceName())).findFirst() + .get(); + ids.add(insuranceCategoryPO.getId()); + } + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getSocial() != null) { + accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString()); + } + accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids, baseParam.getSupplementaryMonth()); + } else if ("3".equals(baseParam.getSupplementType())) { + accountSupEndowmentInsuranceByData(insuranceAccountDetailPO, baseParam, ids); + } else { + accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids, baseParam.getSupplementaryMonth()); + } + + } + if (projects.contains(ProjectTypeEnum.FUND.getValue())) { + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getFund() != null) { + accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString()); + } + accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } else if ("3".equals(baseParam.getSupplementType())) { + accountSupFundByData(insuranceAccountDetailPO, baseParam); + } else { + accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } + } + if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { + + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getOther() != null) { + accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString()); + } + accountOther(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } else if ("3".equals(baseParam.getSupplementType())) { + accountSupOtherByData(insuranceAccountDetailPO, baseParam); + } else { + accountOther(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); + } + + } + + return account(insuranceAccountDetailPO); + } + + public void accountSupFundByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) { + //公积金个人 + if (StringUtils.isNotBlank(baseParam.getFundPaymentPerString())) { + List fundPer = new ArrayList<>(); + HashMap fundPerson = JSON.parseObject(baseParam.getFundPaymentPerString(), new HashMap().getClass()); + fundPerson.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + fundPer.add(result); + }); + insuranceAccountDetailPO.setFundPerJson(baseParam.getFundPaymentPerString()); + BigDecimal fundPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : fundPer) { + fundPerSum = fundPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setFundPerSum(fundPerSum.toPlainString()); + } + //公积金单位 + if (StringUtils.isNotBlank(baseParam.getFundPaymentComString())) { + List fundCom = new ArrayList<>(); + HashMap fundComMap = JSON.parseObject(baseParam.getFundPaymentComString(), new HashMap().getClass()); + fundComMap.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + fundCom.add(result); + }); + insuranceAccountDetailPO.setFundComJson(baseParam.getFundPaymentComString()); + BigDecimal fundComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : fundCom) { + fundComSum = fundComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setFundComSum(fundComSum.toPlainString()); + } + } + + public void accountSupOtherByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) { + //其他福利个人 + if (StringUtils.isNotBlank(baseParam.getOtherPaymentPerString())) { + List otherPer = new ArrayList<>(); + HashMap otherPerMap = JSON.parseObject(baseParam.getOtherPaymentPerString(), new HashMap().getClass()); + otherPerMap.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + otherPer.add(result); + }); + insuranceAccountDetailPO.setOtherPerJson(baseParam.getOtherPaymentPerString()); + BigDecimal otherPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : otherPer) { + otherPerSum = otherPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setOtherPerSum(otherPerSum.toPlainString()); + } + //其他福利单位 + if (StringUtils.isNotBlank(baseParam.getOtherPaymentComString())) { + List otherCom = new ArrayList<>(); + HashMap otherComMap = JSON.parseObject(baseParam.getOtherPaymentComString(), new HashMap().getClass()); + otherComMap.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + otherCom.add(result); + }); + insuranceAccountDetailPO.setOtherComJson(baseParam.getOtherPaymentComString()); + BigDecimal otherComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : otherCom) { + otherComSum = otherComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString()); + } + } + + public void accountSupSocialByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) { + //社保个人 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) { + List socialPer = new ArrayList<>(); + HashMap archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap().getClass()); + archivesPerson.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + socialPer.add(result); + }); + insuranceAccountDetailPO.setSocialPerJson(baseParam.getSocialPaymentPerString()); + BigDecimal socialPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialPer) { + socialPerSum = socialPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString()); + } + //社保单位 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) { + List socialCom = new ArrayList<>(); + HashMap archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap().getClass()); + archivesCom.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + socialCom.add(result); + }); + insuranceAccountDetailPO.setSocialComJson(baseParam.getSocialPaymentComString()); + BigDecimal socialComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialCom) { + socialComSum = socialComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString()); + } + } + + public InsuranceAccountDetailPO accountEndowmentInsurance(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, List categoryIds, String billMonth) { + if (accountPO.getSocial() != null) { + InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); + insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); + insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); + insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); + insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); + //判断是否在起始缴纳月和最后缴纳月之间 + Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); + + if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId()); + encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); + //方案中包含的需要缴纳社保的个人福利 + int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; + Map schemeperson = detailPOS.stream() + .filter(item -> Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) + && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) + && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesPerson = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + //需要核算社保的福利id 个人 + List needArchivesPerson = new ArrayList<>(); + if (archivesPerson != null) { + categoryIds.forEach(item -> { + if (archivesPerson.containsKey(String.valueOf(item)) && schemeperson.containsKey(item)) { + if (StringUtils.isNotBlank(archivesPerson.get(String.valueOf(item)))) { + needArchivesPerson.add(item); + } + } + }); + } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeperson, billMonth, socialPO.getSocialStartTime()); + + List socialPer = new ArrayList<>(); + Map socialPerJsonMap = new HashMap<>(); + needArchivesPerson.forEach(e -> { + InsuranceSchemeDetailPO po = schemeperson.get(e); + BigDecimal paymentProportion = new BigDecimal(po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesPerson) || StringUtils.isBlank(archivesPerson.get(String.valueOf(e)))) ? "0" : archivesPerson.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (Objects.equals(po.getPaymentCycle(), 1)) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + socialPerJsonMap.put(String.valueOf(e), result.toPlainString()); + socialPer.add(result); + }); + insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerJsonMap)); + BigDecimal socialPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialPer) { + socialPerSum = socialPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString()); + //方案中包含的需要缴纳社保的单位福利 + Map schemeCom = detailPOS.stream() + .filter(item -> Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue()) && + (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + .collect( + Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); + //档案中包含的基数信息 + HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + //需要核算社保的福利id 单位 + List needArchivesCom = new ArrayList<>(); + if (archivesCom != null) { + categoryIds.forEach(item -> { + if (archivesCom.containsKey(String.valueOf(item)) && schemeCom.containsKey(item)) { + if (StringUtils.isNotBlank(archivesCom.get(String.valueOf(item)))) { + needArchivesCom.add(item); + } + } + }); + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeCom, billMonth, socialPO.getSocialStartTime()); + } + List socialCom = new ArrayList<>(); + Map sociaComJsonMap = new HashMap<>(); + needArchivesCom.forEach(e -> { + InsuranceSchemeDetailPO po = schemeCom.get(e); + BigDecimal paymentProportion = new BigDecimal(po.getPaymentProportion()).divide(new BigDecimal("100")); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); + Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); + BigDecimal result = new BigDecimal("0"); + if (Objects.equals(po.getPaymentCycle(), 1)) { + int monthValue = 1; + for (int i = monthIndex - 1; i >= 0; i--) { + String cycleValue = po.getCycleSetting().charAt(i) + ""; + if (Integer.parseInt(cycleValue) == 1) { + break; + } + monthValue++; + } + if (po.getAccountType() == 1) { + paymentNum = paymentNum.multiply(new BigDecimal(monthValue)); + fixedCost = fixedCost.multiply(new BigDecimal(monthValue)); + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } else { + for (int i = 0; i < monthValue; i++) { + result = result.add(SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost))); + } + } + } else { + result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); + } + + sociaComJsonMap.put(String.valueOf(e), result.toPlainString()); + socialCom.add(result); + + }); + insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(sociaComJsonMap)); + BigDecimal socialComSum = new BigDecimal("0"); + for (BigDecimal decimal : socialCom) { + socialComSum = socialComSum.add(decimal); + } + insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString()); + } + } + return insuranceAccountDetailPO; + } + + public void accountSupEndowmentInsuranceByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam, List ids) { + //社保个人 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) { + List socialPer = new ArrayList<>(); + HashMap archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap().getClass()); + HashMap socialPerson = new HashMap<>(); + archivesPerson.forEach((k, v) -> { + if (ids.contains(Long.valueOf(k))) { + socialPerson.put(k, v); + BigDecimal result = new BigDecimal(v); + socialPer.add(result); + } + + }); + insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerson)); + BigDecimal socialPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialPer) { + socialPerSum = socialPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString()); + } + //社保单位 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) { + List socialCom = new ArrayList<>(); + HashMap archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap().getClass()); + HashMap socialComMap = new HashMap<>(); + archivesCom.forEach((k, v) -> { + if (ids.contains(Long.valueOf(k))) { + socialComMap.put(k, v); + BigDecimal result = new BigDecimal(v); + socialCom.add(result); + } + }); + insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap)); + BigDecimal socialComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialCom) { + socialComSum = socialComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString()); + } + } + + public void batchSaveSupplementAccount(List pos) { + if (CollectionUtils.isEmpty(pos)) { + return; + } + batchSaveAccountInspectDetail(pos); + getInsuranceAccountDetailMapper().batchDelSupplementAccountDetails(pos); + encryptUtil.encryptList(pos, InsuranceAccountDetailPO.class); + List> lists = splitDetailList(pos, 20); + lists.forEach(subList -> { + getInsuranceAccountDetailMapper().batchSaveAccountDetails(subList); + }); + //删除日志 +// pos.stream().forEach(item -> { +// LoggerContext insuranceSchemeContext = new LoggerContext(); +// insuranceSchemeContext.setTargetId(String.valueOf(item.getId())); +// insuranceSchemeContext.setTargetName(String.valueOf(item.getEmployeeId())); +// insuranceSchemeContext.setOperateType(OperateTypeEnum.DELETE.getValue()); +// insuranceSchemeContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(100448, "删除核算记录")); +// insuranceSchemeContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(100448, "删除核算记录")); +// insuranceSchemeContext.setNewValues(item); +// siAccountLoggerTemplate.write(insuranceSchemeContext); +// }); + //插入日志 +// pos.stream().forEach(item -> { +// LoggerContext insuranceSchemeContext = new LoggerContext(); +// insuranceSchemeContext.setTargetId(String.valueOf(item.getId())); +// insuranceSchemeContext.setTargetName(String.valueOf(item.getEmployeeId())); +// insuranceSchemeContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// insuranceSchemeContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(100494, "新建核算记录")); +// insuranceSchemeContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(100494, "新建核算记录")); +// insuranceSchemeContext.setNewValues(item); +// siAccountLoggerTemplate.write(insuranceSchemeContext); +// }); + //记录操作日志 + encryptUtil.decryptList(pos, InsuranceAccountDetailPO.class); + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(pos.get(0).getBillMonth(), pos.get(0).getPaymentOrganization()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + pos.forEach(targetDetailPO -> { + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(targetDetailPO.getEmployeeId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + targetPO.getId()); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增补缴")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增补缴") + + ": " + taxAgentInfo.getName() + "-" + targetPO.getBillMonth() + "-" + empInfo.getUsername()); + loggerContext.setNewValues(targetDetailPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + }); + } + + public void siDeleteCommonAccount(SaveCommonAccountParam param) { + ValidUtil.doValidator(param); + //根据id批量删除 + if (param.getIds().size() > 0) { + getInsuranceAccountDetailMapper().batchDelAccountDetailsByIds(param.getIds()); + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "请勾选需要删除的数据项!")); + } + //记录操作日志 + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getIds().stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setTargetName(param.getIds().stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除正常缴纳核算记录")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除正常缴纳核算记录")); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + + updateBatchAccount(AccountParam.builder().billMonth(param.getBillMonth()).paymentOrganization(param.getPaymentOrganization()).build()); + } + + public void siDeleteSupplementaryAccount(SaveCommonAccountParam param) { + ValidUtil.doValidator(param); + //根据id批量删除 + if (param.getIds().size() > 0) { + getInsuranceAccountDetailMapper().batchDelAccountDetailsByIds(param.getIds()); + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "请勾选需要删除的数据项!")); + } + getInsuranceAccountDetailMapper().batchDelAccountDetailsByIds(param.getIds()); + //记录操作日志 + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getIds().stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setTargetName(param.getIds().stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除补缴核算记录")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除补缴核算记录")); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + + updateBatchAccount(AccountParam.builder().billMonth(param.getBillMonth()).paymentOrganization(param.getPaymentOrganization()).build()); + } + + public void accountInspect(Collection ids, String billMonth, Long paymentOrganization) { + List insuranceAccountInspectPOS = allInspects(ids, billMonth); + SalaryAssert.notEmpty(insuranceAccountInspectPOS, SalaryI18nUtil.getI18nLabel(0, "无核算数据")); + List commonInspects = insuranceAccountInspectPOS.stream() + .filter(e -> Objects.equals(e.getPaymentStatus(), PaymentStatusEnum.COMMON.getValue())) + .collect(Collectors.toList()); + List supplementInspects = insuranceAccountInspectPOS.stream() + .filter(e -> Objects.equals(e.getPaymentStatus(), PaymentStatusEnum.REPAIR.getValue())) + .collect(Collectors.toList()); + //核算正常缴纳 + if (CollectionUtils.isNotEmpty(commonInspects)) { + SaveCommonAccountParam param = new SaveCommonAccountParam(); + param.setBillMonth(billMonth); + param.setIncludes(commonInspects.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList())); + siSaveCommonAccount(param); + } + //核算补缴 + if (CollectionUtils.isNotEmpty(supplementInspects)) { + List baseList = new ArrayList<>(); + supplementInspects.forEach(e -> { + SupplementAccountBaseParam base = new SupplementAccountBaseParam(); + base.setBillMonth(billMonth); + base.setProjects( + e.getSupplementaryProjects() == null ? null : Arrays.stream(e.getSupplementaryProjects().split(",")).map(Integer::valueOf).collect(Collectors.toList())); + base.setEmployeeId(e.getEmployeeId()); + base.setSupplementaryMonth(e.getSupplementaryMonth()); + baseList.add(base); + }); + accountSupplement(baseList, baseList.stream().map(SupplementAccountBaseParam::getEmployeeId).collect(Collectors.toList()), paymentOrganization); + } + } + + public PageInfo siOverView(InsuranceAccountDetailParam queryParam) { + + List insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(queryParam.getBillMonth(), StringUtil.isBlank(queryParam.getPaymentOrganization()) ? null : Long.valueOf(queryParam.getPaymentOrganization())); + encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); + //获取扣缴义务人信息 + List paymentList = getTaxAgentMapper().listAll(); + SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(0, "该租户无扣缴义务人")); + Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); + List insuranceAccountViewListDTOS = buildRecords(insuranceAccountDetailPOS, paymentMap); + + PageInfo insuranceAccountViewListDTOPage = new PageInfo<>(insuranceAccountViewListDTOS, InsuranceAccountViewListDTO.class); + insuranceAccountViewListDTOPage.setTotal(insuranceAccountViewListDTOS.size()); + return insuranceAccountViewListDTOPage; + } + + @Override + public List buildRecords(List list, Map paymentMap) { + Map result = new HashMap<>(); + //根据组织分组,对社保进行统计 + Map> socialCollect = list.stream().filter(item -> item.getSocialPayOrg() != null) + .collect(Collectors.groupingBy(InsuranceAccountDetailPO::getSocialPayOrg)); + socialCollect.forEach((k, v) -> { + if (result.get(k) == null) { + InsuranceAccountViewListDTO temp = new InsuranceAccountViewListDTO(); + temp.setPayOrg(paymentMap.get(k).getName()); + result.put(k, temp); + } + InsuranceAccountViewListDTO insuranceAccountViewListDTO = result.get(k); + accountSocialView(insuranceAccountViewListDTO, v); + }); + //根据组织分组,对公积金进行统计 + Map> fundCollect = list.stream().filter(item -> item.getSocialPayOrg() != null) + .collect(Collectors.groupingBy(InsuranceAccountDetailPO::getSocialPayOrg)); + fundCollect.forEach((k, v) -> { + if (result.get(k) == null) { + InsuranceAccountViewListDTO temp = new InsuranceAccountViewListDTO(); + temp.setPayOrg(paymentMap.get(k).getName()); + result.put(k, temp); + } + InsuranceAccountViewListDTO insuranceAccountViewListDTO = result.get(k); + accountFundView(insuranceAccountViewListDTO, v); + }); + //根据组织分组,对其他福利进行统计 + Map> otherCollect = list.stream().filter(item -> item.getSocialPayOrg() != null) + .collect(Collectors.groupingBy(InsuranceAccountDetailPO::getSocialPayOrg)); + otherCollect.forEach((k, v) -> { + if (result.get(k) == null) { + InsuranceAccountViewListDTO temp = new InsuranceAccountViewListDTO(); + temp.setPayOrg(paymentMap.get(k).getName()); + result.put(k, temp); + } + InsuranceAccountViewListDTO insuranceAccountViewListDTO = result.get(k); + accountOtherView(insuranceAccountViewListDTO, v); + }); + //对各组织进行金额合计 + List viewDTOS = new ArrayList<>(); + result.forEach((k, v) -> { + BigDecimal socialPaySum = StringUtils.isBlank(v.getSocialPaySum()) ? new BigDecimal("0") : new BigDecimal(v.getSocialPaySum()); + BigDecimal fundPaySum = StringUtils.isBlank(v.getFundPaySum()) ? new BigDecimal("0") : new BigDecimal(v.getFundPaySum()); + BigDecimal otherPaySum = StringUtils.isBlank(v.getOtherPaySum()) ? new BigDecimal("0") : new BigDecimal(v.getOtherPaySum()); + v.setIndex(k); + BigDecimal sum = socialPaySum.add(fundPaySum).add(otherPaySum); + v.setSum(sum.toPlainString()); + viewDTOS.add(v); + }); + //合计 + InsuranceAccountViewListDTO insuranceAccountViewListDTO = new InsuranceAccountViewListDTO(); + int socialNum = 0; + int fundNum = 0; + int otherNum = 0; + BigDecimal socialSum = new BigDecimal("0"); + BigDecimal fundSum = new BigDecimal("0"); + BigDecimal otherSum = new BigDecimal("0"); + BigDecimal sum = new BigDecimal("0"); + for (InsuranceAccountViewListDTO item : viewDTOS) { + if (item.getSocialNum() != null) { + socialNum += item.getSocialNum(); + } + if (item.getFundNum() != null) { + fundNum += item.getFundNum(); + } + if (item.getOtherNum() != null) { + otherNum += item.getOtherNum(); + } + if (StringUtils.isNotBlank(item.getSocialPaySum())) { + socialSum = socialSum.add(new BigDecimal(item.getSocialPaySum())); + } + if (StringUtils.isNotBlank(item.getFundPaySum())) { + fundSum = fundSum.add(new BigDecimal(item.getFundPaySum())); + } + if (StringUtils.isNotBlank(item.getOtherPaySum())) { + otherSum = otherSum.add(new BigDecimal(item.getOtherPaySum())); + } + if (StringUtils.isNotBlank(item.getSum())) { + sum = sum.add(new BigDecimal(item.getSum())); + } + } + insuranceAccountViewListDTO.setSum(sum.toPlainString()); + insuranceAccountViewListDTO.setSocialPaySum(socialSum.toPlainString()); + insuranceAccountViewListDTO.setPayOrg(SalaryI18nUtil.getI18nLabel(0, "合计")); + insuranceAccountViewListDTO.setFundPaySum(fundSum.toPlainString()); + insuranceAccountViewListDTO.setOtherPaySum(otherSum.toPlainString()); + insuranceAccountViewListDTO.setSocialNum(socialNum); + insuranceAccountViewListDTO.setFundNum(fundNum); + insuranceAccountViewListDTO.setOtherNum(otherNum); + viewDTOS.add(insuranceAccountViewListDTO); + viewDTOS.forEach(e -> { + e.setSocialPaySum(StringUtils.isBlank(e.getSocialPaySum()) ? "0" : e.getSocialPaySum()); + e.setSocialNum(e.getSocialNum() == null ? 0 : e.getSocialNum()); + e.setFundNum(e.getFundNum() == null ? 0 : e.getFundNum()); + e.setFundPaySum(StringUtils.isBlank(e.getFundPaySum()) ? "0" : e.getFundPaySum()); + e.setOtherPaySum(StringUtils.isBlank(e.getOtherPaySum()) ? "0" : e.getOtherPaySum()); + e.setOtherNum(e.getOtherNum() == null ? 0 : e.getOtherNum()); + e.setSum(SalaryEntityUtil.thousandthConvert(e.getSum())); + e.setSocialPaySum(SalaryEntityUtil.thousandthConvert(e.getSocialPaySum())); + e.setOtherPaySum(SalaryEntityUtil.thousandthConvert(e.getOtherPaySum())); + e.setFundPaySum(SalaryEntityUtil.thousandthConvert(e.getFundPaySum())); + }); + return viewDTOS; + } + + @Override + public void cacheWelfareField(List welfareNames) { + String cacheKey = user.getUID() + SalaryItemConstant.SI_ACCOUNT_IMPORT_FIELD_SIGN; + Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(welfareNames)); + } + + @Override + public void cacheBalanceWelfareField(List welfareNames) { + String cacheKey = user.getUID() + SalaryItemConstant.SI_ACCOUNT_BALANCE_IMPORT_FIELD_SIGN; + Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(welfareNames)); + } + + public void accountOtherView(InsuranceAccountViewListDTO dto, List pos) { + int otherNum = 0; + BigDecimal otherPaySum = new BigDecimal("0"); + for (InsuranceAccountDetailPO item : pos) { + if (StringUtils.isNotBlank(item.getOtherSum()) && SalaryEntityUtil.string2DoubleDefault0(item.getOtherSum()) != 0.0) { + if (!PaymentStatusEnum.BALANCE.getValue().equals(item.getPaymentStatus())) { + otherNum += 1; + } + otherPaySum = otherPaySum.add(new BigDecimal(item.getOtherSum())); + } + } + dto.setOtherNum(otherNum); + dto.setOtherPaySum(otherPaySum.toPlainString()); + } + + public void accountFundView(InsuranceAccountViewListDTO dto, List pos) { + int fundNum = 0; + BigDecimal fundPaySum = new BigDecimal("0"); + for (InsuranceAccountDetailPO item : pos) { + if (StringUtils.isNotBlank(item.getFundSum()) && SalaryEntityUtil.string2DoubleDefault0(item.getFundSum()) != 0.0) { + if (!PaymentStatusEnum.BALANCE.getValue().equals(item.getPaymentStatus())) { + fundNum += 1; + } + fundPaySum = fundPaySum.add(new BigDecimal(item.getFundSum())); + } + } + dto.setFundNum(fundNum); + dto.setFundPaySum(fundPaySum.toPlainString()); + } + + public void accountSocialView(InsuranceAccountViewListDTO dto, List pos) { + int socialNum = 0; + BigDecimal socialPaySum = new BigDecimal("0"); + for (InsuranceAccountDetailPO item : pos) { + if (StringUtils.isNotBlank(item.getSocialSum()) && SalaryEntityUtil.string2DoubleDefault0(item.getSocialSum()) != 0.0 ) { + if (!PaymentStatusEnum.BALANCE.getValue().equals(item.getPaymentStatus())) { + socialNum += 1; + } + socialPaySum = socialPaySum.add(new BigDecimal(item.getSocialSum())); + } + } + dto.setSocialNum(socialNum); + dto.setSocialPaySum(socialPaySum.toPlainString()); + } + + /** + * 查询台账id是否已经薪资核算核算过 + * + * @param param + * @return + */ + public int checkIfBusinessAccounting(InsuranceAccountBatchPO param) { + List list = getSIAccountUtilMapper().checkIfBusinessaccounting(param.getId()); + 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(); + } + + /** + * 更新薪资台账 + * + * @param param + * @return + */ + public void updateById(InsuranceAccountBatchPO param) { + getInsuranceAccountBatchMapper().updateById(param); + } + + /** + * 更新福利台账 + */ + public void updateByEmployeeIdAndBillMonth(InsuranceAccountDetailPO insuranceAccountDetailPO) { + getInsuranceAccountDetailMapper().updateByEmployeeIdAndBillMonth(insuranceAccountDetailPO); + } + + /*****以上代码为SIAccountBiz中方法逻辑迁移,旨在减少Biz类的使用*****/ + } diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 2278c341f..e38c6c74c 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -1,61 +1,93 @@ package com.engine.salary.service.impl; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.api.browser.bean.SearchConditionGroup; +import com.api.browser.bean.SearchConditionItem; +import com.api.browser.bean.SearchConditionOption; +import com.api.browser.util.ConditionFactory; +import com.api.browser.util.ConditionType; import com.cloudstore.dev.api.util.Util_DataCache; +import com.cloudstore.eccom.pc.table.WeaTable; +import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom; import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.cmd.siarchives.SIArchivesTipsCmd; +import com.engine.salary.common.SalaryContext; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.encrypt.EncryptUtil; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO; import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBaseInfoBO; -import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO; -import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; -import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam; -import com.engine.salary.entity.siarchives.param.SIArchiveBaseHistoryListParam; +import com.engine.salary.entity.siarchives.dto.*; +import com.engine.salary.entity.siarchives.param.*; import com.engine.salary.entity.siarchives.po.*; +import com.engine.salary.entity.sicategory.po.ICategoryPO; +import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; +import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.siaccount.EmployeeStatusEnum; -import com.engine.salary.enums.sicategory.DeleteTypeEnum; -import com.engine.salary.enums.sicategory.NonPaymentEnum; -import com.engine.salary.enums.sicategory.WelfareTypeEnum; +import com.engine.salary.enums.sicategory.*; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.siarchives.FundSchemeMapper; -import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; -import com.engine.salary.mapper.siarchives.OtherSchemeMapper; -import com.engine.salary.mapper.siarchives.SocialSchemeMapper; -import com.engine.salary.service.SIArchivesService; -import com.engine.salary.service.TaxAgentEmpChangeService; -import com.engine.salary.service.TaxAgentService; +import com.engine.salary.mapper.datacollection.EmployMapper; +import com.engine.salary.mapper.siarchives.*; +import com.engine.salary.mapper.sicategory.ICategoryMapper; +import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; +import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; +import com.engine.salary.service.*; import com.engine.salary.sys.constant.SalarySysConstant; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; +import com.engine.salary.sys.enums.OpenEnum; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.wrapper.TaxAgentWrapper; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.session.SqlSession; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StopWatch; +import weaver.conn.mybatis.MyBatisFactory; import weaver.general.BaseBean; import weaver.general.Util; import weaver.hrm.User; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_AUTO_ADJUST; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM; + /** * @Author weaver_cl * @Description: @@ -68,9 +100,9 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log")); - private SIArchivesBiz getSiArchivesBiz(User user) { - return ServiceUtil.getService(SIArchivesBiz.class, user); - } +// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + + private EncryptUtil encryptUtil = new EncryptUtil(); private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); @@ -100,6 +132,44 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService return MapperProxyFactory.getProxy(OtherSchemeMapper.class); } + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + + private InsuranceSchemeDetailMapper getInsuranceSchemeDetailMapper() { + return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class); + } + + private InsuranceSchemeMapper getInsuranceSchemeMapper() { + return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private TaxAgentWrapper getTaxAgentWrapper(User user) { + return ServiceUtil.getService(TaxAgentWrapper.class, user); + } + + public SICategoryService getSICategoryService(User user) { + return ServiceUtil.getService(SICategoryServiceImpl.class, user); + } + + private SISchemeService getSISchemeService(User user) { + return ServiceUtil.getService(SISchemeServiceImpl.class,user); + } + + private EmployMapper getEmployMapper() { + return MapperProxyFactory.getProxy(EmployMapper.class); + } + + + private InsuranceBaseAdjustHistoryMapper getInsuranceBaseAdjustHistoryMapper() { + return MapperProxyFactory.getProxy(InsuranceBaseAdjustHistoryMapper.class); + } + + @Override public Map getTips(Map params) { return commandExecutor.execute(new SIArchivesTipsCmd(params, user)); @@ -112,13 +182,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId); Map apidatas = new HashMap<>(16); - SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); - siArchivesBiz.setNeedAuth(needAuth); - siArchivesBiz.setTaxAgentPOS(taxAgentPOS); +// SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); +//// siArchivesBiz.setNeedAuth(needAuth); +//// siArchivesBiz.setTaxAgentPOS(taxAgentPOS); WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum) params.get("welfareTypeEnum"); Long employeeId = Long.valueOf(Util.null2String(params.get("employeeId"))); Long paymentOrganization = welfareTypeEnum != null ? Long.valueOf(Util.null2String(params.get("paymentOrganization"))) : null; - apidatas = siArchivesBiz.getBaseForm(welfareTypeEnum, employeeId, (long) user.getUID(), user, paymentOrganization); +// apidatas = siArchivesBiz.getBaseForm(welfareTypeEnum, employeeId, (long) user.getUID(), user, paymentOrganization); + apidatas = getBaseForm(welfareTypeEnum, employeeId, paymentOrganization, taxAgentPOS); return apidatas; } @@ -134,15 +205,31 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (StringUtils.isNotBlank(schemeIdStr)) { schemeId = Long.valueOf(schemeIdStr); } - - apidatas = getSiArchivesBiz(user).getPaymentForm(user, welfareTypeEnum, employeeId, (long) user.getUID(), schemeId, paymentOrganization); +// apidatas = siArchivesBiz.getPaymentForm(user, welfareTypeEnum, employeeId, (long) user.getUID(), schemeId, paymentOrganization); + apidatas = getPaymentForm(user, welfareTypeEnum, employeeId, schemeId, paymentOrganization); return apidatas; } @Override public String insert(InsuranceArchivesSaveParam param) { - getSiArchivesBiz(user).insert(param, (long) user.getUID(), user); + SalaryAssert.notNull(param.getWelfareType(), "福利类型为空"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + switch (param.getWelfareType()) { + case SOCIAL_SECURITY: + socialSave(param, user, welBaseDiffSign); + break; + case ACCUMULATION_FUND: + fundSave(param, user, welBaseDiffSign); + break; + case OTHER: + otherSave(param, user, welBaseDiffSign); + break; + default: + throw new SalaryRunTimeException("福利类型不存在"); + } return null; } @@ -184,8 +271,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } Map apidatas = new HashMap<>(16); +// apidatas = siArchivesBiz.listPage(param, (long) user.getUID()); + apidatas = listPage(param, (long) user.getUID()); - apidatas = getSiArchivesBiz(user).listPage(param, (long) user.getUID()); + //记录操作日志 + List runStatuses = param.getRunStatuses() == null ? Collections.emptyList() : param.getRunStatuses().stream().map(s -> EmployeeStatusEnum.parseByValue(s).getDefaultLabel()).collect(Collectors.toList()); + String runStatusStr = CollectionUtils.isEmpty(runStatuses) ? "" : StringUtils.join(runStatuses, ""); + if (param.isExtWelArchiveList()) { + runStatusStr = "非系统人员"; + } + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetName(runStatusStr); + loggerContext.setOperateType(OperateTypeEnum.READ.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "查看福利档案列表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "查看福利档案列表")); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); log.info("各操作计时 {}", sw.prettyPrint()); return apidatas; @@ -197,8 +298,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService */ private void handleHistoryData(long currentEmployeeId) { //如果触发历史数据处理,则进行一次全量增员 - if (getSiArchivesBiz(user).createOldInsuranceBaseInfo(currentEmployeeId)) { - + if (createOldInsuranceBaseInfo(currentEmployeeId)) { //批量增员 List allBaseInfoList = getInsuranceBaseInfoMapper().listAll(); Collection stayAddIds = allBaseInfoList.stream().filter(f->f.getRunStatus().equals(EmployeeStatusEnum.STAY_ADD.getValue())) @@ -410,7 +510,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService List socialArchiveDelIds = insuranceArchivesList.stream().map(InsuranceArchivesBaseInfoPO::getSocialArchivesId).collect(Collectors.toList()); List fundArchiveDelIds = insuranceArchivesList.stream().map(InsuranceArchivesBaseInfoPO::getFundArchivesId).collect(Collectors.toList()); List otherArchiveDelIds = insuranceArchivesList.stream().map(InsuranceArchivesBaseInfoPO::getOtherArchivesId).collect(Collectors.toList()); - + //获取子表数据,方便记录操作日志 + List socialArchives = getSocialSchemeMapper().getSocialById(socialArchiveDelIds); + List fundArchives = getFundSchemeMapper().getFundById(fundArchiveDelIds); + List otherArchives = getOtherSchemeMapper().getOtherById(otherArchiveDelIds); + Map socialArchiveMap = SalaryEntityUtil.convert2Map(socialArchives, InsuranceArchivesSocialSchemePO::getId); + Map fundArchiveMap = SalaryEntityUtil.convert2Map(fundArchives, InsuranceArchivesFundSchemePO::getId); + Map otherArchiveMap = SalaryEntityUtil.convert2Map(otherArchives, InsuranceArchivesOtherSchemePO::getId); // 删除社保档案主表及3张明细表数据 if(CollectionUtils.isNotEmpty(archiveDelIds)){ getInsuranceBaseInfoMapper().deleteByIds(archiveDelIds); @@ -424,6 +530,65 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if(CollectionUtils.isNotEmpty(otherArchiveDelIds)){ getOtherSchemeMapper().deleteByIds(otherArchiveDelIds); } + //记录操作日志 + List targetPOList = insuranceArchivesList.stream().filter(f -> archiveDelIds.contains(f.getId())).collect(Collectors.toList()); + if (targetPOList.size() > 0) { + targetPOList.forEach(targetPO -> { + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + targetPO.setDeleteType(DeleteTypeEnum.DELETED.getValue()); + //记录主表操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除福利档案主表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除福利档案") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + //记录明细表操作日志 + InsuranceArchivesSocialSchemePO socialTargetDetail = socialArchiveMap.get(targetPO.getSocialArchivesId()); + if (socialTargetDetail != null) { + socialTargetDetail.setDeleteType(DeleteTypeEnum.DELETED.getValue()); + LoggerContext detailLoggerContext = new LoggerContext<>(); + detailLoggerContext.setUser(user); + detailLoggerContext.setTargetId(String.valueOf(targetPO.getId())); + detailLoggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + detailLoggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + detailLoggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除福利档案-社保明细")); + detailLoggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除福利档案-社保明细") + ":" + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + detailLoggerContext.setNewValues(socialTargetDetail); + SalaryElogConfig.siArchivesLoggerTemplate.write(detailLoggerContext); + } + InsuranceArchivesFundSchemePO fundTargetDetail = fundArchiveMap.get(targetPO.getFundArchivesId()); + if (fundTargetDetail != null) { + fundTargetDetail.setDeleteType(DeleteTypeEnum.DELETED.getValue()); + LoggerContext detailLoggerContext = new LoggerContext<>(); + detailLoggerContext.setUser(user); + detailLoggerContext.setTargetId(String.valueOf(targetPO.getId())); + detailLoggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + detailLoggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + detailLoggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除福利档案-公积金明细")); + detailLoggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除福利档案-公积金明细") + ":" + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + detailLoggerContext.setNewValues(fundTargetDetail); + SalaryElogConfig.siArchivesLoggerTemplate.write(detailLoggerContext); + } + InsuranceArchivesOtherSchemePO otherTargetDetail = otherArchiveMap.get(targetPO.getOtherArchivesId()); + if (otherTargetDetail != null) { + otherTargetDetail.setDeleteType(DeleteTypeEnum.DELETED.getValue()); + LoggerContext detailLoggerContext = new LoggerContext<>(); + detailLoggerContext.setUser(user); + detailLoggerContext.setTargetId(String.valueOf(targetPO.getId())); + detailLoggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + detailLoggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + detailLoggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除福利档案-其他福利明细")); + detailLoggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除福利档案-其他福利明细") + ":" + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + detailLoggerContext.setNewValues(otherTargetDetail); + SalaryElogConfig.siArchivesLoggerTemplate.write(detailLoggerContext); + } + }); + } } //新增社保、公积金、其他福利档案、福利档案基础信息 @@ -573,7 +738,8 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService @Override public Map getSearchCondition(Map param) { Map apidatas = new HashMap<>(16); - apidatas = getSiArchivesBiz(user).getSearchCondition(user); +// apidatas = siArchivesBiz.getSearchCondition(user); + apidatas = getSearchCondition(); return apidatas; } @@ -603,8 +769,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (insuranceArchivesEmployeePOS == null) { insuranceArchivesEmployeePOS = new ArrayList<>(); } - List> records = getSiArchivesBiz(user).buildTableData(insuranceArchivesEmployeePOS); - List columns = getSiArchivesBiz(user).buildWeaTableColumns(insuranceArchivesEmployeePOS, user.getUID()); +// List> records = getSiArchivesBiz(user).buildTableData(insuranceArchivesEmployeePOS); + List> records = buildTableData(insuranceArchivesEmployeePOS); +// List columns = getSiArchivesBiz(user).buildWeaTableColumns(insuranceArchivesEmployeePOS, user.getUID()); + List columns = buildWeaTableColumns(insuranceArchivesEmployeePOS); //工作簿list List> excelSheetData = new ArrayList<>(); @@ -647,12 +815,9 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService @Override public Map queryInsuranceTabTotal() { long currentEmployeeId = user.getUID(); - // tab页签数量 Map result = new HashMap<>(); - Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId); - //获取管理的人员范围 List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); Map> taxAgentEmployeesMap = SalaryEntityUtil.convert2Map(taxAgentEmployeeDTOS, TaxAgentManageRangeEmployeeDTO::getTaxAgentId, TaxAgentManageRangeEmployeeDTO::getEmployeeList); @@ -661,22 +826,18 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService // 获取作为管理员的所有个税扣缴义务人列表 Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId); Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId); - //获取所有福利档案基础信息 List archiveListDTOS = getInsuranceBaseInfoMapper().listAll(); list = archiveListDTOS.stream().filter(dto -> taxAgentIds.contains(dto.getPaymentOrganization())).collect(Collectors.toList()); - Boolean adminEnable = getTaxAgentService(user).isAdminEnable(currentEmployeeId); //不是管理员看不到数据,返回空 if (!adminEnable) { list = new ArrayList<>(); } - } else { list = getInsuranceBaseInfoMapper().listAll(); } - long stayAddTotal = 0L; long payTotal = 0L; long stayDelTotal = 0L; @@ -711,12 +872,28 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } /** - * 批量变更档案列表的runStatus + * 批量变更档案列表的runStatus,目前仅在待增员tab中删除待办使用,后边其他方调用时需修改操作日志记录 */ @Override public void updateRunStatus(InsuranceArchivesBaseInfoPO po) { - getInsuranceBaseInfoMapper().updateRunStatusByIds(po); + //记录操作日志 + List targetPOList = getInsuranceBaseInfoMapper().listByIds(po.getIds()); + if (targetPOList != null && targetPOList.size() > 0) { + targetPOList.forEach(targetPO -> { + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "待增员档案-删除待办")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "待增员档案-删除待办") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); +// loggerContext.setNewValues(targetPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + }); + } } @Override @@ -733,11 +910,9 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService List oldStayAddList = pos.stream().filter(f -> f.getRunStatus().equals(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue())).collect(Collectors.toList()); boolean isNotExist = oldStayAddList.stream().anyMatch(te -> taxAgentManageRangeEmployees.stream().noneMatch(p -> p.getEmployeeId() != null && p.getEmployeeId().equals(te.getEmployeeId()) && p.getTaxAgentId().equals(te.getPaymentOrganization()))); - if (isNotExist) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542465, "不在当前个税扣缴义人的人员范围中,不可取消停缴")); } - for(InsuranceArchivesBaseInfoPO po : pos) { if (po.getRunStatus().equals(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue())) { //来自待增员的停缴->待增员 @@ -758,7 +933,23 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (stayDelPO.getIds().size() > 0) { getInsuranceBaseInfoMapper().updateRunStatusByIds(stayDelPO); } - + //记录操作日志 + Map oldBaseInfoMap = SalaryEntityUtil.convert2Map(pos, e -> e.getPaymentOrganization() + "-" + e.getEmployeeId()); + List newPos = getInsuranceBaseInfoMapper().listByIds(ids); + newPos.forEach(targetPO -> { + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "停缴档案-取消停缴")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "停缴档案-取消停缴") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOldValues(oldBaseInfoMap.get(targetPO.getPaymentOrganization() + "-" + targetPO.getEmployeeId())); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + }); } /** @@ -771,12 +962,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542372, "没有可以操作的记录")); } List baseInfoPOList = getInsuranceBaseInfoMapper().listByIds(ids); - //分别新建福利档案基础信息相关的社保、公积金、其他福利档案列表 List socialList = new ArrayList<>(); List fundList = new ArrayList<>(); List otherList = new ArrayList<>(); - //新建最终可以进行减员的福利档案基础信息id列表 List toStopBaseInfoIdList = new ArrayList<>(); //新建最终不可以进行减员的福利档案基础信息id列表 @@ -799,10 +988,9 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //获取社保档案 socialList = getSocialSchemeMapper().getSocialById(socialIds); //筛选可减员的社保档案相关信息 - toStopSocialIds = socialList.stream().filter(f-> f.getSocialSchemeId() == null || (f.getSocialEndTime() != null && f.getSocialEndTime().length() > 0 && (f.getSocialEndTime().compareTo(todayMonth)) <= 0)) .map(InsuranceArchivesSocialSchemePO::getId).collect(Collectors.toList()); - // + List finalToStopSocialIds = toStopSocialIds; noStopBaseInfoIds = baseInfoPOList.stream().filter(f -> !finalToStopSocialIds.contains(f.getSocialArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()); @@ -830,7 +1018,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //社保、公积金、其他福利档案的可减员的人员信息与入参中的人员信息一致时 toStopBaseInfoIdList = baseInfoIds; } else { - //与最终不可减员的baseInfoId信息做差集 toStopBaseInfoIdList = (List) CollectionUtils.subtract(baseInfoIds, noStopBaseInfoIds); } @@ -838,6 +1025,23 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (toStopBaseInfoIdList.size() > 0) { getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder() .ids(toStopBaseInfoIdList).runStatus(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()).build()); + //记录操作日志 + toStopBaseInfoIdList.forEach(f -> { + InsuranceArchivesBaseInfoPO targetPO = getInsuranceBaseInfoMapper().getById(f); + if (targetPO != null) { + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案减员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "停缴一名在缴员工") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + } + }); } Map resultMap = new HashMap<>(2); @@ -887,6 +1091,44 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService return resultMap; } + @Override + public Map stopWithoutLimit(Collection ids, String yearMonth) { + + if (CollectionUtils.isEmpty(ids)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(145969, "没有可以操作的记录")); + } + List baseInfoPOList = getInsuranceBaseInfoMapper().listByIds(ids); + + //分别新建福利档案基础信息相关的社保、公积金、其他福利档案列表 + List socialList = new ArrayList<>(); + List fundList = new ArrayList<>(); + List otherList = new ArrayList<>(); + //获取待处理的福利档案基础信息id列表 + List baseInfoIds = baseInfoPOList.stream().map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()); + //分别获取福利档案基础信息相关的社保、公积金、其他福利档案id列表 + List socialIds = baseInfoPOList.stream().map(InsuranceArchivesBaseInfoPO::getSocialArchivesId).collect(Collectors.toList()); + List fundIds = baseInfoPOList.stream().map(InsuranceArchivesBaseInfoPO::getFundArchivesId).collect(Collectors.toList()); + List otherIds = baseInfoPOList.stream().map(InsuranceArchivesBaseInfoPO::getOtherArchivesId).collect(Collectors.toList()); + //进行减员操作 + if (baseInfoIds.size() > 0) { + getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder() + .ids(baseInfoIds).runStatus(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()).build()); + + getSocialSchemeMapper().batchUpdateEndTime(socialIds, yearMonth); + getFundSchemeMapper().batchUpdateEndTime(fundIds, yearMonth); + getOtherSchemeMapper().batchUpdateEndTime(otherIds, yearMonth); + } + + + Map resultMap = new HashMap<>(2); + String resultMsg = "操作成功"; + String resultType = "success"; + + resultMap.put("type", resultType); + resultMap.put("msg", resultMsg); + return resultMap; + } + /** * 全量减员 */ @@ -921,19 +1163,15 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (CollectionUtils.isEmpty(ids)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542372, "没有可以操作的记录")); } - // List baseInfoPOList = new ArrayList<>(); List> partitionInfo = Lists.partition((List) ids, 100); partitionInfo.forEach(part -> baseInfoPOList.addAll( getInsuranceBaseInfoMapper().listByIds(part))); - // - //分别新建福利档案基础信息相关的社保、公积金、其他福利档案列表 List socialList = new ArrayList<>(); List fundList = new ArrayList<>(); List otherList = new ArrayList<>(); - //新建最终可以进行增员的福利档案基础信息id列表 List toPayBaseInfoIdList = new ArrayList<>(); //新建最终不可以进行增员的福利档案基础信息id列表 @@ -1031,6 +1269,23 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService .ids(part).runStatus(EmployeeStatusEnum.PAYING.getValue()).build()); }); + //记录操作日志 + toPayBaseInfoIdList.forEach(f -> { + InsuranceArchivesBaseInfoPO targetPO = getInsuranceBaseInfoMapper().getById(f); + if (targetPO != null) { + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案增员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "增加一名在缴员工") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + } + }); } Map resultMap = new HashMap<>(2); @@ -1113,7 +1368,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (insuranceArchivesBaseInfoPO.getIds() == null || StringUtils.isBlank(insuranceArchivesBaseInfoPO.getRunStatus())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),389204, "参数错误")); } - if (insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())) { List> baseInfoIdsPartition = Lists.partition((List) insuranceArchivesBaseInfoPO.getIds(), 100); List nowList = new ArrayList<>(); @@ -1130,7 +1384,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (isNotExist) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),116196, "个税扣缴义务人不存在或不在权限范围内,删除失败!")); } - //置空社保、公积金、其他福利档案的最后缴纳月信息,并将福利档案基础信息表的状态置为“正在缴纳” if (nowList.size() > 0) { List socialIds = nowList.stream() @@ -1155,7 +1408,19 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService .runStatus(EmployeeStatusEnum.PAYING.getValue()) .build()); }); - + nowList.forEach(targetPO -> { + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "待减员档案-删除待办")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "待减员档案-删除待办") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); +// loggerContext.setNewValues(targetPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + }); } } @@ -1167,7 +1432,8 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (param.getWelfareTypeEnum() == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 389204, "参数错误")); } - List adjustHistoryDTOS = getSiArchivesBiz(user).getAdjustHistoryList(param.getPaymentOrganization(), param.getEmployeeId()); +// List adjustHistoryDTOS = getSiArchivesBiz(user).getAdjustHistoryList(param.getPaymentOrganization(), param.getEmployeeId()); + List adjustHistoryDTOS = getAdjustHistoryList(param.getPaymentOrganization(), param.getEmployeeId()); List targetHistory = adjustHistoryDTOS.stream() .filter(f -> f.getWelfareType().equals(param.getWelfareTypeEnum().getValue())).collect(Collectors.toList()); @@ -1181,7 +1447,34 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService @Override public PageInfo historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param) { - List adjustHistoryDTOS = getSiArchivesBiz(user).getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId()); +// List adjustHistoryDTOS = getSiArchivesBiz(user).getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId()); + List adjustHistoryDTOS = getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId()); + // 分权逻辑 + Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); + if (needAuth) { + Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); + List taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(taxAgents)) { + //防止普通用户查询 + adjustHistoryDTOS = new ArrayList<>(); + } else { + adjustHistoryDTOS = adjustHistoryDTOS.stream().filter(f -> taxAgents.contains(f.getPaymentOrganization())).collect(Collectors.toList()); + } + } + + adjustHistoryDTOS.forEach(f -> { + if (StringUtils.isNotBlank(f.getPaymentScope())) { + if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人")); + } else if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "公司")); + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司")); + } + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司")); + } + }); PageInfo listPage = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), adjustHistoryDTOS , InsuranceArchivesBaseHistoryDTO.class); @@ -1189,4 +1482,2545 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService return listPage; } + /** + * 拷贝福利档案到新的个税扣缴义务人并置为在缴 + */ + @Override + public Map copyToPay(Long toCopyTaxAgentId, Long toUpdateTaxAgentId, Long employeeId, String payStartYearMonth) { + if (toCopyTaxAgentId == null || toUpdateTaxAgentId == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人不能为空")); + } + if (employeeId == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "人员id不能为空")); + } + //获取待拷贝的福利档案明细 + InsuranceArchivesBaseInfoPO toCopyBaseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(toCopyTaxAgentId, employeeId); + if(toCopyBaseInfoPO == null){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "待复制个税扣缴义务人下该员工不存在福利档案,请检查后重试!")); + } + InsuranceArchivesSocialSchemePO toCopySocialInfo = getSocialSchemeMapper().getOneById(toCopyBaseInfoPO.getSocialArchivesId()); + InsuranceArchivesFundSchemePO toCopyFundInfo = getFundSchemeMapper().getOneById(toCopyBaseInfoPO.getFundArchivesId()); + InsuranceArchivesOtherSchemePO toCopyOtherInfo = getOtherSchemeMapper().getOneById(toCopyBaseInfoPO.getOtherArchivesId()); + //获取待更新的福利档案 + InsuranceArchivesBaseInfoPO toUpdateBaseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(toUpdateTaxAgentId, employeeId); + if(toUpdateBaseInfoPO == null){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "待更新个税扣缴义务人下该员工不存在福利档案,请检查后重试!")); + } + InsuranceArchivesSocialSchemePO toUpdateSocialInfo = getSocialSchemeMapper().getOneById(toUpdateBaseInfoPO.getSocialArchivesId()); + InsuranceArchivesFundSchemePO toUpdateFundInfo = getFundSchemeMapper().getOneById(toUpdateBaseInfoPO.getFundArchivesId()); + InsuranceArchivesOtherSchemePO toUpdateOtherInfo = getOtherSchemeMapper().getOneById(toUpdateBaseInfoPO.getOtherArchivesId()); + //设置福利档案基数调整记录数据 + encryptUtil.decrypt(toCopySocialInfo, InsuranceArchivesSocialSchemePO.class); + encryptUtil.decrypt(toUpdateSocialInfo, InsuranceArchivesSocialSchemePO.class); + encryptUtil.decrypt(toCopyFundInfo, InsuranceArchivesFundSchemePO.class); + encryptUtil.decrypt(toUpdateFundInfo, InsuranceArchivesFundSchemePO.class); + encryptUtil.decrypt(toCopyOtherInfo, InsuranceArchivesOtherSchemePO.class); + encryptUtil.decrypt(toUpdateOtherInfo, InsuranceArchivesOtherSchemePO.class); + + InsuranceArchivesBaseHistoryDTO socialAdjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(toCopySocialInfo.getSocialSchemeId()) + .adjustAfterBaseJson(toCopySocialInfo.getSocialPaymentBaseString()) + .adjustAfterComBaseJson(toCopySocialInfo.getSocialPaymentComBaseString()) + .welfareType(toUpdateSocialInfo.getWelfareType()) + .employeeId(toUpdateSocialInfo.getEmployeeId()) + .paymentOrganization(toUpdateSocialInfo.getPaymentOrganization()) + .adjustBeforeSchemeId(toUpdateSocialInfo.getSocialSchemeId()) + .adjustBeforeBaseJson(toUpdateSocialInfo.getSocialPaymentBaseString()) + .adjustBeforeComBaseJson(toUpdateSocialInfo.getSocialPaymentComBaseString()) + .build(); + InsuranceArchivesBaseHistoryDTO fundAdjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(toCopyFundInfo.getFundSchemeId()) + .adjustAfterBaseJson(toCopyFundInfo.getFundPaymentBaseString()) + .adjustAfterComBaseJson(toCopyFundInfo.getFundPaymentComBaseString()) + .welfareType(toUpdateFundInfo.getWelfareType()) + .employeeId(toUpdateFundInfo.getEmployeeId()) + .paymentOrganization(toUpdateFundInfo.getPaymentOrganization()) + .adjustBeforeSchemeId(toUpdateFundInfo.getFundSchemeId()) + .adjustBeforeBaseJson(toUpdateFundInfo.getFundPaymentBaseString()) + .adjustBeforeComBaseJson(toUpdateFundInfo.getFundPaymentComBaseString()) + .build(); + InsuranceArchivesBaseHistoryDTO otherAdjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(toCopyOtherInfo.getOtherSchemeId()) + .adjustAfterBaseJson(toCopyOtherInfo.getOtherPaymentBaseString()) + .adjustAfterComBaseJson(toCopyOtherInfo.getOtherPaymentComBaseString()) + .welfareType(toUpdateOtherInfo.getWelfareType()) + .employeeId(toUpdateOtherInfo.getEmployeeId()) + .paymentOrganization(toUpdateOtherInfo.getPaymentOrganization()) + .adjustBeforeSchemeId(toUpdateOtherInfo.getOtherSchemeId()) + .adjustBeforeBaseJson(toUpdateOtherInfo.getOtherPaymentBaseString()) + .adjustBeforeComBaseJson(toUpdateOtherInfo.getOtherPaymentComBaseString()) + .build(); + List adjustHistoryList = new ArrayList<>(); + adjustHistoryList.addAll(createAdjustInfo(socialAdjustInfo, (long) user.getUID())); + adjustHistoryList.addAll(createAdjustInfo(fundAdjustInfo, (long) user.getUID())); + adjustHistoryList.addAll(createAdjustInfo(otherAdjustInfo, (long) user.getUID())); + //更新字段 + toUpdateBaseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + + toUpdateSocialInfo.setSocialAccount(toCopySocialInfo.getSocialAccount()); + toUpdateSocialInfo.setSocialSchemeId(toCopySocialInfo.getSocialSchemeId()); + toUpdateSocialInfo.setSocialPaymentBaseString(toCopySocialInfo.getSocialPaymentBaseString()); + toUpdateSocialInfo.setSocialPaymentComBaseString(toCopySocialInfo.getSocialPaymentComBaseString()); + toUpdateSocialInfo.setNonPayment(toCopySocialInfo.getNonPayment()); + toUpdateSocialInfo.setUnderTake(toCopySocialInfo.getUnderTake()); + toUpdateSocialInfo.setSocialStartTime(StringUtils.isNotBlank(payStartYearMonth) ? payStartYearMonth : toCopySocialInfo.getSocialStartTime()); + toUpdateSocialInfo.setUpdateTime(new Date()); + + toUpdateFundInfo.setFundAccount(toCopyFundInfo.getFundAccount()); + toUpdateFundInfo.setSupplementFundAccount(toCopyFundInfo.getSupplementFundAccount()); + toUpdateFundInfo.setFundSchemeId(toCopyFundInfo.getFundSchemeId()); + toUpdateFundInfo.setFundPaymentBaseString(toCopyFundInfo.getFundPaymentBaseString()); + toUpdateFundInfo.setFundPaymentComBaseString(toCopyFundInfo.getFundPaymentComBaseString()); + toUpdateFundInfo.setNonPayment(toCopyFundInfo.getNonPayment()); + toUpdateFundInfo.setUnderTake(toCopyFundInfo.getUnderTake()); + toUpdateFundInfo.setFundStartTime(StringUtils.isNotBlank(payStartYearMonth) ? payStartYearMonth : toCopyFundInfo.getFundStartTime()); + toUpdateFundInfo.setUpdateTime(new Date()); + + toUpdateOtherInfo.setOtherSchemeId(toCopyOtherInfo.getOtherSchemeId()); + toUpdateOtherInfo.setOtherPaymentBaseString(toCopyOtherInfo.getOtherPaymentBaseString()); + toUpdateOtherInfo.setOtherPaymentComBaseString(toCopyOtherInfo.getOtherPaymentComBaseString()); + toUpdateOtherInfo.setNonPayment(toCopyOtherInfo.getNonPayment()); + toUpdateOtherInfo.setUnderTake(toCopyOtherInfo.getUnderTake()); + toUpdateOtherInfo.setOtherStartTime(StringUtils.isNotBlank(payStartYearMonth) ? payStartYearMonth : toCopyOtherInfo.getOtherStartTime()); + toUpdateOtherInfo.setUpdateTime(new Date()); + //档案入库 + encryptUtil.encrypt(toUpdateSocialInfo, InsuranceArchivesSocialSchemePO.class); + encryptUtil.encrypt(toUpdateFundInfo, InsuranceArchivesFundSchemePO.class); + encryptUtil.encrypt(toUpdateOtherInfo, InsuranceArchivesOtherSchemePO.class); + + getInsuranceBaseInfoMapper().updateById(toUpdateBaseInfoPO); + getSocialSchemeMapper().updateById(toUpdateSocialInfo); + getFundSchemeMapper().updateById(toUpdateFundInfo); + getOtherSchemeMapper().updateById(toUpdateOtherInfo); + //基数调整记录入库 +// siArchivesBiz.batchInsertAdjustHistory(adjustHistoryList, (long) user.getUID()); + batchInsertAdjustHistory(adjustHistoryList); + + Map resultMap = new HashMap<>(2); + String resultMsg = "操作成功"; + String resultType = "success"; + + resultMap.put("type", resultType); + resultMap.put("msg", resultMsg); + return resultMap; + } + + /*****以下代码为SIArchivesBiz中逻辑迁移,旨在减少Biz类的使用*****/ + /** + * 判断是否需要生成历史福利档案基本信息 + */ + public Boolean createOldInsuranceBaseInfo(Long creator) { + log.info("判断是否需要生成历史数据"); + List nowBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoList(); + if (nowBaseInfoList.size() == 0) { + StopWatch sw = new StopWatch(); + log.info("福利档案基础信息表为空,开始生成历史数据:"); + //处理公积金、其他福利档案中个税扣缴义务人为空的情况 + sw.start("处理公积金、其他福利档案中个税扣缴义务人为空的情况"); + List socialList = getSocialSchemeMapper().listAll(); + List fundList = getFundSchemeMapper().listAll(); + List otherList = getOtherSchemeMapper().listAll(); + + List updateFundList = new ArrayList<>(); + List updateOtherList = new ArrayList<>(); + for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { + List toDealFundList = fundList.stream().filter(f -> f.getEmployeeId().equals(socialSchemePO.getEmployeeId()) && f.getPaymentOrganization() == null).collect(Collectors.toList()); + if (toDealFundList.size() > 0) { + InsuranceArchivesFundSchemePO toDealFundPO = toDealFundList.get(0); + toDealFundPO.setPaymentOrganization(socialSchemePO.getPaymentOrganization()); + updateFundList.add(toDealFundPO); + } + + List toDealOtherList = otherList.stream().filter(f -> f.getEmployeeId().equals(socialSchemePO.getEmployeeId()) && f.getPaymentOrganization() == null).collect(Collectors.toList()); + if (toDealOtherList.size() > 0) { + InsuranceArchivesOtherSchemePO toDealOtherPO = toDealOtherList.get(0); + toDealOtherPO.setPaymentOrganization(socialSchemePO.getPaymentOrganization()); + updateOtherList.add(toDealOtherPO); + } + + } + log.info("重置个税扣缴义务人id的公积金档案数:{}", updateFundList.size()); + log.info("重置个税扣缴义务人id的其他福利档案数:{}", updateOtherList.size()); + //更新公积金和其他福利档案 + updateFundList.forEach(getFundSchemeMapper()::updateById); + updateOtherList.forEach(getOtherSchemeMapper()::updateById); + sw.stop(); + + sw.start("处理待入库的历史福利档案基础信息并入库"); + List addBaseInfoList = new ArrayList<>(); + + List oldBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoListByInsuranceDetail(null); + log.info("获取待生成的历史福利档案基础信息条数:{}", oldBaseInfoList.size()); + //去重 + oldBaseInfoList = oldBaseInfoList.stream() + .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); + log.info("去重后的待生成历史福利档案基础信息条数:{}", oldBaseInfoList.size()); + if (oldBaseInfoList.size() > 0) { + //设置基本信息表字段 + for (InsuranceArchivesBaseInfoPO po : oldBaseInfoList) { + po.setId(IdGenerator.generate()); + po.setCreateTime(new Date()); + po.setDeleteType(0); + po.setCreator(creator); + po.setRunStatus(EmployeeStatusEnum.STAY_ADD.getValue()); + po.setUpdateTime(new Date()); + po.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + + addBaseInfoList.add(po); + } + //将历史基本信息入库 + List> partition = Lists.partition(addBaseInfoList, 50); + partition.forEach(getInsuranceBaseInfoMapper()::batchSave); + + sw.stop(); + log.info("各操作计时 {}", sw.prettyPrint()); + return true; + }else { + return false; + } + } else { + return false; + } + + } + @Override + public List> buildTableData(List insuranceArchivesEmployeePOS) { + return buildTableData(insuranceArchivesEmployeePOS, false); + } + + /** + * @param insuranceArchivesEmployeePOS + * @return + */ + public List> buildTableData(List insuranceArchivesEmployeePOS, boolean export) { + boolean welBaseDiffSign = isDiffWelBase(); + + List taxAgentPOS = getTaxAgentMapper().listAll(); + Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + + + List> records = new ArrayList<>(); + + Map socialSchemePOMap = encryptUtil.decryptList(this.getSocialByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesSocialSchemePO.class) + .stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getId, Function.identity())); + + Map fundSchemePOMap = encryptUtil.decryptList(this.getFundByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesFundSchemePO.class) + .stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getId, Function.identity())); + List otherByEmployeeList = this.getOtherByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS); + encryptUtil.decryptList(otherByEmployeeList, InsuranceArchivesOtherSchemePO.class); + Map otherSchemePOMap = otherByEmployeeList + .stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getId, Function.identity())); + insuranceArchivesEmployeePOS.forEach(item -> { + InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getSocialId()); + InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getFundId()); + InsuranceArchivesOtherSchemePO otherItem = otherSchemePOMap.get(item.getOtherId()); + Map map = new HashMap<>(); + map.put("employeeName", item.getUserName()); + map.put("paymentOrganizationName", longTaxAgentPOMap.get(item.getPaymentOrganization()) != null ? longTaxAgentPOMap.get(item.getPaymentOrganization()).getName() : ""); + map.put("employeeId", item.getEmployeeId()); + map.put("departmentName", item.getDepartmentName()); + map.put("subcompanyName", item.getSubcompanyName()); + map.put("departmentId", item.getDepartmentId()); + map.put("jobNum", item.getJobNum()); + map.put("companystartdate", item.getCompanystartdate()); + map.put("dismissdate", item.getDimissionDate()); + map.put("mobile", item.getTelephone()); + map.put("siSchemeId", item.getSiSchemeId()); + map.put("fundSchemeId", item.getFundSchemeId()); + map.put("otherSchemeId", item.getOtherSchemeId()); + map.put("status", item.getUserStatus() != null ? UserStatusEnum.getDefaultLabelByValue(item.getUserStatus()) : ""); + map.put("baseInfo", item.getBaseInfoId()); + map.put("paymentOrganization", item.getPaymentOrganization()); + if (socialItem != null) { + map.put("socialName", getInsuranceSchemeMapper().querySchemeName(socialItem.getSocialSchemeId())); + Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { + }); + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } + } + + map.put("socialAccount", socialItem.getSocialAccount()); + map.put("socialStartTime", socialItem.getSocialStartTime()); + map.put("socialEndTime", socialItem.getSocialEndTime()); + } + if (fundItem != null) { + map.put("fundName", getInsuranceSchemeMapper().querySchemeName(fundItem.getFundSchemeId())); + map.put("fundAccount", fundItem.getFundAccount()); + Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { + }); + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } + } + + map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); + map.put("fundStartTime", fundItem.getFundStartTime()); + map.put("fundEndTime", fundItem.getFundEndTime()); + + } + if (otherItem != null) { + map.put("otherName", getInsuranceSchemeMapper().querySchemeName(otherItem.getOtherSchemeId())); + Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { + }); + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } + } + + map.put("otherStartTime", otherItem.getOtherStartTime()); + map.put("otherEndTime", otherItem.getOtherEndTime()); + } + records.add(map); + }); + return records; + + + } + + @Override + public boolean isDiffWelBase() { + User user = (User) SalaryContext.get().getValue("user"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + + return welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + } + + /** + * 根据人员id和个税扣缴人id获取记录 + */ + public List getSocialByEmployeeIdAndPayOrg(List insuranceArchivesEmployeePOS) { + + List allList = new ArrayList<>(); + for (InsuranceArchivesEmployeePO po : insuranceArchivesEmployeePOS) { + List socialList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(po); + if (socialList.size() > 0) { + allList.add(socialList.get(0)); + } + } + return allList; + } + + public List getFundByEmployeeIdAndPayOrg(List insuranceArchivesEmployeePOS) { + + List allList = new ArrayList<>(); + for (InsuranceArchivesEmployeePO po : insuranceArchivesEmployeePOS) { + List fundList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(po); + if (fundList.size() > 0) { + allList.add(fundList.get(0)); + } + } + return allList; + } + + public List getOtherByEmployeeIdAndPayOrg(List insuranceArchivesEmployeePOS) { + + List allList = new ArrayList<>(); + for (InsuranceArchivesEmployeePO po : insuranceArchivesEmployeePOS) { + List otherList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(po); + if (otherList.size() > 0) { + allList.add(otherList.get(0)); + } + } + return allList; + } + + @Override + public List payInsuranceIds(Long socialSchemeId, Integer paymentScope) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //开启缴纳的 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)) + .map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } + + @Override + public List payInsuranceIds(Long socialSchemeId) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //开启缴纳的 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue())).map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } + + @Override + public List buildWeaTableColumns(List insuranceArchivesEmployeePOS) { + + Map> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS); + List list = new ArrayList<>(); + WeaTableColumn nameColumn = new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "employeeName"); + nameColumn.setFixed("left"); + list.add(nameColumn); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人"), "paymentOrganizationName")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "分部"), "subcompanyName")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "部门"), "departmentName")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "手机号"), "mobile")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "员工状态"), "status")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "工号"), "jobNum")); + + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "入职日期"), "companystartdate")); +// list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "合同到期日期"), "dismissdate")); + + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "社保方案名称"), "socialName")); + titleMap.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k))); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "社保账号"), "socialAccount")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "社保起始缴纳月"), "socialStartTime")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "社保最后缴纳月"), "socialEndTime")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "公积金方案名称"), "fundName")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "公积金账号"), "fundAccount")); + titleMap.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k))); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "补充公积金账号"), "supplementFundAccount")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "公积金起始缴纳月"), "fundStartTime")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "公积金最后缴纳月"), "fundEndTime")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "其他福利方案名称"), "otherName")); + titleMap.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k))); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "其他福利起始缴纳月"), "otherStartTime")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "其他福利最后缴纳月"), "otherEndTime")); + return list; + } + + public Map> buildColumnTitle(List insuranceArchivesEmployeePOS) { + + boolean welBaseDiffSign = isDiffWelBase(); + + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + Map> result = new HashMap<>(); + + insuranceArchivesEmployeePOS = insuranceArchivesEmployeePOS.stream() + .filter(f -> f.getEmployeeId() != null) + .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesEmployeePO::getEmployeeId))), ArrayList::new)); + try { + + SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); + FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class); + OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class); + ICategoryMapper iCategoryMapper = sqlSession.getMapper(ICategoryMapper.class); + + Set socialSet = new HashSet<>(); + Set fundSet = new HashSet<>(); + Set otherSet = new HashSet<>(); + + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + + insuranceArchivesEmployeePOS.forEach(item -> { + List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())); + encryptUtil.decryptList(socialList, InsuranceArchivesSocialSchemePO.class); + List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())); + encryptUtil.decryptList(fundList, InsuranceArchivesFundSchemePO.class); + List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())); + encryptUtil.decryptList(otherList, InsuranceArchivesOtherSchemePO.class); + if (socialList.size() > 0) { + for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { + + Map socialJson = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new TypeReference>() { + }); + if (socialJson != null) { + socialJson.forEach((k, v) -> socialSet.add(k)); + } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } + } + + } + if (fundList.size() > 0) { + for (InsuranceArchivesFundSchemePO fundSchemePO : fundList) { + Map fundJson = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new TypeReference>() { + }); + if (fundJson != null) { + fundJson.forEach((k, v) -> fundSet.add(k)); + } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } + } + + } + if (otherList.size() > 0) { + for (InsuranceArchivesOtherSchemePO otherSchemePO : otherList) { + Map otherJson = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new TypeReference>() { + }); + if (otherJson != null) { + otherJson.forEach((k, v) -> otherSet.add(k)); + } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } + } + + } + }); + Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); + Map socialCollect = new HashMap<>(); + Map customSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null) + .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + + Map sysSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()) + .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + + socialCollect.putAll(customSocial); + socialCollect.putAll(sysSocial); + + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } + Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); + Map fundCollect = new HashMap<>(); + Map customFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + fundCollect.putAll(customFund); + fundCollect.putAll(sysFund); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } + Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); + Map otherCollect = new HashMap<>(); + Map customOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); + otherCollect.putAll(customOther); + otherCollect.putAll(sysOther); + + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } + // map根据key排序 + LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundMapWithAscKey = fundMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherMapWithAscKey = otherMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } + + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); + result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); + result.put(WelfareTypeEnum.OTHER.getValue(), otherMapWithAscKey); + return result; + } finally { + sqlSession.close(); + } + + + } + + /** + * 获取福利档案基数调整记录 + * + */ + public List getAdjustHistoryList(Long paymentOrganization, Long employeeId) { + + if (paymentOrganization == null && employeeId == null) { + return null; + } + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + InsuranceBaseAdjustHistoryMapper mapper = sqlSession.getMapper(InsuranceBaseAdjustHistoryMapper.class); + List list = mapper.listByEmployeeIdAndPayOrg(paymentOrganization, employeeId); + return list; + } finally { + sqlSession.close(); + } + } + + /** + * 获取福利档案基数调整记录 + * + */ + public List getBaseHistoryByEmployeeIdAndOperator(Long operator, Long employeeId) { + + List empList = getInsuranceBaseAdjustHistoryMapper().listByEmployeeIdAndOperator(operator, employeeId); + List extEmpList = getInsuranceBaseAdjustHistoryMapper().listByExtEmpIdAndOperator(operator, employeeId); + if (extEmpList != null) { + empList.addAll(extEmpList); + empList = empList.stream().filter(f -> org.apache.commons.lang.StringUtils.isNotBlank(f.getEmployeeName())) + .sorted(Comparator.comparing(InsuranceArchivesBaseHistoryDTO::getOperateTime).reversed()).collect(Collectors.toList()); + } + return empList; + } + + //生成基数调整记录(基数单元未变化则忽略) + public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { + Date now = new Date(); + boolean welBaseDiffSign = isDiffWelBase(); + + List toCreateAdjustHistoryList = new ArrayList<>(); + //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 + if(org.apache.commons.lang.StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && org.apache.commons.lang.StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) { + Map adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference>() { + }); + for (String key : adjustAfterBaseMap.keySet()) { + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustAfterBaseValue((String) adjustAfterBaseMap.get(key)); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + toCreateAdjustHistoryList.add(adjustItem); + } + } else if (org.apache.commons.lang.StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && org.apache.commons.lang.StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) { + Map adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference>() { + }); + Map adjustBeforeBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeBaseJson(), new TypeReference>() { + }); + Map reDealMap = new HashMap<>(); + if (adjustAfterBaseMap != null) { + reDealMap.putAll(adjustAfterBaseMap); + } + if (adjustBeforeBaseMap != null) { + reDealMap.putAll(adjustBeforeBaseMap); + } + if (reDealMap.size() >0) { + for (String key : reDealMap.keySet()) { + String beforeValue = (String) adjustBeforeBaseMap.get(key); + String afterValue = (String) adjustAfterBaseMap.get(key); + if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) { + continue; + } + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustBeforeBaseValue(beforeValue); + adjustItem.setAdjustAfterBaseValue(afterValue); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + + toCreateAdjustHistoryList.add(adjustItem); + } + } + + } + //如果系统应用设置拆分了个人和公司福利基数,则对adjustBeforeComBaseJson,adjustAfterComBaseJson也进行处理 + if (welBaseDiffSign) { + //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 + if(org.apache.commons.lang.StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && org.apache.commons.lang.StringUtils.isBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + for (String key : adjustAfterComBaseMap.keySet()) { + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustAfterBaseValue((String) adjustAfterComBaseMap.get(key)); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + toCreateAdjustHistoryList.add(adjustItem); + } + } else if (org.apache.commons.lang.StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && org.apache.commons.lang.StringUtils.isNotBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + Map adjustBeforeComBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeComBaseJson(), new TypeReference>() { + }); + Map reDealMap = new HashMap<>(); + if (adjustAfterComBaseMap != null) { + reDealMap.putAll(adjustAfterComBaseMap); + } + if (adjustBeforeComBaseMap != null) { + reDealMap.putAll(adjustBeforeComBaseMap); + } + if (reDealMap.size() >0) { + for (String key : reDealMap.keySet()) { + String beforeValue = (String) adjustBeforeComBaseMap.get(key); + String afterValue = (String) adjustAfterComBaseMap.get(key); + if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) { + continue; + } + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustBeforeBaseValue(beforeValue); + adjustItem.setAdjustAfterBaseValue(afterValue); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope( PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + + toCreateAdjustHistoryList.add(adjustItem); + } + } + + } + } + return toCreateAdjustHistoryList; + } + + /** + * 新增福利档案基数调整记录 + * + */ + @Override + public void batchInsertAdjustHistory(List adjustHistoryList) { + + if (org.apache.commons.collections.CollectionUtils.isEmpty(adjustHistoryList)) { + return; + } + List> partition = Lists.partition(adjustHistoryList, 100); + partition.forEach(getInsuranceBaseAdjustHistoryMapper()::batchSave); + } + + public Map getBaseForm(WelfareTypeEnum welfareType, Long employeeId, Long paymentOrganization, Collection taxAgentPOS) { + Map data = new HashMap<>(16); + SalaryAssert.notNull(employeeId, SalaryI18nUtil.getI18nLabel(0, "员工id不可为空")); + List employeeByIds = getSalaryEmployeeService(user).getEmployeeByIdsAll(Collections.singletonList(employeeId)); + SalaryAssert.notEmpty(employeeByIds, SalaryI18nUtil.getI18nLabel(0, "员工信息不存在")); + DataCollectionEmployee item = employeeByIds.get(0); + + if (welfareType == null) { + //基础信息表单 + InsuranceArchivesBaseDTO insuranceArchivesBaseDTO = InsuranceArchivesBaseDTO.builder().department(item.getDepartmentName()) + .hiredate(item.getCompanystartdate()) + .position(item.getJobtitleName()) + .username(item.getUsername()) + .telephone(item.getMobile()) + .dimissionDate(item.getDismissdate()) + .build(); + + data.put("data", insuranceArchivesBaseDTO); + return data; + } + +// List list = siSchemeBiz.listAll(); + List list = getSISchemeService(user).listAll(); + // 过滤可见性范围 + list = filterList(list, taxAgentPOS); + List selectItems = new ArrayList<>(); + List addGroups = new ArrayList<>(); + List paymentOptions = paymentOrganizationOptions(taxAgentPOS); + List underTakeOptions = Arrays.stream(UndertakerEnum.values()) + .map(e -> new SearchConditionOption(e.getValue().toString(), e.getDefaultLabel())).collect(Collectors.toList()); + //返回数据 + switch (welfareType) { + case SOCIAL_SECURITY: + InsuranceArchivesSocialSchemeDTO insuranceArchivesSocialSchemeDTO = buildSocialForm(employeeId, paymentOrganization); + List socialList = list.stream().filter(e -> Objects.equals(e.getWelfareType(), WelfareTypeEnum.SOCIAL_SECURITY.getValue())).collect(Collectors.toList()); + List socialOptions = new ArrayList<>(); + socialList.forEach(social -> { + socialOptions.add(new SearchConditionOption(Util.null2String(social.getId()), social.getSchemeName())); + }); + SearchConditionItem socialName = SalaryFormItemUtil.selectItem(user, socialOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "社保方案名称"), "socialSchemeId"); + SearchConditionItem organizationName = SalaryFormItemUtil.selectItem(user, paymentOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "社保缴纳组织"), "paymentOrganization"); + SearchConditionItem underTakeName = SalaryFormItemUtil.selectItem(user, underTakeOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "社保个人实际承担方"), "underTake"); + + selectItems.add(socialName); + selectItems.add(organizationName); + selectItems.add(underTakeName); + + addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "社保基础信息"), true, selectItems)); + data.put("data", insuranceArchivesSocialSchemeDTO); + data.put("items", addGroups); + break; + case ACCUMULATION_FUND: + InsuranceArchivesFundSchemeDTO insuranceArchivesFundSchemeDTO = buildFundForm(employeeId, paymentOrganization); + List fundList = list.stream().filter(e -> Objects.equals(e.getWelfareType(), WelfareTypeEnum.ACCUMULATION_FUND.getValue())).collect(Collectors.toList()); + List fundOptions = new ArrayList<>(); + fundList.forEach(social -> { + fundOptions.add(new SearchConditionOption(Util.null2String(social.getId()), social.getSchemeName())); + }); + SearchConditionItem fundName = SalaryFormItemUtil.selectItem(user, fundOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "公积金方案名称"), "fundSchemeId"); + SearchConditionItem organizationFundName = SalaryFormItemUtil.selectItem(user, paymentOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "公积金缴纳组织"), "paymentOrganization"); + SearchConditionItem underTakeFundName = SalaryFormItemUtil.selectItem(user, underTakeOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "公积金个人实际承担方"), "underTake"); + + selectItems.add(fundName); + selectItems.add(organizationFundName); + selectItems.add(underTakeFundName); + addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "公积金基础信息"), true, selectItems)); + data.put("data", insuranceArchivesFundSchemeDTO); + data.put("items", addGroups); + break; + case OTHER: + InsuranceArchivesOtherSchemeDTO insuranceArchivesOtherSchemeDTO = buildOtherForm(employeeId, paymentOrganization); + List otherList = list.stream().filter(e -> Objects.equals(e.getWelfareType(), WelfareTypeEnum.OTHER.getValue())).collect(Collectors.toList()); + List otherOptions = new ArrayList<>(); + otherList.forEach(social -> { + otherOptions.add(new SearchConditionOption(Util.null2String(social.getId()), social.getSchemeName())); + }); + SearchConditionItem otherName = SalaryFormItemUtil.selectItem(user, otherOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "其他福利名称"), "otherSchemeId"); + SearchConditionItem organizationOtherName = SalaryFormItemUtil.selectItem(user, paymentOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "其他福利缴纳组织"), "paymentOrganization"); + SearchConditionItem underTakeOtherName = SalaryFormItemUtil.selectItem(user, underTakeOptions, 2, 12, 6, false, SalaryI18nUtil.getI18nLabel(0, "其他福利个人实际承担方"), "underTake"); + + selectItems.add(otherName); + selectItems.add(organizationOtherName); + selectItems.add(underTakeOtherName); + addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "其他福利基础信息"), true, selectItems)); + data.put("data", insuranceArchivesOtherSchemeDTO); + data.put("items", addGroups); + break; + default: + } + return data; + } + + /*** + * @description 过滤没有权限访问的 + * @return List + * @author Harryxzy + * @date 2022/9/19 18:32 + */ + List filterList(List list, Collection taxAgentPOS){ + List ids = taxAgentPOS.stream().map(i -> String.valueOf(i.getId())).collect(Collectors.toList()); + List result = list.stream().filter(item -> { + boolean flag = true; + if (item.getSharedType()!= null && item.getSharedType().equals("1")) { + flag = false; + String taxAgentIds = item.getTaxAgentIds(); + if(org.apache.commons.lang.StringUtils.isNotBlank(taxAgentIds)){ + String splitFlag = ","; + String[] split = taxAgentIds.split(splitFlag); + for (int i = 0; i < split.length; i++) { + if (ids.contains(split[i])) { + flag = true; + } + } + } + } + return flag; + }).collect(Collectors.toList()); + return result; + } + + /** + * 社保缴纳组织 + * + * @return + */ + public List paymentOrganizationOptions(Collection taxAgentPOS) { + Collection list = taxAgentPOS; + if (org.apache.commons.collections.CollectionUtils.isEmpty(list)) { + return new ArrayList<>(); + } + return list + .stream() + .map(item -> new SearchConditionOption(String.valueOf(item.getId()), item.getName())).collect(Collectors.toList()); + } + + /** + * 其它基础表单 + * + * @param employeeId + * @return + */ + public InsuranceArchivesOtherSchemeDTO buildOtherForm(Long employeeId, Long paymentOrganization) { + + List otherList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); + encryptUtil.decryptList(otherList, InsuranceArchivesOtherSchemePO.class); + InsuranceArchivesOtherSchemePO insuranceArchivesOtherSchemePO = otherList.size() != 0 ? otherList.get(0) : null; + InsuranceArchivesOtherSchemeDTO data = InsuranceArchivesBO.convertOtherPOtoDTO(insuranceArchivesOtherSchemePO, employeeId); + if (insuranceArchivesOtherSchemePO == null) { + data.setEmployeeId(employeeId); + data.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue().toString()); + } + return data; + } + + /** + * 公积金基础表单 + * + * @param employeeId + * @return + */ + public InsuranceArchivesFundSchemeDTO buildFundForm(Long employeeId, Long paymentOrganization) { + + List fundList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); + encryptUtil.decryptList(fundList, InsuranceArchivesFundSchemePO.class); + InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO = fundList.size() != 0 ? fundList.get(0) : null; + InsuranceArchivesFundSchemeDTO data = InsuranceArchivesBO.convertFundPOtoDTO(insuranceArchivesFundSchemePO, employeeId); + if (insuranceArchivesFundSchemePO == null) { + data.setEmployeeId(employeeId); + data.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue().toString()); + } + return data; + } + + /** + * 社保基础表单 + * + * @param employeeId + * @return + */ + public InsuranceArchivesSocialSchemeDTO buildSocialForm(Long employeeId, Long paymentOrganization) { + InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO = getSocialByEmployeeId(employeeId, paymentOrganization); + InsuranceArchivesSocialSchemeDTO data = InsuranceArchivesBO.convertSocialPOtoDTO(insuranceArchivesSocialSchemePO, employeeId); + if (insuranceArchivesSocialSchemePO == null) { + data.setEmployeeId(employeeId); + data.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue().toString()); + } + return data; + } + + /** + * 获取社保档案表 + * + * @param employeeId + * @return + */ + public InsuranceArchivesSocialSchemePO getSocialByEmployeeId(Long employeeId, Long paymentOrganization) { + + List socialList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); + encryptUtil.decryptList(socialList, InsuranceArchivesSocialSchemePO.class); + return socialList.size() != 0 ? socialList.get(0) : null; + } + + /** + * 获取详细表单 + * + * @param user + * @param welfareType + * @param employeeId + * @param schemeId + * @return + */ + public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, Long schemeId, Long paymentOrganization) { + Map data = new HashMap<>(16); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + //判断是否要自动调整基数 + SalarySysConfPO welBaseAutoAdjust = getSalarySysConfService(user).getOneByCode(WEL_BASE_AUTO_ADJUST); + boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue()); + + switch (welfareType) { + case SOCIAL_SECURITY: + data = buildSocialPaymentForm(user, employeeId, schemeId,welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); + break; + case ACCUMULATION_FUND: + data = buildFundPaymentForm(user, employeeId, schemeId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); + break; + case OTHER: + data = buildOtherPaymentForm(user, employeeId, schemeId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); + break; + default: + } + return data; + } + + /** + * 其他payForm + * + * @param employeeId + * @param schemeId + * @return + */ + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { + Map dataMap = new HashMap<>(); + InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); + if (data != null) { + insuranceValueMap = StrUtil.isNotBlank(data.getOtherPaymentBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getOtherPaymentComBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } + } + List addGroups = new ArrayList<>(); + List inputItems = buildPaymentBase(user, schemeId, welfareType, welBaseDiffSign); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); + addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "其他福利缴纳基数"), true, inputItems)); + dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "其他福利缴纳基数"), true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } + return dataMap; + } + + /** + * 公积金payForm + * + * @param employeeId + * @param schemeId + * @return + */ + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { + + Map dataMap = new HashMap<>(); + InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); + if (data != null) { + insuranceValueMap = StrUtil.isNotBlank(data.getFundPaymentBaseString()) + ? JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getFundPaymentComBaseString()) + ? JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } + } + + List addGroups = new ArrayList<>(); + List inputItems = buildPaymentBase(user, schemeId, welfareType, welBaseDiffSign); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); + addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "公积金缴纳基数"), true, inputItems)); + dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "公积金缴纳基数"), true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } + return dataMap; + } + + /** + * 社保payForm + * + * @param employeeId + * @param schemeId + * @return + */ + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { + Map dataMap = new HashMap<>(); + InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); + if (data != null) { + insuranceValueMap = StrUtil.isNotBlank(data.getSchemePaymentBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); + if (welBaseDiffSign) { + insuranceComValueMap = StrUtil.isNotBlank(data.getSchemePaymentComBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); + } + } + + List addGroups = new ArrayList<>(); + List inputItems = buildPaymentBase(user, schemeId, welfareType, welBaseDiffSign); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); + addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "社保缴纳基数"), true, inputItems)); + dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0, "社保缴纳基数"), true, inputComItems)); + dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); + } + return dataMap; + + } + + /** + * 构造payment(items) + * + * @param schemeId + * @return + */ + public List buildPaymentBase(User user, Long schemeId, Integer welfareType, boolean welBaseDiffSign) { + List inputItems = new ArrayList<>(); + if (schemeId == null) { + return new ArrayList<>(); + } + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + if (!welBaseDiffSign) { + List perInsuranceIdList = list.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + List moreComList = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue()) && !perInsuranceIdList.contains(f.getInsuranceId())).collect(Collectors.toList()); + if (moreComList.size() > 0) { + list.addAll(moreComList); + } + } + + list.forEach(insuranceSchemeDetail -> { +// ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); + ICategoryPO iCategoryPO = getSICategoryService(user).getICategoryPOByID(insuranceSchemeDetail.getInsuranceId()); + if (iCategoryPO != null) { +// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()))); + inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()) + , insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit())); + } + }); + return inputItems; + } + + public List buildPaymentComBase(User user, Long schemeId, Integer welfareType) { + List inputItems = new ArrayList<>(); + if (schemeId == null) { + return new ArrayList<>(); + } + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue())).collect(Collectors.toList()); + list.forEach(insuranceSchemeDetail -> { +// ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); + ICategoryPO iCategoryPO = getSICategoryService(user).getICategoryPOByID(insuranceSchemeDetail.getInsuranceId()); + if (iCategoryPO != null) { +// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()))); + inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()) + , insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit())); + } + }); + return inputItems; + } + + /** + * 获取方案明细 + * + * @param schemeId + * @return + */ + public List queryListByPrimaryIdIsPayment(Long schemeId, Integer welfareType) { + + List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListByPrimaryIdIsPayment(schemeId, IsPaymentEnum.YES.getValue(), welfareType); + encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + return insuranceSchemeDetailPOS; + } + + public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); + InsuranceArchivesOtherSaveParam param = JSONObject.parseObject(paramReq.getBaseForm(), InsuranceArchivesOtherSaveParam.class); + SalaryAssert.notNull(SalaryI18nUtil.getI18nLabel(0, "员工id为空"), param, param.getEmployeeId()); + + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getOtherStartTime()) && !SalaryDateUtil.checkYearMonth(param.getOtherStartTime())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "其他福利起始缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); + } + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getOtherEndTime()) && !SalaryDateUtil.checkYearMonth(param.getOtherEndTime())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "其他福利最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); + } + //创建操作日志记录对象 + InsuranceArchivesBaseInfoPO targetPO = new InsuranceArchivesBaseInfoPO(); + InsuranceArchivesOtherSchemePO targetDetailPO = new InsuranceArchivesOtherSchemePO(); + + List otherIds = new ArrayList(); + otherIds.add(param.getId()); + List oldOtherInfoList = getOtherSchemeMapper().getOtherById(otherIds); + //设置福利档案基数调整记录数据 + InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(param.getOtherSchemeId()) + .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) + .welfareType(paramReq.getWelfareType().getValue()) + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build(); + + if (oldOtherInfoList.size() == 1) { + InsuranceArchivesOtherSchemePO oldOtherInfo = oldOtherInfoList.get(0); + //设置福利档案基数调整记录数据 + encryptUtil.decrypt(oldOtherInfo, InsuranceArchivesOtherSchemePO.class); + adjustInfo.setAdjustBeforeBaseJson(oldOtherInfo.getOtherPaymentBaseString()); + adjustInfo.setAdjustBeforeSchemeId(oldOtherInfo.getOtherSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldOtherInfo.getOtherPaymentComBaseString()); + //新数据 + InsuranceArchivesOtherSchemePO updateOtherInfo = + InsuranceArchivesOtherSchemePO.builder() + .id(oldOtherInfo.getId()) + .otherSchemeId(param.getOtherSchemeId()) + .otherStartTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getOtherStartTime()) ? param.getOtherStartTime() : null) + .underTake(param.getUnderTake()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .welfareType(paramReq.getWelfareType().getValue()) + .otherEndTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getOtherEndTime()) ? param.getOtherEndTime() : null) + .employeeId(param.getEmployeeId()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(oldOtherInfo.getCreateTime()) + .updateTime(new Date()) + .nonPayment(param.getNonPayment()) + .creator(employeeId) + .paymentOrganization(param.getPaymentOrganization()) + .otherPaymentBaseString(paramReq.getPaymentForm()) + .build(); + //校验福利基数是否符合上下限要求, + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + } + encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class); + getOtherSchemeMapper().updateById(updateOtherInfo); + //更新base_info表状态 + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + //对于非系统人员,编辑后状态切换为正在缴纳 + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } + baseInfoPO.setOtherArchivesId(updateOtherInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + + targetPO = baseInfoPO; + encryptUtil.decrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class); + targetDetailPO = updateOtherInfo; + } else { + getOtherSchemeMapper().deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + //新建社保档案,并关联主表 + InsuranceArchivesOtherSchemePO insertOtherInfo = InsuranceArchivesOtherSchemePO.builder() + .otherSchemeId(param.getOtherSchemeId()) + .otherStartTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getOtherStartTime()) ? param.getOtherStartTime() : null) + .underTake(param.getUnderTake()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .welfareType(paramReq.getWelfareType().getValue()) + .otherEndTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getOtherEndTime()) ? param.getOtherEndTime() : null) + .employeeId(param.getEmployeeId()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(new Date()) + .updateTime(new Date()) + .nonPayment(param.getNonPayment()) + .creator(employeeId) + .paymentOrganization(param.getPaymentOrganization()) + .otherPaymentBaseString(paramReq.getPaymentForm()) + .build(); + //校验福利基数是否符合上下限要求, + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + } + encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class); + getOtherSchemeMapper().insert(insertOtherInfo); + + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null) { + List otherInfos = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + baseInfoPO.setOtherArchivesId(otherInfos.get(0).getId()); + //对于非系统人员,编辑后状态切换为正在缴纳 + if (baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + + targetPO = baseInfoPO; + encryptUtil.decrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class); + targetDetailPO = insertOtherInfo; + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); + } + } + //记录操作日志 + DataCollectionEmployee empInfo = getSalaryEmployeeService(user).getEmployeeById(targetDetailPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案-其他福利明细保存")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利档案-其他福利明细保存") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + if (oldOtherInfoList.size() == 1) { + loggerContext.setOldValues(oldOtherInfoList.get(0)); + } + loggerContext.setNewValues(targetDetailPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + //生成福利档案基数调整记录数据 + List adjustHistoryList = createAdjustInfo(adjustInfo, employeeId); + //福利档案基数调整记录数据入库 + batchInsertAdjustHistory(adjustHistoryList); + + } + + /** + * @param paramReq + * @param + */ + public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); + InsuranceArchivesFundSaveParam param = JSONObject.parseObject(paramReq.getBaseForm(), InsuranceArchivesFundSaveParam.class); + SalaryAssert.notNull(SalaryI18nUtil.getI18nLabel(0,"员工id为空"), param, param.getEmployeeId()); + + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getFundStartTime()) && !SalaryDateUtil.checkYearMonth(param.getFundStartTime())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "公积金起始缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); + } + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getFundEndTime()) && !SalaryDateUtil.checkYearMonth(param.getFundEndTime())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "公积金最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); + } + //创建操作日志记录对象 + InsuranceArchivesBaseInfoPO targetPO = new InsuranceArchivesBaseInfoPO(); + InsuranceArchivesFundSchemePO targetDetailPO = new InsuranceArchivesFundSchemePO(); + + List fundIds = new ArrayList(); + fundIds.add(param.getId()); + List oldFundInfoList = getFundSchemeMapper().getFundById(fundIds); + //设置福利档案基数调整记录数据 + InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(param.getFundSchemeId()) + .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) + .welfareType(paramReq.getWelfareType().getValue()) + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build(); + + if (oldFundInfoList.size() == 1) { + InsuranceArchivesFundSchemePO oldFundInfo = oldFundInfoList.get(0); + //设置福利档案基数调整记录数据 + encryptUtil.decrypt(oldFundInfo, InsuranceArchivesFundSchemePO.class); + adjustInfo.setAdjustBeforeBaseJson(oldFundInfo.getFundPaymentBaseString()); + adjustInfo.setAdjustBeforeSchemeId(oldFundInfo.getFundSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldFundInfo.getFundPaymentComBaseString()); + //新数据 + InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder() + .id(oldFundInfo.getId()) + .fundSchemeId(param.getFundSchemeId()) + .fundAccount(param.getFundAccount()) + .fundEndTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getFundEndTime()) ? param.getFundEndTime() : null) + .fundStartTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getFundStartTime()) ? param.getFundStartTime() : null) + .fundPaymentBaseString(paramReq.getPaymentForm()) + .supplementFundAccount(param.getSupplementFundAccount()) + .creator(employeeId) + .nonPayment(param.getNonPayment()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .underTake(param.getUnderTake()) + .paymentOrganization(param.getPaymentOrganization()) + .createTime(oldFundInfo.getCreateTime()) + .updateTime(new Date()) + .welfareType(paramReq.getWelfareType().getValue()) + .employeeId(param.getEmployeeId()) + .build(); + //校验福利基数是否符合上下限要求, + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + } + encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class); + getFundSchemeMapper().updateById(updateFundInfo); + //更新base_info表状态 + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + //对于非系统人员,编辑后状态切换为正在缴纳 + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } + baseInfoPO.setFundArchivesId(updateFundInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + + targetPO = baseInfoPO; + encryptUtil.decrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class); + targetDetailPO = updateFundInfo; + } else { + getFundSchemeMapper().deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + //新建社保档案,并关联主表 + InsuranceArchivesFundSchemePO insertFundInfo = InsuranceArchivesFundSchemePO.builder() + .fundSchemeId(param.getFundSchemeId()) + .fundAccount(param.getFundAccount()) + .fundEndTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getFundEndTime()) ? param.getFundEndTime() : null) + .fundStartTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getFundStartTime()) ? param.getFundStartTime() : null) + .fundPaymentBaseString(paramReq.getPaymentForm()) + .supplementFundAccount(param.getSupplementFundAccount()) + .creator(employeeId) + .nonPayment(param.getNonPayment()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .underTake(param.getUnderTake()) + .paymentOrganization(param.getPaymentOrganization()) + .createTime(new Date()) + .updateTime(new Date()) + .welfareType(paramReq.getWelfareType().getValue()) + .employeeId(param.getEmployeeId()) + .build(); + //校验福利基数是否符合上下限要求, + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + } + encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class); + getFundSchemeMapper().insert(insertFundInfo); + + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null) { + List fundInfos = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + baseInfoPO.setFundArchivesId(fundInfos.get(0).getId()); + //对于非系统人员,编辑后状态切换为正在缴纳 + if (baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + + targetPO = baseInfoPO; + encryptUtil.decrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class); + targetDetailPO = insertFundInfo; + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); + } + } + //记录操作日志 + DataCollectionEmployee empInfo = getSalaryEmployeeService(user).getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案-公积金明细保存")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利档案-公积金明细保存") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + if (oldFundInfoList.size() == 1) { + loggerContext.setOldValues(oldFundInfoList.get(0)); + } + loggerContext.setNewValues(targetDetailPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + //生成福利档案基数调整记录数据 + List adjustHistoryList = createAdjustInfo(adjustInfo, employeeId); + //福利档案基数调整记录数据入库 + batchInsertAdjustHistory(adjustHistoryList); + } + + /** + * @param paramReq + * @param + */ + public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); + InsuranceArchivesSocialSaveParam param = JSONObject.parseObject(paramReq.getBaseForm(), InsuranceArchivesSocialSaveParam.class); + SalaryAssert.notNull(SalaryI18nUtil.getI18nLabel(0,"员工id为空"), param, param.getEmployeeId()); + + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getSocialStartTime()) && !SalaryDateUtil.checkYearMonth(param.getSocialStartTime())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "社保起始缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); + } + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getSocialEndTime()) && !SalaryDateUtil.checkYearMonth(param.getSocialEndTime())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "社保最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); + } + +// //删除社保数据 +// socialSchemeMapper.batchDeleteByEmployeeIds(Collections.singletonList(param.getEmployeeId())); + + //创建操作日志记录对象 + InsuranceArchivesBaseInfoPO targetPO = new InsuranceArchivesBaseInfoPO(); + InsuranceArchivesSocialSchemePO targetDetailPO = new InsuranceArchivesSocialSchemePO(); + //查询已有数据 + List socialIds = new ArrayList(); + socialIds.add(param.getId()); + List oldSocialInfoList = getSocialSchemeMapper().getSocialById(socialIds); + //设置福利档案基数调整记录数据 + InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(param.getSocialSchemeId()) + .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) + .welfareType(paramReq.getWelfareType().getValue()) + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build(); + //组装新数据 + if (oldSocialInfoList.size() == 1) { + //老数据 + InsuranceArchivesSocialSchemePO oldSocialInfo = oldSocialInfoList.get(0); + //设置福利档案基数调整记录数据 + encryptUtil.decrypt(oldSocialInfo, InsuranceArchivesSocialSchemePO.class); + adjustInfo.setAdjustBeforeBaseJson(oldSocialInfo.getSocialPaymentBaseString()); + adjustInfo.setAdjustBeforeSchemeId(oldSocialInfo.getSocialSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldSocialInfo.getSocialPaymentComBaseString()); + //新数据 + InsuranceArchivesSocialSchemePO updateSocialInfo = + InsuranceArchivesSocialSchemePO.builder() + .id(oldSocialInfo.getId()) + .welfareType(paramReq.getWelfareType().getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .socialPaymentBaseString(paramReq.getPaymentForm()) + .socialSchemeId(param.getSocialSchemeId()) + .socialEndTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getSocialEndTime()) ? param.getSocialEndTime() : null) + .socialStartTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getSocialStartTime()) ? param.getSocialStartTime() : null) + .creator(employeeId) + .nonPayment(param.getNonPayment()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .employeeId(param.getEmployeeId()) + .createTime(oldSocialInfo.getCreateTime()) + .updateTime(new Date()) + .underTake(param.getUnderTake()) + .socialAccount(param.getSchemeAccount()) + .paymentOrganization(param.getPaymentOrganization()) + .build(); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + } + encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class); + getSocialSchemeMapper().updateById(updateSocialInfo); + //更新base_info表状态 + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + //对于非系统人员,编辑后状态切换为正在缴纳 + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } + baseInfoPO.setSocialArchivesId(updateSocialInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + + targetPO = baseInfoPO; + encryptUtil.decrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class); + targetDetailPO = updateSocialInfo; + } else { + getSocialSchemeMapper().deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + //新建社保档案,并关联主表 + InsuranceArchivesSocialSchemePO insertSocialInfo = + InsuranceArchivesSocialSchemePO.builder() + .welfareType(paramReq.getWelfareType().getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .socialPaymentBaseString(paramReq.getPaymentForm()) + .socialSchemeId(param.getSocialSchemeId()) + .socialEndTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getSocialEndTime()) ? param.getSocialEndTime() : null) + .socialStartTime(org.apache.commons.lang.StringUtils.isNotBlank(param.getSocialStartTime()) ? param.getSocialStartTime() : null) + .creator(employeeId) + .nonPayment(param.getNonPayment()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .employeeId(param.getEmployeeId()) + .createTime(new Date()) + .updateTime(new Date()) + .underTake(param.getUnderTake()) + .socialAccount(param.getSchemeAccount()) + .paymentOrganization(param.getPaymentOrganization()) + .build(); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!")); + } + } + encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class); + getSocialSchemeMapper().insert(insertSocialInfo); + + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null) { + List socialInfos = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + baseInfoPO.setSocialArchivesId(socialInfos.get(0).getId()); + //对于非系统人员,编辑后状态切换为正在缴纳 + if (baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + + targetPO = baseInfoPO; + encryptUtil.decrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class); + targetDetailPO = insertSocialInfo; + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); + } + } + //记录操作日志 + DataCollectionEmployee empInfo = getSalaryEmployeeService(user).getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案-社保明细保存")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利档案-社保明细保存") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + if (oldSocialInfoList.size() == 1) { + loggerContext.setOldValues(oldSocialInfoList.get(0)); + } + loggerContext.setNewValues(targetDetailPO); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + //生成福利档案基数调整记录数据 + List adjustHistoryList = createAdjustInfo(adjustInfo, employeeId); + //福利档案基数调整记录数据入库 + batchInsertAdjustHistory(adjustHistoryList); + } + + /** + * 校验福利基数是否符合上下限要求 + * @param primaryId + * @param paymentBaseString + * @return + */ + @Override + public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { + + if (primaryId ==null || paymentBaseString == null) { + return true; + } + Map paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap().getClass()); + if (paymentBaseJson == null) { + return true; + } + + for (Map.Entry entry : paymentBaseJson.entrySet()) { + + //判断福利值是否为空/数字 + if (entry.getValue() == null || entry.getValue().length() == 0) { + continue; + } else if (!isNumeric(entry.getValue())) { + log.info("福利值非数字!"); + return false; + } + + //根据福利方案id、险种id、缴纳对象、缴费状态查询明细 + List insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey())); + log.info("福利方案id: {},, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + if (insuranceSchemeDetailPOList.size() == 0) { + log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + return false; + } + List isPaymentList = insuranceSchemeDetailPOList.stream() + .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); + if (isPaymentList.size() > 0) { + InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0); + + encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class); + String lowerLimit = "0.000".equals(insuranceSchemeDetailPO.getLowerLimit()) ? null : insuranceSchemeDetailPO.getLowerLimit(); + String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit(); + if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) { + //数值低于对应福利明细下限 + log.info("社保基数 {} 数值 {} 低于对应福利明细下限 {}!", entry.getKey(), entry.getValue(), lowerLimit); + return false; + } + if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) { + //数值高于对应福利明细上限 + log.info("社保基数 {} 数值 {} 高于对应福利明细上限 {} !", entry.getKey(), entry.getValue(), upperLimit); + return false; + } + } else { + log.info("福利明细项属于未缴费状态,不对上下限进行约束"); + } + + + } + return true; + } + + + /** + * 校验福利基数是否符合上下限要求,并返回符合要求的数据 + * @param primaryId + * @param paymentBaseString + * @return + */ + @Override + public String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { + + if (primaryId ==null || paymentBaseString == null) { + return paymentBaseString; + } + Map paymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + Map newPaymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + if (paymentBaseJson == null) { + return null; + } + + for (Map.Entry entry : paymentBaseJson.entrySet()) { + //判断福利值是否为空/数字 + if (entry.getValue() == null || entry.getValue().length() == 0) { + continue; + } else if (!isNumeric(entry.getValue())) { + log.info("福利值非数字!"); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + //根据福利方案id、险种id + List insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey())); + log.info("福利方案id: {},, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + if (insuranceSchemeDetailPOList.size() == 0) { + log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + List checkList = insuranceSchemeDetailPOList.stream() + .filter(f -> f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); + if (checkList.size() > 0) { + InsuranceSchemeDetailPO insuranceSchemeDetailPO = checkList.get(0); + encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class); + String lowerLimit = "0.000".equals(insuranceSchemeDetailPO.getLowerLimit()) ? null : insuranceSchemeDetailPO.getLowerLimit(); + String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit(); + if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) { + //数值低于对应福利明细下限 + log.info("社保基数 {} 数值 {} 低于对应福利明细下限 {}!", entry.getKey(), entry.getValue(), lowerLimit); + newPaymentBaseJson.put(entry.getKey(), lowerLimit); + } + if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) { + //数值高于对应福利明细上限 + log.info("社保基数 {} 数值 {} 高于对应福利明细上限 {} !", entry.getKey(), entry.getValue(), upperLimit); + newPaymentBaseJson.put(entry.getKey(), upperLimit); + } + } + } + return JSON.toJSONString(newPaymentBaseJson); + } + + /** + * 判断字符串是否为整数或者小数或者负数 + */ + public static boolean isNumeric(String str){ + + Pattern pattern = Pattern.compile("^-?\\d+(\\.\\d+)?$"); + Matcher isNum = pattern.matcher(str); + if (!isNum.matches()) { + return false; + } + return true; + + } + + /** + * 档案列表 + *

+ * 这里是一个含有比较多动态字段的列表,用的是手动拼装的方式 + * + * @param param 高级搜索条件 + * @param operateId 操作员id + * @return table + */ + public Map listPage(InsuranceArchivesListParam param, long operateId) { + Map apidatas = new HashMap<>(16); + InsuranceArchivesListParam request = InsuranceArchivesListParam.builder().build(); + if (param.getHireDate() != null && param.getHireDate().length == 2) { + param.setHiredateStart(param.getHireDate()[0]); + param.setHiredateEnd(param.getHireDate()[1]); + } + if (param.getDimissionDate() != null && param.getDimissionDate().length == 2) { + param.setDimissionDateStart(param.getDimissionDate()[0]); + param.setDimissionDateEnd(param.getDimissionDate()[1]); + } + + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getDepartmentIdsStr())) { + request.setDepartmentIds(Arrays.stream(param.getDepartmentIdsStr().split(",")).map(BigDecimal::new).collect(Collectors.toList())); + } + + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getSubcompanyIdsStr())) { + request.setSubcompanyIds(Arrays.stream(param.getSubcompanyIdsStr().split(",")).map(BigDecimal::new).collect(Collectors.toList())); + } + + + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getPositionsStr())) { + request.setPositions(Arrays.stream(param.getPositionsStr().split(",")).map(BigDecimal::new).collect(Collectors.toList())); + } + + if (org.apache.commons.lang.StringUtils.isNotBlank(param.getStatusesStr())) { + request.setStatuses(Arrays.stream(param.getStatusesStr().split(",")).map(String::new).collect(Collectors.toList())); + } + + request.setNeedAuth(param.getNeedAuth()); + request.setTaxAgentEmployeeIds(param.getTaxAgentEmployeeIds()); + request.setTaxAgentIds(param.getTaxAgentIds()); + + Integer current = param.getCurrent() == null ? 1 : param.getCurrent(); + Integer pageSize = param.getPageSize() == null ? 10 : param.getPageSize(); + long startNum = (current - 1) * pageSize; + param.setStartNum(startNum); + param.setPageSize(pageSize); +// request.setStatuses(param.getStatuses()); + request.setKeyword(param.getUserName()); + + request.setSiSchemeId(param.getSiSchemeId()); + request.setFundSchemeId(param.getFundSchemeId()); + request.setOtherSchemeId(param.getOtherSchemeId()); + + request.setPageSize(param.getPageSize()); + request.setCurrent(param.getCurrent()); + + request.setJobNum(param.getJobNum()); + + request.setOrderRule(param.getOrderRule()); + + request.setRunStatuses(param.getRunStatuses()); + + request.setTaxAgentId(param.getTaxAgentId()); + + request.setExtWelArchiveList(param.isExtWelArchiveList()); + + apidatas = listPageEmployeePOS(request, operateId); + + return apidatas; + } + + /** + * 获取员工的基本信息 + *

+ * 此处主要是一个公共接口,有多处引用。我们薪资系统只保存员工id(employeeId), + * 但是页面上需要展示员工的更多信息(姓名,部门,状态。。。), + * 所以这里主要是用于接收联表数据的一个接口 + * + * @param param 高级搜索条件,用于过滤数据 + * @param operateId 操作员id + * @return list + */ + public Map listPageEmployeePOS(InsuranceArchivesListParam param, long operateId) { + //是否分权 + Boolean needAuth = param.getNeedAuth(); + StopWatch sw = new StopWatch(); + Map datas = new HashMap<>(16); + + List page = new ArrayList<>(); + PageInfo pageInfo = new PageInfo<>(InsuranceArchivesEmployeePO.class); + //获取福利档案列表数据 + if (needAuth) { + Collection taxAgentEmployeeIds = param.getTaxAgentEmployeeIds(); + Collection taxAgentIds = param.getTaxAgentIds(); + log.info("从数据库获取档案列表数据开始"); + sw.start("获取福利档案列表数据"); + if (param.isExtWelArchiveList()) { + page = getSocialSchemeMapper().queryExtEmployeeList(param); + } else { + page = getSocialSchemeMapper().queryEmployeeList(param); + } + sw.stop(); + log.info("从数据库获取档案列表数据完成!"); + page = page.stream().filter(f -> +// taxAgentEmployeeIds.contains(f.getEmployeeId())|| + taxAgentIds.contains(f.getPaymentOrganization()) + ).collect(Collectors.toList()); + // 填充总数和当页数据 + // 分页参数 + pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), InsuranceArchivesEmployeePO.class); + pageInfo.setTotal(page.size()); + pageInfo.setList(SalaryPageUtil.subList(pageInfo.getPageNum(), pageInfo.getPageSize(), page)); + } else { + log.info("从数据库获取档案列表数据开始"); + sw.start("获取档案列表数据"); + if (param.isExtWelArchiveList()) { + page = getSocialSchemeMapper().queryExtEmployeeList(param); + } else { + page = getSocialSchemeMapper().queryEmployeeList(param); + } + sw.stop(); + log.info("从数据库获取档案列表数据完成!"); + pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), + page, InsuranceArchivesEmployeePO.class); + } + List> records = null; + log.info("buildTableData方法处理福利档案列表数据开始"); + sw.start("buildTableData方法处理福利档案列表数据"); + if (param.getExportData() != null && param.getExportData()) { + records = buildTableData(pageInfo.getList(), true); + } else { + records = buildTableData(pageInfo.getList(), false); + } + sw.stop(); + log.info("buildTableData方法处理福利档案列表数据完成!"); + + log.info("buildWeaTableColumns方法处理福利档案列表数据开始"); + sw.start("buildWeaTableColumns方法处理福利档案列表数据"); + List columns = buildWeaTableColumns(pageInfo.getList()); + sw.stop(); + log.info("buildWeaTableColumns方法处理福利档案列表数据完成!"); + WeaTable table = new WeaTable(); + table.setColumns(columns); + //设置check是否可用 + List checkboxpopedomList = new ArrayList<>(); + WeaTableCheckboxpopedom checkboxpopedom = new WeaTableCheckboxpopedom(); + checkboxpopedom.setPopedompara("column:system_type"); + checkboxpopedom.setShowmethod("com.engine.salary.transmethod.TaxRateTransMethod.getCheckBoxPopedom"); + checkboxpopedomList.add(checkboxpopedom); + table.setCheckboxList(checkboxpopedomList); + table.setCheckboxpopedom(null); + + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + datas.put("pageInfo", pageInfo); + datas.put("datas", records); + datas.put("columns", columns); + datas.put("dataKey", result.getResultMap()); + + log.info("各操作计时 {}", sw.prettyPrint()); + return datas; + } + + /** + * 高级搜索 + * + * @return + */ + public Map getSearchCondition() { + + List userStatusOptions = Arrays.stream(UserStatusEnum.values()).map(e -> new SearchConditionOption(String.valueOf(e.getValue()), e.getDefaultLabel())).collect(Collectors.toList()); +// List list = new SISchemeBiz().listAll(); + List list = getSISchemeService(user).listAll(); + + List schemeOption = list.stream().filter(item -> Objects.equals(item.getWelfareType(), WelfareTypeEnum.SOCIAL_SECURITY.getValue())) + .collect(Collectors.toList()) + .stream().map(item -> new SearchConditionOption(item.getId().toString(), item.getSchemeName())).collect(Collectors.toList()); + + List fundOption = list.stream().filter(item -> Objects.equals(item.getWelfareType(), WelfareTypeEnum.ACCUMULATION_FUND.getValue())) + .collect(Collectors.toList()) + .stream().map(item -> new SearchConditionOption(item.getId().toString(), item.getSchemeName())).collect(Collectors.toList()); + + List otherOption = list.stream().filter(item -> Objects.equals(item.getWelfareType(), WelfareTypeEnum.OTHER.getValue())) + .collect(Collectors.toList()) + .stream().map(item -> new SearchConditionOption(item.getId().toString(), item.getSchemeName())).collect(Collectors.toList()); + + List> taxAgentList = getTaxAgentWrapper(user).selectListAsAdmin(); + List taxAgentOption = taxAgentList.stream().map(item -> new SearchConditionOption(item.get("id").toString(), item.get("content").toString())).collect(Collectors.toList()); + + Map apidatas = new HashMap(); + ConditionFactory conditionFactory = new ConditionFactory(user); + //条件组 + List addGroups = new ArrayList(); + List conditionItems = new ArrayList(); + //文本输入框 + SearchConditionItem username = conditionFactory.createCondition(ConditionType.INPUT, 25034, "username"); + username.setInputType("input"); + username.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 + username.setFieldcol(16); //条件输入框所占宽度,默认值18 + username.setLabelcol(8); + username.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 + username.setLabel(SalaryI18nUtil.getI18nLabel(0,"姓名")); //设置文本值 这个将覆盖多语言标签的值 + conditionItems.add(username); + //文本输入框 + SearchConditionItem jobNum = conditionFactory.createCondition(ConditionType.INPUT, 25034, "jobNum"); + jobNum.setInputType("input"); + jobNum.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 + jobNum.setFieldcol(16); //条件输入框所占宽度,默认值18 + jobNum.setLabelcol(8); + jobNum.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 + jobNum.setLabel(SalaryI18nUtil.getI18nLabel(0,"工号")); //设置文本值 这个将覆盖多语言标签的值 + conditionItems.add(jobNum); + + SearchConditionItem departmentIds = conditionFactory.createCondition(ConditionType.BROWSER, 502329, "departmentIdsStr", "57"); + departmentIds.setColSpan(2); + departmentIds.setFieldcol(16); + departmentIds.setLabelcol(8); + departmentIds.setLabel(SalaryI18nUtil.getI18nLabel(0,"部门")); + conditionItems.add(departmentIds); + + SearchConditionItem statuses = conditionFactory.createCondition(ConditionType.SELECT, 502327, "statusesStr"); + statuses.setInputType("select"); + statuses.setMultiple(true); + statuses.setOptions(userStatusOptions); + statuses.setColSpan(2); + statuses.setFieldcol(16); + statuses.setLabelcol(8); + statuses.setIsQuickSearch(true); + statuses.setLabel(SalaryI18nUtil.getI18nLabel(0,"状态")); + conditionItems.add(statuses); + + SearchConditionItem positions = conditionFactory.createCondition(ConditionType.BROWSER, 502327, "positionsStr", "278"); + positions.setInputType("browser"); + positions.setColSpan(2); + positions.setFieldcol(16); + positions.setLabelcol(8); + positions.setIsQuickSearch(true); + positions.setLabel(SalaryI18nUtil.getI18nLabel(0,"岗位")); + conditionItems.add(positions); + + SearchConditionItem subcompanyIds = conditionFactory.createCondition(ConditionType.BROWSER, 502327, "subcompanyIdsStr", "194"); + subcompanyIds.setInputType("browser"); + subcompanyIds.setColSpan(2); + subcompanyIds.setFieldcol(16); + subcompanyIds.setLabelcol(8); + subcompanyIds.setIsQuickSearch(true); + subcompanyIds.setLabel(SalaryI18nUtil.getI18nLabel(0,"分部")); + conditionItems.add(subcompanyIds); + +// SearchConditionItem hireDate = conditionFactory.createCondition(ConditionType.TIMEPICKER,502327,new String[]{"hireDate", "hireDate"}); +// hireDate.setInputType("timepicker"); +// hireDate.setColSpan(2); +// hireDate.setFieldcol(16); +// hireDate.setViewAttr(8); +// hireDate.setFormat("yyyy-MM-dd"); +// hireDate.setLabel(SalaryI18nUtil.getI18nLabel(0,"入职日期")); +// conditionItems.add(hireDate); +// +// +// SearchConditionItem dimissionDate = conditionFactory.createCondition(ConditionType.TIMEPICKER,502327,new String[]{"dimissionDate", "dimissionDate"}); +// dimissionDate.setInputType("timepicker"); +// dimissionDate.setColSpan(2); +// dimissionDate.setFieldcol(16); +// dimissionDate.setViewAttr(8); +// dimissionDate.setFormat("yyyy-MM-dd"); +// dimissionDate.setLabel(SalaryI18nUtil.getI18nLabel(0,"离职日期")); +// conditionItems.add(dimissionDate); + + + SearchConditionItem siSchemeId = conditionFactory.createCondition(ConditionType.SELECT, 502327, "siSchemeId"); + siSchemeId.setInputType("select"); + siSchemeId.setOptions(schemeOption); + siSchemeId.setColSpan(2); + siSchemeId.setFieldcol(16); + siSchemeId.setLabelcol(8); + siSchemeId.setIsQuickSearch(true); + siSchemeId.setLabel(SalaryI18nUtil.getI18nLabel(0,"社保方案")); + conditionItems.add(siSchemeId); + + SearchConditionItem fundSchemeId = conditionFactory.createCondition(ConditionType.SELECT, 502327, "fundSchemeId"); + fundSchemeId.setInputType("select"); + fundSchemeId.setOptions(fundOption); + fundSchemeId.setColSpan(2); + fundSchemeId.setFieldcol(16); + fundSchemeId.setLabelcol(8); + fundSchemeId.setIsQuickSearch(true); + fundSchemeId.setLabel(SalaryI18nUtil.getI18nLabel(0,"公积金方案")); + conditionItems.add(fundSchemeId); + + SearchConditionItem otherSchemeId = conditionFactory.createCondition(ConditionType.SELECT, 502327, "otherSchemeId"); + otherSchemeId.setInputType("select"); + otherSchemeId.setOptions(otherOption); + otherSchemeId.setColSpan(2); + otherSchemeId.setFieldcol(16); + otherSchemeId.setLabelcol(8); + otherSchemeId.setIsQuickSearch(true); + otherSchemeId.setLabel(SalaryI18nUtil.getI18nLabel(0,"其他福利方案")); + conditionItems.add(otherSchemeId); + + SearchConditionItem taxAgentId = conditionFactory.createCondition(ConditionType.SELECT, 502327, "taxAgentId"); + taxAgentId.setInputType("select"); + taxAgentId.setOptions(taxAgentOption); + taxAgentId.setColSpan(2); + taxAgentId.setFieldcol(16); + taxAgentId.setLabelcol(8); + taxAgentId.setIsQuickSearch(true); + taxAgentId.setLabel(SalaryI18nUtil.getI18nLabel(0,"个税扣缴义务人")); + conditionItems.add(taxAgentId); + + addGroups.add(new SearchConditionGroup(SalaryI18nUtil.getI18nLabel(0,"常用条件"), true, conditionItems)); + apidatas.put("condition", addGroups); + return apidatas; + } + + @Override + public List getSocialByEmployeeIds(List employeeIds) { + + List> partition = Lists.partition(employeeIds, 1000); + List allList = new ArrayList<>(); + for (List longs : partition) { + List socialList = getSocialSchemeMapper().getSocialByEmployeeId(longs); + allList.addAll(socialList); + } + return allList; + } + + @Override + public List getFundByEmployeeIds(List employeeIds) { + + List> partition = Lists.partition(employeeIds, 1000); + List allList = new ArrayList<>(); + for (List longs : partition) { + List fundList = getFundSchemeMapper().getFundByEmployeeId(longs); + allList.addAll(fundList); + } + return allList; + } + + @Override + public List getOtherByEmployeeIds(List employeeIds) { + + List> partition = Lists.partition(employeeIds, 1000); + List allList = new ArrayList<>(); + for (List longs : partition) { + List otherList = getOtherSchemeMapper().getOtherByEmployeeId(longs); + allList.addAll(otherList); + } + return allList; + } + + /** + * 组装员工的社保,公积金,其他福利数据 + * + * @param ids 员工id集合 + * @return map + */ + @Override + public Map buildBatchAccount(List ids, Long paymentOrganization) { + if (org.apache.commons.collections.CollectionUtils.isEmpty(ids)) { + return new HashMap<>(); + } + //设置获取社保/公积金/其他福利档案方法的入参 + List insuranceArchivesEmployeePOS = new ArrayList<>(); + for (Long employeeId : ids) { + insuranceArchivesEmployeePOS.add(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); + } + + Map result = new HashMap<>(); + Map socialMap = new HashMap<>(); + Map funMap = new HashMap<>(); + Map otherMap = new HashMap<>(); + List socialPOS = encryptUtil.decryptList(this.getSocialByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesSocialSchemePO.class); + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(socialPOS)) { + socialMap = socialPOS.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); + } + List fundPOS = encryptUtil.decryptList(this.getFundByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesFundSchemePO.class); + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(fundPOS)) { + funMap = fundPOS.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); + } + List otherPOS = this.getOtherByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS); + encryptUtil.decryptList(otherPOS, InsuranceArchivesOtherSchemePO.class); + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(otherPOS)) { + otherMap = otherPOS.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); + } + for (Long id : ids) { + InsuranceArchivesAccountPO po = new InsuranceArchivesAccountPO(); + po.setSocial(socialMap.get(id)); + po.setFund(funMap.get(id)); + po.setOther(otherMap.get(id)); + result.put(id, po); + } + return result; + } + + @Override + public List dealSocialBaseAdjustInfoList(List adjustList, Long creator) { + List adjustHistoryList = new ArrayList<>(); + if (adjustList.size() > 0) { + //遍历待更新的福利档案数据,对每组档案生成基数调整记录(基数单元未变化则忽略) + for (InsuranceArchivesSocialSchemePO po : adjustList) { + List oldBaseInfoList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build()); + + InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(po.getSocialSchemeId()) + .adjustAfterBaseJson(po.getSocialPaymentBaseString()) + .adjustAfterComBaseJson(po.getSocialPaymentComBaseString()) + .welfareType(po.getWelfareType()) + .employeeId(po.getEmployeeId()) + .paymentOrganization(po.getPaymentOrganization()) + .build(); + if (oldBaseInfoList.size() == 1) { + //新增调整记录,变更 + InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0); + encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class); + adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getSocialPaymentComBaseString()); + adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId()); + } else if (oldBaseInfoList.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!")); + } + adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator)); + } + } + return adjustHistoryList; + + } + + @Override + public List dealFundBaseAdjustInfoList(List adjustList, Long creator) { + List adjustHistoryList = new ArrayList<>(); + if (adjustList.size() > 0) { + //遍历待更新的福利档案数据,对每组档案生成基数调整记录(基数单元未变化则忽略) + for (InsuranceArchivesFundSchemePO po : adjustList) { + List oldBaseInfoList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build()); + + InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(po.getFundSchemeId()) + .adjustAfterBaseJson(po.getFundPaymentBaseString()) + .adjustAfterComBaseJson(po.getFundPaymentComBaseString()) + .welfareType(po.getWelfareType()) + .employeeId(po.getEmployeeId()) + .paymentOrganization(po.getPaymentOrganization()) + .build(); + if (oldBaseInfoList.size() == 1) { + //新增调整记录,变更 + InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0); + encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class); + adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getFundPaymentComBaseString()); + adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId()); + } else if (oldBaseInfoList.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!")); + } + adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator)); + } + } + return adjustHistoryList; + } + + @Override + public List dealOtherBaseAdjustInfoList(List adjustList, Long creator) { + List adjustHistoryList = new ArrayList<>(); + if (adjustList.size() > 0) { + //遍历待更新的福利档案数据,对每组档案生成基数调整记录(基数单元未变化则忽略) + for (InsuranceArchivesOtherSchemePO po : adjustList) { + List oldBaseInfoList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build()); + + InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() + .adjustAfterSchemeId(po.getOtherSchemeId()) + .adjustAfterBaseJson(po.getOtherPaymentBaseString()) + .adjustAfterComBaseJson(po.getOtherPaymentComBaseString()) + .welfareType(po.getWelfareType()) + .employeeId(po.getEmployeeId()) + .paymentOrganization(po.getPaymentOrganization()) + .build(); + if (oldBaseInfoList.size() == 1) { + //新增调整记录,变更 + InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0); + encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class); + adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getOtherPaymentComBaseString()); + adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId()); + } else if (oldBaseInfoList.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利档案存在冗余数据!")); + } + adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator)); + } + } + return adjustHistoryList; + } + + /** + * 获取没有设置社保、公积金最后缴纳月的档案 + * @param employeeIds + * @return + */ + @Override + public List listEndDateIsNull(List employeeIds) { + if (org.apache.commons.collections.CollectionUtils.isEmpty(employeeIds)) { + return Collections.emptyList(); + } + return getInsuranceBaseInfoMapper().listEndDateIsNull(employeeIds); + } + + /** + * 获取没有设置社保、公积金最后缴纳月的档案 + * @param employeeIds + * @return + */ + @Override + public List listStartDateIsNull(List employeeIds) { + return getInsuranceBaseInfoMapper().listStartDateIsNull(employeeIds); + } + /*****以上代码为SIArchivesBiz中方法逻辑迁移,旨在减少Biz类的使用*****/ + + @Override + public List listInsuranceArchivesSocialSchemeByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + List> partition = Lists.partition(ids, 1000); + ArrayList resultList = new ArrayList<>(); + partition.forEach(list -> resultList.addAll(getSocialSchemeMapper().getSocialById(list))); + return resultList; + } + + @Override + public List listInsuranceArchivesFundSchemeByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + List> partition = Lists.partition(ids, 1000); + ArrayList resultList = new ArrayList<>(); + partition.forEach(list -> resultList.addAll(getFundSchemeMapper().getFundById(list))); + return resultList; + } + + @Override + public List listInsuranceArchivesOtherSchemeByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + List> partition = Lists.partition(ids, 1000); + ArrayList resultList = new ArrayList<>(); + partition.forEach(list -> resultList.addAll(getOtherSchemeMapper().getOtherById(list))); + return resultList; + } } diff --git a/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java b/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java index 167e15dd0..5fb9618b4 100644 --- a/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java @@ -4,15 +4,20 @@ import com.alibaba.fastjson.JSON; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.param.BalanceAccountBaseParam; import com.engine.salary.entity.siaccount.param.EditAccountDetailParam; import com.engine.salary.entity.siaccount.param.InspectAccountParam; +import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siarchives.po.*; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; @@ -21,6 +26,7 @@ import com.engine.salary.enums.sicategory.IsPaymentEnum; import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siarchives.FundSchemeMapper; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; @@ -28,13 +34,14 @@ import com.engine.salary.mapper.siarchives.OtherSchemeMapper; import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SIAccountService; import com.engine.salary.service.SIBalanceService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; @@ -87,6 +94,14 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { private EncryptUtil encryptUtil = new EncryptUtil(); + private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class); + } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + @Override public void del(InspectAccountParam param, Long employeeId) { @@ -98,7 +113,15 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { //根据id删除 List> partition = Lists.partition((List) param.getIds(), 100); partition.forEach(getInsuranceAccountDetailMapper()::batchDelAccountDetailsByIds); - + //记录操作日志 + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getIds().stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setTargetName(param.getIds().stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除补差核算记录")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除补差核算记录")); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); //刷新bill_batch表中统计信息 getSIAccountService(user).refreshBillBatch(param.getPaymentOrganization(), param.getBillMonth()); } @@ -266,14 +289,14 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { Long creator = (long) user.getUID(); Long paymentOrganization = param.getPaymentOrganization(); - InsuranceAccountDetailPO banlanceAccountPO = getInsuranceAccountDetailMapper().getOneByBpep(InsuranceAccountDetailPO.builder() + InsuranceAccountDetailPO balanceAccountPO = getInsuranceAccountDetailMapper().getOneByBpep(InsuranceAccountDetailPO.builder() .billMonth(billMonth) .paymentStatus(PaymentStatusEnum.BALANCE.getValue()) .employeeId(employeeId) .paymentOrganization(paymentOrganization) .build()); - if (banlanceAccountPO != null) { + if (balanceAccountPO != null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),545747, "补差数据已存在,不可重复新增!")); } @@ -330,6 +353,20 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { //刷新bill_batch表中统计信息 getSIAccountService(user).refreshBillBatch(paymentOrganization, billMonth); + //记录操作日志 + encryptUtil.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class); + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, paymentOrganization); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增补差")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增补差") + + ":" + taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setNewValues(insuranceAccountDetailPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } else { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),545746, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!")); } diff --git a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java index 0b040c8d3..0f7e9311d 100644 --- a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java @@ -1,19 +1,25 @@ package com.engine.salary.service.impl; +import com.api.browser.bean.SearchConditionItem; +import com.api.browser.bean.SearchConditionOption; +import com.api.browser.util.ConditionFactory; +import com.api.browser.util.ConditionType; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.cmd.sicategory.SICategoryGetFormCmd; -import com.engine.salary.cmd.sicategory.SICategoryInsertCmd; -import com.engine.salary.cmd.sicategory.SICategoryUpdateCmd; -import com.engine.salary.cmd.sicategory.SICategoryUpdateStatusByIdCmd; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; +import com.engine.salary.entity.sicategory.bo.ICategoryBO; import com.engine.salary.entity.sicategory.dto.ICategoryDTO; import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO; import com.engine.salary.entity.sicategory.dto.ICategoryListDTO; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam; +import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.sicategory.DataTypeEnum; +import com.engine.salary.enums.sicategory.IsPaymentEnum; import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -21,12 +27,14 @@ import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.service.RecordsBuildService; import com.engine.salary.service.SICategoryService; +import com.engine.salary.service.SISchemeService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.mzlion.core.utils.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -58,32 +66,102 @@ public class SICategoryServiceImpl extends Service implements SICategoryService private EncryptUtil encryptUtil = new EncryptUtil(); + private SISchemeService getSISchemeService(User user) { + return ServiceUtil.getService(SISchemeServiceImpl.class,user); + } + @Override public Map getForm(Map params) { - return commandExecutor.execute(new SICategoryGetFormCmd(params,user)); +// return commandExecutor.execute(new SICategoryGetFormCmd(params,user)); + Map apidatas = new HashMap<>(16); + Long id = (Long) params.get("id"); +// ICategoryFormDTO form = siCategoryBiz.getForm(id); + ICategoryFormDTO form = getForm(id); + apidatas.put("form",form); + ConditionFactory conditionFactory = new ConditionFactory(user); + Map items = new HashMap<>(); + + SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT,0, "insuranceName"); + input.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 + input.setFieldcol(12); //条件输入框所占宽度,默认值18 + input.setViewAttr(3); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 + input.setLength(10); // 设置输入长度 + input.setLabel(SalaryI18nUtil.getI18nLabel(0,"福利名称")); //设置文本值 这个将覆盖多语言标签的值 + input.setRules("required"); //设置字段填入规则 + + items.put("insuranceName",input); + + SearchConditionItem radio = conditionFactory.createCondition(ConditionType.RADIO,0,"welfareType"); + List radioOptions = new ArrayList <>(); + radioOptions.add(new SearchConditionOption("SOCIAL_SECURITY",SalaryI18nUtil.getI18nLabel(0,"社保"),true)); + radioOptions.add(new SearchConditionOption("ACCUMULATION_FUND",SalaryI18nUtil.getI18nLabel(0,"公积金"))); + radioOptions.add(new SearchConditionOption("OTHER",SalaryI18nUtil.getI18nLabel(0,"企业年金及其他福利"))); + radio.setColSpan(2); + radio.setFieldcol(12); + radio.setLabelcol(6); + radio.setViewAttr(3); + radio.setIsQuickSearch(false); + radio.setOptions(radioOptions); + radio.setLabel(SalaryI18nUtil.getI18nLabel(0,"类型")); + radio.setRules("required"); + items.put("welfareType",radio); + + SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX,0,"paymentScope"); + List checkOptions = new ArrayList <>(); + checkOptions.add(new SearchConditionOption("SCOPE_COMPANY",SalaryI18nUtil.getI18nLabel(0,"公司"))); + checkOptions.add(new SearchConditionOption("SCOPE_PERSON",SalaryI18nUtil.getI18nLabel(0,"个人"))); + checkbox.setColSpan(2); + checkbox.setFieldcol(12); + checkbox.setLabelcol(6); + checkbox.setViewAttr(3); + checkbox.setIsQuickSearch(false); + checkbox.setOptions(checkOptions); + checkbox.setLabel(SalaryI18nUtil.getI18nLabel(0,"缴纳对象")); + checkbox.setRules("required"); + items.put("paymentScope",checkbox); + + apidatas.put("item",items); + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(form.getId())); + loggerContext.setTargetName(form.getInsuranceName()); + loggerContext.setOperateType(OperateTypeEnum.READ.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "查看自定义福利明细")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "查看自定义福利明细") + ": " + form.getInsuranceName()); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + return apidatas; } @Override public Map insert(Map params) { - //校验重名 - if (checkSameName((ICategoryFormDTO)params.get("iCategoryFormDTO"))) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543857, "福利名称不允许重复")); - } - return commandExecutor.execute(new SICategoryInsertCmd(params,user)); +// return commandExecutor.execute(new SICategoryInsertCmd(params,user)); + Map apidatas = new HashMap<>(16); + ICategoryFormDTO iCategoryFormDTO = (ICategoryFormDTO)params.get("iCategoryFormDTO"); +// siCategoryBiz.save(iCategoryFormDTO,(long) user.getUID()); + save(iCategoryFormDTO,(long) user.getUID()); + return apidatas; } @Override public Map update(Map params) { - //校验重名 - if (checkSameName((ICategoryFormDTO)params.get("iCategoryFormDTO"))) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543857, "福利名称不允许重复")); - } - return commandExecutor.execute(new SICategoryUpdateCmd(params,user)); +// return commandExecutor.execute(new SICategoryUpdateCmd(params,user)); + Map apidatas = new HashMap(16); + ICategoryFormDTO iCategoryFormDTO = (ICategoryFormDTO) params.get("iCategoryFormDTO"); +// siCategoryBiz.update(iCategoryFormDTO, (long) user.getUID()); + update(iCategoryFormDTO); + return apidatas; } @Override public Map updateStatusById(Map params) { - return commandExecutor.execute(new SICategoryUpdateStatusByIdCmd(params,user)); +// return commandExecutor.execute(new SICategoryUpdateStatusByIdCmd(params,user)); + Map apidatas = new HashMap(16); + Long id = (Long) params.get("id"); + Integer isUse = (Integer) params.get("isUse"); +// siCategoryBiz.updateStatusById(id, isUse,(long) user.getUID()); + updateStatusById(id, isUse); + return apidatas; } @Override @@ -198,6 +276,16 @@ public class SICategoryServiceImpl extends Service implements SICategoryService .updateTime(new Date()) .build(); getICategoryMapper().updateNameAndPayScopeById(iCategoryPO); + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(iCategoryPO.getId())); + loggerContext.setTargetName(iCategoryPO.getInsuranceName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更新自定义福利信息")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更新自定义福利信息")); + loggerContext.setNewValues(iCategoryPO); + SalaryElogConfig.siCategoryLoggerTemplate.write(loggerContext); return null; } @@ -245,6 +333,16 @@ public class SICategoryServiceImpl extends Service implements SICategoryService //删除自定义福利项 categoryPO.setUpdateTime(new Date()); getICategoryMapper().deleteCustomCategoryById(categoryPO); + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(categoryPO.getId())); + loggerContext.setTargetName(categoryPO.getInsuranceName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建自定义福利项")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建自定义福利项")); +// loggerContext.setNewValues(categoryPO); + SalaryElogConfig.siCategoryLoggerTemplate.write(loggerContext); return null; } @@ -293,4 +391,142 @@ public class SICategoryServiceImpl extends Service implements SICategoryService || tradChineseNameAll.contains(Util.formatMultiLang(checkName, "8")) || englishNameAll.contains(Util.formatMultiLang(checkName, "9")); } + /*****以下代码为SICategoryBiz中逻辑迁移,旨在减少Biz类的使用*****/ + + /** + * 自定义福利表单 + * id == null ? 新建表单 : 查看已有数据内容表单 + * @param id 自定义福利主键 + * @return 表单 + */ + public ICategoryFormDTO getForm(Long id) { + if (id != null) { + ICategoryPO iCategoryPO = getICategoryPOByID(id); + ICategoryFormDTO iCategoryFormDTO = new ICategoryFormDTO(); + if (Objects.isNull(iCategoryPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"数据不存在")); + } + BeanUtils.copyProperties(iCategoryPO,iCategoryFormDTO); + iCategoryFormDTO.setWelfareType(SalaryEnumUtil.enumMatchByValue(iCategoryPO.getWelfareType(), WelfareTypeEnum.values(), WelfareTypeEnum.class)); + iCategoryFormDTO.setPaymentScope(SalaryEnumUtil.stringToEnums(iCategoryPO.getPaymentScope(), ",")); + return iCategoryFormDTO; + } + + return ICategoryFormDTO.builder().welfareType(WelfareTypeEnum.SOCIAL_SECURITY).build(); + } + + /** + * 根据id获取 + * @param id + * @return + */ + @Override + public ICategoryPO getICategoryPOByID(Long id) { + + ICategoryPO iCategoryPO = getICategoryMapper().getById(id); + return iCategoryPO; + + } + + /** + * 根据名称获取 + * @param insuranceName + * @return + */ + @Override + public List listByName(String insuranceName) { + + List iCategoryPOS = getICategoryMapper().listByName(insuranceName); + return iCategoryPOS; + + } + + /** + * 保存 + * @param iCategoryFormDTO + * @param employeeId DataTypeEnum.SYSTEM.getValue() + */ + public void save(ICategoryFormDTO iCategoryFormDTO, long employeeId) { + iCategoryFormDTO.setInsuranceName(StringUtils.trim(iCategoryFormDTO.getInsuranceName())); + List iCategoryPOS = listByName(iCategoryFormDTO.getInsuranceName()); + if (CollectionUtils.isNotEmpty(iCategoryPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"福利名称不允许重复")); + } + ICategoryPO iCategoryPO = ICategoryBO.convertToInsuranceCategoryPO(iCategoryFormDTO, employeeId); + getICategoryMapper().insert(iCategoryPO); + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(iCategoryPO.getId())); + loggerContext.setTargetName(iCategoryPO.getInsuranceName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建自定义福利项")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建自定义福利项")); + loggerContext.setNewValues(iCategoryPO); + SalaryElogConfig.siCategoryLoggerTemplate.write(loggerContext); + } + + /** + * 更新 + * @param iCategoryFormDTO + */ + public void update(ICategoryFormDTO iCategoryFormDTO) { + if (iCategoryFormDTO.getId() == null) { + throw new SalaryRunTimeException("id is required"); + } + ICategoryPO iCategoryPO = getICategoryPOByID(iCategoryFormDTO.getId()); + if (Objects.isNull(iCategoryPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"数据不存在")); + } + List iCategoryPOS = listByName(iCategoryFormDTO.getInsuranceName()); + if (CollectionUtils.isNotEmpty(iCategoryPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"福利名称不允许重复")); + } + iCategoryPO.setInsuranceName(iCategoryFormDTO.getInsuranceName()); +// iCategoryPO.setWelfareType(iCategoryFormDTO.getWelfareType().getValue()); +// iCategoryPO.setPaymentScope(SalaryEnumUtil.enumArrToString(iCategoryFormDTO.getPaymentScope())); + iCategoryPO.setUpdateTime(new Date()); + + getICategoryMapper().update(iCategoryPO); + + } + + /** + * 更新状态 + * @param id + * @param isUse + */ + public void updateStatusById(Long id, Integer isUse) { + + if(id == null) { + throw new SalaryRunTimeException("id is required"); + } + if (isUse == null) { + throw new SalaryRunTimeException("isUse is required"); + } +// List insuranceSchemeDetailPOS = new SISchemeBiz().queryListByInsuranceIdIsPayment(id, IsPaymentEnum.YES.getValue()); + List insuranceSchemeDetailPOS = getSISchemeService(user).queryListByInsuranceIdIsPayment(id, IsPaymentEnum.YES.getValue()); + if(CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS) && isUse == 0) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该福利开启缴费,不可删除(或停用)")); + } + ICategoryPO iCategoryPO = getICategoryPOByID(id); + if (Objects.isNull(iCategoryPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"数据记录不存在")); + } + iCategoryPO.setIsUse(isUse); + getICategoryMapper().updateById(iCategoryPO); + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(iCategoryPO.getId())); + loggerContext.setTargetName(iCategoryPO.getInsuranceName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "更新自定义福利状态")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "更新自定义福利状态")); + loggerContext.setNewValues(iCategoryPO); + SalaryElogConfig.siCategoryLoggerTemplate.write(loggerContext); + } + + /*****以上代码为SICategoryBiz中方法逻辑迁移,旨在减少Biz类的使用*****/ + } diff --git a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java index 043d7f8b7..03aba3d3d 100644 --- a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java @@ -6,26 +6,33 @@ import com.cloudstore.eccom.pc.table.WeaTable; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.dto.HrmInfoDTO; import com.engine.salary.entity.hrm.param.HrmQueryParam; import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO; import com.engine.salary.entity.siaccount.param.CompensationParam; +import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siaccount.po.InsuranceCompensationConfigPO; import com.engine.salary.entity.siaccount.po.InsuranceCompensationPO; import com.engine.salary.entity.sicategory.po.ICategoryPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.EmployMapper; +import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siaccount.InsuranceCompensationConfigMapper; import com.engine.salary.mapper.siaccount.InsuranceCompensationMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; @@ -33,7 +40,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.Column; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.springframework.beans.BeanUtils; import weaver.general.Util; import weaver.hrm.User; @@ -86,6 +93,15 @@ public class SICompensationServiceImpl extends Service implements SICompensation private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + + private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class); + } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + /** * 可调差人员 */ @@ -488,6 +504,20 @@ public class SICompensationServiceImpl extends Service implements SICompensation idList.add(insuranceCompensationPO.getId()); // result.put(param.getOriginId(), insuranceCompensationPO.getId().toString()); + //记录操作日志 + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(insuranceAccountDetailPO.getBillMonth(), insuranceAccountDetailPO.getPaymentOrganization()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(insuranceAccountDetailPO.getPaymentOrganization()); + DataCollectionEmployee empInfo = getEmployMapper().getEmployeeById(insuranceAccountDetailPO.getEmployeeId()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + insuranceAccountDetailPO.getBillMonth() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增调差")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增调差") + + ":" + taxAgentInfo.getName() + "-" + insuranceAccountDetailPO.getBillMonth() + "-" + empInfo.getUsername()); + loggerContext.setNewValues(insuranceCompensationPO); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } } @@ -530,6 +560,18 @@ public class SICompensationServiceImpl extends Service implements SICompensation .creator(currentEmployeeId).build(); }).collect(Collectors.toList()); configList.forEach(config -> getInsuranceCompensationConfigMapper().insert(config)); + //记录操作日志 + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(param.get(0).getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(param.get(0).getPaymentOrganization())); + loggerContext.setTargetName(taxAgentInfo.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-保存社保调差默认配置")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-保存社保调差默认配置") + + ":" + taxAgentInfo.getName()); + configList.forEach(loggerContext::setNewValues); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); return SalaryI18nUtil.getI18nLabel(user.getLanguage(),542493, "配置成功"); } diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index cb4fdca19..1d599279d 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -1,10 +1,12 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.SIAccountBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; @@ -14,20 +16,19 @@ import com.engine.salary.entity.siexport.param.InsuranceExportParam; import com.engine.salary.entity.siexport.po.AccountExportPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; import com.engine.salary.enums.sicategory.DataTypeEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.mapper.InsuranceExportMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; -import com.engine.salary.service.SIAccountService; -import com.engine.salary.service.SIExportService; -import com.engine.salary.service.SISchemeService; -import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.enums.OpenEnum; @@ -38,6 +39,7 @@ import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import org.springframework.beans.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -65,7 +67,9 @@ public class SIExportServiceImpl extends Service implements SIExportService { private EncryptUtil encryptUtil = new EncryptUtil(); - private SIAccountBiz siAccountBiz = new SIAccountBiz(); +// private SIAccountBiz siAccountBiz = new SIAccountBiz(); + +// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); private SISchemeService getSISchemeService(User user) { return ServiceUtil.getService(SISchemeServiceImpl.class, user); @@ -103,6 +107,10 @@ public class SIExportServiceImpl extends Service implements SIExportService { return ServiceUtil.getService(SIAccountServiceImpl.class, user); } + public SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class, user); + } + @Override public XSSFWorkbook exportOverView(InsuranceExportParam queryParam) { List insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(queryParam.getBillMonth(), StringUtils.isBlank(queryParam.getPaymentOrganization()) ? null : Long.valueOf(queryParam.getPaymentOrganization())); @@ -112,7 +120,8 @@ public class SIExportServiceImpl extends Service implements SIExportService { List paymentList =getTaxAgentMapper().listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542496, "该租户无扣缴义务人")); Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); - List insuranceAccountViewListDTOS = siAccountBiz.buildRecords(insuranceAccountDetailPOS, paymentMap, user); +// List insuranceAccountViewListDTOS = siAccountBiz.buildRecords(insuranceAccountDetailPOS, paymentMap, user); + List insuranceAccountViewListDTOS = getSIAccountService(user).buildRecords(insuranceAccountDetailPOS, paymentMap); List> excelSheetData = new ArrayList<>(); // 1.工作簿名称 @@ -144,8 +153,13 @@ public class SIExportServiceImpl extends Service implements SIExportService { rows.add(row); } excelSheetData.addAll(rows); - - + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账-导出总览")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账-导出总览")); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); return ExcelUtil.genWorkbookV2(excelSheetData, sheetName); } @@ -243,11 +257,23 @@ public class SIExportServiceImpl extends Service implements SIExportService { } excelSheetData.addAll(rows); - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName, total); + //记录操作日志 + PaymentStatusEnum targetEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, PaymentStatusEnum.values(), PaymentStatusEnum.class); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-导出") + + SalaryI18nUtil.getI18nLabel(targetEnum.getLabelId(), targetEnum.getDefaultLabel())); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-导出") + + SalaryI18nUtil.getI18nLabel(targetEnum.getLabelId(), targetEnum.getDefaultLabel())); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); + return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName, total); } @Override public List> buildCommonRecords(List list) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); List> result = new ArrayList<>(); List paymentList = getTaxAgentMapper().listAll(); @@ -275,10 +301,45 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("socialSchemeName", schemeIdNameMap.get(item.getSocialSchemeId())); if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", v); +// if (socialJson != null) { +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } @@ -287,22 +348,92 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("fundSchemeName", schemeIdNameMap.get(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", v); + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if (fundJson != null) { +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", paymentMap.get(item.getOtherPayOrg()) == null ? "" : paymentMap.get(item.getOtherPayOrg()).getName()); record.put("otherSchemeName", schemeIdNameMap.get(item.getOtherSchemeId())); if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", v); + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if (otherJson != null) { +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } @@ -646,58 +777,128 @@ public class SIExportServiceImpl extends Service implements SIExportService { } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if (socialJson != null) { socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if (fundJson != null) { fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if (otherJson != null) { otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"), social + "otherBase"); + } + }); + } // map根据value排序 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -712,6 +913,24 @@ public class SIExportServiceImpl extends Service implements SIExportService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index 753e95e3a..8b8d2dea9 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -5,7 +5,6 @@ import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO; @@ -26,7 +25,7 @@ import com.engine.salary.service.SIImportService; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; -import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -52,7 +51,7 @@ import java.util.stream.Collectors; public class SIImportServiceImpl extends Service implements SIImportService { private EncryptUtil encryptUtil = new EncryptUtil(); - private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); +// private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); public SIArchivesService getSIArchivesService(User user) { return ServiceUtil.getService(SIArchivesServiceImpl.class,user); @@ -196,6 +195,8 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public List buildHeader() { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); List result = new ArrayList<>(); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034,"姓名")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人")); @@ -208,24 +209,42 @@ public class SIImportServiceImpl extends Service implements SIImportService { // result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542513, "社保缴纳组织")); //社保福利基数 Map socialMap = welfareNameIdMap( WelfareTypeEnum.SOCIAL_SECURITY); - socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"))); + if (welBaseDiffSign) { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 81594, "社保账号")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542507, "社保起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542508, "社保最后缴纳月")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542269, "公积金方案名称")); - // result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542514, "公积金缴纳组织")); + // result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542514, "公积金缴纳组织")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542268, "公积金账号")); //公积金福利基数 Map fundMap = welfareNameIdMap( WelfareTypeEnum.ACCUMULATION_FUND); - fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"))); + if (welBaseDiffSign) { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( user.getLanguage(), 542283, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( user.getLanguage(), 542283, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( user.getLanguage(), 542283, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542270, "补充公积金账号")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542509, "公积金起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542510, "公积金最后缴纳月")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542271, "其他福利方案名称")); - // result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542515, "其他福利缴纳组织")); + // result.add(SalaryI18nUtil.getI18nLabel( 91497, "其他福利缴纳组织")); //其他福利基数 Map otherMap = welfareNameIdMap( WelfareTypeEnum.OTHER); - otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542283, "申报基数"))); + if (welBaseDiffSign) { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( user.getLanguage(), 542283, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( user.getLanguage(), 542283, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( user.getLanguage(), 542283, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542511, "其他福利起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542512, "其他福利最后缴纳月")); return result; @@ -291,19 +310,22 @@ public class SIImportServiceImpl extends Service implements SIImportService { } List employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList()); Map socialSchemePOMap = new HashMap<>(); - List socialSchemePOList = siArchivesBiz.getSocialByEmployeeIds(employeeIds); +// List socialSchemePOList = siArchivesBiz.getSocialByEmployeeIds(employeeIds); + List socialSchemePOList = getSIArchivesService(user).getSocialByEmployeeIds(employeeIds); encryptUtil.decryptList(socialSchemePOList, InsuranceArchivesSocialSchemePO.class, user); if (CollectionUtils.isNotEmpty(socialSchemePOList)) { socialSchemePOMap = socialSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); } - List fundSchemePOList = siArchivesBiz.getFundByEmployeeIds(employeeIds); +// List fundSchemePOList = siArchivesBiz.getFundByEmployeeIds(employeeIds); + List fundSchemePOList = getSIArchivesService(user).getFundByEmployeeIds(employeeIds); encryptUtil.encryptList(fundSchemePOList, InsuranceArchivesFundSchemePO.class, user); Map fundSchemePOMap = new HashMap<>(); if (CollectionUtils.isNotEmpty(fundSchemePOList)) { fundSchemePOMap = fundSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); } Map otherSchemePOMap = new HashMap<>(); - List otherSchemePOList = siArchivesBiz.getOtherByEmployeeIds(employeeIds); +// List otherSchemePOList = siArchivesBiz.getOtherByEmployeeIds(employeeIds); + List otherSchemePOList = getSIArchivesService(user).getOtherByEmployeeIds(employeeIds); encryptUtil.decryptList(otherSchemePOList, InsuranceArchivesOtherSchemePO.class, user); if (CollectionUtils.isNotEmpty(otherSchemePOList)) { otherSchemePOMap = otherSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); diff --git a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java index 36c7fa7d1..2bcb1b6a6 100644 --- a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.hrm.dto.HrmInfoDTO; import com.engine.salary.entity.hrm.param.HrmQueryParam; @@ -12,6 +14,8 @@ import com.engine.salary.entity.siaccount.param.RecessionParam; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.siaccount.ProjectTypeEnum; @@ -20,6 +24,7 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SIAccountService; import com.engine.salary.service.SIRecessionService; import com.engine.salary.service.TaxAgentService; @@ -65,6 +70,11 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() { return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class); } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + @Override public void save(RecessionParam param, Long employeeId) { @@ -112,13 +122,25 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic //删除已有退差记录 finalRecessionDetails.forEach(getInsuranceAccountDetailMapper()::deleteRecessionData); - //入库新数据 List> partition = Lists.partition((List) finalRecessionDetails, 20); partition.forEach(getInsuranceAccountDetailMapper()::batchSaveAccountDetails); - //刷新bill_batch表中统计信息 getSIAccountService(user).refreshBillBatch(Long.valueOf(param.getPaymentOrganization()), param.getBillMonth()); + //记录操作日志 + encryptUtil.decryptList(finalRecessionDetails, InsuranceAccountDetailPO.class); + InsuranceAccountBatchPO targetPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), Long.valueOf(param.getPaymentOrganization())); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增退差")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-新增退差") + + ":" + taxAgentInfo.getName() + "-" + targetPO.getBillMonth()); + finalRecessionDetails.forEach(loggerContext::setNewValues); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); } } @@ -137,7 +159,15 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic //根据id删除 List> partition = Lists.partition((List) ids, 100); partition.forEach(getInsuranceAccountDetailMapper()::batchDelAccountDetailsByIds); - + //记录操作日志 + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(ids.stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setTargetName(ids.stream().map(String::valueOf).collect(Collectors.joining(","))); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除退差核算记录")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利台账明细表-删除退差核算记录")); + SalaryElogConfig.siAccountLoggerTemplate.write(loggerContext); //刷新bill_batch表中统计信息 getSIAccountService(user).refreshBillBatch(refreshTargetPO.getPaymentOrganization(), refreshTargetPO.getBillMonth()); } @@ -197,6 +227,9 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic // temp.setExternalFlag(insuranceAccountDetailPO.getExternalFlag()); temp.setPaymentOrganization(insuranceAccountDetailPO.getPaymentOrganization()); // temp.setPaymentAgency(insuranceAccountDetailPO.getPaymentAgency()); + temp.setSocialPaymentComBaseString(insuranceAccountDetailPO.getSocialPaymentComBaseString()); + temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString()); + temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString()); } private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) { //退差社保个人缴费 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 5954ef924..07a5612eb 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -4,34 +4,43 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.SIArchivesBiz; -import com.engine.salary.biz.SISchemeBiz; -import com.engine.salary.cmd.sischeme.*; +import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; import com.engine.salary.entity.siarchives.param.SIArchiveImportParam; import com.engine.salary.entity.siarchives.po.*; import com.engine.salary.entity.sicategory.po.ICategoryPO; +import com.engine.salary.entity.sischeme.bo.InsuranceSchemeBO; +import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDTO; +import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDetailDTO; import com.engine.salary.entity.sischeme.dto.InsuranceSchemeListDTO; import com.engine.salary.entity.sischeme.param.InsuranceSchemeDetailUpdateParam; import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam; +import com.engine.salary.entity.sischeme.param.InsuranceSchemeReqParam; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; +import com.engine.salary.entity.sischeme.vo.InsuranceSchemeFormVO; +import com.engine.salary.entity.sischeme.vo.SISchemeTableVO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentManageRangeSaveParam; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.enums.siaccount.EmployeeStatusEnum; 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.SIAccountUtilMapper; import com.engine.salary.mapper.siarchives.FundSchemeMapper; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.siarchives.OtherSchemeMapper; @@ -44,12 +53,15 @@ import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; +import com.engine.salary.sys.enums.OpenEnum; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; @@ -57,7 +69,6 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -71,10 +82,13 @@ import weaver.general.Util; import weaver.hrm.User; import java.io.InputStream; +import java.math.BigDecimal; import java.util.*; import java.util.function.Function; +import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_AUTO_ADJUST; import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** @@ -128,8 +142,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { return ServiceUtil.getService(SIImportServiceImpl.class, user); } - private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); - private SISchemeBiz siSchemeBiz = new SISchemeBiz(); + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private SISchemeBiz siSchemeBiz = new SISchemeBiz(); private SalaryEmployeeService getSalaryEmployeeService(User user) { return (SalaryEmployeeService) ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); @@ -151,39 +165,147 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user); } + public SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class,user); + } + + private SIAccountUtilMapper getSIAccountUtilMapper() { + return SqlProxyHandle.getProxy(SIAccountUtilMapper.class); + } + + private EmployMapper getEmployMapper() { + return MapperProxyFactory.getProxy(EmployMapper.class); + } + @Override public Map getForm(Map params) { - return commandExecutor.execute(new SISchemeGetFormCmd(params, user)); +// return commandExecutor.execute(new SISchemeGetFormCmd(params, user)); + Map apidatas = new HashMap<>(16); + + Long id = null; + if (Objects.nonNull(params.get("id"))) { + id =Long.valueOf(Util.null2String(params.get("id"))); + } + WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum)params.get("welfareTypeEnum"); +// InsuranceSchemeFormVO form = siSchemeBiz.getForm(id, welfareTypeEnum); + InsuranceSchemeFormVO form = getForm(id, welfareTypeEnum); + apidatas.put("form",form); + //记录操作日志 + InsuranceSchemeDTO schemeBatch = form.getSchemeBatch(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(schemeBatch.getId())); + loggerContext.setTargetName(schemeBatch.getSchemeName()); + loggerContext.setOperateType(OperateTypeEnum.READ.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "查看福利方案明细")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "查看福利方案明细") + ": " + schemeBatch.getSchemeName()); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + return apidatas; } @Override public Map insertScheme(Map params) { - return commandExecutor.execute(new SISchemeInsertCmd(params, user)); +// return commandExecutor.execute(new SISchemeInsertCmd(params, user)); + Map apidatas = new HashMap(16); + InsuranceSchemeReqParam insuranceSchemeReqParam = (InsuranceSchemeReqParam) params.get("insuranceSchemeReqParam"); +// siSchemeBiz.save(insuranceSchemeReqParam, (long) user.getUID()); + save(insuranceSchemeReqParam, (long) user.getUID()); + return apidatas; } @Override public Map update(Map params) { - return commandExecutor.execute(new SISchemeUpdateCmd(params, user)); +// return commandExecutor.execute(new SISchemeUpdateCmd(params, user)); + Map apidatas = new HashMap(16); + InsuranceSchemeReqParam insuranceSchemeReqParam = (InsuranceSchemeReqParam) params.get("insuranceSchemeReqParam"); +// siSchemeBiz.update(insuranceSchemeReqParam, (long) user.getUID()); + update(insuranceSchemeReqParam, (long) user.getUID()); + return apidatas; } @Override public Map delete(Map params) { - return commandExecutor.execute(new SISchemeDeleteCmd(params, user)); +// return commandExecutor.execute(new SISchemeDeleteCmd(params, user)); + Map apidatas = new HashMap(16); + Collection ids = (Collection)params.get("ids"); + if (CollectionUtils.isEmpty(ids)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"参数错误")); + } + //校验带上类型 + int welfareTypeId = (Integer) params.get("welfareTypeId"); + if(WelfareTypeEnum.SOCIAL_SECURITY.getValue() == welfareTypeId){ +// int num = siSchemeBiz.checkBeforeDeleteSocialscheme(params); + int num = checkBeforeDeleteSocialscheme(params); + if (num > 0){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该社保方案已被使用")); + } + } + if(WelfareTypeEnum.ACCUMULATION_FUND.getValue() == welfareTypeId){ +// int accumulationfundNum = siSchemeBiz.checkBeforeDeleteAccumulationfund(params); + int accumulationfundNum = checkBeforeDeleteAccumulationfund(params); + if (accumulationfundNum > 0){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该公积金方案已被使用")); + } + } + if(WelfareTypeEnum.OTHER.getValue() == welfareTypeId){ +// int otherschemeNum = siSchemeBiz.checkBeforeDeleteOtherscheme(params); + int otherschemeNum = checkBeforeDeleteOtherscheme(params); + if (otherschemeNum > 0){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该其他福利方案已被使用")); + } + } + +// int billNum = siSchemeBiz.checkBeforeDeleteBill(params,welfareTypeId); + int billNum = checkBeforeDeleteBill(params,welfareTypeId); + if (billNum > 0){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该福利方案已被核算")); + } +// siSchemeBiz.deleteSocialscheme(params); + deleteSocialscheme(params); + + return apidatas; } @Override public Map copyScheme(Map params) { - return commandExecutor.execute(new SISchemeCopyCmd(params, user)); +// return commandExecutor.execute(new SISchemeCopyCmd(params, user)); + Map apidatas = new HashMap(16); + Long id = (Long) params.get("id"); + String schemeName = Util.null2String(params.get("schemeName")); +// siSchemeBiz.copy(id,schemeName,(long) user.getUID()); + copy(id,schemeName,(long) user.getUID()); + return apidatas; } @Override public List queryListByInsuranceIdIsPayment(Long insuranceId, Integer isPayment) { - return new SISchemeBiz().queryListByInsuranceIdIsPayment(insuranceId, isPayment); +// return new SISchemeBiz().queryListByInsuranceIdIsPayment(insuranceId, isPayment); + + List insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().queryListByInsuranceIdIsPayment(insuranceId, isPayment); + encryptUtil.decryptList(insuranceSchemeDetailPOList, InsuranceSchemeDetailPO.class); + return insuranceSchemeDetailPOList; } @Override public Map listPage(Map params) { - return commandExecutor.execute(new SISchemeListCmd(params, user)); +// return commandExecutor.execute(new SISchemeListCmd(params, user)); + SalaryWeaTable table = new SalaryWeaTable<>(user,SISchemeTableVO.class); + String sqlWhere = buildSqlWhere(params); + table.setSqlwhere(sqlWhere); + + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + return result.getResultMap(); + } + + private String buildSqlWhere(Map params) { + String sqlWhere = "where a.id = b.primary_id and b.insurance_id = c.id and a.delete_Type = 0"; + Integer welfareType = (Integer)params.get("welfareType"); + if (Objects.nonNull(welfareType)){ + sqlWhere += " and a.welfare_type ="+welfareType; + } + return sqlWhere; } @Override @@ -263,6 +385,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { @Override public List> buildTableData(List insuranceArchivesEmployeePOS) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); List> records = new ArrayList<>(); List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -280,17 +404,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { end = employeeIds.size(); } List ids = employeeIds.subList(i, end); - socialList.addAll(encryptUtil.decryptList(siArchivesBiz.getSocialByEmployeeIds(ids), InsuranceArchivesSocialSchemePO.class, user)); - fundList.addAll(encryptUtil.decryptList(siArchivesBiz.getFundByEmployeeIds(ids), InsuranceArchivesFundSchemePO.class, user)); - otherList.addAll(encryptUtil.decryptList(siArchivesBiz.getOtherByEmployeeIds(ids), InsuranceArchivesOtherSchemePO.class, user)); + socialList.addAll(encryptUtil.decryptList(getSIArchivesService(user).getSocialByEmployeeIds(ids), InsuranceArchivesSocialSchemePO.class, user)); + fundList.addAll(encryptUtil.decryptList(getSIArchivesService(user).getFundByEmployeeIds(ids), InsuranceArchivesFundSchemePO.class, user)); + otherList.addAll(encryptUtil.decryptList(getSIArchivesService(user).getOtherByEmployeeIds(ids), InsuranceArchivesOtherSchemePO.class, user)); } Map socialSchemePOMap = SalaryEntityUtil.convert2Map(socialList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); Map fundSchemePOMap = SalaryEntityUtil.convert2Map(fundList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); Map otherSchemePOMap = SalaryEntityUtil.convert2Map(otherList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); -// Map socialSchemePOMap = socialList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); -// Map fundSchemePOMap = fundList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); -// Map otherSchemePOMap = otherList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); insuranceArchivesEmployeePOS.forEach(item -> { InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); @@ -311,15 +432,39 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("socialName", getSiSchemeService().querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); @@ -330,15 +475,39 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); @@ -349,15 +518,39 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("otherName", getSiSchemeService().querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 +// List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + List insuranceIdList = getSIArchivesService(user).payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); @@ -441,11 +634,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } //工作簿数据 - List> rows = new LinkedList<>(); - List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); + List> rows = new LinkedList<>(); + List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); rows.add(collect); for (Map recordData : records) { - List row = new LinkedList<>(); + List row = new LinkedList<>(); for (WeaTableColumn column : columns) { try { Object o = recordData.get(column.getColumn()); @@ -468,8 +661,15 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { // .handlerName("insuranceArchivesExportHandler") // .dataType(SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 99915, "档案")) // .function(exportMap.get("function")).build(), sheetList); + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案导出")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利档案导出")); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); //获取excel - return ExcelUtilPlus.genWorkbook(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -560,12 +760,20 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, Long employeeId) { +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); + Map> result = new HashMap<>(); Set socialSet = new HashSet<>(); Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { - List socialByEmployeeId = siArchivesBiz.getSocialByEmployeeIds(new ArrayList() {{ + List socialByEmployeeId = getSIArchivesService(user).getSocialByEmployeeIds(new ArrayList() {{ add(item.getEmployeeId()); }}); encryptUtil.decryptList(socialByEmployeeId, InsuranceArchivesSocialSchemePO.class, user); @@ -575,7 +783,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } InsuranceArchivesFundSchemePO fundItem = null; - List fundByEmployeeId = siArchivesBiz.getFundByEmployeeIds(new ArrayList() {{ + List fundByEmployeeId = getSIArchivesService(user).getFundByEmployeeIds(new ArrayList() {{ add(item.getEmployeeId()); }}); encryptUtil.decryptList(fundByEmployeeId, InsuranceArchivesFundSchemePO.class, user); @@ -585,7 +793,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } InsuranceArchivesOtherSchemePO otherItem = null; - List otherByEmployeeId = siArchivesBiz.getOtherByEmployeeIds(new ArrayList() {{ + List otherByEmployeeId = getSIArchivesService(user).getOtherByEmployeeIds(new ArrayList() {{ add(item.getEmployeeId()); }}); encryptUtil.decryptList(otherByEmployeeId, InsuranceArchivesOtherSchemePO.class, user); @@ -599,6 +807,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } if (fundItem != null) { Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { @@ -606,6 +822,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } if (otherItem != null) { Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { @@ -613,72 +837,122 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - //获取福利险种名(多语言) - String insuranceName = ""; - if(socialCollect.get(Long.valueOf(item)) != null && socialCollect.get(Long.valueOf(item)).getInsuranceName() != null) { + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + //获取福利险种名(多语言) + String insuranceName = ""; + if(socialCollect.get(Long.valueOf(item)) != null && socialCollect.get(Long.valueOf(item)).getInsuranceName() != null) { // insuranceName = socialCollect.get(Long.valueOf(item)).getLabelId() != null // ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),socialCollect.get(Long.valueOf(item)).getLabelId(),socialCollect.get(Long.valueOf(item)).getInsuranceName()) // : socialCollect.get(Long.valueOf(item)).getInsuranceName(); - //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name - insuranceName = Util.formatMultiLang(socialCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); - } - socialMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name + insuranceName = Util.formatMultiLang(socialCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); + } + socialMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); // socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - } - }); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - //获取福利险种名(多语言) - String insuranceName = ""; - if(fundCollect.get(Long.valueOf(item)) != null && fundCollect.get(Long.valueOf(item)).getInsuranceName() != null) { + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + //获取福利险种名(多语言) + String insuranceName = ""; + if(fundCollect.get(Long.valueOf(item)) != null && fundCollect.get(Long.valueOf(item)).getInsuranceName() != null) { // insuranceName = fundCollect.get(Long.valueOf(item)).getLabelId() != null // ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),fundCollect.get(Long.valueOf(item)).getLabelId(),fundCollect.get(Long.valueOf(item)).getInsuranceName()) // : fundCollect.get(Long.valueOf(item)).getInsuranceName(); - //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name - insuranceName = Util.formatMultiLang(fundCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); - } - fundMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name + insuranceName = Util.formatMultiLang(fundCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); + } + fundMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); // fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - } - }); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - //获取福利险种名(多语言) - String insuranceName = ""; - if(otherCollect.get(Long.valueOf(item)) != null && otherCollect.get(Long.valueOf(item)).getInsuranceName() != null) { + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + //获取福利险种名(多语言) + String insuranceName = ""; + if(otherCollect.get(Long.valueOf(item)) != null && otherCollect.get(Long.valueOf(item)).getInsuranceName() != null) { // insuranceName = otherCollect.get(Long.valueOf(item)).getLabelId() != null // ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),otherCollect.get(Long.valueOf(item)).getLabelId(),otherCollect.get(Long.valueOf(item)).getInsuranceName()) // : otherCollect.get(Long.valueOf(item)).getInsuranceName(); - //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name - insuranceName = Util.formatMultiLang(otherCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); - } - otherMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + //20231113逻辑变更,对福利险种、薪资项目、薪资项目分组的名称舍弃基于labelId的多语言适配逻辑,直接以多语言命名方式设置name + insuranceName = Util.formatMultiLang(otherCollect.get(Long.valueOf(item)).getInsuranceName(), String.valueOf(user.getLanguage())); + } + otherMap.put(item, insuranceName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); // otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - } - }); + } + }); + } // map根据key排序 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() @@ -693,6 +967,23 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); @@ -722,6 +1013,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { /** * 导入的数据插入到数据库中 */ + @Override public Map batchImportEbatch(SIArchiveImportParam param) { ValidUtil.doValidator(param); param.setProcess(false); @@ -919,7 +1211,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { isError = true; } //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - employees = getSalaryEmployeeService(user).matchImportEmployee(employeeByIds, userName, deparmentName, mobile, workcode, null); + employees = getSalaryEmployeeService(user).matchImportEmployee(confValue,employeeByIds, userName, deparmentName, mobile, workcode, null); } else { employees = employeeByIds.stream().filter(f -> f.getEmployeeId().equals(addEmployeeId)).collect(Collectors.toList()); } @@ -1160,41 +1452,79 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO = buildOtherPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } /**************校验申报基数**************/ - for (Map.Entry entry : welfareMap.entrySet()) { - String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"); - String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); - if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),508795, "请输入数字")); - excelComments.add(errorMessageMap); - isError = true; +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); + if (welBaseDiffSign) { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyPerName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"); + String keyComName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"); + String numberPerValue = findElement(singleAccount, keyPerName).get(keyPerName) == null ? "" : findElement(singleAccount, keyPerName).get(keyPerName).toString(); + String numberComValue = findElement(singleAccount, keyComName).get(keyComName) == null ? "" : findElement(singleAccount, keyComName).get(keyComName).toString(); + + if (!"".equals(numberPerValue) && !NumberUtils.isParsable(numberPerValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyPerName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } + if (!"".equals(numberComValue) && !NumberUtils.isParsable(numberComValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyComName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } + } + } else { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数"); + String numberValue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); + if (!"".equals(numberValue) && !NumberUtils.isParsable(numberValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(user.getLanguage(),508795, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } } } + //生成福利档案基础信息数据 InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = buildBaseInfoPO(employeeId, singleAccount, paymentNameIdMap, creator, runStatus, employees.get(0).isExtEmp()); - if (!isError) { + + //判断是否福利档案导入时,不符合上下限的基数调整为上限/下限 + SalarySysConfPO welBaseAutoAdjust = getSalarySysConfService(user).getOneByCode(WEL_BASE_AUTO_ADJUST); + boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue()); + + if (!isError && !welBaseAutoAdjustSign) { insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO); insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO); insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO); //校验福利基数是否符合上下限要求, - Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), user); + Boolean socialCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), user); + Boolean fundCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), user); + Boolean otherCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - if (socialCheckBase && fundCheckBase && otherCheckBase) { + Boolean socialCheckComBase = true; + Boolean fundCheckComBase = true; + Boolean otherCheckComBase = true; + if (welBaseDiffSign) { + socialCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + } + if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) { insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); } else { String checkMessage = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542543, "该条数据中") + ","; - if (!socialCheckBase) { + if (!socialCheckBase || !socialCheckComBase) { checkMessage = checkMessage + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542544, "社保福利基数") + "、"; } - if (!fundCheckBase) { + if (!fundCheckBase || !fundCheckComBase) { checkMessage = checkMessage + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542545, "公积金福利基数") + "、"; } - if (!otherCheckBase) { + if (!otherCheckBase || !otherCheckComBase) { checkMessage = checkMessage + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542546, "其他福利基数") + "、"; } checkMessage = checkMessage.substring(0, checkMessage.length() - 1); @@ -1206,6 +1536,32 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { isError = true; } + } else if (!isError) { + //校验福利基数是否符合上下限要求,不符合上下限的基数调整为上限 /下限 + String newSocialPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + String newFundPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + String newOtherPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + + insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString); + insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString); + insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString); + + if (welBaseDiffSign) { + String newSocialPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + String newFundPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + String newOtherPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + + insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(newSocialPaymentComBaseString); + insuranceArchivesFundSchemePO.setFundPaymentComBaseString(newFundPaymentComBaseString); + insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(newOtherPaymentComBaseString); + } + + insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO); + insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO); + insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); + insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO); + + insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); } return isError; } @@ -1239,12 +1595,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String socialAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(user.getLanguage(),81594, "社保账号")).get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),81594, "社保账号")); Long socialSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542267, "社保方案名称")).get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542267, "社保方案名称"))); HashMap oldSocialBaseMap = new HashMap<>(); + HashMap oldSocialComBaseMap = new HashMap<>(); if (oldSocialSchemeInfos.size() > 0) { oldSocialSchemePO = oldSocialSchemeInfos.get(0); encryptUtil.decrypt(oldSocialSchemePO, InsuranceArchivesSocialSchemePO.class, user); BeanUtils.copyProperties(oldSocialSchemePO, insuranceArchivesSocialSchemePO); //社保基数 oldSocialBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + oldSocialComBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesSocialSchemePO.setId(IdGenerator.generate()); @@ -1279,21 +1637,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesSocialSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue()); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class, user); + +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); HashMap socialPaymentBase = new HashMap<>(); + HashMap socialPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialComBaseMap != null && StringUtils.isNotBlank(oldSocialComBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentComBase.put(String.valueOf(insuranceId), oldSocialComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } } } + } insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase)); } @@ -1320,12 +1706,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String supplementFundAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542270, "补充公积金账号")).get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542270, "补充公积金账号")); Long fundSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542269, "公积金方案名称")).get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542269, "公积金方案名称"))); HashMap oldFundBaseMap = new HashMap<>(); + HashMap oldFundComBaseMap = new HashMap<>(); if (oldFundSchemeInfos.size() > 0) { oldFundSchemePO = oldFundSchemeInfos.get(0); encryptUtil.decrypt(oldFundSchemePO, InsuranceArchivesFundSchemePO.class, user); BeanUtils.copyProperties(oldFundSchemePO, insuranceArchivesFundSchemePO); //社保基数 oldFundBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + oldFundComBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesFundSchemePO.setId(IdGenerator.generate()); @@ -1363,24 +1751,50 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesFundSchemePO.getFundSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class, user); +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap fundPaymentBase = new HashMap<>(); + HashMap fundPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundComBaseMap != null && StringUtils.isNotBlank(oldFundComBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentComBase.put(String.valueOf(insuranceId), oldFundComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesFundSchemePO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542283, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBase)); } return insuranceArchivesFundSchemePO; } @@ -1402,12 +1816,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //设置其他福利方案、起始缴纳月、最后缴纳月 Long otherSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542271, "其他福利方案名称")).get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542271, "其他福利方案名称"))); HashMap oldOtherBaseMap = new HashMap<>(); + HashMap oldOtherComBaseMap = new HashMap<>(); if (oldOtherSchemeInfos.size() > 0) { oldOtherSchemePO = oldOtherSchemeInfos.get(0); encryptUtil.decrypt(oldOtherSchemePO, InsuranceArchivesOtherSchemePO.class, user); BeanUtils.copyProperties(oldOtherSchemePO, insuranceArchivesOtherSchemePO); //社保基数 oldOtherBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + oldOtherComBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesOtherSchemePO.setId(IdGenerator.generate()); @@ -1438,9 +1854,12 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO.setEmployeeId(employeeId); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesOtherSchemePO.getOtherSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class, user); +// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap otherPaymentBase = new HashMap<>(); + HashMap otherPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; @@ -1451,11 +1870,40 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { socialPaymentBase.put(String.valueOf(insuranceId), itemValue); } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { socialPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherComBaseMap != null && StringUtils.isNotBlank(oldOtherComBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentComBase.put(String.valueOf(insuranceId), oldOtherComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBase)); } return insuranceArchivesOtherSchemePO; } @@ -1482,16 +1930,24 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } public void handleImportData(List insuranceArchivesAccountPOS, SIArchiveImportParam param) { + List baseInfoPOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getBaseInfo).collect(Collectors.toList()); + //去除员工id+个税扣缴义务人下重复的数据 + baseInfoPOS = baseInfoPOS.stream() + .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); + //老数据map + Map oldSocialArchiveMap = getSocialArchiveMap(baseInfoPOS); + Map oldFundArchiveMap = getFundArchiveMap(baseInfoPOS); + Map oldOtherArchiveMap = getOtherArchiveMap(baseInfoPOS); //导入社保档案 List socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(socialSchemePOS)) { - //去除员工id+个税扣缴义务人下重复的数据 socialSchemePOS = socialSchemePOS.stream() .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); //生成福利档案基数调整历史记录 - List adjustSocialHistoryPOList = siArchivesBiz.dealSocialBaseAdjustInfoList(socialSchemePOS, (long) user.getUID()); +// List adjustSocialHistoryPOList = siArchivesBiz.dealSocialBaseAdjustInfoList(socialSchemePOS, (long) user.getUID()); + List adjustSocialHistoryPOList = getSIArchivesService(user).dealSocialBaseAdjustInfoList(socialSchemePOS, (long) user.getUID()); //根据人员id和个税扣缴义务人id删除对应旧档案 socialSchemePOS.forEach(getSocialSchemeMapper()::deleteByEmployeeIdAndPayOrg); @@ -1502,18 +1958,19 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { partition.forEach(getSocialSchemeMapper()::batchSave); //新建福利档案基数调整历史记录 - siArchivesBiz.batchInsertAdjustHistory(adjustSocialHistoryPOList, user.getUID()); +// siArchivesBiz.batchInsertAdjustHistory(adjustSocialHistoryPOList, user.getUID()); + getSIArchivesService(user).batchInsertAdjustHistory(adjustSocialHistoryPOList); } //导入公积金档案 List fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(fundSchemePOS)) { - //去除员工id+个税扣缴义务人下重复的数据 fundSchemePOS = fundSchemePOS.stream() .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); //生成福利档案基数调整历史记录 - List adjustFundHistoryPOList = siArchivesBiz.dealFundBaseAdjustInfoList(fundSchemePOS, (long) user.getUID()); +// List adjustFundHistoryPOList = siArchivesBiz.dealFundBaseAdjustInfoList(fundSchemePOS, (long) user.getUID()); + List adjustFundHistoryPOList = getSIArchivesService(user).dealFundBaseAdjustInfoList(fundSchemePOS, (long) user.getUID()); //根据人员id和个税扣缴义务人id删除对应档案 fundSchemePOS.forEach(getFundSchemeMapper()::deleteByEmployeeIdAndPayOrg); //新建新档案 @@ -1521,18 +1978,19 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List> partition = Lists.partition(insuranceArchivesFundSchemePOS, 100); partition.forEach(getFundSchemeMapper()::batchSave); //新建福利档案基数调整历史记录 - siArchivesBiz.batchInsertAdjustHistory(adjustFundHistoryPOList, user.getUID()); +// siArchivesBiz.batchInsertAdjustHistory(adjustFundHistoryPOList, user.getUID()); + getSIArchivesService(user).batchInsertAdjustHistory(adjustFundHistoryPOList); } //导入其他福利档案 List otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(otherSchemePOS)) { - //去除员工id+个税扣缴义务人下重复的数据 otherSchemePOS = otherSchemePOS.stream() .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); //生成福利档案基数调整历史记录 - List adjustOtherHistoryPOList = siArchivesBiz.dealOtherBaseAdjustInfoList(otherSchemePOS, (long) user.getUID()); +// List adjustOtherHistoryPOList = siArchivesBiz.dealOtherBaseAdjustInfoList(otherSchemePOS, (long) user.getUID()); + List adjustOtherHistoryPOList = getSIArchivesService(user).dealOtherBaseAdjustInfoList(otherSchemePOS, (long) user.getUID()); //根据人员id和个税扣缴义务人id删除对应档案 otherSchemePOS.forEach(getOtherSchemeMapper()::deleteByEmployeeIdAndPayOrg); @@ -1541,15 +1999,16 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List> partition = Lists.partition(insuranceArchivesOtherSchemePOS, 100); partition.forEach(getOtherSchemeMapper()::batchSave); //新建福利档案基数调整历史记录 - siArchivesBiz.batchInsertAdjustHistory(adjustOtherHistoryPOList, user.getUID()); +// siArchivesBiz.batchInsertAdjustHistory(adjustOtherHistoryPOList, user.getUID()); + getSIArchivesService(user).batchInsertAdjustHistory(adjustOtherHistoryPOList); } //导入福利档案基础信息 - List baseInfoPOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getBaseInfo).collect(Collectors.toList()); +// List baseInfoPOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getBaseInfo).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(baseInfoPOS)) { // baseInfoPOS = baseInfoPOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesBaseInfoPO::getEmployeeId))), ArrayList::new)); - //去除员工id+个税扣缴义务人下重复的数据 - baseInfoPOS = baseInfoPOS.stream() - .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); +// //去除员工id+个税扣缴义务人下重复的数据 +// baseInfoPOS = baseInfoPOS.stream() +// .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 baseInfoPOS.forEach(getInsuranceBaseInfoMapper()::deleteByEmployeeIdAndPayOrg); //分批批量删除 @@ -1574,6 +2033,54 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //分批批量入库 List> partition = Lists.partition(newInsuranceArchivesBaseInfoList, 100); partition.forEach(getInsuranceBaseInfoMapper()::batchSave); + //记录操作日志 + //获取新数据map和老数据map + Map newSocialArchiveMap = getSocialArchiveMap(baseInfoPOS); + Map newFundArchiveMap = getFundArchiveMap(baseInfoPOS); + Map newOtherArchiveMap = getOtherArchiveMap(baseInfoPOS); + newInsuranceArchivesBaseInfoList.forEach(targetPO -> { + InsuranceArchivesSocialSchemePO targetSocialDetail = newSocialArchiveMap.get(targetPO.getPaymentOrganization() + "-" + targetPO.getEmployeeId()); + InsuranceArchivesFundSchemePO targetFundDetail = newFundArchiveMap.get(targetPO.getPaymentOrganization() + "-" + targetPO.getEmployeeId()); + InsuranceArchivesOtherSchemePO targetOtherDetail = newOtherArchiveMap.get(targetPO.getPaymentOrganization() + "-" + targetPO.getEmployeeId()); + DataCollectionEmployee empInfo = getSalaryEmployeeService(user).getEmployeeById(targetPO.getEmployeeId()); + TaxAgentPO taxAgentInfo = getTaxAgentMapper().getById(targetPO.getPaymentOrganization()); + if (targetSocialDetail != null) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案-社保明细导入")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利档案-社保明细导入") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOldValues(oldSocialArchiveMap.get(targetPO.getPaymentOrganization() + "-" + targetPO.getEmployeeId())); + loggerContext.setNewValues(targetSocialDetail); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + } + if (targetFundDetail != null) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案-公积金明细导入")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利档案-公积金明细导入") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOldValues(oldFundArchiveMap.get(targetPO.getPaymentOrganization() + "-" + targetPO.getEmployeeId())); + loggerContext.setNewValues(targetFundDetail); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + } + if (targetOtherDetail != null) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "福利档案-其他福利明细导入")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利档案-其他福利明细导入") + ": " + taxAgentInfo.getName() + "-" + empInfo.getUsername()); + loggerContext.setOldValues(oldOtherArchiveMap.get(targetPO.getPaymentOrganization() + "-" + targetPO.getEmployeeId())); + loggerContext.setNewValues(targetOtherDetail); + SalaryElogConfig.siArchivesLoggerTemplate.write(loggerContext); + } + }); } //新增人员范围(会自动生成人员档案) if (CollectionUtils.isNotEmpty(param.getTaxAgentRanges())) { @@ -1581,12 +2088,68 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } } + private Map getSocialArchiveMap(List baseInfoPOS) { + Map map = new HashMap<>(); + if (baseInfoPOS.size() > 0) { + //遍历待更新的福利档案数据,对每组档案生成基数调整记录(基数单元未变化则忽略) + for (InsuranceArchivesBaseInfoPO po : baseInfoPOS) { + List archiveList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build()); + if (archiveList.size() == 1) { + //新增调整记录,变更 + encryptUtil.decryptList(archiveList, InsuranceArchivesSocialSchemePO.class); + map.put(po.getPaymentOrganization() + "-" + po.getEmployeeId(), archiveList.get(0)); + } else if (archiveList.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!")); + } + } + } + return map; + } + private Map getFundArchiveMap(List baseInfoPOS) { + Map map = new HashMap<>(); + if (baseInfoPOS.size() > 0) { + //遍历待更新的福利档案数据,对每组档案生成基数调整记录(基数单元未变化则忽略) + for (InsuranceArchivesBaseInfoPO po : baseInfoPOS) { + List archiveList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build()); + if (archiveList.size() == 1) { + //新增调整记录,变更 + encryptUtil.decryptList(archiveList, InsuranceArchivesFundSchemePO.class); + map.put(po.getPaymentOrganization() + "-" + po.getEmployeeId(), archiveList.get(0)); + } else if (archiveList.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!")); + } + } + } + return map; + } + private Map getOtherArchiveMap(List baseInfoPOS) { + Map map = new HashMap<>(); + if (baseInfoPOS.size() > 0) { + //遍历待更新的福利档案数据,对每组档案生成基数调整记录(基数单元未变化则忽略) + for (InsuranceArchivesBaseInfoPO po : baseInfoPOS) { + List archiveList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build()); + if (archiveList.size() == 1) { + //新增调整记录,变更 + encryptUtil.decryptList(archiveList, InsuranceArchivesOtherSchemePO.class); + map.put(po.getPaymentOrganization() + "-" + po.getEmployeeId(), archiveList.get(0)); + } else if (archiveList.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!")); + } + } + } + return map; + } + /** * 导出档案导入所需要的模板,可根据开关选择是否导出现有的档案数据 * * @param param 是否导出带档案数据的模板 */ + @Override public XSSFWorkbook exportTemplate(InsuranceArchivesListParam param) { return getSIImportService().exportTemplate(param); @@ -1756,7 +2319,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { schemeDetailList.forEach(f -> { schemeDetailUpdateMap.put(f.getInsuranceId() + "-" + f.getPaymentScope(), f); }); - List schemeDetailPOS = siSchemeBiz.listByPrimaryId(primaryId); +// List schemeDetailPOS = siSchemeBiz.listByPrimaryId(primaryId); + List schemeDetailPOS = listByPrimaryId(primaryId); //替换修改字段 if (schemeDetailPOS.size() > 0) { schemeDetailPOS.forEach(f -> { @@ -1778,5 +2342,472 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } return errorInfo; } + /*****以下代码为SISchemeBiz中逻辑迁移,旨在减少Biz类的使用*****/ + /** + * 获取社保方案 + * + * @param id + * @param welfareTypeEnum + * @return + */ + public InsuranceSchemeFormVO getForm(Long id, WelfareTypeEnum welfareTypeEnum) { + InsuranceSchemeDTO insuranceSchemeDTO = getSchemeFormDTO(welfareTypeEnum, id); + List insuranceSchemeDetailDTOList = getSchemeDetailFormDTO(welfareTypeEnum, id); + return InsuranceSchemeFormVO.builder().schemeBatch(insuranceSchemeDTO).schemeDetailList(insuranceSchemeDetailDTOList).build(); + } + + /** + * 获取方案主表信息 新建|详情 + * + * @param welfareTypeEnum 福利类型 + * @param id 方案主键id + * @return form + */ + private InsuranceSchemeDTO getSchemeFormDTO(WelfareTypeEnum welfareTypeEnum, Long id) { + InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().paymentType(PaymentTypeEnum.SCHEME_TOWN).welfareType(welfareTypeEnum).build(); + if (id != null) { + InsuranceSchemePO insuranceSchemePO = getById(id); + SalaryAssert.notNull(insuranceSchemePO, SalaryI18nUtil.getI18nLabel(0,"福利方案不存在")); + //BeanUtils.copyProperties(insuranceSchemePO, insuranceSchemeDTO); + insuranceSchemeDTO.setId(insuranceSchemePO.getId()); + insuranceSchemeDTO.setPaymentArea(insuranceSchemePO.getPaymentArea()); + insuranceSchemeDTO.setRemarks(insuranceSchemePO.getRemarks()); + insuranceSchemeDTO.setSchemeName(insuranceSchemePO.getSchemeName()); + insuranceSchemeDTO.setPaymentType(SalaryEnumUtil.enumMatchByValue(insuranceSchemePO.getPaymentType(), PaymentTypeEnum.values(), PaymentTypeEnum.class)); + insuranceSchemeDTO.setWelfareType(welfareTypeEnum); + insuranceSchemeDTO.setSharedType(StringUtils.isBlank(insuranceSchemePO.getSharedType()) ? "0" : insuranceSchemePO.getSharedType()); + insuranceSchemeDTO.setTaxAgentIds(insuranceSchemePO.getTaxAgentIds()); + } + return insuranceSchemeDTO; + } + + /** + * 获取方案明细表集合 新建|详情 + * + * @param welfareTypeEnum 福利类型 + * @param id 方案主键id + * @return form + */ + public List getSchemeDetailFormDTO(WelfareTypeEnum welfareTypeEnum, Long id) { + List insuranceCategoryPOS = listByWelfareType(welfareTypeEnum.getValue()); + List insuranceSchemeDetailDTOList = new ArrayList<>(); + insuranceCategoryPOS.forEach(item -> { + PaymentScopeEnum[] paymentScopeEnums = SalaryEnumUtil.stringToEnums(item.getPaymentScope(), ","); + Arrays.stream(paymentScopeEnums).forEach(e -> { + InsuranceSchemeDetailDTO insuranceSchemeDetailDTO = InsuranceSchemeDetailDTO.builder().build(); + InsuranceSchemeDetailPO insuranceSchemeDetailPO = getByPPI(id, e.getValue(), item.getId()); + if (insuranceSchemeDetailPO == null) { + insuranceSchemeDetailDTO = InsuranceSchemeDetailDTO.builder() + .id((long) (Math.random() * 10000)) + .insuranceId(item.getId()) + .insuranceName(item.getInsuranceName()) + .paymentScope(e.getDefaultLabel()) + .rententionRule(String.valueOf(RententionRuleEnum.ROUND.getValue())) + .cycleSetting("000000000000") + .paymentCycle("0") + .accountType("0") + .build(); + if (Objects.equals(item.getDataType(), DataTypeEnum.SYSTEM.getValue())) { + insuranceSchemeDetailDTO.setIsPayment(true); + } else { + insuranceSchemeDetailDTO.setIsPayment(false); + } + } else { + //BeanUtils.copyProperties(insuranceSchemeDetailPO, insuranceSchemeDetailDTO); + insuranceSchemeDetailDTO.setEffectiveTime(insuranceSchemeDetailPO.getEffectiveTime()); + insuranceSchemeDetailDTO.setExpirationTime(insuranceSchemeDetailPO.getExpirationTime()); + insuranceSchemeDetailDTO.setId(insuranceSchemeDetailPO.getId()); + insuranceSchemeDetailDTO.setInsuranceId(insuranceSchemeDetailPO.getInsuranceId()); + insuranceSchemeDetailDTO.setPaymentScopeValue(insuranceSchemeDetailPO.getPaymentScope()); + insuranceSchemeDetailDTO.setPrimaryId(insuranceSchemeDetailPO.getPrimaryId()); + insuranceSchemeDetailDTO.setValidNum(insuranceSchemeDetailPO.getValidNum()); + + if (insuranceSchemeDetailPO.getIsPayment() != null) { + insuranceSchemeDetailDTO.setIsPayment(Objects.equals(insuranceSchemeDetailPO.getIsPayment(), IsPaymentEnum.YES.getValue())); + } + if (insuranceSchemeDetailPO.getPaymentCycle() != null) { + insuranceSchemeDetailDTO.setPaymentCycle(insuranceSchemeDetailPO.getPaymentCycle() + ""); + } else { + insuranceSchemeDetailDTO.setPaymentCycle("0"); + } + if (insuranceSchemeDetailPO.getAccountType() != null) { + insuranceSchemeDetailDTO.setAccountType(insuranceSchemeDetailPO.getAccountType() + ""); + } else { + insuranceSchemeDetailDTO.setAccountType("0"); + } + if (insuranceSchemeDetailPO.getCycleSetting() == null) { + insuranceSchemeDetailDTO.setCycleSetting("000000000000"); + } else { + insuranceSchemeDetailDTO.setCycleSetting(insuranceSchemeDetailPO.getCycleSetting()); + } + if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getUpperLimit())) { + BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getUpperLimit()); + insuranceSchemeDetailDTO.setUpperLimit(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal); + } + if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getLowerLimit())) { + BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getLowerLimit()); + insuranceSchemeDetailDTO.setLowerLimit(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal); + } + if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getPaymentProportion())) { + BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getPaymentProportion()); + insuranceSchemeDetailDTO.setPaymentProportion(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal); + } + if (StringUtils.isNotBlank(insuranceSchemeDetailPO.getFixedCost())) { + BigDecimal bigDecimal = new BigDecimal(insuranceSchemeDetailPO.getFixedCost()); + insuranceSchemeDetailDTO.setFixedCost(numberCheck(bigDecimal.toPlainString()) ? null : bigDecimal); + } + insuranceSchemeDetailDTO.setInsuranceName(item.getInsuranceName()); + insuranceSchemeDetailDTO.setRententionRule(String.valueOf(insuranceSchemeDetailPO.getRententionRule())); + insuranceSchemeDetailDTO.setPaymentScope(e.getDefaultLabel()); + + } + insuranceSchemeDetailDTO.setPaymentScopeValue(e.getValue()); + insuranceSchemeDetailDTOList.add(insuranceSchemeDetailDTO); + }); + }); + return insuranceSchemeDetailDTOList; + } + + /** + * 社保方案基础信息主表 + * + * @param id + * @return + */ + public InsuranceSchemePO getById(Long id) { + + InsuranceSchemePO insuranceSchemePO = getInsuranceSchemeMapper().getById(id); + return insuranceSchemePO; + } + + /** + * 根据福利类型获取 + * + * @param welfareType + * @return + */ + public List listByWelfareType(Integer welfareType) { + + List insuranceCategoryPOS = getICategoryMapper().listByWelfareType(welfareType, null); + return insuranceCategoryPOS; + } + + public boolean numberCheck(String number) { + return Pattern.compile("^0\\.[0]*").matcher(number).matches(); + } + + private InsuranceSchemeDetailPO getByPPI(Long primaryId, Integer paymentScope, Long insuranceId) { + + InsuranceSchemeDetailPO insuranceSchemeDetailPO = getInsuranceSchemeDetailMapper().getByPPI(primaryId, paymentScope, insuranceId); + encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class); + return insuranceSchemeDetailPO; + + } + + /** + * 新增 + * + * @param saveParam + * @param employeeId + */ + public void save(InsuranceSchemeReqParam saveParam, long employeeId) { + + //保存福利项目主表 + saveParam.getInsuranceScheme().setSchemeName(StringUtils.trim(saveParam.getInsuranceScheme().getSchemeName())); + List listResult = getInsuranceSchemeMapper().listByName(saveParam.getInsuranceScheme().getSchemeName()); + SalaryAssert.isEmpty(listResult, SalaryI18nUtil.getI18nLabel(0,"该福利名称已经存在,福利名称系统全局唯一")); + + InsuranceSchemePO insuranceSchemePO = InsuranceSchemeBO.convert2BatchPO(saveParam.getInsuranceScheme(), employeeId); + if (insuranceSchemePO.getSharedType() == null) { + insuranceSchemePO.setSharedType(SharedTypeEnum.PUBLIC.getValue()); + } else { + if (insuranceSchemePO.getSharedType().equals(SharedTypeEnum.PRIVATE.getValue()) && StringUtils.isBlank(insuranceSchemePO.getTaxAgentIds())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"方案可见性为私有时,未设置可见范围")); + } + } + getInsuranceSchemeMapper().insert(insuranceSchemePO); + //记录操作日志 + List schemePOList = getInsuranceSchemeMapper().listByName(insuranceSchemePO.getSchemeName()); + InsuranceSchemePO targetPO = new InsuranceSchemePO(); + if (schemePOList != null && schemePOList.size() > 0) { + targetPO = schemePOList.get(0); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(targetPO.getSchemeName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增福利方案主表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利方案基础信息") + ": " + targetPO.getSchemeName()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + } + //保存福利项目明细表 + List insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(saveParam.getInsuranceSchemeDetailList(), employeeId, insuranceSchemePO.getId()); + //加密入库 + encryptUtil.encryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + insuranceSchemeDetailPOS.forEach(getInsuranceSchemeDetailMapper()::insert); + //记录明细表操作日志 + if (insuranceSchemeDetailPOS.size() > 0) { + encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(targetPO.getSchemeName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增福利方案明细表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利方案明细")); + insuranceSchemeDetailPOS.forEach(loggerContext::setNewValues); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + } + + } + + /** + * 更新 + * + * @param updateParam + * @param employeeId + */ + public void update(InsuranceSchemeReqParam updateParam, long employeeId) { + //查询是否存在福利方案 + InsuranceSchemePO insuranceSchemePO = getById(updateParam.getInsuranceScheme().getId()); + if (Objects.isNull(insuranceSchemePO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"福利方案不存在")); + } + //去除入参中方案名称的空格 + updateParam.getInsuranceScheme().setSchemeName(StringUtils.trim(updateParam.getInsuranceScheme().getSchemeName())); + //福利方案名称重复 + List insuranceSchemePOList = getInsuranceSchemeMapper().listByName(updateParam.getInsuranceScheme().getSchemeName()); + if (CollectionUtils.isNotEmpty(insuranceSchemePOList)) { + boolean repeat = insuranceSchemePOList.stream().anyMatch(item -> !Objects.equals(item.getId(), updateParam.getInsuranceScheme().getId())); + SalaryAssert.isTrue(!repeat, SalaryI18nUtil.getI18nLabel(0,"福利方案名称重复")); + } + + if (insuranceSchemePO.getSharedType() == null) { + insuranceSchemePO.setSharedType(SharedTypeEnum.PUBLIC.getValue()); + } else { + if (insuranceSchemePO.getSharedType().equals(SharedTypeEnum.PRIVATE.getValue()) && StringUtils.isBlank(insuranceSchemePO.getTaxAgentIds())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"方案可见性为私有时,未设置可见范围")); + } + } + //记录主表操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(insuranceSchemePO.getId().toString()); + loggerContext.setTargetName(insuranceSchemePO.getSchemeName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "修改福利方案主表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利方案基础信息") + ": " + insuranceSchemePO.getSchemeName()); +// loggerContext.setOldValues(insuranceSchemePO); + //更新福利方案主表 + InsuranceSchemePO insuranceSchemePO1 = InsuranceSchemeBO.buildInsuranceSchemePO(insuranceSchemePO, updateParam.getInsuranceScheme()); + getInsuranceSchemeMapper().update(insuranceSchemePO1); + //记录主表操作日志 + loggerContext.setNewValues(insuranceSchemePO1); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + //更新福利方案明细表 先删后插 + getInsuranceSchemeDetailMapper().batchDeleteByPrimaryIds(Collections.singleton(updateParam.getInsuranceScheme().getId())); + //更新明细表 + List insuranceSchemeDetailPOS = InsuranceSchemeBO.convertToInsuranceSchemeDetailPoList(updateParam.getInsuranceSchemeDetailList(), employeeId, insuranceSchemePO.getId()); + encryptUtil.encryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + insuranceSchemeDetailPOS.forEach(getInsuranceSchemeDetailMapper()::insert); + //记录明细表操作日志 + encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + LoggerContext insuranceSchemeDetailContext = new LoggerContext<>(); + insuranceSchemeDetailContext.setUser(user); + insuranceSchemeDetailContext.setTargetId(String.valueOf(insuranceSchemePO.getId())); + insuranceSchemeDetailContext.setTargetName(insuranceSchemePO.getSchemeName()); + insuranceSchemeDetailContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + insuranceSchemeDetailContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "修改福利方案明细表")); + insuranceSchemeDetailContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利方案明细")); + insuranceSchemeDetailPOS.forEach(insuranceSchemeDetailContext::setNewValues); + SalaryElogConfig.siSchemeLoggerTemplate.write(insuranceSchemeDetailContext); + + } + + public int checkBeforeDeleteSocialscheme(Map params) { + return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection) params.get("ids")).get(0).getNum(); + } + + public int checkBeforeDeleteAccumulationfund(Map params) { + return getSIAccountUtilMapper().checkBeforeDeleteAccumulationfund((Collection) params.get("ids")).get(0).getNum(); + } + + public int checkBeforeDeleteOtherscheme(Map params) { + return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection) params.get("ids")).get(0).getNum(); + } + + public int checkBeforeDeleteBill(Map params, Integer welfareTypeId) { + return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection) params.get("ids"), welfareTypeId).get(0).getNum(); + } + + public void deleteSocialscheme(Map params) { + + Collection schemeIds = (Collection) params.get("ids"); + List targetPoList = getInsuranceSchemeMapper().listBySchemeIds(schemeIds); + List targetDetailPoList = getInsuranceSchemeDetailMapper().listBySchemeIds(schemeIds); + getInsuranceSchemeMapper().deleteByIds(schemeIds); + getInsuranceSchemeDetailMapper().deleteByIds(schemeIds); + + //记录操作日志 + Map> targetDetailMap = targetDetailPoList.stream() + .collect(Collectors.groupingBy(InsuranceSchemeDetailPO::getPrimaryId)); + if (targetPoList.size() > 0) { + targetPoList.forEach(targetPO -> { + //记录主表操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(targetPO.getSchemeName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除福利方案主表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除福利方案") + ": " + targetPO.getSchemeName()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + //记录明细表操作日志 + List targetDetails = targetDetailMap.get(targetPO.getId()); + encryptUtil.decryptList(targetDetails, InsuranceSchemeDetailPO.class); + if (targetDetails != null && targetDetails.size() > 0) { + LoggerContext detailLoggerContext = new LoggerContext<>(); + detailLoggerContext.setUser(user); + detailLoggerContext.setTargetId(String.valueOf(targetPO.getId())); + detailLoggerContext.setTargetName(targetPO.getSchemeName()); + detailLoggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + detailLoggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除福利方案明细")); + detailLoggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利方案明细")); + targetDetails.forEach(detailLoggerContext::setNewValues); + SalaryElogConfig.siSchemeLoggerTemplate.write(detailLoggerContext); + } + }); + } + + } + + /** + * 复制方案 + * + * @param id + * @param schemeName + * @param employeeId + */ + public void copy(Long id, String schemeName, long employeeId) { + //去除入参中方案名称的空格 + schemeName = StringUtils.trim(schemeName); + List listResult = getInsuranceSchemeMapper().listByName(schemeName); + SalaryAssert.isEmpty(listResult, SalaryI18nUtil.getI18nLabel(0,"方案名称重复")); + if (Objects.isNull(id)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"方案id为空")); + } + if (Objects.isNull(schemeName)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"复制方案名为空")); + } + InsuranceSchemePO insuranceSchemePO = getById(id); + if (Objects.isNull(insuranceSchemePO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"方案不存在")); + } + if (insuranceSchemePO.getSchemeName().equals(schemeName)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"方案名称重复")); + } + InsuranceSchemePO batchPO = InsuranceSchemePO.builder() + .creator(employeeId) + .createTime(new Date()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .schemeName(schemeName) + .paymentArea(insuranceSchemePO.getPaymentArea()) + .updateTime(new Date()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .paymentType(insuranceSchemePO.getPaymentType()) + .remarks(insuranceSchemePO.getRemarks()) + .welfareType(insuranceSchemePO.getWelfareType()) + .isUse(insuranceSchemePO.getIsUse()) + .build(); + getInsuranceSchemeMapper().insert(batchPO); + //记录操作日志 + List schemePOList = getInsuranceSchemeMapper().listByName(insuranceSchemePO.getSchemeName()); + InsuranceSchemePO targetPO = new InsuranceSchemePO(); + if (schemePOList != null && schemePOList.size() > 0) { + targetPO = schemePOList.get(0); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(targetPO.getSchemeName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "复制新增福利方案主表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利方案基础信息") + ": " + targetPO.getSchemeName()); + loggerContext.setNewValues(targetPO); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + } + List detailList = getInsuranceSchemeDetailMapper().queryListBySchemeId(id); + detailList = encryptUtil.decryptList(detailList,InsuranceSchemeDetailPO.class); + if (CollectionUtils.isNotEmpty(detailList)) { + List detailPOS = detailList.stream().map(item -> InsuranceSchemeDetailPO.builder() + .creator(employeeId) + .createTime(new Date()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .effectiveTime(item.getEffectiveTime()) + .expirationTime(item.getExpirationTime()) + .fixedCost(item.getFixedCost()) + .insuranceId(item.getInsuranceId()) + .isPayment(item.getIsPayment()) + .lowerLimit(item.getLowerLimit()) + .paymentScope(item.getPaymentScope()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .paymentProportion(item.getPaymentProportion()) + .updateTime(new Date()) + .primaryId(batchPO.getId()) + .rententionRule(item.getRententionRule()) + .upperLimit(item.getUpperLimit()) + .validNum(item.getValidNum()) + .build() + ).collect(Collectors.toList()); + + //加密入库 + encryptUtil.encryptList(detailPOS, InsuranceSchemeDetailPO.class); + detailPOS.forEach(getInsuranceSchemeDetailMapper()::insert); + //记录明细表操作日志 + if (detailPOS.size() > 0) { + encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); + + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetPO.getId())); + loggerContext.setTargetName(targetPO.getSchemeName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "复制新增福利方案明细表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "福利方案明细")); + detailPOS.forEach(loggerContext::setNewValues); + SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext); + } + } + + } + + /** + * 社保方案基础信息明细表 + * + * @param primaryId + * @return + */ + public List listByPrimaryId(Long primaryId) { + + List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(primaryId); + encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + return insuranceSchemeDetailPOS; + } + + /** + * 获取所有方案 + * + * @return + */ + @Override + public List listAll(){ + + List insuranceSchemePOList = getInsuranceSchemeMapper().listAll(); + return insuranceSchemePOList; + } + + /*****以上代码为SISchemeBiz中方法逻辑迁移,旨在减少Biz类的使用*****/ } diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 23247a55a..85ec2fa8e 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -1,10 +1,13 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; @@ -14,7 +17,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobPO; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper; @@ -53,9 +56,6 @@ import java.util.stream.Collectors; @Slf4j public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcctEmployeeService { - - private SalaryAcctEmployeeMapper salaryAcctEmployeeMapper; - private SalaryAcctEmployeeMapper getSalaryAcctEmployeeMapper() { return MapperProxyFactory.getProxy(SalaryAcctEmployeeMapper.class); } @@ -92,8 +92,6 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } -// private LoggerTemplate salaryAcctRecordLoggerTemplate; - private SalarySysConfMapper getSalarySysConfMapper() { return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } @@ -288,7 +286,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct List salaryAcctEmployeePOS = listByParam(queryParam); Set keySet = SalaryEntityUtil.properties(salaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId()); List resultList = Lists.newArrayList(); - if(CollectionUtils.isNotEmpty(keySet)){ + if (CollectionUtils.isNotEmpty(keySet)) { lastMonthSalaryAcctEmployeePOMap.forEach((k, v) -> { if (!keySet.contains(k)) { resultList.add(v); @@ -336,7 +334,18 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct // 查询合并计税的薪资核算人员 Set otherSalaryAcctRecordIds = SalaryEntityUtil.properties(otherSalaryAcctRecordPOS, SalaryAcctRecordPO::getId); // 分页参数 - List salaryAcctEmployeePOS = getSalaryAcctEmployeeMapper().listPage4ConsolidatedTax(otherSalaryAcctRecordIds, queryParam); + List salaryAcctEmployeePOS = new ArrayList<>(); + if (CollUtil.isNotEmpty(queryParam.getIds())) { + List list = new ArrayList<>(); + List> partition = Lists.partition(queryParam.getIds(), 500); + partition.forEach(ids -> { + queryParam.setIds(ids); + list.addAll(getSalaryAcctEmployeeMapper().list4ConsolidatedTax(otherSalaryAcctRecordIds, queryParam)); + }); + salaryAcctEmployeePOS = list; + } else { + salaryAcctEmployeePOS = getSalaryAcctEmployeeMapper().listPage4ConsolidatedTax(otherSalaryAcctRecordIds, queryParam); + } return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), salaryAcctEmployeePOS, SalaryAcctEmployeePO.class); } @@ -353,6 +362,17 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct } // 查询合并计税的薪资核算人员 Set otherSalaryAcctRecordIds = SalaryEntityUtil.properties(otherSalaryAcctRecordPOS, SalaryAcctRecordPO::getId); + + List list = new ArrayList<>(); + if (CollUtil.isNotEmpty(queryParam.getIds())) { + List> partition = Lists.partition(queryParam.getIds(), 500); + partition.forEach(ids -> { + queryParam.setIds(ids); + list.addAll(getSalaryAcctEmployeeMapper().list4ConsolidatedTax(otherSalaryAcctRecordIds, queryParam)); + }); + return list; + } + return getSalaryAcctEmployeeMapper().list4ConsolidatedTax(otherSalaryAcctRecordIds, queryParam); } @@ -395,15 +415,16 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct // 记录日志 -// String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98837, "添加薪资核算人员")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98837, "添加薪资核算人员") + ":" + targetName); -// loggerContext.setNewValueList(salaryAcctEmployeePOS); -// salaryAcctRecordLoggerTemplate.write(loggerContext); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "添加薪资核算人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "添加薪资核算人员") + ":" + targetName); + loggerContext.setNewValueList(salaryAcctEmployeePOS); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); } @Override @@ -461,15 +482,16 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542303, "薪资账套不存在或已被删除")); } // 记录日志 -// String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98835, "删除薪资核算人员")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98835, "删除薪资核算人员") + ":" + targetName); -// loggerContext.setOldValueList(salaryAcctEmployeePOS); -// salaryAcctRecordLoggerTemplate.write(loggerContext); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除薪资核算人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除薪资核算人员") + ":" + targetName); + loggerContext.setOldValueList(salaryAcctEmployeePOS); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); } @Override @@ -556,19 +578,26 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct SalaryAcctEmployeePO lambdaQueryChainWrapper = SalaryAcctEmployeePO.builder().build(); // 个税扣缴义务人 - Collection taxAgentList = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); - if (CollectionUtils.isNotEmpty(taxAgentList)) { - List taxAgentIds = taxAgentList.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - // 有查询参数就取交集 - if (CollectionUtils.isNotEmpty(param.getTaxAgent())) { - List finalTaxAgentIds = taxAgentIds; - taxAgentIds = param.getTaxAgent().stream().filter(finalTaxAgentIds::contains).collect(Collectors.toList()); - lambdaQueryChainWrapper.setTaxAgentIds(CollectionUtils.isEmpty(taxAgentIds) ? Collections.singletonList(0L) : taxAgentIds); - } else { - lambdaQueryChainWrapper.setTaxAgentIds(taxAgentIds); - } - } else { - lambdaQueryChainWrapper.setTaxAgentIds(Collections.singletonList(0L)); +// Collection taxAgentList = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); +// if (CollectionUtils.isNotEmpty(taxAgentList)) { +// List taxAgentIds = taxAgentList.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); +// // 有查询参数就取交集 +// if (CollectionUtils.isNotEmpty(param.getTaxAgent())) { +// List finalTaxAgentIds = taxAgentIds; +// taxAgentIds = param.getTaxAgent().stream().filter(finalTaxAgentIds::contains).collect(Collectors.toList()); +// lambdaQueryChainWrapper.setTaxAgentIds(CollectionUtils.isEmpty(taxAgentIds) ? Collections.singletonList(0L) : taxAgentIds); +// } else { +// lambdaQueryChainWrapper.setTaxAgentIds(taxAgentIds); +// } +// } else { +// lambdaQueryChainWrapper.setTaxAgentIds(Collections.singletonList(0L)); +// } + if (CollectionUtils.isNotEmpty(param.getTaxAgent())) { + lambdaQueryChainWrapper.setTaxAgentIds(param.getTaxAgent()); + } + + if (CollectionUtils.isNotEmpty(param.getSalarySob())) { + lambdaQueryChainWrapper.setSalarySobIds(param.getSalarySob()); } // 薪资所属月 diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 57d341f37..bbf5e80a6 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -5,8 +5,10 @@ import com.cloudstore.dev.api.util.Util_DataCache; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.WeaTableColumnGroup; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SalaryItemConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.report.po.SalaryAcctResultReportPO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO; @@ -28,7 +30,9 @@ import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; +import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.LockStatusEnum; @@ -42,9 +46,8 @@ import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.enums.OpenEnum; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; -import com.engine.salary.util.JsonUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtilPlus; @@ -54,7 +57,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.wbi.util.Util; -import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; @@ -64,6 +66,7 @@ import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; import weaver.conn.RecordSet; import weaver.file.ImageFileManager; import weaver.general.BaseBean; @@ -89,11 +92,14 @@ import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; @Slf4j public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExcelService { - private SalaryAcctRecordService getSalaryAcctRecordService(User user) { return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); } + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } @@ -159,6 +165,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) { ValidUtil.doValidator(queryParam); + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId()); + if (salaryAcctRecordPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"薪资核算记录不存在或已被删除")); + } // 1.工作簿名称 String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542307, "核算人员范围"); // 2.表头 @@ -183,6 +193,18 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // 3.表数据 List> lists = convert2ExcelRow(salaryAcctEmployees); rows.addAll(lists); + + // 记录日志 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.salaryAcctRecordLoggerTemplate, + queryParam.getSalaryAcctRecordId(), + targetName, + SalaryI18nUtil.getI18nLabel(0, "导出薪资核算人员"), + SalaryI18nUtil.getI18nLabel(0, "导出薪资核算人员") + ":" + targetName, + user + ); + // return ExcelUtil.genWorkbookV2(rows, sheetName); return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -191,6 +213,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc @Override public XSSFWorkbook exportReducedEmployee(SalaryAcctEmployeeQueryParam queryParam) { ValidUtil.doValidator(queryParam); + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId()); + if (salaryAcctRecordPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "薪资核算记录不存在或已被删除")); + } // 1.工作簿名称 String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542308, "环比上月减少人员"); @@ -216,6 +242,18 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // 3.表数据 List> lists = convert2ExcelRow(salaryAcctEmployees); rows.addAll(lists); + + // 记录日志 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.salaryAcctRecordLoggerTemplate, + queryParam.getSalaryAcctRecordId(), + targetName, + SalaryI18nUtil.getI18nLabel(0, "导出环比上月减少人员"), + SalaryI18nUtil.getI18nLabel(0, "导出环比上月减少人员") + ":" + targetName, + user + ); + // return ExcelUtil.genWorkbookV2(rows, sheetName); return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -248,7 +286,20 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // 3.表数据 List> lists = convert2ExcelRow(salaryAcctEmployees); rows.addAll(lists); -// return ExcelUtil.genWorkbookV2(rows, sheetName); + + // 记录日志 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId()); + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导出环比增加人员")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导出环比增加人员") + ":" + targetName); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -300,10 +351,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc //判断是否按照自定义字段导出表头 List finalWeaTableColumns = new ArrayList<>(); - if (queryParam.getSalaryItemIds() != null ) { + if (queryParam.getSalaryItemIds() != null) { //获取人员基本信息字段(汇总) Collection> empFieldList = getSalarySobItemWrapper(user).empFieldList(); - List empFieldIdList= new ArrayList<>(); + List empFieldIdList = new ArrayList<>(); empFieldList.forEach(f -> empFieldIdList.add(f.get("id"))); // 必须选择导出所需的薪资项目 if (CollectionUtils.isEmpty(queryParam.getSalaryItemIds())) { @@ -322,7 +373,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc columnGroupItem.setChildren(childrenColumns); finalWeaTableColumns.add(columnGroupItem); } - } else if (empFieldIdList.contains(tableColumn.getColumn()) || headerRangeList.contains(tableColumn.getColumn())){ + } else if (empFieldIdList.contains(tableColumn.getColumn()) || headerRangeList.contains(tableColumn.getColumn())) { finalWeaTableColumns.add(columnGroupItem); } @@ -345,12 +396,12 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (openSum != null && StringUtils.isNotBlank(openSum.getConfValue()) && OpenEnum.parseByValue(openSum.getConfValue()) == OpenEnum.OPEN) { total = true; Map sumRow = getSalaryAcctResultService(user).sumRow(queryParam); - sumRow.forEach((k,v) -> { + sumRow.forEach((k, v) -> { if (NumberUtils.isCreatable(v.toString())) { - sumRow.put(k,new BigDecimal(v.toString())); + sumRow.put(k, new BigDecimal(v.toString())); } }); - if(sumRow !=null){ + if (sumRow != null) { sumRow.put("taxAgentName", SalaryI18nUtil.getI18nLabel(user.getLanguage(),523, "总计")); resultMapList.add(sumRow); } @@ -365,7 +416,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc for (WeaTableColumnGroup weaTableColumn : headerColumnGroup) { String fieldType = (String) map.getOrDefault(weaTableColumn.getColumn().toString() + DATA_TYPE_SUFFIX, StringUtils.EMPTY); if (StringUtils.equals("number", fieldType)) { - row.add(new BigDecimal(StringUtils.isBlank(map.get(weaTableColumn.getColumn()).toString()) ? "0" :map.get(weaTableColumn.getColumn()).toString())); + row.add(new BigDecimal(StringUtils.isBlank(map.get(weaTableColumn.getColumn()).toString()) ? "0" : map.get(weaTableColumn.getColumn()).toString())); } else { row.add(map.getOrDefault(weaTableColumn.getColumn(), StringUtils.EMPTY)); } @@ -374,6 +425,18 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc rows.add(row); } + // 记录日志 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.salaryAcctRecordLoggerTemplate, + queryParam.getSalaryAcctRecordId(), + targetName, + SalaryI18nUtil.getI18nLabel(0, "导出薪资核算结果"), + SalaryI18nUtil.getI18nLabel(0, "导出薪资核算结果") + ":" + targetName, + user + ); + + String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542310, "薪资核算结果"); // return ExcelUtil.genWorkbookV2(rows, sheetName, total); return ExcelUtilPlus.genWorkbookWithChildTitleColumnWithExcelFormat(rows, sheetName, total); @@ -391,7 +454,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc SalaryAcctRecordPO byId = getSalaryAcctRecordService(user).getById(salaryAcctRecordPO.getId()); boolean isBackCalc = Objects.equals(byId.getBackCalcStatus(), 1); // 查询薪资账套下的薪资项目+员工信息字段 - SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateWithItemHideBySalarySobId(salaryAcctRecordPO.getSalarySobId(),isBackCalc); + SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateWithItemHideBySalarySobId(salaryAcctRecordPO.getSalarySobId(), isBackCalc); // 构建薪资核算结果列表表头 List columnList = SalaryAcctResultBO.buildTableColumns(salarySobItemAggregateDTO, ListUtils.emptyIfNull(salaryAcctRecordPO.getLockSalaryItemIds())); // 获取固定列头数 @@ -461,8 +524,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc SalaryAcctResultBO.sortItem(salarySobItemPOMap); // 根据账套分组封装薪资项目的值 List itemsByGroup = new ArrayList<>(); - for(SalarySobItemGroupPO groupPO : salarySobItemGroupPOS){ - List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(),Collections.emptyList()); + for (SalarySobItemGroupPO groupPO : salarySobItemGroupPOS) { + List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(), Collections.emptyList()); List items = groupItems.stream() .map(salarySobItemPO -> { //获取name(多语言) @@ -491,13 +554,13 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc .salarySobItemGroupId(groupPO.getId()) .salarySobItemGroupName(groupName) .salaryItems(items) - .sortedIndex(groupPO.getSortedIndex()).build() ); + .sortedIndex(groupPO.getSortedIndex()).build()); } // 未分类 List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); - if(CollectionUtils.isNotEmpty(noGroupItems)){ + if (CollectionUtils.isNotEmpty(noGroupItems)) { List items = noGroupItems.stream() - .map(salarySobItemPO ->{ + .map(salarySobItemPO -> { //获取name(多语言) SalaryItemPO salaryItemPO = salaryItemMap.get(salarySobItemPO.getSalaryItemId()); String name = ""; @@ -547,7 +610,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // .collect(Collectors.toList()); // 缓存勾选 String cacheKey = user.getUID() + SalaryItemConstant.RESULT_IMPORT_FIELD_SIGN; - String cacheValue = (String)Util_DataCache.getObjVal(cacheKey); + 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(); @@ -578,8 +641,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc SalaryAcctResultBO.sortItem(salarySobItemPOMap); // 根据账套分组封装薪资项目的值 List itemsByGroup = new ArrayList<>(); - for(SalarySobItemGroupPO groupPO : salarySobItemGroupPOS){ - List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(),Collections.emptyList()); + for (SalarySobItemGroupPO groupPO : salarySobItemGroupPOS) { + List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(), Collections.emptyList()); List items = groupItems.stream() .map(salarySobItemPO -> { //获取name(多语言) @@ -607,13 +670,13 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc .salarySobItemGroupId(groupPO.getId()) .salarySobItemGroupName(groupName) .salaryItems(items) - .sortedIndex(groupPO.getSortedIndex()).build() ); + .sortedIndex(groupPO.getSortedIndex()).build()); } // 未分类 List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); - if(CollectionUtils.isNotEmpty(noGroupItems)){ + if (CollectionUtils.isNotEmpty(noGroupItems)) { List items = noGroupItems.stream() - .map(salarySobItemPO ->{ + .map(salarySobItemPO -> { //获取name(多语言) SalaryItemPO salaryItemPO = salaryItemMap.get(salarySobItemPO.getSalaryItemId()); String name = ""; @@ -637,7 +700,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc } // 缓存勾选 String cacheKey = user.getUID() + SalaryItemConstant.RESULT_EXPORT_FIELD_SIGN; - String cacheValue = (String)Util_DataCache.getObjVal(cacheKey); + 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(); @@ -649,7 +712,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // ValidUtil.doValidator(param); // 从缓存中获取所选的薪资项目 String cacheKey = user.getUID() + SalaryItemConstant.RESULT_IMPORT_FIELD_SIGN; - String cacheValue = (String)Util_DataCache.getObjVal(cacheKey); + String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); List checkItems = JsonUtil.parseList(cacheValue, Long.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, Long.class); // 必须选择导入模板所需的薪资项目 if (CollectionUtils.isEmpty(checkItems)) { @@ -754,7 +817,6 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc } - @Override public XSSFWorkbook exportComparisonResult(SalaryComparisonResultQueryParam queryParam) { ValidUtil.doValidator(queryParam); @@ -833,6 +895,17 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc rows.add(row); } + // 记录日志 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.salaryAcctRecordLoggerTemplate, + queryParam.getSalaryAcctRecordId(), + targetName, + SalaryI18nUtil.getI18nLabel(0, "导出线下对比结果"), + SalaryI18nUtil.getI18nLabel(0, "导出线下对比结果") + ":" + targetName, + user + ); + String sheetName = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542315, "线下对比结果"); // return ExcelUtil.genWorkbookV2(rows, sheetName); @@ -890,7 +963,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // 查询薪资核算所用的薪资账套的员工信息字段 List salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); List salarySobEmpFieldDTOS = new SalarySobItemAggregateBO().buildEmpField(salarySobEmpFieldPOS, user); - salarySobEmpFieldDTOS.stream().forEach(empField -> finalWeaTableColumns.add(new WeaTableColumnGroup("150", SalaryI18nUtil.getI18nLabel(0, empField.getFieldName()), SalaryI18nUtil.getI18nLabel(0, empField.getFieldName())))); + salarySobEmpFieldDTOS.stream().forEach(empField -> finalWeaTableColumns.add(new WeaTableColumnGroup("150", SalaryI18nUtil.getI18nLabel(0, empField.getFieldName()), SalaryI18nUtil.getI18nLabel(0, empField.getFieldName())))); for (WeaTableColumnGroup tableColumn : weaTableColumns) { WeaTableColumnGroup columnGroupItem = (WeaTableColumnGroup) tableColumn; if (columnGroupItem.getChildren() != null) { @@ -1067,16 +1140,16 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // List headers = ExcelSupport.getSheetHeader(sheet, 0); List headers; // if (StringUtils.equals("importSalaryAcctResult", importType)) { - headers = ExcelSupport.getSheetHeader(sheet, 1); + headers = ExcelSupport.getSheetHeader(sheet, 1); // } else { // headers = ExcelSupport.getSheetHeader(sheet, 0); // } - // 处理数值 + // 处理数值 // List> data = ExcelParseHelper.parse2Map(sheet, 1); List> data; // if (StringUtils.equals("importSalaryAcctResult", importType)) { - data = ExcelParseHelper.parse2Map(sheet, 2, 1); + data = ExcelParseHelper.parse2Map(sheet, 2, 1); // } else { // data = ExcelParseHelper.parse2Map(sheet, 1); // } @@ -1121,7 +1194,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc //salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542130,"姓名不能为空"), i, i, j, j); } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, dataValue, deparmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -1227,7 +1300,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (StringUtils.equals("importExcelAcctResult", importType) && (employeeId != null && employeeId > 0) && (taxAgentId != null && taxAgentId > 0) - && i == data.size() - 1 + && j == headers.size() - 1 && !salaryAcctEmployeeMap.containsKey(employeeId + "-" + taxAgentId)) { isError = true; Map errorMessageMap = Maps.newHashMap(); @@ -1240,7 +1313,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (StringUtils.equals("importSalaryAcctResult", importType) && (employeeId != null && employeeId > 0) && (taxAgentId != null && taxAgentId > 0) - && i == data.size() - 1 + && j == headers.size() - 1 && !salaryAcctEmployeeMap.containsKey(employeeId + "-" + taxAgentId)) { isError = true; Map errorMessageMap = Maps.newHashMap(); @@ -1323,7 +1396,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc getSalaryComparisonResultService(user).deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId)); if (CollectionUtils.isNotEmpty(excelAcctResults)) { excelAcctResults.stream().forEach(result -> { - if(StringUtils.isEmpty(result.getResultValue())){ + if (StringUtils.isEmpty(result.getResultValue())) { result.setResultValue(" "); } }); @@ -1342,7 +1415,28 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (CollectionUtils.isNotEmpty(salaryAcctResults)) { // 处理导入薪资项的回算值 handleOriginResultValue(deleteResults, salaryAcctResults); + // 备份一份加密前的值 + List list4log = new ArrayList<>(); + salaryAcctResults.stream().forEach(source -> { + SalaryAcctResultPO target = new SalaryAcctResultPO(); + BeanUtils.copyProperties(source,target); + list4log.add(target); + }); getSalaryAcctResultService(user).batchSave(salaryAcctResults); + + // 记录操作日志 TODO 这里的数据没有id,id是自增的重新查数据太多效率太低 + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + String targetName = salarySobPO.getName() + ":" + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getSalaryAcctRecordId().toString()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "导入薪资核算数据")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "导入薪资核算数据 ") + targetName); + loggerContext.setOldValueList(list4log); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); + // 存储薪资核算结果数据来源日志 new Thread() { public void run() { @@ -1357,7 +1451,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc } } SalarySysConfPO autoLock = getSalarySysConfService(user).getOneByCode(SalarySysConstant.EDIT_IMPORT_AUTO_LOCK); - if(autoLock != null && StringUtils.equals(autoLock.getConfValue(),"1")){ + if (autoLock != null && StringUtils.equals(autoLock.getConfValue(), "1")) { // 导入的列都自动锁定 SalaryAcctResultUpdateLockStatusParam updateLockStatusParam = SalaryAcctResultUpdateLockStatusParam.builder() .salaryItemIds(excelSalaryItemIds) @@ -1380,7 +1474,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc } /** - * 存储薪资核算结果数据来源日志 + * 存储薪资核算结果数据来源日志 + * * @param salaryAcctResults */ private void handleSalaryAcctResultLog(List salaryAcctResults) { @@ -1390,14 +1485,14 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc List salaryAcctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, salaryItemIds); Long uid = Long.valueOf(user.getUID()); List needInsertList = SalaryAcctResultLogBO.buildSalaryAcctResultLog(salaryAcctResultList, uid, SalaryAcctResultDataSourceEnum.IMPORT); - if(CollectionUtils.isNotEmpty(needInsertList)){ + if (CollectionUtils.isNotEmpty(needInsertList)) { getSalaryAcctResultLogService(user).batchInsert(needInsertList); } } /** - * @description * @return void + * @description * @author Harryxzy * @date 2022/12/26 22:36 */ @@ -1405,7 +1500,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc Map> deleteMap = SalaryEntityUtil.group2Map(deleteResults, po -> po.getSalaryAcctEmpId() + "-" + po.getSalaryItemId()); salaryAcctResults.stream().forEach(result -> { List salaryAcctResultPOS = deleteMap.get(result.getSalaryAcctEmpId() + "-" + result.getSalaryItemId()); - if(salaryAcctResultPOS != null && salaryAcctResultPOS.size() > 0 ){ + if (salaryAcctResultPOS != null && salaryAcctResultPOS.size() > 0) { result.setOriginResultValue(salaryAcctResultPOS.get(0).getOriginResultValue()); } }); diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index ffd7b3869..73a7761d8 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -5,6 +5,8 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryBill.po.SalarySendPO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; @@ -15,6 +17,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -51,7 +54,6 @@ import java.util.stream.Collectors; **/ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRecordService { - private SalaryAcctRecordMapper getSalaryAcctRecordMapper() { return MapperProxyFactory.getProxy(SalaryAcctRecordMapper.class); } @@ -79,6 +81,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + // private SalaryCheckResultService salaryCheckResultService; // // private SalaryCheckResultDetailService salaryCheckResultDetailService; @@ -104,6 +110,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + @Override public SalaryAcctRecordPO getById(Long id) { @@ -290,15 +300,16 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 初始化薪资核算人员 getSalaryAcctEmployeeService(user).initBySalaryAcctRecord(salaryAcctRecordPO); // 记录日志 -// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98768, "新建薪资核算")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98768, "新建薪资核算") + ": " + targetName); -// loggerContext.setNewValues(salaryAcctRecordPO); -// salaryAcctRecordLoggerTemplate.write(loggerContext); + String targetName = getLogTargetNameById(salaryAcctRecordPO.getId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建薪资核算")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建薪资核算") + ": " + targetName); + loggerContext.setNewValues(salaryAcctRecordPO); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); // 返回薪资核算记录id return salaryAcctRecordPO.getId(); } @@ -593,18 +604,19 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe } // 记录日志 -// salaryAcctRecordPOS.forEach(salaryAcctRecordPO -> { -// SalarySobPO salarySobPO = salarySobPOMap.get(salaryAcctRecordPO.getSalarySobId()); -// String targetName = salarySobPO.getName() + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98821, "删除薪资核算")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98821, "删除薪资核算") + ":" + targetName); -// loggerContext.setNewValues(salaryAcctRecordPO); -// salaryAcctRecordLoggerTemplate.write(loggerContext); -// }); + salaryAcctRecordPOS.forEach(salaryAcctRecordPO -> { + SalarySobPO salarySobPO = salarySobPOMap.get(salaryAcctRecordPO.getSalarySobId()); + String targetName = salarySobPO.getName() + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除薪资核算")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除薪资核算") + ":" + targetName); + loggerContext.setNewValues(salaryAcctRecordPO); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); + }); } @Override @@ -636,15 +648,16 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 记录日志 -// String targetName = getLogTargetNameById(salaryAcctRecordId); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98817, "薪资核算归档")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98817, "薪资核算归档") + ": " + targetName); -// loggerContext.setNewValues(salaryAcctRecordPO); -// salaryAcctRecordLoggerTemplate.write(loggerContext); + String targetName = getLogTargetNameById(salaryAcctRecordId); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "薪资核算归档")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "薪资核算归档") + ": " + targetName); + loggerContext.setNewValues(salaryAcctRecordPO); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); } @Override @@ -685,15 +698,16 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // salaryAcctRecordPO.setUpdateTime(new Date()); // getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO); // 记录日志 -// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542637, "重新核算")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542637, "重新核算") + ": " + targetName); -// loggerContext.setNewValues(salaryAcctRecordPO); -// salaryAcctRecordLoggerTemplate.write(loggerContext); + String targetName = getLogTargetNameById(salaryAcctRecordPO.getId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "重新核算")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "重新核算") + ": " + targetName); + loggerContext.setNewValues(salaryAcctRecordPO); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java index 72a128c1e..378920dbd 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java @@ -60,7 +60,11 @@ public class SalaryAcctResultLogServiceImpl extends Service implements SalaryAcc } @Override - public void deleteBySalaryAcctEmpIdExceptItemIds(Collection salaryAcctEmployeeIds, Collection lockSalaryItemIds) { - getSalaryAcctResultLogMapper().deleteBySalaryAcctEmpIdExceptItemIds(salaryAcctEmployeeIds,lockSalaryItemIds, new Date()); + public void deleteBySalaryAcctEmpIdExceptItemIds(List salaryAcctEmployeeIds, Collection lockSalaryItemIds) { + // 分片 + List> partition = Lists.partition(salaryAcctEmployeeIds, 50); + partition.forEach(part -> { + getSalaryAcctResultLogMapper().deleteBySalaryAcctEmpIdExceptItemIds(part,lockSalaryItemIds, new Date()); + }); } } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 864ee28b9..d0c6ac913 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -5,6 +5,10 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.hrmelog.util.LoggerTemplate; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; @@ -23,9 +27,10 @@ import com.engine.salary.entity.salarysob.dto.*; import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; -import com.engine.salary.enums.common.FilterEnum; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.common.FilterEnum; import com.engine.salary.enums.salaryaccounting.LockStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctResultDataSourceEnum; @@ -47,15 +52,18 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; @@ -143,7 +151,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe private SalaryAcctResultTempService getSalaryAcctResultTempService(User user) { return ServiceUtil.getService(SalaryAcctResultTempServiceImpl.class, user); } -// private LoggerTemplate salaryAcctRecordLoggerTemplate; private SIAccountService getSIAccountService(User user) { return ServiceUtil.getService(SIAccountServiceImpl.class, user); @@ -301,9 +308,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe TaxAgentPO taxAgent = getTaxAgentService(user).getById(salaryAcctEmployeePO.getTaxAgentId()); // 查询公式 Map formulaContentMap = getSalaryAcctResultService(user).getColumnBySalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()); + List lockItems = byId.getLockSalaryItemIds() == null ? Collections.emptyList() : byId.getLockSalaryItemIds(); // 转换成薪资核算结果详情dto - return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemGroupPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS, salarySobBackItemPOList, salaryBackItemPOS, salaryBackItemFormula, formulaContentMap, user); + return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemGroupPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS, salarySobBackItemPOList, salaryBackItemPOS, salaryBackItemFormula, formulaContentMap, user, lockItems); } @Override @@ -353,7 +361,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe //其他条件 List otherConditions = queryParam.getOtherConditions(); - if(CollectionUtils.isNotEmpty(otherConditions)){ + if (CollectionUtils.isNotEmpty(otherConditions)) { List items = SalaryEntityUtil.properties(otherConditions, SalaryAcctResultQueryParam.OtherCondition::getItemId, Collectors.toList()); List list = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(queryParam.getSalaryAcctRecordId()), items); for (int i = 0; i < otherConditions.size(); i++) { @@ -468,7 +476,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe salaryAcctEmployeeIds4ConsolidatedTax = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId); } else { // 如果查询条件中没有包含"合并计税",那么就需要查询出存在合并计税的人,标记给前端 - SalaryAcctEmployeeQueryParam accEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder().salaryAcctRecordId(queryParam.getSalaryAcctRecordId()).ids(SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId)).build(); + SalaryAcctEmployeeQueryParam accEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder().salaryAcctRecordId(queryParam.getSalaryAcctRecordId()).ids(SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId, Collectors.toList())).build(); List salaryAcctEmployeePOS4ConsolidatedTax = getSalaryAcctEmployeeService(user).listByParam4ConsolidatedTax(accEmployeeQueryParam); salaryAcctEmployeeIds4ConsolidatedTax = SalaryEntityUtil.properties(salaryAcctEmployeePOS4ConsolidatedTax, SalaryAcctEmployeePO::getId); } @@ -644,21 +652,22 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe saveSalaryAcctResultLog(salaryAcctResultPOSOld, salaryAcctResultPOS); // 查询操作日志的targetName -// String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(salaryAcctEmployeePO.getSalaryAcctRecordId()); - // 查询人员信息 -// DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salaryAcctEmployeePO.getEmployeeId()); - // 查询个税扣缴义务人 -// TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(salaryAcctEmployeePO.getTaxAgentId()); - // 记录日志 -// String operateDesc = simpleEmployee.getUsername() + "(" + Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse(StringUtils.EMPTY) + ")"; -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(salaryAcctEmployeePO.getSalaryAcctRecordId())); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),95783, "编辑薪资核算结果") + ": " + operateDesc); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),95783, "编辑薪资核算结果") + ": " + operateDesc); -// loggerContext.setNewValueList(Lists.newArrayList(salaryAcctResultPOS)); -// salaryAcctRecordLoggerTemplate.write(loggerContext); + String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(salaryAcctEmployeePO.getSalaryAcctRecordId()); +// 查询人员信息 + DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salaryAcctEmployeePO.getEmployeeId()); +// 查询个税扣缴义务人 + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(salaryAcctEmployeePO.getTaxAgentId()); +// 记录日志 + String operateDesc = simpleEmployee.getUsername() + "(" + Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse(StringUtils.EMPTY) + ")"; + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryAcctEmployeePO.getSalaryAcctRecordId())); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑薪资核算结果") + ": " + operateDesc); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑薪资核算结果") + ": " + operateDesc); + loggerContext.setNewValueList(Lists.newArrayList(salaryAcctResultPOS)); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); } /** @@ -854,14 +863,15 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe }.start(); // 记录日志 // 查询操作日志的targetName -// String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId()); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId())); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),95783, "薪资核算")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),95783, "薪资核算")); -// salaryAcctRecordLoggerTemplate.write(loggerContext); + String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId())); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "薪资核算")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "薪资核算")); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); } catch (Exception e) { log.info("薪资核算出错:{}", e.getMessage(), e); // throw new SalaryRunTimeException(e); @@ -1127,4 +1137,107 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe }); return sumMap; } + + @Override + public void batchUpdate(SalaryAcctResultBatchUpdateParam param) { + ValidUtil.doValidator(param); + + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId()); + if (ObjectUtils.isEmpty(salaryAcctRecordPO)) { + throw new SalaryRunTimeException("薪资核算记录不存在,或已被删除"); + } + List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + // 薪资账套中包含的薪资项目 + List salarySobItemIds = salarySobItemPOS.stream().map(SalarySobItemPO::getSalaryItemId).collect(Collectors.toList()); + if (!salarySobItemIds.contains(param.getSalaryItemId())) { + throw new SalaryRunTimeException("该账套不包含该薪资项目或已被删除,请先检查账套"); + } + // 获取需要更新的核算人员信息 + List salaryAcctEmployeePOList = new ArrayList<>(); + if (CollectionUtils.isEmpty(param.getIdList())) { + // 没有选择核算人员,更新核算记录中所有人员 + salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId())); + } else { + salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listByIds(param.getIdList())); + } + + if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOList)) { + List salaryAcctEmployeeIdList = SalaryEntityUtil.properties(salaryAcctEmployeePOList, SalaryAcctEmployeePO::getId, Collectors.toList()); + // 查询薪资核算结果 + List resultPOS = listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIdList, Collections.singleton(param.getSalaryItemId())); + Map salaryAcctResultPOMap = SalaryEntityUtil.convert2Map(resultPOS, SalaryAcctResultPO::getSalaryAcctEmpId); + List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); + Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); + List needUpdateList = new ArrayList<>(); + List needInsertList = new ArrayList<>(); + Date now = new Date(); + List salaryAcctResultReportPOS = new ArrayList<>(); + salaryAcctEmployeePOList.forEach(salaryAcctEmployeePO -> { + if (salaryAcctResultPOMap.containsKey(salaryAcctEmployeePO.getId())) { + // 更新 + SalaryAcctResultPO po = salaryAcctResultPOMap.get(salaryAcctEmployeePO.getId()); + po.setResultValue(param.getValue()); + po.setUpdateTime(now); + needUpdateList.add(po); + } else { + // 新增 + needInsertList.add(SalaryAcctResultPO.builder() + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(param.getSalaryItemId()) + .salaryAcctRecordId(param.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployeePO.getId()) + .employeeId(salaryAcctEmployeePO.getEmployeeId()) + .taxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .resultValue(param.getValue()) + .originResultValue("") + .creator(Long.valueOf(user.getUID())) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); + } + + // 报表 + SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder() + .id(IdGenerator.generate()) + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(param.getSalaryItemId()) + .salaryAcctRecordId(param.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployeePO.getId().toString()) + .employeeId(salaryAcctEmployeePO.getEmployeeId().toString()) + .taxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .resultValue(param.getValue()) + .creator(Long.valueOf(user.getUID())) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + DataCollectionEmployee dataCollectionEmployee = emps.get(salaryAcctEmployeePO.getEmployeeId()); + if (dataCollectionEmployee != null) { + po.setDepartmentId(dataCollectionEmployee.getDepartmentId()); + po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid()); + po.setCostcenterId(dataCollectionEmployee.getCostcenterId()); + po.setJobtitleId(dataCollectionEmployee.getJobtitleId()); + po.setLocationId(dataCollectionEmployee.getLocationId()); + } + salaryAcctResultReportPOS.add(po); + }); + + // 入库 + if (CollectionUtils.isNotEmpty(needUpdateList)) { + // 数据加密 + encryptUtil.encryptList(needUpdateList, SalaryAcctResultPO.class); + List> partition = Lists.partition(needUpdateList, 100); + partition.forEach(getSalaryAcctResultMapper()::batchUpdate); + } + batchSave(needInsertList); + + // 报表入库前先删除 + getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(param.getIdList(), Collections.singletonList(param.getSalaryItemId())); + getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS); + + } + } } \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index a709686db..c88de03c5 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -2,9 +2,12 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.*; +import com.engine.salary.biz.SalaryArchiveBiz; +import com.engine.salary.biz.SalaryArchiveItemBiz; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SalaryItemConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveExcelBO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveInitImportDTO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO; @@ -22,14 +25,13 @@ 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; -import com.engine.salary.mapper.archive.SalaryArchiveMapper; import com.engine.salary.service.*; 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.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.SalaryLoggerUtil; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; @@ -40,8 +42,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; @@ -59,12 +59,6 @@ import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; */ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArchiveExcelService { - private static final Logger log = LoggerFactory.getLogger(SalaryArchiveExcelServiceImpl.class); - - private SalaryArchiveMapper getSalaryArchiveMapper() { - return MapperProxyFactory.getProxy(SalaryArchiveMapper.class); - } - private SalaryArchiveItemService salaryArchiveItemService(User user) { return ServiceUtil.getService(SalaryArchiveItemServiceImpl.class, user); } @@ -97,9 +91,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch private SalaryArchiveBiz salaryArchiveMapper = new SalaryArchiveBiz(); private SalaryArchiveItemBiz salaryArchiveItemMapper = new SalaryArchiveItemBiz(); - private SalaryArchiveTaxAgentBiz salaryArchiveTaxAgentMapper = new SalaryArchiveTaxAgentBiz(); - private SalaryArchiveDimissionBiz salaryArchiveDimissionMapper = new SalaryArchiveDimissionBiz(); - private SalaryItemBiz salaryItemMapper = new SalaryItemBiz(); // private SalaryArchiveSobService salaryArchiveSobService; // @@ -324,14 +315,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch rows.add(header); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listAll(); - Collection salaryArchives = new ArrayList<>(); - - if (queryParam.isExtSalaryArchiveList()) { - //非系统人员档案 - salaryArchives = getSalaryArchiveMapper().listExtSalaryArchive(queryParam); - } else { - salaryArchives = getSalaryArchiveMapper().list(queryParam); - } + Collection salaryArchives = salaryArchiveService(user).getSalaryArchiveList(queryParam); long employeeId = user.getUID(); if (getTaxAgentService(user).isNeedAuth(employeeId)) { @@ -413,6 +397,9 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch + SalaryI18nUtil.getI18nLabel(user.getLanguage(),16250, "入职") + "、" + SalaryI18nUtil.getI18nLabel(user.getLanguage(),6088, "转正") + "、" + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542686, "调薪") + "、" + + SalaryI18nUtil.getI18nLabel(user.getLanguage(),0, "晋升") + "、" + + SalaryI18nUtil.getI18nLabel(user.getLanguage(),0, "降职") + "、" + + SalaryI18nUtil.getI18nLabel(user.getLanguage(),0, "调岗") + "、" + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542688, "调岗调薪") + "、" + SalaryI18nUtil.getI18nLabel(user.getLanguage(),6091, "离职") + "、" + SalaryI18nUtil.getI18nLabel(user.getLanguage(),25740, "其他") + "、" @@ -835,7 +822,8 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch List taxAgentRanges = importHandleParam.getTaxAgentRanges(); List salaryArchiveSobSaves = importHandleParam.getSalaryArchiveSobSaves(); - + Map empMap = SalaryEntityUtil.convert2Map(importHandleParam.getEmployees(), DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + Map taxAgentMap = SalaryEntityUtil.convert2Map(importHandleParam.getTaxAgentList(), TaxAgentManageRangeEmployeeDTO::getTaxAgentId, TaxAgentManageRangeEmployeeDTO::getTaxAgentName); // 新增薪资档案 if (CollectionUtils.isNotEmpty(salaryArchiveSaves)) { // 去除已经存在的,避免重复 @@ -848,8 +836,24 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch } // 修改薪资档案 if (CollectionUtils.isNotEmpty(salaryArchiveUpdates)) { + // 查询更新前档案信息 + List oldArchive = salaryArchiveService(user).listSome(SalaryArchivePO.builder().ids(salaryArchiveUpdates.stream().map(SalaryArchivePO::getId).collect(Collectors.toList())).build()); + Map oldArchiveMap = SalaryEntityUtil.convert2Map(oldArchive, SalaryArchivePO::getId); // 薪资档案 salaryArchiveMapper.batchUpdate(salaryArchiveUpdates); + // 记录日志 + salaryArchiveUpdates.stream().forEach(a -> { + SalaryArchivePO oldPO = oldArchiveMap.getOrDefault(a.getId(), SalaryArchivePO.builder().build()); + String name = taxAgentMap.getOrDefault(a.getTaxAgentId(), StringUtils.EMPTY) + "-" + empMap.getOrDefault(a.getEmployeeId(), StringUtils.EMPTY); + SalaryLoggerUtil.recordUpdateSingleLog(SalaryElogConfig.salaryArchiveLoggerTemplate, + a.getId(), + name, + SalaryI18nUtil.getI18nLabel(0, "薪资档案导入更新"), + SalaryI18nUtil.getI18nLabel(0, "薪资档案导入更新") + name, + oldPO, + a, + user); + }); } // 薪资档案-薪资项目 if (CollectionUtils.isNotEmpty(salaryArchiveItemDelSalaryItemIds)) { diff --git a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java index 5a497f0fa..d4620662d 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java @@ -5,6 +5,7 @@ import com.engine.core.impl.Service; import com.engine.salary.biz.SalaryArchiveBiz; import com.engine.salary.biz.SalaryArchiveItemBiz; import com.engine.salary.biz.SalaryItemBiz; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO; @@ -25,6 +26,7 @@ import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.SalaryLoggerUtil; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.valid.ValidUtil; @@ -247,6 +249,20 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi // 构建更新PO SalaryArchiveItemPO updateSalaryArchiveItemPO = buildUpdateSalaryArchiveItemPO(salaryArchiveItemSaveParam, salaryArchiveItems, salaryItemIds, salaryArchiveItem); salaryArchiveItemMapper.updateIgnoreNull(updateSalaryArchiveItemPO, user); + + // 查询更新后的po + SalaryArchiveItemPO saiNew = salaryArchiveItemMapper.getById(updateSalaryArchiveItemPO.getId()); + // 记录操作日志 + String name = SalaryI18nUtil.getI18nLabel(0, "编辑调薪记录"); + SalaryLoggerUtil.recordUpdateSingleLog(SalaryElogConfig.salaryArchiveItemAdjustLoggerTemplate, + saiNew.getId(), + name + ":" + saiNew.getId(), + name, + name + ":" + saiNew.getId(), + salaryArchiveItem, + saiNew, + user + ); } return StringUtils.EMPTY; } @@ -565,6 +581,15 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi salaryArchiveItem.setDeleteType(1); // 删除未生效数据 salaryArchiveItemMapper.updateById(salaryArchiveItem, user); + // 记录日志 + String operateName = SalaryI18nUtil.getI18nLabel(0, "删除调薪记录"); + SalaryLoggerUtil.recordDeleteSingleLog(SalaryElogConfig.salaryArchiveItemAdjustLoggerTemplate, + salaryArchiveItem.getId(), + operateName + ":" + salaryArchiveItem.getId(), + operateName, + operateName, + salaryArchiveItem, + user); // } else { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98299, "该薪资项目已生效不可删除")); // } diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 02bd7f986..609853415 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -5,8 +5,11 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.*; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SalaryItemConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveBO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; @@ -21,6 +24,7 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryarchive.*; @@ -39,6 +43,7 @@ import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; @@ -48,7 +53,6 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.time.DateUtils; @@ -163,7 +167,22 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe if (queryParam.isExtSalaryArchiveList()) { return getSalaryArchiveMapper().listExtSalaryArchive(queryParam); } - return getSalaryArchiveMapper().list(queryParam); + if (StringUtils.isNotBlank(queryParam.getPayStartDateStartDateStr())) { + queryParam.setPayStartDateStartDate(SalaryDateUtil.stringToDate(queryParam.getPayStartDateStartDateStr())); + } + if (Objects.nonNull(queryParam.getPayStartDateEndDateStr())) { + queryParam.setPayStartDateEndDate(SalaryDateUtil.stringToDate(queryParam.getPayStartDateEndDateStr())); + } + + if (StringUtils.isNotBlank(queryParam.getPayEndDateStartDateStr())) { + queryParam.setPayEndDateStartDate(SalaryDateUtil.stringToDate(queryParam.getPayEndDateStartDateStr())); + } + if (Objects.nonNull(queryParam.getPayEndDateEndDateStr())) { + queryParam.setPayEndDateEndDate(SalaryDateUtil.stringToDate(queryParam.getPayEndDateEndDateStr())); + } + + List list = getSalaryArchiveMapper().list(queryParam); + return SalaryI18nUtil.i18nList(list); } @Override @@ -320,11 +339,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe @Override public void deleteSalaryArchive(Collection salaryArchiveIds) { - if(CollectionUtils.isEmpty(salaryArchiveIds)){ + if (CollectionUtils.isEmpty(salaryArchiveIds)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544759,"薪资档案参数为空!")); } SalarySysConfPO canDelete = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ARCHIVE_DELETE); - if(Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(),"0") ){ + if (Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(), "0")) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544760,"不允许删除薪资档案,请先开启删除档案规则配置!")); } List salaryArchiveList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build()); @@ -333,17 +352,17 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List canDeleteTaxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()) .stream().map(TaxAgentPO::getId).collect(Collectors.toList()); boolean err = salaryArchiveList.stream().anyMatch(po -> !canDeleteTaxAgentIds.contains(po.getTaxAgentId())); - if(CollectionUtils.isEmpty(salaryArchiveList) || err){ + if (CollectionUtils.isEmpty(salaryArchiveList) || err) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544761,"薪资档案不存在,或没有权限删除该薪资档案!")); } Optional fixedList = salaryArchiveList.stream().filter(archive -> !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.PENDING.getValue()) && !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())).findFirst(); - if(fixedList.isPresent()){ + if (fixedList.isPresent()) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544762,"发薪员工、待停薪员工、停薪_来自待停薪,无法删除薪资档案!")); } List deleteIds = salaryArchiveList.stream().map(SalaryArchivePO::getId).collect(Collectors.toList()); // 删除薪资档案及档案项目 - if(CollectionUtils.isNotEmpty(deleteIds)){ + if (CollectionUtils.isNotEmpty(deleteIds)) { getSalaryArchiveMapper().deleteByIds(deleteIds); getSalaryArchiveItemMapper().deleteBySalaryArchiveId(deleteIds); } @@ -432,7 +451,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List salaryItemIds = salaryItems.stream().map(SalaryItemPO::getId).collect(Collectors.toList()); // 1.获取薪资档案所对应的当前生效的薪资项目数据 List salaryArchiveItemList = Collections.emptyList(); - if(CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage){ + if (CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage) { salaryArchiveItemList = getCurrentEffectiveItemList(ids, salaryItemIds); } List finalSalaryArchiveItemList = salaryArchiveItemList; @@ -462,7 +481,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List> listMaps = new ArrayList<>(); salaryArchives.forEach(e -> { UserStatusEnum userStatusEnum = UserStatusEnum.parseByValue(Integer.parseInt(e.getEmployeeStatus())); -// e.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus()))); +// e.setEmployeeStatus(NumberUtils.isCreatable(e.getEmployeeStatus()) ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus())) : ""); e.setEmployeeStatus(SalaryI18nUtil.getI18nLabel(user.getLanguage(), userStatusEnum.getLabelId(), userStatusEnum.getDefaultLabel())); Map map = new LinkedHashMap<>(); @@ -580,6 +599,17 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 3.表数据 // return ExcelUtil.genWorkbookV2(rows, sheetName); + + // 记录日志 + String statusStr = StringUtils.join(queryParam.getRunStatusList().stream().map(status -> SalaryArchiveStatusEnum.parseByValue(status).getDefaultLabel()).collect(Collectors.toList()), ","); + String name = SalaryI18nUtil.getI18nLabel(0, "导出"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "薪资档案 ") + statusStr); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "薪资档案") + "-" + name); + loggerContext.setUser(user); + SalaryElogConfig.salaryArchiveLoggerTemplate.write(loggerContext); return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -711,6 +741,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } salaryArchive.setPayEndDate(saveParam.getPayEndDate()); } + salaryArchive.setUpdateTime(new Date()); getSalaryArchiveMapper().update(salaryArchive); // List salarySobList = getSalarySobList(currentEmployeeId, currentTenantKey); @@ -718,9 +749,49 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // List salaryArchiveSobSaveList = SalaryArchiveBO.buildSalaryArchiveSob(salaryArchive.getId(), salarySobIds, LocalDateTime.now()); // this.salaryArchiveSobService.saveBatchBySalaryArchiveIdsAndSaves(Collections.singletonList(salaryArchive.getId()), salaryArchiveSobSaveList, currentTenantKey); + // 记录日志 + List newList = Collections.singletonList(this.getById(salaryArchive.getId())); + String operatedesc = SalaryI18nUtil.getI18nLabel(0, "发薪设置"); + recordLog(oldList, newList, operatedesc); + return StringUtils.EMPTY; } + /** + * 记录日志 + * + * @param oldSalaryArchiveList + * @param newSalaryArchiveList + * @param operatedesc + */ + private void recordLog(List oldSalaryArchiveList, List newSalaryArchiveList, String operatedesc) { + if (CollectionUtils.isEmpty(oldSalaryArchiveList) || CollectionUtils.isEmpty(oldSalaryArchiveList)) { + return; + } + List updateEmpIds = newSalaryArchiveList.stream().map(SalaryArchivePO::getEmployeeId).distinct().collect(Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(updateEmpIds); + Map empMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + + + // 获取所有个税扣缴义务人 + Collection taxAgents = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + String bar = "-"; + oldSalaryArchiveList.forEach(e -> { + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(e.getId())); + loggerContext.setTargetName( Optional.ofNullable(taxAgentMap.get(e.getTaxAgentId())).orElse(StringUtils.EMPTY) + bar + Optional.ofNullable(empMap.get(e.getEmployeeId())).orElse(StringUtils.EMPTY) ); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(operatedesc); + loggerContext.setOperatedesc(operatedesc); + loggerContext.setOldValues(e); + Optional optionalNew = newSalaryArchiveList.stream().filter(n -> n.getId().equals(e.getId())).findFirst(); + loggerContext.setNewValues(optionalNew.isPresent() ? optionalNew.get() : null); + SalaryElogConfig.salaryArchiveLoggerTemplate.write(loggerContext); + }); + } + @Override public List dimissionSets() { @@ -764,11 +835,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 获取核算人员规则 List statusList = Collections.emptyList(); SalarySysConfPO employeeRule = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ACCT_EMPLOYEE_RULE); - if(Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())){ + if (Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())) { // 默认包含停薪列表 statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue(), - SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue() ); - }else{ + SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()); + } else { // 仅包含发薪、待定薪 statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue()); } @@ -1070,6 +1141,10 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } // 从待定薪到停薪 getSalaryArchiveMapper().deletePendingTodo(ids); + // 记录日志 + List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + String operatedesc = SalaryI18nUtil.getI18nLabel(0, "删除待办"); + recordLog(oldList, newList, operatedesc); return StringUtils.EMPTY; } @@ -1100,6 +1175,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List> partition = Lists.partition((List) ids, 1000); partition.forEach(getSalaryArchiveMapper()::gotoFixed); + // 记录日志 + List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + String operateDesc = SalaryI18nUtil.getI18nLabel(0, "设为发薪员工"); + recordLog(salaryArchiveList, newList, operateDesc); + // 获取所有可被引用的薪资项目 List salaryItemIds = getSalaryArchiveItemService(user).getCanAdjustSalaryItems().stream().map(SalaryItemPO::getId).collect(Collectors.toList()); List currentEffectiveItemList = getSalaryArchiveItemService(user).getCurrentEffectiveItemListIngoreValue(ids, salaryItemIds) @@ -1164,6 +1244,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 从待停薪到停薪 getSalaryArchiveMapper().gotoStop(ids); + // 记录日志 + List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + String operatedesc = SalaryI18nUtil.getI18nLabel(0, "停薪"); + recordLog(oldList, newList, operatedesc); + Map resultMap = new HashMap<>(2); String resultMsg = SalaryI18nUtil.getI18nLabel(user.getLanguage(),30700, "操作成功"); String resultType = "success"; @@ -1235,7 +1320,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } // 删除最后发薪日期,设置状态为发薪 if (CollectionUtils.isNotEmpty(list)) { - getSalaryArchiveMapper().deleteSuspendTodo(list.stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList())); + List salaryArchiveIds = list.stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList()); + getSalaryArchiveMapper().deleteSuspendTodo(salaryArchiveIds); + // 记录日志 + List oldList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build()); + List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + String operatedesc = SalaryI18nUtil.getI18nLabel(0, "删除待办"); + recordLog(oldList, newList, operatedesc); } return StringUtils.EMPTY; } @@ -1269,6 +1360,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 从停薪到定薪 getSalaryArchiveMapper().gotoFixedFromStop(ids); + // 记录日志 + List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + String operatedesc = SalaryI18nUtil.getI18nLabel(0, "取消停薪"); + recordLog(oldList, newList, operatedesc); + return StringUtils.EMPTY; } @@ -1330,4 +1426,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe salaryArchiveMapper.batchUpdate(archives); return "执行完毕"; } + + @Override + public List listPayStartDateIsNull(String runStatus) { + if (StringUtils.isBlank(runStatus)) { + return Collections.emptyList(); + } + return getSalaryArchiveMapper().listPayStartDateIsNull(runStatus); + } } diff --git a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java index 71a506428..d4e49119a 100644 --- a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java @@ -22,7 +22,7 @@ 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 com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.StringUtils; @@ -96,18 +96,24 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB // 工资单确认和反馈 =========================================================== SalaryBillAckFeedbackDTO ackFeedbackSetting = saveParam.getAckFeedbackSetting(); // 1.保存确认反馈开关状态 - getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAckStatus(), SALARY_SEND_FEEDBACK, "工资单确认反馈状态", "billSend"); + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAckStatus(), SALARY_SEND_FEEDBACK, "工资单确认状态", "billSend"); + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getFeedbackStatus(), SALARY_SEND_FEEDBACK_FK, "工资单反馈状态", "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"); } + if (StringUtils.equals(ackFeedbackSetting.getFeedbackStatus(), "1")) { + // 保存反馈地址 + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getFeedBackUrl(), SALARY_FEEDBACK_URL, "工资单反馈地址", "billSend"); + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getMobileFeedbackUrl(), SALARY_FEEDBACK_URL_MOBILE, "移动端工资单反馈地址", "billSend"); + } + // 工资单时效性设置 salaryBillViewingLimitSetting salaryBillViewingLimitDTO = saveParam.getSalaryBillViewingLimitSetting(); if (salaryBillViewingLimitDTO != null) { getSalarySysConfService(user).saveSettingByType(Util.null2String(salaryBillViewingLimitDTO.getLimitMonth()), SALARY_BILL_VIEWING_LIMIT_MONTH, "工资单时效性设置", "billSend"); + getSalarySysConfService(user).saveSettingByType(Util.null2String(salaryBillViewingLimitDTO.getBurningAfterReadingMin()), SALARY_BILL_BURNING_AFTER_READING_MIN, "工资单查看后销毁设置", "billSend"); } return StringUtils.EMPTY; } @@ -126,38 +132,60 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB @Override public SalaryBillAckFeedbackDTO getDefaultAckFeedbackSetting() { // 获取反馈开启状态、自动确认时长、反馈地址 - List codes = Arrays.asList(SalarySysConstant.SALARY_SEND_FEEDBACK, SalarySysConstant.SALARY_AUTO_ACK_DAYS, SalarySysConstant.SALARY_FEEDBACK_URL); + List codes = Arrays.asList(SalarySysConstant.SALARY_SEND_FEEDBACK, SalarySysConstant.SALARY_SEND_FEEDBACK_FK ,SalarySysConstant.SALARY_AUTO_ACK_DAYS, SalarySysConstant.SALARY_FEEDBACK_URL, SALARY_FEEDBACK_URL_MOBILE); 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; - } + // if (StringUtils.equals(ackStatus, "0")) { + // // 未开启工资单确认 + // defaultAckFeedBackDTO.setAckStatus("0"); + // defaultAckFeedBackDTO.setAutoAckDays(0); + // defaultAckFeedBackDTO.setFeedBackUrl("/"); + // defaultAckFeedBackDTO.setMobileFeedbackUrl("/"); + // return defaultAckFeedBackDTO; + // } defaultAckFeedBackDTO.setAckStatus(ackStatus); + + + String feedbackStatus = sysConfMap.get(SALARY_SEND_FEEDBACK_FK); + if (feedbackStatus == null) { + // 处理历史数据 + feedbackStatus = ackStatus; + } + defaultAckFeedBackDTO.setFeedbackStatus(feedbackStatus); + // 获取超时自动确认时间 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); + + String mobileFeedbackUrl = sysConfMap.getOrDefault(SALARY_FEEDBACK_URL_MOBILE, ""); + defaultAckFeedBackDTO.setMobileFeedbackUrl(mobileFeedbackUrl); return defaultAckFeedBackDTO; } @Override public salaryBillViewingLimitSetting getSalaryBillViewingLimitSetting() { - SalarySysConfPO limitMonthSetting = getSalarySysConfService(user).getOneByCode(SALARY_BILL_VIEWING_LIMIT_MONTH); - int limitMonth = 0; if (limitMonthSetting != null && NumberUtils.isNumber(limitMonthSetting.getConfValue())) { limitMonth = Integer.parseInt(limitMonthSetting.getConfValue()); } return salaryBillViewingLimitSetting.builder().limitMonth(limitMonth).build(); } + + @Override + public Integer getBurningAfterReadingMin() { + SalarySysConfPO ineffectiveMinSetting = getSalarySysConfService(user).getOneByCode(SALARY_BILL_BURNING_AFTER_READING_MIN); + if (ineffectiveMinSetting == null || StringUtils.isBlank(ineffectiveMinSetting.getConfValue()) || !NumberUtils.isNumber(ineffectiveMinSetting.getConfValue())) { + // 代表该设置不生效,即首次读后可以一直查看 + return null; + } else { + return Integer.parseInt(ineffectiveMinSetting.getConfValue()); + } + } } diff --git a/src/com/engine/salary/service/impl/SalaryBillItemNameServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillItemNameServiceImpl.java index 170390108..081453ba9 100644 --- a/src/com/engine/salary/service/impl/SalaryBillItemNameServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillItemNameServiceImpl.java @@ -15,7 +15,7 @@ import com.engine.salary.service.SalaryTemplateService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java index feb8e26cc..d53bdb128 100644 --- a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java @@ -8,7 +8,9 @@ import com.engine.core.impl.Service; import com.engine.salary.biz.SalarySendBiz; import com.engine.salary.biz.SalarySendInfoBiz; import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.HrmSalaryPayrollConf; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.salaryBill.bo.SalaryBillBO; @@ -24,6 +26,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.OperateTypeEnum; import com.engine.salary.enums.salarybill.*; import com.engine.salary.enums.salarysend.SalarySendGrantTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -758,6 +761,19 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService salarySendNew.setLastSendTime(new Date()); mapper.updateById(salarySendNew); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setTargetId(String.valueOf(salarySend.getId())); + loggerContext.setTargetName(SalaryDateUtil.getFormatYearMonth(salarySend.getSalaryMonth()) + "-" + (salarySob == null ? "" : salarySob.getName())); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0,"工资单发放")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0,"工资单发放")); + loggerContext.setOldValues(salarySend); + loggerContext.setNewValues(salarySendNew); + loggerContext.setOperator(user.getUID() + StringUtils.EMPTY); + loggerContext.setOperatorName(Objects.isNull(user) ? StringUtils.EMPTY : user.getUsername()); + SalaryElogConfig.salarySendLoggerTemplate.write(loggerContext); } // /** diff --git a/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java index edae9c75c..35f98ecbe 100644 --- a/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java @@ -215,7 +215,7 @@ public class SalaryComparisonResultServiceImpl extends Service implements Salary } else { SalaryAcctEmployeeQueryParam accEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder() .salaryAcctRecordId(queryParam.getSalaryAcctRecordId()) - .ids(SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId)) + .ids(SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId, Collectors.toList())) .build(); List salaryAcctEmployeePOS4ConsolidatedTax = getSalaryAcctEmployeeService(user).listByParam4ConsolidatedTax(accEmployeeQueryParam); salaryAcctEmployeeIds4ConsolidatedTax = SalaryEntityUtil.properties(salaryAcctEmployeePOS4ConsolidatedTax, SalaryAcctEmployeePO::getId); diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 75bf1fbae..fb343af61 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -19,6 +19,8 @@ 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.enums.salarysob.TargetTypeEnum; +import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.ExtEmpService; @@ -27,8 +29,9 @@ 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; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -60,6 +63,10 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } + private EmployMapper getEmployMapper() { + return SqlProxyHandle.getProxy(EmployMapper.class); + } + private ExpandFieldSettingsMapper getExpandFieldSettingsMapper() { return SqlProxyHandle.getProxy(ExpandFieldSettingsMapper.class); @@ -91,6 +98,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee result.addAll(employBiz.listAll()); result.addAll(getExtEmpService(user).listEmployee()); } + SalaryI18nUtil.i18nList(result); return result; } @@ -100,6 +108,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee if (openExtEmp) { result.addAll(getExtEmpService(user).listAllForReport()); } + SalaryI18nUtil.i18nList(result); return result; } @@ -145,7 +154,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee includeSalaryEmployees.addAll(extEmps); } - + SalaryI18nUtil.i18nList(includeSalaryEmployees); return includeSalaryEmployees; } @@ -158,23 +167,34 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee if (openExtEmp) { employeeList.addAll(getExtEmpService(user).getEmployeeByIds(ids)); } + SalaryI18nUtil.i18nList(employeeList); return employeeList; } @Override public List listByIds(List ids) { - return employBiz.getEmployeeByIdsAll(ids); + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + List result = new ArrayList<>(); + if (openExtEmp) { + result.addAll(getExtEmpService(user).getEmployeeByIds(ids)); + } + result.addAll(employBiz.getEmployeeByIdsAll(ids)); + SalaryI18nUtil.i18nList(result); + return result; } @Override public DataCollectionEmployee getEmployeeById(Long employeeId) { if (openExtEmp) { - DataCollectionEmployee employeeById = getExtEmpService(user).getEmployeeById(employeeId); - if (Objects.nonNull(employeeById)) { - return employeeById; + DataCollectionEmployee employee = getExtEmpService(user).getEmployeeById(employeeId); + if (Objects.nonNull(employee)) { + return SalaryI18nUtil.i18n(employee); } } - return employBiz.getEmployeeById(employeeId); + DataCollectionEmployee employee = employBiz.getEmployeeById(employeeId); + return SalaryI18nUtil.i18n(employee); } @Override @@ -190,8 +210,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee employeeList.addAll(getExtEmpService(user).getEmployeeByIds(longs)); } } - - return employeeList; + return SalaryI18nUtil.i18nList(employeeList); } @@ -206,19 +225,17 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) .collect(Collectors.toList()); - return employeeSameIds; + return SalaryI18nUtil.i18nList(employeeSameIds); } @Override - public List matchImportEmployee(List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid) { + public List matchImportEmployee(String confValue, List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid) { if (uid != null) { return employeeList.stream() .filter(e -> Objects.equals(e.getEmployeeId(), uid)) .collect(Collectors.toList()); } - //查询对于人员信息导入筛选的全局配置 - String confValue = empValidType(); List employees = new ArrayList<>(); //“0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 if ("0".equals(confValue)) { @@ -231,7 +248,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee .collect(Collectors.toList()); } - return employees; + return SalaryI18nUtil.i18nList(employees); } @@ -249,17 +266,35 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List getDeptInfoList(List departmentIds) { - return employBiz.getDeptInfoList(departmentIds); + return SalaryI18nUtil.i18nList(employBiz.getDeptInfoList(departmentIds)); } + @Override + public List getVirtualDeptInfoList(List virtualDepartmentIds) { + if (CollectionUtils.isEmpty(virtualDepartmentIds)) { + return Collections.emptyList(); + } + return SalaryI18nUtil.i18nList(getEmployMapper().getVirtualDeptInfoList(virtualDepartmentIds)); + } + + @Override public List getSubCompanyInfoList(List subDepartmentIds) { - return employBiz.getSubCompanyInfoList(subDepartmentIds); + return SalaryI18nUtil.i18nList(employBiz.getSubCompanyInfoList(subDepartmentIds)); } + @Override + public List getVirtualSubCompanyInfoList(List virtualSubDepartmentIds) { + if (CollectionUtils.isEmpty(virtualSubDepartmentIds)) { + return Collections.emptyList(); + } + return SalaryI18nUtil.i18nList(getEmployMapper().getVirtualSubCompanyInfoList(virtualSubDepartmentIds)); + } + + @Override public List listPositionInfo(List positionIds) { - return employBiz.listPositionInfo(positionIds); + return SalaryI18nUtil.i18nList(employBiz.listPositionInfo(positionIds)); } @Override @@ -268,16 +303,30 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee if (openExtEmp) { result.addAll(getExtEmpService(user).listEmployee()); } - return result; + return SalaryI18nUtil.i18nList(result); } @Override public List listByParams(List includeQueryParams) { + if (CollectionUtils.isEmpty(includeQueryParams)) { + return Collections.emptyList(); + } + List result = employBiz.listByParams(includeQueryParams); if (openExtEmp) { result.addAll(getExtEmpService(user).listByParams(includeQueryParams)); } - return result; + // 查询虚拟部门、分部人员信息 + List virtualParams = includeQueryParams.stream().filter(param -> + (param.getTargetType().equals(TargetTypeEnum.SUBCOMPANY.name()) || param.getTargetType().equals(TargetTypeEnum.DEPT.name())) && ((List) param.getTargetIds()).get(0).compareTo(0L) < 0 + ).collect(Collectors.toList()); + + result.addAll(employBiz.listByVirtualParams(virtualParams)); + + // 从hrmresource和hrmresourcevirtual可能获取到重复人员数据,需要根据人员id去重 + result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new)); + + return SalaryI18nUtil.i18nList(result); } /** @@ -321,7 +370,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee .forEach(e -> e.setExtendData(extendData)); } } - return employees; + return SalaryI18nUtil.i18nList(employees); } @Override @@ -440,4 +489,20 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee employee.setChildren(getChildren(employee, all)); }).collect(Collectors.toList()); } + + @Override + public List getVirtualEmpByVirtualDepIds(List virtualDepartmentIds) { + if (CollectionUtils.isEmpty(virtualDepartmentIds)) { + return Collections.emptyList(); + } + return getEmployMapper().listVirtualEmpByVirtualDepIds(virtualDepartmentIds); + } + + @Override + public List getVirtualEmpByVirtualSubCompanyIds(List virtualSubCompanyIds) { + if (CollectionUtils.isEmpty(virtualSubCompanyIds)) { + return Collections.emptyList(); + } + return getEmployMapper().listVirtualEmpByVirtualSubCompanyIds(virtualSubCompanyIds); + } } diff --git a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java index 41e9c62ba..9e2cd4314 100644 --- a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java @@ -23,7 +23,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 2aa7bf15c..0cdddf973 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -5,6 +5,8 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SalaryItemBiz; import com.engine.salary.biz.SysSalaryItemBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryformula.po.FormulaPO; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.bo.SalaryItemBO; @@ -19,6 +21,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; import com.engine.salary.enums.sicategory.SharedTypeEnum; @@ -79,7 +82,6 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService return ServiceUtil.getService(SalarySobServiceImpl.class, user); } - private SysSalaryItemBiz sysSalaryItemBiz = new SysSalaryItemBiz(); // @Autowired // private LoggerTemplate salaryItemLoggerTemplate; @@ -192,7 +194,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService // } @Override - public void save(SalaryItemSaveParam saveParam) { + public SalaryItemPO save(SalaryItemSaveParam saveParam) { // 名称不能和已有的自定义薪资项目重名 // List salaryItemPOS = listByName(saveParam.getName()); if (checkSameSalaryItemName(saveParam.getId(), saveParam.getName(), false)) { @@ -205,15 +207,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService } SalaryItemPO salaryItemPO = SalaryItemBO.convert2SalaryItemPO(saveParam, (long) user.getUID()); salaryItemBiz.insert(salaryItemPO); - // todo 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(salaryItemPO.getId())); -// loggerContext.setTargetName(salaryItemPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98329, "新建薪资项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98329, "新建薪资项目") + ": " + salaryItemPO.getName()); -// loggerContext.setNewValues(salaryItemPO); -// salaryItemLoggerTemplate.write(loggerContext); + return salaryItemPO; } @Override @@ -222,7 +216,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService } @Override - public void update(SalaryItemSaveParam saveParam) { + public SalaryItemPO update(SalaryItemSaveParam saveParam) { // 查询薪资项目,判断薪资项目是否存在 SalaryItemPO salaryItemPO = getById(saveParam.getId()); if (Objects.isNull(salaryItemPO)) { @@ -257,6 +251,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService newSalaryItemPO.setSharedType(saveParam.getSharedType()); newSalaryItemPO.setTaxAgentIds(saveParam.getTaxAgentIds()); newSalaryItemPO.setSortedIndex(saveParam.getSortedIndex()); + newSalaryItemPO.setWidth(saveParam.getWidth()); salaryItemBiz.updateById(newSalaryItemPO); //改名后更新公式 @@ -285,17 +280,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService } } - - // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(newSalaryItemPO.getId())); -// loggerContext.setTargetName(newSalaryItemPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93892, "编辑薪资项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93892, "编辑薪资项目") + ": " + newSalaryItemPO.getName()); -// loggerContext.setOldValues(salaryItemPO); -// loggerContext.setNewValues(newSalaryItemPO); -// salaryItemLoggerTemplate.write(loggerContext); + return salaryItemPO; } private void changeName(SalaryItemPO salaryItemPO, String oldName, String newName, String itemPrefix, String fieldNamePrefix) { @@ -349,17 +334,36 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService // 删除薪资项目 ids = SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getId); salaryItemBiz.deleteByIds(ids); - //todo 记录删除日志 -// salaryItemPOS.forEach(salaryItemPO -> { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(salaryItemPO.getId())); -// loggerContext.setTargetName(salaryItemPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98323, "删除薪资项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98323, "删除薪资项目") + ": " + salaryItemPO.getName()); -// loggerContext.setOldValues(salaryItemPO); -// salaryItemLoggerTemplate.write(loggerContext); -// }); + Integer useInEmployeeSalary = salaryItemPOS.get(0).getUseInEmployeeSalary(); + // 记录删除日志 + if (useInEmployeeSalary == 0) { + // 薪资项目 + salaryItemPOS.forEach(salaryItemPO -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryItemPO.getId())); + loggerContext.setTargetName(salaryItemPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除薪资项目")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除薪资项目") + ": " + salaryItemPO.getName()); + loggerContext.setOldValues(salaryItemPO); + SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext); + }); + } else { + // 字段管理 + salaryItemPOS.forEach(salaryItemPO -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryItemPO.getId())); + loggerContext.setTargetName(salaryItemPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除字段")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除字段") + ": " + salaryItemPO.getName()); + loggerContext.setOldValues(salaryItemPO); + SalaryElogConfig.salaryArchiveFieldLoggerTemplate.write(loggerContext); + }); + } + } @@ -424,6 +428,9 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService List salarySobItemList = getSalarySobItemService(user).listBySalaryItemIds(Collections.singleton(salaryItemId)); Set salarySobIds = SalaryEntityUtil.properties(salarySobItemList, SalarySobItemPO::getSalarySobId); List salarySobs = getSalarySobService(user).listByIds(salarySobIds); + // 获取能够管理的义务人 + Set taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())), TaxAgentPO::getId); + salarySobs = salarySobs.stream().filter(sob -> taxAgentIds.contains(sob.getTaxAgentId())).collect(Collectors.toList()); return salarySobs.stream().map(m -> { Map map = new HashMap<>(); map.put("id", String.valueOf(m.getId())); diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index ee232e7ce..f8e6ca21f 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -11,10 +11,13 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SalarySendBiz; import com.engine.salary.biz.SalarySendInfoBiz; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryArchiveConstant; import com.engine.salary.constant.SalaryItemConstant; import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; +import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryBill.bo.SalaryBillBO; import com.engine.salary.entity.salaryBill.dto.*; @@ -36,6 +39,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum; import com.engine.salary.enums.salarybill.BillConfimStatusEnum; @@ -59,12 +63,12 @@ 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.IdGenerator; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; @@ -507,6 +511,27 @@ public class SalarySendServiceImpl extends Service implements SalarySendService if(ObjectUtils.isEmpty(salarySendPO)){ throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544320, "工资单不存在")); } + // 获取、记录首次查看时间 + Date firstReadingTime = new Date(); + if (salarySendInfo.getFirstReadingTime() == null) { + salarySendInfo.setFirstReadingTime(firstReadingTime); + getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo); + } else { + // 不是首次查看 + firstReadingTime = salarySendInfo.getFirstReadingTime(); + // 获取首次查看后多少分钟不能查看工资单(0代表一旦查看后无法再次查看,null代表不限制) + Integer burningAfterReadingMin = getSalaryBillBaseSetService(user).getBurningAfterReadingMin(); + if (burningAfterReadingMin != null) { + LocalDateTime limitTime = SalaryDateUtil.dateToLocalDateTime(firstReadingTime).plusMinutes(burningAfterReadingMin); + LocalDateTime now = SalaryDateUtil.dateToLocalDateTime(new Date()); + if (burningAfterReadingMin == 0) { + throw new SalaryRunTimeException("无法查看工资单,该工资单仅供查看一次。首次查看时间为:" + SalaryDateUtil.getFormatLocalDateTime(firstReadingTime)); + } else if (limitTime.isBefore(now)) { + throw new SalaryRunTimeException("首次查看工资单" + burningAfterReadingMin + "分钟后,无法查看工资单。首次查看时间为:" + SalaryDateUtil.getFormatLocalDateTime(firstReadingTime)); + } + } + } + // 更新查看状态 if (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(), BillReadStatusEnum.UNREAD.getValue()) == 0) { salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); @@ -534,6 +559,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } SalaryTemplatePO salaryTemplate = buildSalaryTemplateContent(salaryTemplateContent); + if (StringUtils.isNotBlank(salaryTemplate.getFeedbackUrl()) && StringUtils.isBlank(salaryTemplate.getMobileFeedbackUrl())) { + // 如果设置了pc反馈地址,没有设置移动端反馈地址,则移动端反馈地址默认等于pc反馈地址 + salaryTemplate.setMobileFeedbackUrl(salaryTemplate.getFeedbackUrl()); + } // 判断是否是补发 boolean isReplenish = NumberUtils.INTEGER_ONE.equals(salarySendInfo.getSalaryAcctType()); @@ -700,20 +729,47 @@ 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) { - // 反馈后还可以确认或反馈按钮,确认后2个按钮消失 - Integer confirmStatus = salarySendInfo.getBillConfirmStatus(); - if (confirmStatus == null || confirmStatus != BillConfimStatusEnum.CONFIRMED.getValue()) { - map.put("confirmStatus", "0"); + // 开启了工资单确认 + Integer ackStatus = salarySendInfo.getBillConfirmStatus(); + if (ackStatus == null || ackStatus != BillConfimStatusEnum.CONFIRMED.getValue()) { + map.put("showAck", "1"); } else { - map.put("confirmStatus", "1"); + map.put("showAck", "0"); } map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId()); } else { - map.put("confirmStatus", "1"); + map.put("showAck", "0"); } + + // 工资单反馈 + if (NumberUtils.compare(salaryTemplate.getFeedbackStatus(), 1) == 0) { + // 开启了工资单反馈按钮 + Integer confirmStatus = salarySendInfo.getBillConfirmStatus(); + map.put("showFeedback", "1"); + // 除非确认状态为已确认否则可以一直反馈 + if (NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(), 1) == 0 && confirmStatus != null && confirmStatus == BillConfimStatusEnum.CONFIRMED.getValue()) { + map.put("showFeedback", "0"); + } + map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId()); + } else { + map.put("showFeedback", "0"); + } + + + // 记录查看日志 + String targetName = taxAgentPO.getName() + "-" + SalaryDateUtil.getFormatYearMonth(salarySendInfo.getSalaryMonth()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salarySendInfo.getId())); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.READ.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "查看工资单") + ": " + targetName + " " + salaryInfoId); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "查看工资单") + ": " + targetName); + SalaryElogConfig.mySalaryBillLoggerTemplate.write(loggerContext); return map; } @@ -779,7 +835,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544322, "请先设置工资单模板")); } Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); - if (ackFeedbackStatus != null && NumberUtils.compare(ackFeedbackStatus, 1) == 0) { + Integer feedbackStatus = salaryTemplates.get(0).getFeedbackStatus(); + if ( (ackFeedbackStatus != null && NumberUtils.compare(ackFeedbackStatus, 1) == 0) + || (feedbackStatus != null && NumberUtils.compare(feedbackStatus, 1) == 0)) { // 默认为空时,未读未确认 pageInfo.getList().stream().forEach(obj -> { SalarySendInfoListDTO dto = (SalarySendInfoListDTO) obj; @@ -901,11 +959,12 @@ public class SalarySendServiceImpl extends Service implements SalarySendService */ private SalaryTemplatePO buildSalaryTemplateContent(String salaryTemplateContent) { Map map = JsonUtil.parseMap(salaryTemplateContent, Object.class); - return SalaryTemplatePO.builder() + SalaryTemplatePO build = 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()) + .mobileFeedbackUrl(map.getOrDefault("mobileFeedbackUrl", "").toString()) .name(map.getOrDefault("name", "").toString()) .salarySobId(Long.valueOf(map.getOrDefault("salarySobId", "0").toString())) .useType(Integer.valueOf(map.getOrDefault("useType", "0").toString())) @@ -924,6 +983,13 @@ public class SalarySendServiceImpl extends Service implements SalarySendService .replenishName(map.getOrDefault("replenishName", "").toString()) .replenishSalaryItemSetting(map.getOrDefault("replenishSalaryItemSetting", "").toString()) .build(); + Object feedbackStatus = map.get("feedbackStatus"); + if (feedbackStatus == null || StringUtils.isBlank(feedbackStatus.toString())) { + build.setFeedbackStatus(build.getAckFeedbackStatus()); + } else { + build.setFeedbackStatus(Integer.valueOf(feedbackStatus.toString())); + } + return build; } /** @@ -1471,14 +1537,20 @@ public class SalarySendServiceImpl extends Service implements SalarySendService salarySendNew.setSendTotal(sendTotal); mapper.updateById(salarySendNew); + SalarySobPO salarySob = getSalarySobService(user).getById(salarySend.getSalarySobId()); // 记录日志 -// SalaryLoggerUtil.recordUpdateSingleLog(salarySendLoggerTemplate, -// salarySend.getId(), -// salarySend.getSalaryMonth() + "-" + (CollectionUtils.isNotEmpty(salarySobs) ? salarySobs.get(0).getName() : ""), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"), -// salarySend, -// salarySendNew); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setTargetId(String.valueOf(salarySend.getId())); + loggerContext.setTargetName(SalaryDateUtil.getFormatYearMonth(salarySend.getSalaryMonth()) + "-" + (salarySob == null ? "" : salarySob.getName())); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "撤回工资单")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "撤回工资单")); + loggerContext.setOldValues(salarySend); + loggerContext.setNewValues(salarySendNew); + loggerContext.setOperator(user.getUID() + StringUtils.EMPTY); + loggerContext.setOperatorName(Objects.isNull(user) ? StringUtils.EMPTY : user.getUsername()); + SalaryElogConfig.salarySendLoggerTemplate.write(loggerContext); + SalarySendGrantParam grantParam = SalarySendGrantParam.builder().ids(param.getIds()).salarySendId(param.getSalarySendId()).build(); @@ -1550,6 +1622,19 @@ public class SalarySendServiceImpl extends Service implements SalarySendService row.add(dto.getSendStatus()); rows.add(row); } + + // 记录操作日志 + SalarySendPO salarySend = mapper.getById(queryParam.getSalarySendId()); + SalarySobPO salarySob = getSalarySobService(user).getById(salarySend.getSalarySobId()); + + String name = SalaryDateUtil.getFormatYearMonth(salarySend.getSalaryMonth()) + "-" + (salarySob == null ? "" : salarySob.getName()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(name); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "工资单发放") + ":" + name + SalaryI18nUtil.getI18nLabel(0, " 导出")); + loggerContext.setUser(user); + SalaryElogConfig.salarySendLoggerTemplate.write(loggerContext); return ExcelUtil.genWorkbookV2(rows, sheetName); } @@ -1614,6 +1699,19 @@ public class SalarySendServiceImpl extends Service implements SalarySendService rows.add(row); } + + // 记录日志 + SalarySobPO salarySob = getSalarySobService(user).getById(salaryAcctRecord.getSalarySobId()); + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setTargetId(String.valueOf(salarySend.getId())); + loggerContext.setTargetName(SalaryDateUtil.getFormatYearMonth(salarySend.getSalaryMonth()) + "-" + (salarySob == null ? "" : salarySob.getName())); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0,"导出工资单")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0,"导出工资单")); + loggerContext.setOperator(user.getUID() + StringUtils.EMPTY); + loggerContext.setOperatorName(Objects.isNull(user) ? StringUtils.EMPTY : user.getUsername()); + SalaryElogConfig.salarySendLoggerTemplate.write(loggerContext); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -1840,4 +1938,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } return employees.get(0).getChildren(); } + + @Override + public List listSome(SalarySendPO param) { + return getSalarySendMapper().listSome(param); + } } diff --git a/src/com/engine/salary/service/impl/SalarySobAdjustRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobAdjustRuleServiceImpl.java index 393b770b6..ce36e12e1 100644 --- a/src/com/engine/salary/service/impl/SalarySobAdjustRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobAdjustRuleServiceImpl.java @@ -2,10 +2,13 @@ package com.engine.salary.service.impl; import com.engine.core.impl.Service; import com.engine.salary.biz.SalarySobAdjustRuleBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salarysob.bo.SalarySobAdjustRuleBO; import com.engine.salary.entity.salarysob.param.SalarySobAdjustRuleSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobAdjustRuleMapper; import com.engine.salary.mapper.salarysob.SalarySobMapper; @@ -40,7 +43,6 @@ public class SalarySobAdjustRuleServiceImpl extends Service implements SalarySob return MapperProxyFactory.getProxy(SalarySobAdjustRuleMapper.class); } -// private LoggerTemplate salarySobLoggerTemplate; @Override public List listBySalarySobId(Long salarySobId) { @@ -76,20 +78,14 @@ public class SalarySobAdjustRuleServiceImpl extends Service implements SalarySob salarySobAdjustRuleMapper.batchInsert(salarySobAdjustRulePOS); } // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98614, "保存调薪计薪规则")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98614, "保存调薪计薪规则")); -// salarySobLoggerTemplate.write(loggerContext); -// } catch (Exception e) { -// sqlSession.rollback(); -// throw new SalaryRunTimeException(e); -// }finally { -// sqlSession.commit(); -// sqlSession.close(); -// } + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "保存调薪计薪规则")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "保存调薪计薪规则")); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); } @Override diff --git a/src/com/engine/salary/service/impl/SalarySobCheckRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobCheckRuleServiceImpl.java index a60726a9b..9a97d501f 100644 --- a/src/com/engine/salary/service/impl/SalarySobCheckRuleServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobCheckRuleServiceImpl.java @@ -3,12 +3,15 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SalarySobCheckRuleBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salarysob.bo.SalarySobCheckRuleBO; import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleSaveParam; import com.engine.salary.entity.salarysob.param.UpdateCheckRuleFormulaParam; import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalarySobCheckRuleService; import com.engine.salary.service.SalarySobService; @@ -37,7 +40,6 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC private SalarySobService getSalarySobService(User user) { return (SalarySobService) ServiceUtil.getService(SalarySobServiceImpl.class, user); } -// private LoggerTemplate salarySobLoggerTemplate; @Override public SalarySobCheckRulePO getById(Long id) { @@ -84,15 +86,15 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC SalarySobCheckRulePO salarySobCheckRulePO = SalarySobCheckRuleBO.convert2PO(saveParam, (long) user.getUID(), user); // 保存 salarySobCheckRuleMapper.insert(salarySobCheckRulePO); - //todo 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93872, "添加校验规则")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93872, "添加校验规则") + ": " + salarySobCheckRulePO.getName()); -// loggerContext.setNewValues(salarySobCheckRulePO); -// salarySobLoggerTemplate.write(loggerContext); + //记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(93872, "添加校验规则")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93872, "添加校验规则") + ": " + salarySobCheckRulePO.getName()); + loggerContext.setNewValues(salarySobCheckRulePO); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); } @Override @@ -129,15 +131,16 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC newSalarySobCheckRulePO.setUpdateTime(new Date()); salarySobCheckRuleMapper.updateById(newSalarySobCheckRulePO); //todo 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93870, "编辑校验规则")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93870, "编辑校验规则") + ": " + newSalarySobCheckRulePO.getName()); -// loggerContext.setOldValues(salarySobCheckRulePO); -// loggerContext.setNewValues(newSalarySobCheckRulePO); -// salarySobLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑校验规则")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑校验规则") + ": " + newSalarySobCheckRulePO.getName()); + loggerContext.setOldValues(salarySobCheckRulePO); + loggerContext.setNewValues(newSalarySobCheckRulePO); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); } @Override @@ -175,17 +178,18 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC // 将薪资账套list转换成map Map salarySobPOMap = SalaryEntityUtil.convert2Map(salarySobPOS, SalarySobPO::getId); //todo 记录日志 -// salarySobCheckRulePOS.forEach(salarySobCheckRulePO -> { -// SalarySobPO salarySobPO = salarySobPOMap.get(salarySobCheckRulePO.getSalarySobId()); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98646, "删除校验规则")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98646, "删除校验规则") + ": " + salarySobCheckRulePO.getName()); -// loggerContext.setOldValues(salarySobCheckRulePO); -// salarySobLoggerTemplate.write(loggerContext); -// }); + salarySobCheckRulePOS.forEach(salarySobCheckRulePO -> { + SalarySobPO salarySobPO = salarySobPOMap.get(salarySobCheckRulePO.getSalarySobId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除校验规则")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除校验规则") + ": " + salarySobCheckRulePO.getName()); + loggerContext.setOldValues(salarySobCheckRulePO); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); + }); } @Override diff --git a/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java index 81b26eed1..42b015586 100644 --- a/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java @@ -20,7 +20,7 @@ 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 com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; @@ -59,8 +59,6 @@ public class SalarySobExtRangeServiceImpl extends Service implements SalarySobEx return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class); } -// private ComInfoCache comInfoCache; -// private LoggerTemplate salarySobLoggerTemplate; @Override public List listByIds(Collection ids) { diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 88ca0034d..5d3c42211 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -6,7 +6,9 @@ import com.engine.salary.biz.SalarySobBiz; import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; @@ -15,6 +17,7 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper; @@ -23,6 +26,7 @@ import com.engine.salary.mapper.salarysob.SalarySobItemMapper; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.valid.ValidUtil; import com.engine.salary.wrapper.SalaryItemWrapper; @@ -95,7 +99,6 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe private SalarySobDefaultItemMapper getSalarySobDefaultItemMapper() { return MapperProxyFactory.getProxy(SalarySobDefaultItemMapper.class); } -// private LoggerTemplate salarySobLoggerTemplate; private SalaryItemWrapper getSalaryItemWrapper(User user) { return ServiceUtil.getService(SalaryItemWrapper.class, user); @@ -267,21 +270,20 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe // 校验 validSaveParam(saveParam); - - //清除原数据 - cleanOldData(salarySobId); - //保存 saveSobItem(saveParam); - //todo 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98613, "编辑薪资账套薪资项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98613, "编辑薪资账套薪资项目")); -// salarySobLoggerTemplate.write(loggerContext); + SalarySobPO salarySob = salarySobBiz.getById(salarySobId); + + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySob.getId()); + loggerContext.setTargetName(salarySob.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套薪资项目")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套薪资项目")); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); } /** @@ -320,34 +322,17 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } - /** - * 清楚原相关数据 - * - * @param salarySobId - */ - private void cleanOldData(Long salarySobId) { - // 删除薪资账套的员工信息字段 -// getSalarySobEmpFieldService(user).deleteBySalarySobIds(Collections.singleton(salarySobId)); - // 删除薪资账套的薪资项目副本 -// deleteBySalarySobIds(Collections.singleton(salarySobId)); - // 删除薪资账套的薪资项目分类 -// getSalarySobItemGroupService(user).deleteBySalarySobIds(Collections.singleton(salarySobId)); - // 删除薪资项目是否显示 - deleteItemShowBySalarySobIds(Collections.singleton(salarySobId)); - - } - /** * 保存项目信息 * * @param saveParam */ private void saveSobItem(SalarySobItemSaveParam saveParam) { - //处理人员信息字段 - handleEmpField(saveParam); - //分组和薪资项 handleGroupAndItem(saveParam); + + //处理人员信息字段 + handleEmpField(saveParam); } private void handleGroupAndItem(SalarySobItemSaveParam saveParam) { @@ -655,6 +640,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe // 保存薪资账套的薪资项目副本 batchSave(salarySobItems); + // 删除原薪资项目是否显示 + deleteItemShowBySalarySobIds(Collections.singleton(salarySobId)); // 保存薪资账套的薪资项目隐藏信息 batchSaveShow(needInsertItemShow); } diff --git a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java index b567b0896..e1db4cc36 100644 --- a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java @@ -6,6 +6,8 @@ import com.engine.core.impl.Service; import com.engine.hrm.biz.OrganizationShowSetBiz; import com.engine.salary.biz.SalarySobRangeBiz; import com.engine.salary.biz.SpecialAddDeductionBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; @@ -20,6 +22,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; @@ -87,10 +90,6 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange private SalarySobExtRangeMapper getSalarySobExtRangeMapper() { return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class); } - -// private ComInfoCache comInfoCache; -// private LoggerTemplate salarySobLoggerTemplate; - @Override public List listByIds(Collection ids) { if (CollectionUtils.isEmpty(ids)) { @@ -185,23 +184,25 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange if (CollectionUtils.isNotEmpty(result.getNeedUpdateSalarySobRanges())) { result.getNeedUpdateSalarySobRanges().forEach(e -> salarySobRangeBiz.updateById(e)); } - // todo 记录日志 -// String operateTypeName = Objects.equals(saveParam.getIncludeType(), NumberUtils.INTEGER_ONE) ? -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),98601, "关联人员范围新增对象") : SalaryI18nUtil.getI18nLabel(user.getLanguage(),98602, "从范围中排除新增对象"); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(operateTypeName); -// loggerContext.setOperatedesc(operateTypeName); -// loggerContext.setNewValues(saveParam); -// salarySobLoggerTemplate.write(loggerContext); + //记录日志 + String operateTypeName = Objects.equals(saveParam.getIncludeType(), 1) ? + SalaryI18nUtil.getI18nLabel(0, "关联人员范围新增对象") : SalaryI18nUtil.getI18nLabel(0, "从范围中排除新增对象"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(operateTypeName); + loggerContext.setOperatedesc(operateTypeName); + loggerContext.setNewValues(saveParam); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); } @Override public void deleteByIds(Collection ids) { // 查询薪资账套的人员范围 List salarySobRangePOS = listByIds(ids); + Map> rangeMap = SalaryEntityUtil.group2Map(salarySobRangePOS, SalarySobRangePO::getSalarySobId); if (CollectionUtils.isEmpty(salarySobRangePOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542142,"数据不存在或已被删除!")); } @@ -209,21 +210,24 @@ 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, "从范围中排除删除对象"); -// salarySobPOS.forEach(salarySobPO -> { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(operateTypeName); -// loggerContext.setOperatedesc(operateTypeName); -// }); + Set salarySobIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getSalarySobId); + List salarySobPOS = getSalarySobService(user).listByIds(salarySobIds); + // 是"关联人员范围"还是"从范围中排除" + Integer includeType = salarySobRangePOS.get(0).getIncludeType(); + //记录日志 + String operateTypeName = Objects.equals(includeType, 1) ? + SalaryI18nUtil.getI18nLabel(0, "关联人员范围删除对象") : SalaryI18nUtil.getI18nLabel(0, "从范围中排除删除对象"); + salarySobPOS.forEach(salarySobPO -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(operateTypeName); + loggerContext.setOperatedesc(operateTypeName); + loggerContext.setOldValueList(rangeMap.getOrDefault(salarySobPO.getId(), Collections.emptyList())); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); + }); } @Override @@ -327,7 +331,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List emps = getSalaryEmployeeService(user) - .matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + .matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() @@ -414,6 +418,22 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange if (CollectionUtils.isNotEmpty(result.getNeedUpdateSalarySobRanges())) { result.getNeedUpdateSalarySobRanges().forEach(e -> salarySobRangeBiz.updateById(e)); } + List logList = new ArrayList<>(); + logList.addAll(result.getNeedInsertSalarySobRanges()); + logList.addAll(result.getNeedUpdateSalarySobRanges()); + //记录日志 + if (CollectionUtils.isNotEmpty(logList)) { + String operateTypeName = SalaryI18nUtil.getI18nLabel(0, "关联人员范围导入"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(operateTypeName); + loggerContext.setOperatedesc(operateTypeName); + loggerContext.setNewValueList(logList); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); + } apidatas.put("successCount", successCount); apidatas.put("errorCount", errorCount); apidatas.put("errorData", errorData); diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index ca8375a27..6fc36fdca 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -3,7 +3,9 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.*; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; @@ -18,6 +20,7 @@ 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.OperateTypeEnum; import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; @@ -30,13 +33,13 @@ 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.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.RuntimeTypeEnum; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.ObjectUtils; @@ -281,15 +284,16 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID(), user); // 保存薪资账套 salarySobMapper.insert(salarySobPO); - //todo 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98404, "新建薪资账套")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98404, "新建薪资账套") + ": " + salarySobPO.getName()); -// loggerContext.setOldValues(salarySobPO); -// salarySobLoggerTemplate.write(loggerContext); + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建薪资账套")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建薪资账套") + ": " + salarySobPO.getName()); + loggerContext.setNewValues(salarySobPO); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); // 新建薪资账套时,保存默认的员工信息字段 saveDefaultEmpField(salarySobPO); // 新建薪资账套时,保存默认的薪资项目 @@ -531,15 +535,17 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { .setUpdateTime(new Date()); salarySobMapper.updateById(newSalarySobPO); // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(newSalarySobPO.getId())); -// loggerContext.setTargetName(newSalarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98526, "编辑薪资账套基础设置")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98526, "编辑薪资账套基础设置")); -// loggerContext.setOldValues(salarySobPO); -// loggerContext.setNewValues(newSalarySobPO); -// salarySobLoggerTemplate.write(loggerContext); + SalarySobPO salarySobPO4log = getSalarySobMapper().getById(newSalarySobPO.getId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(newSalarySobPO.getId())); + loggerContext.setTargetName(newSalarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套基础设置")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套基础设置")); + loggerContext.setOldValues(salarySobPO); + loggerContext.setNewValues(salarySobPO4log); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); // 返回薪资账套的主键id return salarySobPO.getId(); } @@ -548,6 +554,8 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { public void updateDisable(SalarySobDisableParam disableParam) { // 查询薪资账套 SalarySobPO salarySobPO = getById(disableParam.getId()); + SalarySobPO oldSalarySobPO = new SalarySobPO(); + BeanUtils.copyProperties(salarySobPO, oldSalarySobPO); if (Objects.isNull(salarySobPO)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542420, "参数错误,薪资账套不存在或者已被删除")); } @@ -555,16 +563,19 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { salarySobPO.setDisable(disableParam.getDisable()); salarySobPO.setUpdateTime(new Date()); salarySobMapper.updateById(salarySobPO); - // todo 记录日志 -// String operateTypeName = Objects.equals(disableParam.getDisable(), NumberUtils.INTEGER_ONE) ? -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),98591, "禁用薪资账套") : SalaryI18nUtil.getI18nLabel(user.getLanguage(),98592, "启用薪资账套"); -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(operateTypeName); -// loggerContext.setOperatedesc(operateTypeName + ": " + salarySobPO.getName()); -// salarySobLoggerTemplate.write(loggerContext); + // 记录日志 + String operateTypeName = Objects.equals(disableParam.getDisable(), NumberUtils.INTEGER_ONE) ? + SalaryI18nUtil.getI18nLabel(0, "禁用薪资账套") : SalaryI18nUtil.getI18nLabel(0, "启用薪资账套"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(operateTypeName); + loggerContext.setOperatedesc(operateTypeName + ": " + salarySobPO.getName()); + loggerContext.setOldValues(oldSalarySobPO); + loggerContext.setNewValues(salarySobPO); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); } @Override @@ -619,16 +630,18 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { getSalarySobBackItemService(user).deleteBySalarySobIds(ids); // 删除薪资账套的校验规则 getSalarySobCheckRuleService(user).deleteBySalarySobIds(ids); -// // 记录日志 -// salarySobPOS.forEach(salarySobPO -> { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + salarySobPO.getId()); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98535, "删除薪资账套")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98535, "删除薪资账套")); -// salarySobLoggerTemplate.write(loggerContext); -// }); + // 记录日志 + salarySobPOS.forEach(salarySobPO -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + salarySobPO.getId()); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除薪资账套")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除薪资账套")); + loggerContext.setOldValues(salarySobPO); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); + }); } @Override @@ -771,14 +784,15 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { if (CollectionUtils.isNotEmpty(result.getSalarySobCheckRules())) { getSalarySobCheckRuleService(user).batchSave(result.getSalarySobCheckRules()); } -// // 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId("" + result.getSalarySob().getId()); -// loggerContext.setTargetName(result.getSalarySob().getName()); -// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98570, "复制薪资账套")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98570, "复制薪资账套") + ": " + salarySobPO.getName()); -// salarySobLoggerTemplate.write(loggerContext); + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId("" + result.getSalarySob().getId()); + loggerContext.setTargetName(result.getSalarySob().getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98570, "复制薪资账套")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98570, "复制薪资账套") + ": " + salarySobPO.getName()); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); } @Override diff --git a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java index 69e3348b3..fe8c4673f 100644 --- a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java @@ -1,11 +1,15 @@ package com.engine.salary.service.impl; +import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SalarySobBiz; import com.engine.salary.biz.SalaryTemplateBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryBill.bo.SalaryTemplateBO; import com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO; import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemListDTO; @@ -19,17 +23,24 @@ import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemGroupDTO; +import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper; +import com.engine.salary.report.entity.po.SalaryStatisticsReportPO; import com.engine.salary.service.*; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.mzlion.core.utils.BeanUtils; -import dm.jdbc.util.IdGenerator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -69,6 +80,14 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate return ServiceUtil.getService(SalaryBillItemNameServiceImpl.class, user); } + private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) { + return (SalarySobEmpFieldService) ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user); + } + + private SalarySobEmpFieldMapper getSalarySobEmpFieldMapper() { + return MapperProxyFactory.getProxy(SalarySobEmpFieldMapper.class); + } + @Override public SalaryTemplatePO getById(Long id) { return mapper.getById(id); @@ -104,14 +123,14 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate mapper.updateById(salaryTemplateNew); // 记录日志 -// SalaryLoggerUtil.recordUpdateSingleLog(salaryTemplateLoggerTemplate, -// salaryTemplate.getId(), -// salaryTemplateNew.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),currentTenantKey, currentEmployeeId, 100534, "设为默认使用"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),currentTenantKey, currentEmployeeId, 100534, "设为默认使用"), -// salaryTemplate, -// salaryTemplateNew); - + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryTemplateNew.getId())); + loggerContext.setTargetName(salaryTemplateNew.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "设为默认使用")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "设为默认使用")); + SalaryElogConfig.salaryTemplateLoggerTemplate.write(loggerContext); return ""; } @@ -155,12 +174,15 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate saveParam.getSalaryBillItemNameSetting().stream().forEach(set -> set.setSalaryTemplateId(salaryTemplate.getId())); getSalaryBillItemNameService(user).saveItemShowName(saveParam.getSalaryBillItemNameSetting()); // 记录日志 -// SalaryLoggerUtil.recordAddSingleLog(salaryTemplateLoggerTemplate, -// salaryTemplate.getId(), -// salaryTemplate.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100538, "新增工资单模板"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100538, "新增工资单模板"), -// salaryTemplate); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryTemplate.getId())); + loggerContext.setTargetName(salaryTemplate.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增工资单模板")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增工资单模板")); + loggerContext.setNewValues(salaryTemplate); + SalaryElogConfig.salaryTemplateLoggerTemplate.write(loggerContext); return ""; } @@ -216,8 +238,10 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate salaryTemplateNew.setAutoSendStatus(saveParam.getAutoSendStatus() ? 1 : 0); salaryTemplateNew.setAutoSendCycleType(saveParam.getAutoSendCycleType()); salaryTemplateNew.setAckFeedbackStatus(saveParam.getAckFeedbackStatus() ? 1 : 0); + salaryTemplateNew.setFeedbackStatus(saveParam.getFeedbackStatus() ? 1 : 0); salaryTemplateNew.setAutoAckDays(saveParam.getAutoAckDays()); salaryTemplateNew.setFeedbackUrl(saveParam.getFeedbackUrl()); + salaryTemplateNew.setMobileFeedbackUrl(saveParam.getMobileFeedbackUrl()); // todo 薪资项目设置检查校验 salaryTemplateNew.setSalaryItemSetting(saveParam.getSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getSalaryItemSetting()) : ""); salaryTemplateNew.setReplenishSalaryItemSetting(saveParam.getReplenishSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getReplenishSalaryItemSetting()) : ""); @@ -241,13 +265,16 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate getSalaryBillItemNameService(user).deleteByIds(needDeleteIds); // 记录日志 -// SalaryLoggerUtil.recordUpdateSingleLog(salaryTemplateLoggerTemplate, -// salaryTemplate.getId(), -// salaryTemplateNew.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100539, "编辑工资单模板"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100539, "编辑工资单模板"), -// salaryTemplate, -// salaryTemplateNew); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryTemplateNew.getId())); + loggerContext.setTargetName(salaryTemplateNew.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "编辑工资单模板")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "编辑工资单模板")); + loggerContext.setOldValues(salaryTemplate); + loggerContext.setNewValues(salaryTemplateNew); + SalaryElogConfig.salaryTemplateLoggerTemplate.write(loggerContext); return ""; } @@ -272,7 +299,72 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate BeanUtils.copyProperties(salaryTemplate, salaryTemplateNew); salaryTemplateNew.setId(null); salaryTemplateNew.setName(copyParam.getName()); + salaryTemplateNew.setReplenishName(copyParam.getName() + "-" + SalaryI18nUtil.getI18nLabel(0, "补发工资单")); salaryTemplateNew.setUseType(SalaryTemplateWhetherEnum.FALSE.getValue()); + + //20240122逻辑变更,拷贝工资单模板时,可变更薪资账套 + if (copyParam.getSalarySobId() != null && !copyParam.getSalarySobId().equals(salaryTemplate.getSalarySobId())) { + // 查询薪资账套的员工信息字段 + List salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(copyParam.getSalarySobId()); + List empFieldCodeList = salarySobEmpFieldPOS.stream().map(SalarySobEmpFieldPO::getFieldCode).collect(Collectors.toList()); + Map empFieldCodeWithIdMap = SalaryEntityUtil.convert2Map(salarySobEmpFieldPOS, SalarySobEmpFieldPO::getFieldCode, SalarySobEmpFieldPO::getId); + // 查询薪资账套的薪资项目副本 + List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobIdWithHideItem(copyParam.getSalarySobId()); + List salaryItemIdList = salarySobItemPOS.stream().map(SalarySobItemPO::getSalaryItemId).collect(Collectors.toList()); + //拷贝数据中的薪资项目 + List salaryItemSettingList = StrUtil.isNotBlank(salaryTemplate.getSalaryItemSetting()) + ? JSONArray.parseArray(salaryTemplate.getSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class) : new ArrayList<>(); + for (SalaryTemplateSalaryItemSetListDTO salaryItemSetting : salaryItemSettingList) { + if ("111111111111111111".equals(salaryItemSetting.getGroupId()) && salaryItemSetting.getItems() != null) { + List newItems = new ArrayList<>(); + for (SalaryTemplateSalaryItemListDTO templateItem : salaryItemSetting.getItems()) { + SalarySobEmpFieldPO empFieldPO = getSalarySobEmpFieldMapper().getById(Long.valueOf(templateItem.getSalaryItemId())); + if (empFieldCodeList.contains(empFieldPO.getFieldCode()) && empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()) != null) { + templateItem.setId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString()); + templateItem.setSalaryItemId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString()); + newItems.add(templateItem); + } + } + salaryItemSetting.setItems(newItems); + } else if (salaryItemSetting.getItems() != null){ + List newItems = new ArrayList<>(); + for (SalaryTemplateSalaryItemListDTO templateItem : salaryItemSetting.getItems()) { + if (salaryItemIdList.contains(Long.valueOf(templateItem.getSalaryItemId()))) { + newItems.add(templateItem); + } + } + salaryItemSetting.setItems(newItems); + } + } + List replenishSalaryItemSettingList = StrUtil.isNotBlank(salaryTemplate.getReplenishSalaryItemSetting()) + ? JSONArray.parseArray(salaryTemplate.getReplenishSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class): new ArrayList<>(); + for (SalaryTemplateSalaryItemSetListDTO salaryItemSetting : replenishSalaryItemSettingList) { + if ("111111111111111111".equals(salaryItemSetting.getGroupId()) && salaryItemSetting.getItems() != null) { + List newItems = new ArrayList<>(); + for (SalaryTemplateSalaryItemListDTO templateItem : salaryItemSetting.getItems()) { + SalarySobEmpFieldPO empFieldPO = getSalarySobEmpFieldMapper().getById(Long.valueOf(templateItem.getSalaryItemId())); + if (empFieldCodeList.contains(empFieldPO.getFieldCode()) && empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()) != null) { + templateItem.setId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString()); + templateItem.setSalaryItemId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString()); + newItems.add(templateItem); + } + } + salaryItemSetting.setItems(newItems); + } else if (!"333333333333333333".equals(salaryItemSetting.getGroupId()) && salaryItemSetting.getItems() != null){ + List newItems = new ArrayList<>(); + for (SalaryTemplateSalaryItemListDTO templateItem : salaryItemSetting.getItems()) { + if (salaryItemIdList.contains(Long.valueOf(templateItem.getSalaryItemId()))) { + newItems.add(templateItem); + } + } + salaryItemSetting.setItems(newItems); + } + } + salaryTemplateNew.setSalaryItemSetting(salaryItemSettingList.size() > 0 ? JSONUtil.toJsonStr(salaryItemSettingList) : ""); + salaryTemplateNew.setReplenishSalaryItemSetting(replenishSalaryItemSettingList.size() > 0 ? JSONUtil.toJsonStr(replenishSalaryItemSettingList) : ""); + salaryTemplateNew.setSalarySobId(copyParam.getSalarySobId()); + } + mapper.insert(salaryTemplateNew); // 复制工资单自定义名称信息 @@ -290,12 +382,15 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate getSalaryBillItemNameService(user).batchInsert(needInsertList); } // 记录日志 -// SalaryLoggerUtil.recordAddSingleLog(salaryTemplateLoggerTemplate, -// salaryTemplateNew.getId(), -// salaryTemplateNew.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100541, "复制工资单模板"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100541, "复制工资单模板"), -// salaryTemplateNew); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryTemplateNew.getId())); + loggerContext.setTargetName(salaryTemplateNew.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "复制工资单模板")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "复制工资单模板")); + loggerContext.setNewValues(salaryTemplateNew); + SalaryElogConfig.salaryTemplateLoggerTemplate.write(loggerContext); return ""; } @@ -314,12 +409,16 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate // 删除工资单重命名表 getSalaryBillItemNameService(user).deleteByTemplateIds(ids); // 记录日志 -// salaryTemplates.forEach(e -> SalaryLoggerUtil.recordDeleteSingleLog(salaryTemplateLoggerTemplate, -// e.getId(), -// e.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100542, "删除工资单模板"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),tenantKey, employeeId, 100542, "删除工资单模板")+":" + e.getName(), -// e)); + salaryTemplates.stream().forEach(template -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(template.getId())); + loggerContext.setTargetName(template.getName() + ":" + template.getId()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "删除工资单模板")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "删除工资单模板")); + SalaryElogConfig.salaryTemplateLoggerTemplate.write(loggerContext); + }); return ""; } @@ -364,10 +463,14 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate public List getSalaryItemSetContainHide(Long salarySobId, Long salaryTemplateId, boolean isReplenish) { SalarySobItemAggregateDTO salarySobItemAggregate = getSalarySobItemService(user).getAggregateBySalarySobId(salarySobId); // 获取工资单薪资项目展示名信息 - List billItemNameList = getSalaryBillItemNameService(user).ListByTemplateAndType( - SalaryBillItemNamePO.builder().salaryTemplateId(salaryTemplateId) - .salaryBillType(isReplenish ? 1 : 0) - .build()); + List billItemNameList = Collections.emptyList(); + if (salaryTemplateId != null) { + billItemNameList = getSalaryBillItemNameService(user).ListByTemplateAndType( + SalaryBillItemNamePO.builder().salaryTemplateId(salaryTemplateId) + .salaryBillType(isReplenish ? 1 : 0) + .build()); + } + Map itemShowNameMap = SalaryEntityUtil.convert2Map(billItemNameList, SalaryBillItemNamePO::getSalaryItemId, SalaryBillItemNamePO::getSalaryItemShowName); List salaryTemplateSalaryItemSetListDTOS = SalaryTemplateBO.convertSalarySobItemAggregateToSalaryItemSet(salarySobItemAggregate, new Long(user.getUID()), isReplenish, user); diff --git a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java index e34b0fe67..b69459485 100644 --- a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java @@ -1,10 +1,14 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SpecialAddDeductionBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.encrypt.EncryptUtil; +import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionListDTO; import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionRecordDTO; @@ -16,6 +20,7 @@ import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.SpecialAddDeductionMapper; @@ -32,6 +37,7 @@ 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.ExcelParseHelper; +import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -39,6 +45,7 @@ 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.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -52,6 +59,7 @@ import java.util.*; import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; public class SpecialAddDeductionServiceImpl extends Service implements SpecialAddDeductionService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -157,14 +165,13 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List SpecialAddDeductions = - ExcelParseHelper.parse2Map(fileInputStream, SpecialAddDeductionListDTO.class, 0, 1, 14, - "SpecialAddDeductionTemplate.xlsx"); - apidatas.put("preview", SpecialAddDeductions); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0)); + apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0)); + return apidatas; } finally { IOUtils.closeQuietly(fileInputStream); } - return apidatas; } @@ -240,7 +247,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List emps = getSalaryEmployeeService(user) - .matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + .matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() @@ -366,6 +373,16 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd //获取操作按钮资源 List> rowList = getExcelRowList(param, isTemplate); + // 记录操作日志 + String name = SalaryI18nUtil.getI18nLabel(0, "导出"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除")); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除") + "-" + name); + loggerContext.setUser(user); + SalaryElogConfig.specialAddDeductionLoggerTemplate.write(loggerContext); + //获取excel return ExcelUtil.genWorkbook(rowList, SalaryI18nUtil.getI18nLabel(user.getLanguage(), 542549, "专项附加免税扣除")); } @@ -396,7 +413,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd List> rowList = new ArrayList<>(); rowList.add(title); - if (!isTemplate) { + if (!isTemplate || param.isHasData()) { // 非下载导入模版,查询数据填充 List> dataRowList = queryInfoForExcel(param, rowList); rowList.addAll(dataRowList); @@ -534,6 +551,21 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd .build(); updateList.add(build); SpecialAddDeductionBiz.batchUpdate(updateList, user); + + // 记录操作日志 + SpecialAddDeductionPO newValue = SpecialAddDeductionBiz.getById(build.getId()); + String name = SalaryI18nUtil.getI18nLabel(0, "编辑"); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(newValue.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除") + "-" + newValue.getId()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(name); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "编辑")); + loggerContext.setOldValues(byId); + loggerContext.setNewValues(newValue); + loggerContext.setUser(user); + SalaryElogConfig.specialAddDeductionLoggerTemplate.write(loggerContext); } @Override @@ -605,6 +637,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd SpecialAddDeductionBiz SpecialAddDeductionBiz = new SpecialAddDeductionBiz(); List deleteIds = deleteParam.getIds(); List deleteList = new ArrayList<>(); + List oldSpecialAddDeductionList = new ArrayList<>(); for (Long id : deleteIds) { SpecialAddDeductionPO byId = SpecialAddDeductionBiz.getById(id, user); if (byId == null) { @@ -618,8 +651,25 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542136,"个税扣缴义务人不存在或不在权限范围内")); } deleteList.add(byId.getId()); + oldSpecialAddDeductionList.add(byId); } SpecialAddDeductionBiz.batchDeleteByIds(deleteList); + + // 记录操作日志 + if (CollectionUtils.isNotEmpty(oldSpecialAddDeductionList)) { + oldSpecialAddDeductionList.stream().forEach(e -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(e.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除") + "-" + e.getId()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "删除")); + loggerContext.setOldValues(e); + loggerContext.setUser(user); + SalaryElogConfig.specialAddDeductionLoggerTemplate.write(loggerContext); + }); + } } @Override @@ -647,6 +697,20 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd List list = specialAddDeductionBiz.listByTaxAgentIds(taxAgentIds, user); List deleteIds = list.stream().map(SpecialAddDeductionPO::getId).collect(Collectors.toList()); specialAddDeductionBiz.batchDeleteByIds(deleteIds); + + // 记录操作日志 + Collection finalTaxAgentIds = taxAgentIds; + List taxAgentNames = taxAgentList.stream().filter(t -> finalTaxAgentIds.contains(t.getTaxAgentId())) + .map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList()); + String name = StringUtils.join(taxAgentNames, ","); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetName(name); + loggerContext.setOperateType(OperateTypeEnum.CLEAR.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "一键清空")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除") + "-" + SalaryI18nUtil + .getI18nLabel(0, "一键清空:") + name); + loggerContext.setUser(user); + SalaryElogConfig.specialAddDeductionLoggerTemplate.write(loggerContext); } @Override @@ -656,9 +720,8 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd @Override public SpecialAddDeductionRecordDTO getRecordById(Long id) { - return getSpecialAddDeductionBiz() - .listDTOByParam(SpecialAddDeductionQueryParam.builder().specialAddDeductionId(id).build(), user) - .stream().findFirst().orElse(null); + List specialAddDeductionRecordDTOList = getSpecialAddDeductionBiz().listDTOByParam(SpecialAddDeductionQueryParam.builder().specialAddDeductionId(id).build(), user); + return CollUtil.isNotEmpty(specialAddDeductionRecordDTOList) ? specialAddDeductionRecordDTOList.get(0) : null; } private List> queryInfoForExcel(SpecialAddDeductionQueryParam param, List> rowList) { diff --git a/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java index 6accd0dae..243e4fed3 100644 --- a/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java @@ -3,9 +3,12 @@ package com.engine.salary.service.impl; import com.engine.core.impl.Service; import com.engine.salary.biz.SalaryItemBiz; import com.engine.salary.biz.SysSalaryItemBiz; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salaryitem.SysSalaryItemMapper; @@ -30,7 +33,6 @@ import java.util.Set; * @version 1.0 **/ public class SysSalaryItemServiceImpl extends Service implements SysSalaryItemService { - private SysSalaryItemBiz sysSalaryItemMapper = new SysSalaryItemBiz(); private SalaryItemBiz salaryItemService = new SalaryItemBiz(); @@ -87,19 +89,20 @@ public class SysSalaryItemServiceImpl extends Service implements SysSalaryItemSe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542554, "已经添加过的系统薪资项目不能重复添加")); } // 保存 - List salaryItems = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItemPOS,(long)user.getUID()); + List salaryItems = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItemPOS, (long) user.getUID()); salaryItemService.batchSave(salaryItems); - //todo 记录日志 -// sysSalaryItemPOS.forEach(sysSalaryItemPO -> { -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(sysSalaryItemPO.getId())); -// loggerContext.setTargetName(sysSalaryItemPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93891, "添加系统薪资项目")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(user.getLanguage(),93891, "添加系统薪资项目") + ": " + sysSalaryItemPO.getName()); -// loggerContext.setNewValues(sysSalaryItemPO); -// salaryItemLoggerTemplate.write(loggerContext); -// }); + // 记录日志 + sysSalaryItemPOS.forEach(sysSalaryItemPO -> { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(sysSalaryItemPO.getId())); + loggerContext.setTargetName(sysSalaryItemPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "添加系统薪资项目")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "添加系统薪资项目") + ": " + sysSalaryItemPO.getName()); + loggerContext.setNewValues(sysSalaryItemPO); + SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext); + }); } @Override diff --git a/src/com/engine/salary/service/impl/TaxAgentAdminServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentAdminServiceImpl.java index 5d6cf042c..72838fc10 100644 --- a/src/com/engine/salary/service/impl/TaxAgentAdminServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentAdminServiceImpl.java @@ -7,7 +7,7 @@ import com.engine.salary.mapper.taxagent.TaxAgentAdminMapper; import com.engine.salary.service.TaxAgentAdminService; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import java.util.Collection; diff --git a/src/com/engine/salary/service/impl/TaxAgentBaseServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentBaseServiceImpl.java index a42dda9f2..fed70db52 100644 --- a/src/com/engine/salary/service/impl/TaxAgentBaseServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentBaseServiceImpl.java @@ -15,7 +15,7 @@ import com.engine.salary.service.SalaryAcctRecordService; import com.engine.salary.service.TaxAgentBaseService; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import weaver.hrm.User; diff --git a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java index 7cd9cfd6f..c595c9139 100644 --- a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java @@ -17,7 +17,7 @@ import com.engine.salary.service.TaxAgentEmpService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; @@ -53,7 +53,9 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic return; } List idList = taxAgentEmpList.stream().map(TaxAgentEmpPO::getId).collect(Collectors.toList()); - getTaxAgentEmpMapper().deleteByIds(idList); + + List> partition = Lists.partition(idList, 500); + partition.forEach(getTaxAgentEmpMapper()::deleteByIds); } @Override diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index 5171c99ad..148b53a15 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.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; @@ -30,6 +31,8 @@ import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.SalaryLoggerUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.page.PageInfo; @@ -38,13 +41,13 @@ 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; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.util.IOUtils; +import org.springframework.beans.BeanUtils; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; @@ -173,8 +176,21 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM if (CollectionUtils.isEmpty(taxAgentManageRanges) || CollectionUtils.isEmpty(salaryEmployees)) { return Collections.emptyList(); } + // 获取虚拟部门下人员信息 + List virtualDepartmentIds = taxAgentManageRanges.stream().filter(manageRange -> manageRange.getTargetType().equals(TargetTypeEnum.DEPT.getValue()) && manageRange.getTargetId().compareTo(0L) < 0) + .map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); + List virtualEmpListByDep = getSalaryEmployeeService(user).getVirtualEmpByVirtualDepIds(virtualDepartmentIds); + Map> virtualDepMap = SalaryEntityUtil.group2Map(virtualEmpListByDep, DataCollectionEmployee::getDepartmentId, DataCollectionEmployee::getEmployeeId); + + // 获取虚拟分部下人员信息 + List virtualSubCompanyIds = taxAgentManageRanges.stream().filter(manageRange -> manageRange.getTargetType().equals(TargetTypeEnum.SUBCOMPANY.getValue()) && manageRange.getTargetId().compareTo(0L) < 0) + .map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); + List virtualEmpListBySubCom = getSalaryEmployeeService(user).getVirtualEmpByVirtualSubCompanyIds(virtualSubCompanyIds); + Map> virtualSubCompanyMap = SalaryEntityUtil.group2Map(virtualEmpListBySubCom, DataCollectionEmployee::getSubcompanyid, DataCollectionEmployee::getEmployeeId); + List salaryEmployeeList = Lists.newArrayList(); for (TaxAgentManageRangePO manageRange : taxAgentManageRanges) { + boolean isVirtual = manageRange.getTargetId().compareTo(0L) < 0 ? true : false; salaryEmployeeList.addAll(salaryEmployees.stream().filter(salaryEmployee -> { if (StringUtils.isEmpty(manageRange.getEmployeeStatus()) || !manageRange.getEmployeeStatus().contains("\"" + salaryEmployee.getStatus() + "\"")) { return false; @@ -185,11 +201,26 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.EMPLOYEE.getValue()) && Objects.equals(manageRange.getTargetId(), salaryEmployee.getEmployeeId())) { return true; } - if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.DEPT.getValue()) && Objects.equals(manageRange.getTargetId(), salaryEmployee.getDepartmentId())) { - return true; - } - if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.SUBCOMPANY.getValue()) && Objects.equals(manageRange.getTargetId(), salaryEmployee.getSubcompanyid())) { - return true; + if (isVirtual) { + if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.DEPT.getValue())) { + Set empIds = virtualDepMap.get(manageRange.getTargetId()); + if (CollectionUtils.isNotEmpty(empIds) && empIds.contains(salaryEmployee.getEmployeeId())) { + return true; + } + } + if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.SUBCOMPANY.getValue())) { + Set empIds = virtualSubCompanyMap.get(manageRange.getTargetId()); + if (CollectionUtils.isNotEmpty(empIds) && empIds.contains(salaryEmployee.getEmployeeId())) { + return true; + } + } + } else { + if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.DEPT.getValue()) && Objects.equals(manageRange.getTargetId(), salaryEmployee.getDepartmentId())) { + return true; + } + if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.SUBCOMPANY.getValue()) && Objects.equals(manageRange.getTargetId(), salaryEmployee.getSubcompanyid())) { + return true; + } } if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.POSITION.getValue()) && Objects.equals(manageRange.getTargetId(), salaryEmployee.getJobtitleId())) { return true; @@ -247,10 +278,17 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 查询部门信息 List departmentIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.DEPT.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); List departmentComInfos = getSalaryEmployeeService().getDeptInfoList(departmentIds); + // 虚拟部门 + List virtualDepIds = departmentIds.stream().filter(id -> id.compareTo(0L) < 0).collect(Collectors.toList()); + departmentComInfos.addAll(getSalaryEmployeeService().getVirtualDeptInfoList(virtualDepIds)); + // 查询分部信息 List subDepartmentIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.SUBCOMPANY.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); - List subDepartmentComInfos = getSalaryEmployeeService().getSubCompanyInfoList(subDepartmentIds); + // 虚拟分部 + List virtualSubCompanyIds = subDepartmentIds.stream().filter(id -> id.compareTo(0L) < 0).collect(Collectors.toList()); + subDepartmentComInfos.addAll(getSalaryEmployeeService().getVirtualSubCompanyInfoList(virtualSubCompanyIds)); + // 查询岗位信息 List positionIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.POSITION.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); List positionComInfos = getSalaryEmployeeService().listPositionInfo(positionIds); @@ -321,6 +359,12 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM List taxAgentManageAllRanges = listByTaxAgentId(saveParam.getTaxAgentId()); List taxAgentManageRanges = taxAgentManageAllRanges.stream().filter(f -> f.getIncludeType().equals(saveParam.getIncludeType())).collect(Collectors.toList()); + List oldManageList = new ArrayList<>(); + taxAgentManageRanges.stream().forEach(p -> { + TaxAgentManageRangePO target = new TaxAgentManageRangePO(); + BeanUtils.copyProperties(p, target); + oldManageList.add(target); + }); // 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新) TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, saveParam, taxAgent.getId(), (long) user.getUID(), false); @@ -336,10 +380,37 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ if (CollectionUtils.isNotEmpty(result.getNeedInsertTaxAgentManageRanges())) { - result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().insertIgnoreNull(range)); + result.getNeedInsertTaxAgentManageRanges().forEach(range -> { + getTaxAgentManageRangeMapper().insertIgnoreNull(range); + // 记录操作日志 + String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTargetId(); + SalaryLoggerUtil.recordAddSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, + range.getTaxAgentId(), + name, + SalaryI18nUtil.getI18nLabel(0, "新增人员范围"), + SalaryI18nUtil.getI18nLabel(0, "新增人员范围") + name, + range, + user); + }); + } if (CollectionUtils.isNotEmpty(result.getNeedUpdateTaxAgentManageRanges())) { - result.getNeedUpdateTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range)); + Map oldMap = SalaryEntityUtil.convert2Map(oldManageList, TaxAgentManageRangePO::getId); + result.getNeedUpdateTaxAgentManageRanges().forEach(range -> { + getTaxAgentManageRangeMapper().updateIgnoreNull(range); + // 记录操作日志 + TaxAgentManageRangePO oldPO = oldMap.getOrDefault(range.getId(), TaxAgentManageRangePO.builder().build()); + String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTargetId(); + SalaryLoggerUtil.recordUpdateSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, + range.getTaxAgentId(), + name, + SalaryI18nUtil.getI18nLabel(0, "更新人员范围"), + SalaryI18nUtil.getI18nLabel(0, "更新人员范围") + name, + oldPO, + range, + user); + }); + } /* 同步本地人员范围的关联人员=========================== */ @@ -433,6 +504,15 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM .build(); getTaxAgentExtRangeMapper().insertIgnoreNull(po); + // 记录日志 + String name = taxAgent.getName() + "_" + saveParam.getTaxAgentId(); + SalaryLoggerUtil.recordAddSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, + taxAgent.getId(), + name, + SalaryI18nUtil.getI18nLabel(0, "新增非系统人员范围"), + SalaryI18nUtil.getI18nLabel(0, "新增非系统人员范围") + name, + po, + user); }); List oldEmpList = getExtEmpService(user).getEmployeeByIds(oldIds); employees.addAll(oldEmpList); @@ -450,6 +530,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM syncLocalExtEmp(taxAgentId, finalEmployees); }); } + } private List listAllExtBytaxAgentId(Long taxAgentId) { @@ -479,6 +560,14 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } // 删除管理范围 getTaxAgentExtRangeMapper().deleteByIds(ids); + // 记录日志 + SalaryLoggerUtil.recordDeleteSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, + taxAgentManageRanges.get(0).getTaxAgentId(), + ids.toString(), + SalaryI18nUtil.getI18nLabel(0, "删除非系统人员范围"), + SalaryI18nUtil.getI18nLabel(0, "删除非系统人员范围") + ids.toString(), + null, + user); } private void syncLocalExtEmp(Long taxAgentId, List allSalaryEmployees) { @@ -532,19 +621,21 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM @Override public void deleteByIds(Collection ids) { // 查询管理范围 - List taxAgentManageRanges = listByIds(ids); - if (CollectionUtils.isEmpty(taxAgentManageRanges)) { + List taxAgentManageRangeList = listByIds(ids); + + if (CollectionUtils.isEmpty(taxAgentManageRangeList)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542142,"数据不存在或已被删除!")); } - List taxAgentIds = taxAgentManageRanges.stream().map(TaxAgentManageRangePO::getTaxAgentId).distinct().collect(Collectors.toList()); + List taxAgentIds = taxAgentManageRangeList.stream().map(TaxAgentManageRangePO::getTaxAgentId).distinct().collect(Collectors.toList()); if (taxAgentIds.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542562, "一次只能删一个个税个税扣缴义务人的范围")); } - taxAgentManageRanges = this.listByTaxAgentIds(taxAgentIds); + List taxAgentManageRanges = this.listByTaxAgentIds(taxAgentIds); List allManageRanges = taxAgentManageRanges.stream().filter(f -> !ids.contains(f.getId())).collect(Collectors.toList()); List allRanges = allManageRanges.stream().filter(f -> f.getRangeType().equals(TaxAgentRangeTypeEnum.TAXAGENT.getValue())).collect(Collectors.toList()); // List allSubAdminRanges = allManageRanges.stream().filter(f -> f.getRangeType().equals(TaxAgentRangeTypeEnum.SUBADMIN.getValue())).collect(Collectors.toList()); Long taxAgentId = taxAgentIds.get(0); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentId); List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); List allSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allRanges, salaryEmployees); @@ -559,9 +650,21 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 删除管理范围 getTaxAgentManageRangeMapper().deleteByIds(ids); + // 记录操作日志 + taxAgentManageRangeList.stream().forEach(range -> { + String name = taxAgentPO.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTargetId(); + SalaryLoggerUtil.recordDeleteSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, + range.getTaxAgentId(), + name, + SalaryI18nUtil.getI18nLabel(0, "删除人员范围"), + SalaryI18nUtil.getI18nLabel(0, "删除人员范围") + name, + range, + user); + }); + + /** 同步本地人员范围的关联人员=========================== */ syncLocalEmp(taxAgentId, allSalaryEmployees, false); - // 记录日志 todo } @Override @@ -572,6 +675,10 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM List taxAgentExtRangePOS = getTaxAgentExtRangeMapper().list(TaxAgentExtRangePO.builder().taxAgentId(param.getTaxAgentId()).build()); return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), taxAgentExtRangePOS, TaxAgentExtRangePO.class, user); + if(StringUtils.isNotBlank(param.getTargetName())) { + taxAgentExtRangePOS = taxAgentExtRangePOS.stream().filter(po -> po.getTargetName().contains(param.getTargetName())).collect(Collectors.toList()); + } + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), taxAgentExtRangePOS, TaxAgentExtRangePO.class); } @Override @@ -772,7 +879,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List emps = getSalaryEmployeeService() - .matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + .matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); if (CollectionUtils.isNotEmpty(emps)) { employeeSameIds = emps.stream() .map(DataCollectionEmployee::getEmployeeId) @@ -861,6 +968,13 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 查询已有的管理范围 List taxAgentManageAllRanges = listByTaxAgentId(taxAgentId); List taxAgentManageRanges = taxAgentManageAllRanges.stream().filter(f -> f.getIncludeType().equals(taxAgentRangeSaveParam.getIncludeType())).collect(Collectors.toList()); + List oldManageList = new ArrayList<>(); + taxAgentManageRanges.stream().forEach(p -> { + TaxAgentManageRangePO target = new TaxAgentManageRangePO(); + BeanUtils.copyProperties(p, target); + oldManageList.add(target); + }); + // 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新) TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, taxAgentRangeSaveParam, taxAgent.getId(), (long) user.getUID(), true); @@ -876,10 +990,36 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ if (CollectionUtils.isNotEmpty(result.getNeedInsertTaxAgentManageRanges())) { - result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().insertIgnoreNull(range)); + result.getNeedInsertTaxAgentManageRanges().forEach(range -> { + getTaxAgentManageRangeMapper().insertIgnoreNull(range); + // 记录操作日志 + String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTargetId(); + SalaryLoggerUtil.recordAddSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, + range.getTaxAgentId(), + name, + SalaryI18nUtil.getI18nLabel(0, "新增人员范围"), + SalaryI18nUtil.getI18nLabel(0, "新增人员范围") + name, + range, + user); + }); } if (CollectionUtils.isNotEmpty(result.getNeedUpdateTaxAgentManageRanges())) { - result.getNeedUpdateTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range)); + Map oldMap = SalaryEntityUtil.convert2Map(oldManageList, TaxAgentManageRangePO::getId); + result.getNeedUpdateTaxAgentManageRanges().forEach(range -> { + getTaxAgentManageRangeMapper().updateIgnoreNull(range); + // 记录操作日志 + TaxAgentManageRangePO oldPO = oldMap.getOrDefault(range.getId(), TaxAgentManageRangePO.builder().build()); + String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTargetId(); + SalaryLoggerUtil.recordUpdateSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, + range.getTaxAgentId(), + name, + SalaryI18nUtil.getI18nLabel(0, "更新人员范围"), + SalaryI18nUtil.getI18nLabel(0, "更新人员范围") + name, + oldPO, + range, + user); + }); + } /* 同步本地人员范围的关联人员=========================== */ diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index 23b5f61eb..bdd818691 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -4,7 +4,9 @@ import com.engine.common.service.HrmCommonService; import com.engine.common.service.impl.HrmCommonServiceImpl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryAuthConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -24,6 +26,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.OperateTypeEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; @@ -347,13 +350,15 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { getTaxAgentAdminService(user).batchInsert(taxAgent.getId(), saveParam.getAdminUserIds()); } // 记录日志 -// SalaryLoggerUtil.recordAddSingleLog(taxAgentLoggerTemplate, -// taxAgent.getId(), -// taxAgent.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(), 93766, "新增个税扣缴义务人"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(), 93766, "新增个税扣缴义务人"), -// taxAgent); - + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxAgent.getId().toString()); + loggerContext.setTargetName(taxAgent.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增个税扣缴义务人")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增个税扣缴义务人")); + loggerContext.setNewValues(taxAgent); + SalaryElogConfig.taxAgentLoggerTemplate.write(loggerContext); return StringUtils.EMPTY + taxAgent.getId(); } @@ -402,13 +407,16 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { getTaxAgentAdminService(user).batchInsert(saveParam.getId(), saveParam.getAdminUserIds()); } // 记录日志 -// SalaryLoggerUtil.recordUpdateSingleLog(taxAgentLoggerTemplate, -// taxAgent.getId(), -// taxAgentNew.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),93767, "编辑个税扣缴义务人"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),93767, "编辑个税扣缴义务人"), -// taxAgent, -// taxAgentNew); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxAgentNew.getId().toString()); + loggerContext.setTargetName(taxAgentNew.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑个税扣缴义务人")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑个税扣缴义务人")); + loggerContext.setOldValues(taxAgent); + loggerContext.setNewValues(taxAgentNew); + SalaryElogConfig.taxAgentLoggerTemplate.write(loggerContext); return StringUtils.EMPTY; } @@ -460,13 +468,18 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { getTaxAgentMapper().deleteByIds(ids); // 记录日志 -// taxAgents.forEach(e -> SalaryLoggerUtil.recordDeleteSingleLog(taxAgentLoggerTemplate, -// e.getId(), -// e.getName(), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),100546, "删除个税扣缴义务人"), -// SalaryI18nUtil.getI18nLabel(user.getLanguage(),100546, "删除个税扣缴义务人") + ":" + e.getName(), -// e)); + taxAgents.forEach(e ->{ + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(e.getId().toString()); + loggerContext.setTargetName(e.getName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "删除个税扣缴义务人")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "删除个税扣缴义务人")); + loggerContext.setOldValues(e); + SalaryElogConfig.taxAgentLoggerTemplate.write(loggerContext); + }); return StringUtils.EMPTY; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 6cc4dbf3d..e84869b88 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -2,18 +2,23 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; +import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationDetailService; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; @@ -23,7 +28,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; -import java.lang.reflect.Field; import java.util.List; import java.util.Map; import java.util.Objects; @@ -49,6 +53,10 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + @Override @@ -68,7 +76,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar List dataIndexList = Lists.newArrayList(); if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue())) { // 解析表头 - parseHeader(TaxDeclarationWageListDTO.class, headerList, dataIndexList); + ExcelUtil.parseHeader(TaxDeclarationWageListDTO.class, headerList, dataIndexList); rows.add(headerList); for (int i = 0; i < totalPages; i++) { TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); @@ -89,7 +97,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar } if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_LABOR.getValue())) { // 解析表头 - parseHeader(TaxDeclarationLaborListDTO.class, headerList, dataIndexList); + ExcelUtil.parseHeader(TaxDeclarationLaborListDTO.class, headerList, dataIndexList); rows.add(headerList); for (int i = 0; i < totalPages; i++) { TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); @@ -111,7 +119,7 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) { // 解析表头 - parseHeader(TaxDeclarationAnnualListDTO.class, headerList, dataIndexList); + ExcelUtil.parseHeader(TaxDeclarationAnnualListDTO.class, headerList, dataIndexList); rows.add(headerList); for (int i = 0; i < totalPages; i++) { TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); @@ -130,6 +138,20 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar } } } + + // 查询个税扣缴义务人名称 + String bar = "_"; + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclarationPO.getTaxAgentId()); + String targetName = SalaryDateUtil.getFormatYearMonth(taxDeclarationPO.getSalaryMonth()) + bar + taxAgentPO.getName() + bar + IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getDefaultLabel(); + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxDeclarationId.toString()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "导出个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "导出个税申报表")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); return ExcelUtil.genWorkbookV2(rows, sheetName); } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index a9e31e646..d3ed15085 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -3,6 +3,8 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -12,7 +14,9 @@ import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper; @@ -270,6 +274,21 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration log.info("salary TaxDeclaration step4 AcctRecordStatus save {}", salaryAcctRecordIds.size()); } getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); + + // 记录日志 + result.getNeedInsertTaxDeclarations().stream().forEach(declare -> { + String taxAgentName = taxAgentNameMap.getOrDefault(declare.getTaxAgentId(), ""); + String targetName = SalaryDateUtil.getFormatYearMonth(declare.getSalaryMonth()) + " " + taxAgentName + " " + IncomeCategoryEnum.parseByValue(declare.getIncomeCategory()).getDefaultLabel(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(declare.getId().toString()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "生成个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "生成个税申报表")); + loggerContext.setNewValues(declare); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + }); } @Override @@ -345,5 +364,19 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration if(CollectionUtils.isNotEmpty(salaryAcctRecordIds)){ getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds,SalaryAcctRecordStatusEnum.ARCHIVED); } + + // 查询个税扣缴义务人名称 + String bar = "_"; + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(po.getTaxAgentId()); + String targetName = SalaryDateUtil.getFormatYearMonth(po.getSalaryMonth()) + bar + taxAgentPO.getName() + bar + IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getDefaultLabel(); + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxDeclarationId.toString()); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "撤回个税申报表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "撤回个税申报表")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } } diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index c5b6b08db..ff055b89e 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -82,10 +82,15 @@ 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_SEND_FEEDBACK_FK = "SALARY_SEND_FEEDBACK_FK"; + /** * 工资单反馈自动确认 */ @@ -96,13 +101,48 @@ public class SalarySysConstant { */ public static final String SALARY_FEEDBACK_URL = "SALARY_FEEDBACK_URL"; + /** + * 工资单反馈地址-移动端 + */ + public static final String SALARY_FEEDBACK_URL_MOBILE = "SALARY_FEEDBACK_URL_MOBILE"; + /** * 工资单查询限制 */ public static final String SALARY_BILL_VIEWING_LIMIT_MONTH = "SALARY_BILL_VIEWING_LIMIT_MONTH"; + /** + * 首次查看后多少分钟不能查看工资单 + */ + public static final String SALARY_BILL_BURNING_AFTER_READING_MIN= "SALARY_BILL_BURNING_AFTER_READING_MIN"; + /** * 核算固定列头数 */ public static final String SALARY_ACCT_FIXED_COLUMNS = "salaryAcctFixedColumns"; + + /** + * 应用设置是否福利档案基数区分个人和单位 + */ + public static final String WEL_BASE_DIFF_BY_PER_AND_COM = "welBaseDiffByPerAndCom"; + + /** + * 应用设置是否福利档案导入时,不符合上下限的基数调整为上限 /下限 + */ + public static final String WEL_BASE_AUTO_ADJUST = "welBaseAutoAdjust"; + + /** + * 我的薪资福利工资单显示状态 + */ + public static final String SALARY_SHOW_STATUS = "salaryShowStatus"; + + /** + * 我的薪资福利调薪记录显示状态 + */ + public static final String ADJUST_SHOW_STATUS = "adjustShowStatus"; + + /** + * 我的薪资福利工资单个税扣缴义务人显示状态 + */ + public static final String TAX_AGENT_SHOW_STATUS = "taxAgentShowStatus"; } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index cec9ee1a7..f45153c3f 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -13,6 +13,7 @@ import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; +import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO; @@ -28,6 +29,7 @@ import com.engine.salary.mapper.datacollection.OtherDeductionMapper; import com.engine.salary.mapper.datacollection.SpecialAddDeductionMapper; import com.engine.salary.mapper.salaryacct.ExcelAcctResultMapper; import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper; +import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siarchives.FundSchemeMapper; @@ -46,12 +48,12 @@ import com.engine.salary.sys.enums.*; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; -import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -144,6 +146,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return MapperProxyFactory.getProxy(SpecialAddDeductionMapper.class); } + private ExcelInsuranceDetailMapper getExcelInsuranceDetailMapper() { + return MapperProxyFactory.getProxy(ExcelInsuranceDetailMapper.class); + } + private SalarySysConfService getSalarySysConfService(User user) { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } @@ -756,8 +762,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesSocialSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); } else { po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesSocialSchemePos, 50); @@ -783,8 +791,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesFundSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); } else { po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesFundSchemePos, 50); @@ -810,8 +820,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesOtherSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); } else { po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesOtherSchemePos, 50); @@ -870,6 +882,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo)); po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo)); po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo)); @@ -888,6 +903,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); po.setSocialPerJson(AESEncryptUtil.encrypt(po.getSocialPerJson())); po.setSocialPerSum(AESEncryptUtil.encrypt(po.getSocialPerSum())); po.setFundPerJson(AESEncryptUtil.encrypt(po.getFundPerJson())); @@ -1096,14 +1114,81 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } return 1; }); - int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get(); - if (flag == 14) { + + Future submit14 = fixedThreadPool.submit(() -> { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + List excelInsuranceDetailPOS = getExcelInsuranceDetailMapper().listAll(); + if (CollectionUtils.isNotEmpty(excelInsuranceDetailPOS)) { + excelInsuranceDetailPOS.forEach(po -> { + if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { + po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); + po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); + po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); + po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo)); + po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo)); + po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo)); + po.setFundPerSum(AESEncryptUtil.closeEncryptSetting(po.getFundPerSum(), sysConfPo)); + po.setOtherPerJson(AESEncryptUtil.closeEncryptSetting(po.getOtherPerJson(), sysConfPo)); + po.setOtherPerSum(AESEncryptUtil.closeEncryptSetting(po.getOtherPerSum(), sysConfPo)); + po.setPerSum(AESEncryptUtil.closeEncryptSetting(po.getPerSum(), sysConfPo)); + po.setSocialComJson(AESEncryptUtil.closeEncryptSetting(po.getSocialComJson(), sysConfPo)); + po.setSocialComSum(AESEncryptUtil.closeEncryptSetting(po.getSocialComSum(), sysConfPo)); + po.setComSum(AESEncryptUtil.closeEncryptSetting(po.getComSum(), sysConfPo)); + po.setSocialSum(AESEncryptUtil.closeEncryptSetting(po.getSocialSum(), sysConfPo)); + po.setFundSum(AESEncryptUtil.closeEncryptSetting(po.getFundSum(), sysConfPo)); + po.setOtherSum(AESEncryptUtil.closeEncryptSetting(po.getOtherSum(), sysConfPo)); + po.setTotal(AESEncryptUtil.closeEncryptSetting(po.getTotal(), sysConfPo)); + } else { + po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); + po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); + po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); + po.setSocialPerJson(AESEncryptUtil.encrypt(po.getSocialPerJson())); + po.setSocialPerSum(AESEncryptUtil.encrypt(po.getSocialPerSum())); + po.setFundPerJson(AESEncryptUtil.encrypt(po.getFundPerJson())); + po.setFundPerSum(AESEncryptUtil.encrypt(po.getFundPerSum())); + po.setOtherPerJson(AESEncryptUtil.encrypt(po.getOtherPerJson())); + po.setOtherPerSum(AESEncryptUtil.encrypt(po.getOtherPerSum())); + po.setPerSum(AESEncryptUtil.encrypt(po.getPerSum())); + po.setSocialComJson(AESEncryptUtil.encrypt(po.getSocialComJson())); + po.setSocialComSum(AESEncryptUtil.encrypt(po.getSocialComSum())); + po.setComSum(AESEncryptUtil.encrypt(po.getComSum())); + po.setSocialSum(AESEncryptUtil.encrypt(po.getSocialSum())); + po.setFundSum(AESEncryptUtil.encrypt(po.getFundSum())); + po.setOtherSum(AESEncryptUtil.encrypt(po.getOtherSum())); + po.setTotal(AESEncryptUtil.encrypt(po.getTotal())); + } + }); + List> partition = Lists.partition(excelInsuranceDetailPOS, 10); + ExcelInsuranceDetailMapper mapper = sqlSession.getMapper(ExcelInsuranceDetailMapper.class); + partition.forEach(mapper::updateBatchSelective); + sqlSession.commit(); + log.info("finish hrsa_excel_bill_detail"); + } + } catch (Exception e) { + sqlSession.rollback(); + log.error("fail hrsa_excel_bill_detail", e); + return 0; + } finally { + sqlSession.close(); + } + return 1; + }); + + int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get(); + if (flag == 15) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "success", 30); } else { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); } Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS); - return flag == 14; + return flag == 15; } catch (Exception e) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS); diff --git a/src/com/engine/salary/timer/AutoSiAccountAndFileJob.java b/src/com/engine/salary/timer/AutoSiAccountAndFileJob.java new file mode 100644 index 000000000..47dd04994 --- /dev/null +++ b/src/com/engine/salary/timer/AutoSiAccountAndFileJob.java @@ -0,0 +1,106 @@ +package com.engine.salary.timer; + +import cn.hutool.core.util.StrUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; +import com.engine.salary.entity.siaccount.param.AccountParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.formlua.util.RegularUtil; +import com.engine.salary.service.SIAccountService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.impl.SIAccountServiceImpl; +import com.engine.salary.service.impl.TaxAgentServiceImpl; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; +import weaver.interfaces.schedule.BaseCronJob; + +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Calendar; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Author: sy + * @Description: 福利台账核算并归档任务 + * @Date: 2024/1/15 + **/ +@Slf4j +public class AutoSiAccountAndFileJob extends BaseCronJob { + + private String diffToCurrentMonth; + + public String getDiffToCurrentMonth() { + return diffToCurrentMonth; + } + + public void setDiffToCurrentMonth(String diffToCurrentMonth) { + this.diffToCurrentMonth = diffToCurrentMonth; + } + + private String taxAgentNames; + + public String getTaxAgentNames() { + return taxAgentNames; + } + + public void setTaxAgentNames(String taxAgentNames) { + this.taxAgentNames = taxAgentNames; + } + + private String fileFlag; + + public String getFileFlag() { + return fileFlag; + } + + public void setFileFlag(String fileFlag) { + this.fileFlag = fileFlag; + } + + private TaxAgentService getTaxAgentService(User user) { + SalaryContext.get().setValue("user",user); + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + public SIAccountService getSIAccountService(User user) { + SalaryContext.get().setValue("user",user); + return ServiceUtil.getService(SIAccountServiceImpl.class, user); + } + + @Override + public void execute() { + if (StrUtil.isNotBlank(diffToCurrentMonth) && (RegularUtil.isInteger(diffToCurrentMonth) || "0".equals(diffToCurrentMonth))) { + User user = new User(); + user.setUid(1); + user.setLoginid("sysadmin"); + user.setLastname("sysadmin"); + + Calendar accountTime= Calendar.getInstance(); + accountTime.set(Calendar.MONTH, accountTime.get(Calendar.MONTH) + Integer.parseInt(diffToCurrentMonth)); + SimpleDateFormat s=new SimpleDateFormat("yyyy-MM"); + + String accountMonth = s.format(accountTime.getTime()); + boolean isFile = false; + if (StrUtil.isNotBlank(fileFlag) && "true".equals(fileFlag)) { + isFile = true; + } + //核算并归档 + List taxAgentList = getTaxAgentService(user).listAll(); + //判断是否过滤个税扣缴义务人 + if (StrUtil.isNotBlank(taxAgentNames)) { + List taxAgentNameList = Arrays.stream(taxAgentNames.split(",")).map(String::new).collect(Collectors.toList()); + taxAgentList = taxAgentList.stream().filter(f -> taxAgentNameList.contains(f.getName())).collect(Collectors.toList()); + } + for (TaxAgentPO po : taxAgentList) { + try { + getSIAccountService(user).saveAndFile(AccountParam.builder().paymentOrganization(po.getId()).billMonth(accountMonth).flag(true).fileFlag(isFile).build()); + } catch (Exception e) { + log.info("个税扣缴义务人-" + po.getName() + ",新建账单月份" + accountMonth + "的福利核算(并归档)过程失败,原因:" + e.getMessage()); + } + } + + } + + } +} diff --git a/src/com/engine/salary/timer/AutoSyncEmpArchiveStartDateJob.java b/src/com/engine/salary/timer/AutoSyncEmpArchiveStartDateJob.java new file mode 100644 index 000000000..1b4c32c84 --- /dev/null +++ b/src/com/engine/salary/timer/AutoSyncEmpArchiveStartDateJob.java @@ -0,0 +1,159 @@ +package com.engine.salary.timer; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.biz.SalaryArchiveBiz; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; +import com.engine.salary.enums.salaryarchive.SalaryArchiveListTypeEnum; +import com.engine.salary.enums.siaccount.EmployeeStatusEnum; +import com.engine.salary.mapper.siarchives.FundSchemeMapper; +import com.engine.salary.mapper.siarchives.OtherSchemeMapper; +import com.engine.salary.mapper.siarchives.SocialSchemeMapper; +import com.engine.salary.service.SIArchivesService; +import com.engine.salary.service.SalaryArchiveService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.impl.SIArchivesServiceImpl; +import com.engine.salary.service.impl.SalaryArchiveServiceImpl; +import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; +import weaver.interfaces.schedule.BaseCronJob; + +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Harryxzy + * @ClassName AutoSyncInsuranceArchiveJob + * @date 2023/08/14 9:30 + * @description 自动同步人员社保福利档案、薪资档案为公司开始日期字段(companystartdate) + */ +public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob { + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class,user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class,user); + } + + + private SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class,user); + } + + private String syncInsuranceArchive; + + private String syncSalaryArchive; + + private SalaryArchiveBiz getSalaryArchiveMapper = new SalaryArchiveBiz(); + + private SocialSchemeMapper getSocialSchemeMapper() { + return MapperProxyFactory.getProxy(SocialSchemeMapper.class); + } + + private FundSchemeMapper getFundSchemeMapper() { + return MapperProxyFactory.getProxy(FundSchemeMapper.class); + } + + private OtherSchemeMapper getOtherSchemeMapper() { + return MapperProxyFactory.getProxy(OtherSchemeMapper.class); + } + + + + @Override + public void execute() { + User user = new User(); + user.setUid(1); + user.setLoginid("sysadmin"); + + if (StringUtils.isBlank(syncInsuranceArchive) || !StringUtils.equals(syncInsuranceArchive,"false")) { + // 同步社保福利档案 + // 获取社保、公积金、其他福利中起始缴纳月任意一个为空的社保档案主表po + List needSyncInsuranceBaseInfoList = getSIArchivesService(user).listStartDateIsNull(Collections.emptyList()); + // 过滤出档案状态为待增员的 + needSyncInsuranceBaseInfoList = needSyncInsuranceBaseInfoList.stream().filter(po -> po.getRunStatus().equals(EmployeeStatusEnum.STAY_ADD.getValue())).collect(Collectors.toList()); + // 获取同步人员的公司开始日期 + List employeeList = getSalaryEmployeeService(user).listByIds(SalaryEntityUtil.properties(needSyncInsuranceBaseInfoList, InsuranceArchivesBaseInfoPO::getEmployeeId, Collectors.toList())); + Map empInfoMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, emp -> { + if (StringUtils.isBlank(emp.getCompanystartdate()) || !SalaryDateUtil.checkDay(emp.getCompanystartdate())) { + return ""; + } else { + return StringUtils.substring(emp.getCompanystartdate(), 0, 7); + } + }); + // 设置社保起始缴纳月信息 + List needSyncSocialArchiveIds = SalaryEntityUtil.properties(needSyncInsuranceBaseInfoList, InsuranceArchivesBaseInfoPO::getSocialArchivesId, Collectors.toList()); + List insuranceArchivesSocialSchemePOS = getSIArchivesService(user).listInsuranceArchivesSocialSchemeByIds(needSyncSocialArchiveIds); + insuranceArchivesSocialSchemePOS.stream().forEach(po -> { + if (StringUtils.isBlank(po.getSocialStartTime()) && StringUtils.isNotBlank(empInfoMap.get(po.getEmployeeId()))) { + po.setSocialStartTime(empInfoMap.get(po.getEmployeeId())); + getSocialSchemeMapper().updateById(po); + } + }); + + // 设置公积金起始缴纳月信息 + List needSyncFundArchiveIds = SalaryEntityUtil.properties(needSyncInsuranceBaseInfoList, InsuranceArchivesBaseInfoPO::getFundArchivesId, Collectors.toList()); + List insuranceArchivesFundSchemePOS = getSIArchivesService(user).listInsuranceArchivesFundSchemeByIds(needSyncFundArchiveIds); + insuranceArchivesFundSchemePOS.stream().forEach(po -> { + if (StringUtils.isBlank(po.getFundStartTime()) && StringUtils.isNotBlank(empInfoMap.get(po.getEmployeeId()))) { + po.setFundStartTime(empInfoMap.get(po.getEmployeeId())); + getFundSchemeMapper().updateById(po); + } + }); + + // 设置其他福利起始缴纳月信息 + List needSyncOtherArchiveIds = SalaryEntityUtil.properties(needSyncInsuranceBaseInfoList, InsuranceArchivesBaseInfoPO::getOtherArchivesId, Collectors.toList()); + List insuranceArchivesOtherSchemePOS = getSIArchivesService(user).listInsuranceArchivesOtherSchemeByIds(needSyncOtherArchiveIds); + insuranceArchivesOtherSchemePOS.stream().forEach(po -> { + if (StringUtils.isBlank(po.getOtherStartTime()) && StringUtils.isNotBlank(empInfoMap.get(po.getEmployeeId()))) { + po.setOtherStartTime(empInfoMap.get(po.getEmployeeId())); + getOtherSchemeMapper().updateById(po); + } + }); + } + + if (StringUtils.isBlank(syncSalaryArchive) || !StringUtils.equals(syncSalaryArchive,"false")) { + // 同步薪资档案 + // 获取薪资档案起始发薪日为空且是待定薪资的档案 + List salaryArchiveList = getSalaryArchiveService(user).listPayStartDateIsNull(SalaryArchiveListTypeEnum.PENDING.getValue()); + List empIds = SalaryEntityUtil.properties(salaryArchiveList, SalaryArchivePO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map empMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, emp -> { + if (StringUtils.isBlank(emp.getCompanystartdate()) || !SalaryDateUtil.checkDay(emp.getCompanystartdate())) { + return null; + } else { + return SalaryDateUtil.stringToDate(StringUtils.substring(emp.getCompanystartdate(), 0, 10)); + } + }); + List needUpdateArchiveList = salaryArchiveList.stream().filter(archive -> { + if (archive.getPayStartDate() == null) { + Date startDate = empMap.get(archive.getEmployeeId()); + if (startDate != null) { + archive.setPayStartDate(startDate); + return true; + } else { + return false; + } + } else { + return false; + } + }).collect(Collectors.toList()); + getSalaryArchiveMapper.batchUpdate(needUpdateArchiveList); + } + + } + +} diff --git a/src/com/engine/salary/timer/AutoSyncResignationEmpArchiveJob.java b/src/com/engine/salary/timer/AutoSyncResignationEmpArchiveJob.java index b62f8ce6d..d5bec89d0 100644 --- a/src/com/engine/salary/timer/AutoSyncResignationEmpArchiveJob.java +++ b/src/com/engine/salary/timer/AutoSyncResignationEmpArchiveJob.java @@ -1,15 +1,16 @@ package com.engine.salary.timer; import com.engine.common.util.ServiceUtil; -import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.biz.SalaryArchiveBiz; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; import com.engine.salary.mapper.siarchives.FundSchemeMapper; import com.engine.salary.mapper.siarchives.OtherSchemeMapper; import com.engine.salary.mapper.siarchives.SocialSchemeMapper; +import com.engine.salary.service.SIArchivesService; import com.engine.salary.service.SalaryArchiveService; import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.impl.SIArchivesServiceImpl; import com.engine.salary.service.impl.SalaryArchiveServiceImpl; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.util.SalaryDateUtil; @@ -28,7 +29,7 @@ import java.util.*; * @date 2023/08/14 9:30 * @description 自动同步离职人员社保福利档案内容 */ -public class AutoSyncResignationEmpArchiveJob extends BaseCronJob { +public class AutoSyncResignationEmpArchiveJob extends BaseCronJob { private SalaryArchiveService getSalaryArchiveService(User user) { return ServiceUtil.getService(SalaryArchiveServiceImpl.class,user); @@ -54,6 +55,10 @@ public class AutoSyncResignationEmpArchiveJob extends BaseCronJob { private String preMonth; + public SIArchivesService getSIArchivesService(User user) { + return ServiceUtil.getService(SIArchivesServiceImpl.class,user); + } + @Override public void execute() { User user = new User(); @@ -85,8 +90,8 @@ public class AutoSyncResignationEmpArchiveJob extends BaseCronJob { } // 获取离职人员中没有设置最后缴纳月的社保福利档案 - SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); - List needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet())); +// List needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet())); + List needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet())); // 设置社保、公积金最后缴纳月 for(InsuranceArchivesBaseInfoPO po : needSyncList){ String dismissDate = resignationMap.get(po.getEmployeeId()); diff --git a/src/com/engine/salary/timer/SyncTaxAgentEmp2SobEmpJob.java b/src/com/engine/salary/timer/SyncTaxAgentEmp2SobEmpJob.java index 5df6d7b5e..d1a823059 100644 --- a/src/com/engine/salary/timer/SyncTaxAgentEmp2SobEmpJob.java +++ b/src/com/engine/salary/timer/SyncTaxAgentEmp2SobEmpJob.java @@ -8,7 +8,7 @@ import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.service.SalarySobService; import com.engine.salary.service.impl.SalarySobRangeServiceImpl; import com.engine.salary.service.impl.SalarySobServiceImpl; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import weaver.general.BaseBean; diff --git a/src/com/engine/salary/util/EnumUtil.java b/src/com/engine/salary/util/EnumUtil.java new file mode 100644 index 000000000..aad5269e0 --- /dev/null +++ b/src/com/engine/salary/util/EnumUtil.java @@ -0,0 +1,357 @@ +package com.engine.salary.util; + + +import lombok.extern.slf4j.Slf4j; +import sun.reflect.ConstructorAccessor; +import sun.reflect.FieldAccessor; +import sun.reflect.MethodAccessor; +import sun.reflect.ReflectionFactory; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Slf4j +public class EnumUtil { + + /** + * 扩展枚举(把新枚举的值加入旧枚举里,从旧枚举里删除不要的枚举值) + * @param oldEnumClass 旧枚举类 + * @param newEnumClass 需要扩展的枚举类 + * @param removeOldEnums 需要删除的旧枚举值 + * @param + * @param + * @throws Exception + */ + public static void extendEnum(Class oldEnumClass,Class newEnumClass,O... removeOldEnums) throws Exception { + boolean needToRemoveOldEnum = removeOldEnums!=null&&removeOldEnums.length>0; + if(needToRemoveOldEnum){ + removeEnum(oldEnumClass,removeOldEnums); + } + List newEnums = values(newEnumClass); + Field[] fields = getFields(newEnumClass); + for (Object newEnumObject : newEnums) { + Enum newEnum = Enum.class.cast(newEnumObject); + + List fieldTypeList = new ArrayList<>(); + //枚举名称的类型:String.class + fieldTypeList.add(String.class); + for (Field field : fields) { + fieldTypeList.add(field.getType()); + } + List fieldValueList = new ArrayList<>(); + //枚举名称 + fieldValueList.add(newEnum.name()); + for (Field field : fields) { + Object value = field.get(newEnum); + fieldValueList.add(value); + } + + Class[] fieldTypes = fieldTypeList.toArray(new Class[]{}); + String[] fieldValues = fieldValueList.toArray(new String[]{}); + addEnum(oldEnumClass,fieldTypes,fieldValues); + } + } + + /** + * 新增枚举值 + * @param enumClass 枚举类型 + * @param fieldTypes 字段的类型,第一个是枚举名类型String + * @param fieldValues 字段的值,第一个是枚举名称 + * @throws Exception + */ + public static > T addEnum(Class enumClass, Class[] fieldTypes, Object[] fieldValues) throws Exception { + if(fieldTypes==null||fieldTypes.length==0){ + throw new RuntimeException("参数fieldTypes为空"); + } + if(fieldValues==null||fieldValues.length==0){ + throw new RuntimeException("参数fieldValues为空"); + } + if(fieldTypes[0]!=String.class){ + throw new RuntimeException("参数fieldTypes[0]不是String.class"); + } + if(!(fieldValues[0] instanceof String)){ + throw new RuntimeException("参数fieldValues[0]不是字符串"); + } + if(fieldTypes.length!=fieldValues.length){ + throw new RuntimeException("参数fieldTypes和参数fieldValues的长度不一致"); + } + ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory(); + String enumName = fieldValues[0].toString(); + synchronized (enumClass){ + //判断name是否已经添加过了 + if(hasEnumName(enumClass,enumName)){ + log.info("枚举类{}中已存在该枚举名:{}",enumClass.getSimpleName(),enumName); + return getEnum(enumClass,enumName); + } + //name,ordinal,其他自定义字段 + List allFieldClass = new ArrayList<>(fieldTypes.length + 1); + allFieldClass.add(String.class); + allFieldClass.add(int.class); + for (int i = 1; i < fieldTypes.length; i++) { + allFieldClass.add(fieldTypes[i]); + } + Class[] classes = allFieldClass.toArray(new Class[]{}); + Constructor constructor = enumClass.getDeclaredConstructor(classes); + ConstructorAccessor constructorAccessor = reflectionFactory.newConstructorAccessor(constructor); + List allFields = new ArrayList<>(fieldValues.length + 1); + allFields.add(enumName); + int maxOrdinal = getMaxOrdinal(enumClass); + allFields.add(maxOrdinal+1); + for (int i = 1; i < fieldValues.length; i++) { + allFields.add(fieldValues[i]); + } + //调用枚举的构造方法,创建新的枚举值 + T newEnum = (T) constructorAccessor.newInstance(allFields.toArray()); + log.info("新增枚举:{}" , newEnum); + Field valuesField = enumClass.getDeclaredField("$VALUES"); + valuesField.setAccessible(true); + + //解除values属性的final限制 + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + int modifiers = modifiersField.getInt(valuesField); + modifiers &= ~Modifier.FINAL; + modifiersField.setInt(valuesField, modifiers); + + //将新增的枚举值加入values属性里 + FieldAccessor fieldAccessor = reflectionFactory.newFieldAccessor(valuesField, false); + T[] ts = (T[]) fieldAccessor.get(enumClass); + List list = new ArrayList<>(Arrays.asList(ts)); + list.add(newEnum); + fieldAccessor.set(enumClass, list.toArray(ts)); + + //将Class对象的enumConstants和enumConstantDirectory清空(Enum.valueOf()方法会给它们赋值) + /** + * Enum.valueOf()逻辑: + * 1.取enumConstantDirectory + * 1.1如果有值则直接返回 + * 1.2如果没值,则取enumConstants,并拷贝到enumConstantDirectory,下次可直接返回 + * 1.2.1如果enumConstants有值,则返回 + * 1.2.2如果enumConstants没值,则取枚举的values属性,并拷贝到enumConstants,下次可直接返回 + * 2.enumConstantDirectory.get(name)返回 + */ + Field enumConstantDirectoryField = enumClass.getClass().getDeclaredField("enumConstantDirectory"); + enumConstantDirectoryField.setAccessible(true); + FieldAccessor enumConstantDirectoryFieldAccessor = reflectionFactory.newFieldAccessor(enumConstantDirectoryField, false); + enumConstantDirectoryFieldAccessor.set(enumClass,null); + Field enumConstantsField = enumClass.getClass().getDeclaredField("enumConstants"); + enumConstantsField.setAccessible(true); + FieldAccessor enumConstantsFieldAccessor = reflectionFactory.newFieldAccessor(enumConstantsField, false); + enumConstantsFieldAccessor.set(enumClass,null); + return newEnum; + } + } + + /** + * 获取枚举类当前最大序号 + * @param enumClass 枚举类型 + * @param + * @return + * @throws Exception + */ + public static > int getMaxOrdinal(Class enumClass) throws Exception { + List values = values(enumClass); + if(values==null||values.size()==0){ + return 0; + } + int maxOrdinal = 0; + for (T value : values) { + if(maxOrdinal + */ + public static > void removeEnum(Class enumClass, Enum... removeOldEnums) throws Exception { + if(removeOldEnums==null||removeOldEnums.length==0){ + log.warn("removeOldEnums为空"); + return; + } + ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory(); + synchronized (enumClass){ + Field valuesField = enumClass.getDeclaredField("$VALUES"); + valuesField.setAccessible(true); + + //解除values属性的final限制 + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + int modifiers = modifiersField.getInt(valuesField); + modifiers &= ~Modifier.FINAL; + modifiersField.setInt(valuesField, modifiers); + + FieldAccessor fieldAccessor = reflectionFactory.newFieldAccessor(valuesField, false); + T[] oldEnumArray = (T[]) fieldAccessor.get(enumClass); + List enumList = new ArrayList<>(Arrays.asList(oldEnumArray)); + for (Enum removeOldEnum : removeOldEnums) { + //将指定的枚举值从values属性里删除 + enumList.remove(removeOldEnum); + log.info("删除枚举值:{}",removeOldEnum); + } + //把List转成数组 + T[] newEnumArray = (T[]) Arrays.copyOf(enumList.toArray(), enumList.size(), oldEnumArray.getClass()); + fieldAccessor.set(enumClass, newEnumArray); + } + } + /** + * 修改枚举属性 + * @param enumClass 枚举类型 + * @param enumName 枚举名称 + * @param attributeName 属性名 + * @param attributeValue 属性值 + * @param + * @throws Exception + */ + public static > void setAttribute(Class enumClass,String enumName,String attributeName,Object attributeValue) throws Exception { + List values = values(enumClass); + T target = null; + for (T t:values){ + if(t.name().equals(enumName)){ + target = t; + break; + } + } + if(target==null){ + throw new RuntimeException("该枚举类没有枚举名:"+enumName); + } + Field declaredField = target.getClass().getDeclaredField(attributeName); + declaredField.setAccessible(true); + declaredField.set(target,attributeValue); + } + + /** + * 修改枚举属性 + * @param targetEnum 枚举值 + * @param attributeName 属性名 + * @param attributeValue 属性值 + * @param + * @throws Exception + */ + public static > void setAttribute(T targetEnum,String attributeName,Object attributeValue) throws Exception { + Field declaredField = targetEnum.getClass().getDeclaredField(attributeName); + declaredField.setAccessible(true); + declaredField.set(targetEnum,attributeValue); + } + + /** + * 判断枚举类是否包含了指定枚举名 + * @param clazz + * @param enumName + * @param + * @return + */ + public static > boolean hasEnumName(Class clazz, String enumName) throws Exception { +// 不要用valueOf方法,因为它会初始化enumConstantDirectory使得后续调用valueOf方法后拿不到后面加入的枚举值 +// try{ +// T t = Enum.valueOf(clazz, enumName); +// if(t!=null){ +// return true; +// } +// }catch (Exception e){ +// e.printStackTrace(); +// System.err.println(e.getMessage()); +// } + List values = values(clazz); + for (T t:values){ + if(t.name().equals(enumName)){ + return true; + } + } + return false; + } + + /** + * 根据枚举类型和枚举名获取枚举值 + * @param clazz 枚举类型 + * @param enumName 枚举名称 + * @param + * @return + * @throws Exception + */ + public static > T getEnum(Class clazz, String enumName) throws Exception { + List values = values(clazz); + for (T t:values){ + if(t.name().equals(enumName)){ + return t; + } + } + return null; + } + + /** + * 获取枚举类的所有枚举值 + * @param clazz 枚举类型 + * @param + * @return + * @throws Exception + */ + public static > List values(Class clazz) throws Exception { + ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory(); + Field valuesField = clazz.getDeclaredField("$VALUES"); + valuesField.setAccessible(true); + FieldAccessor fieldAccessor = reflectionFactory.newFieldAccessor(valuesField, false); + T[] ts = (T[]) fieldAccessor.get(clazz); + List list = new ArrayList<>(Arrays.asList(ts)); + return list; + } + + /** + * 获取枚举类的所有枚举值 + * @param clazz 枚举类型 + * @param + * @return + * @throws Exception + */ + public static > List values2(Class clazz) throws Exception { + ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory(); + Method valuesMethod = clazz.getDeclaredMethod("values"); + valuesMethod.setAccessible(true); + MethodAccessor methodAccessor = reflectionFactory.newMethodAccessor(valuesMethod); + T[] ts = (T[]) methodAccessor.invoke(clazz, null); + List list = new ArrayList<>(Arrays.asList(ts)); + return list; + } + + /** + * 获取枚举的字段(排除数组类型、枚举类型) + * @param enumClass + * @return + */ + public static Field[] getFields(Class enumClass){ + List result = new ArrayList<>(); + Field[] declaredFields = enumClass.getDeclaredFields(); + for (Field field : declaredFields) { + Class type = field.getType(); + //排除数组类型(values)、枚举类型(枚举值) + if(type!=enumClass && !type.isArray()){ + field.setAccessible(true); + result.add(field); + } + } + return result.toArray(new Field[]{}); + } + + /** + * 打印枚举值 + * @param enumClass 枚举类型 + * @throws Exception + */ + public static void printEnum(Class enumClass) throws Exception { + System.out.println("+++++++++++++++++++++++"); + List values = values(enumClass); + values.stream().forEach(System.out::println); + System.out.println("+++++++++++++++++++++++"); + } + +} diff --git a/src/com/engine/salary/util/ResponseResult.java b/src/com/engine/salary/util/ResponseResult.java index 7755bc673..2036fd1a2 100644 --- a/src/com/engine/salary/util/ResponseResult.java +++ b/src/com/engine/salary/util/ResponseResult.java @@ -3,9 +3,8 @@ package com.engine.salary.util; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; -import com.engine.common.service.HrmCommonService; -import com.engine.common.service.impl.HrmCommonServiceImpl; import com.engine.core.exception.ECException; +import com.engine.salary.common.SalaryContext; import com.engine.salary.exception.ExceptionUtil; import com.engine.salary.exception.SalaryRunTimeException; import com.fasterxml.jackson.core.JsonProcessingException; @@ -14,6 +13,8 @@ import lombok.extern.slf4j.Slf4j; import weaver.general.BaseBean; import weaver.hrm.User; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.Map; import java.util.function.Consumer; @@ -35,14 +36,20 @@ public class ResponseResult { private final User user; - private final HrmCommonService hrmCommonService = new HrmCommonServiceImpl(); - private final BaseBean baseBean = new BaseBean(); private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log")); public ResponseResult(User user) { this.user = user; + SalaryContext.get().setValue("user", user); + } + + public ResponseResult(HttpServletRequest request, HttpServletResponse response, User user) { + this.user = user; + SalaryContext.get().setValue("user", user); + SalaryContext.get().setValue("request", request); + SalaryContext.get().setValue("response", response); } diff --git a/src/com/engine/salary/util/SalaryI18nUtil.java b/src/com/engine/salary/util/SalaryI18nUtil.java index ae93121da..e121af186 100644 --- a/src/com/engine/salary/util/SalaryI18nUtil.java +++ b/src/com/engine/salary/util/SalaryI18nUtil.java @@ -4,6 +4,19 @@ import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import weaver.systeminfo.SystemEnv; +import com.engine.salary.annotation.I18n; +import com.engine.salary.exception.SalaryRunTimeException; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import weaver.general.Util; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + /** * 多语言工具类 *

Copyright: Copyright (c) 2022

@@ -14,6 +27,68 @@ import weaver.systeminfo.SystemEnv; **/ public class SalaryI18nUtil { + + public static T i18n(T data) { + if (data == null ) { + return data; + } + try { + List fieldList = getFields(data.getClass()); + if (CollectionUtils.isNotEmpty(fieldList)) { + for (Field field : fieldList) { + field.setAccessible(true); + String fieldValue = (String) field.get(data); + if (StringUtils.isNotBlank(fieldValue)) { + String encryptValue = Util.formatMultiLang(fieldValue); + field.set(data, encryptValue); + } + } + } + return data; + } catch (Exception e) { + throw new SalaryRunTimeException("国际化解析异常"); + } + } + + public static List i18nList(List dataList) { + if (CollectionUtils.isEmpty(dataList) ) { + return dataList; + } + try { + List fieldList = getFields(dataList.get(0).getClass()); + if (CollectionUtils.isNotEmpty(fieldList)) { + for (T data : dataList) { + for (Field field : fieldList) { + field.setAccessible(true); + String fieldValue = (String) field.get(data); + if (StringUtils.isNotBlank(fieldValue)) { + String encryptValue = Util.formatMultiLang(fieldValue); + field.set(data, encryptValue); + } + } + } + + } + return dataList; + } catch (Exception e) { + throw new SalaryRunTimeException("国际化批量解析异常"); + } + } + + @NotNull + private static List getFields(Class clazz) { + List> allClasses = new ArrayList>(); + for (Class superClass = clazz; superClass != null; superClass = superClass.getSuperclass()) { + if (superClass != Object.class) { + allClasses.add(superClass); + } + } + return allClasses.stream() + .map(Class::getDeclaredFields) + .flatMap(Arrays::stream) + .filter(field -> field.isAnnotationPresent(I18n.class)).collect(Collectors.toList()); + } + /** * 获取多语言信息 * diff --git a/src/com/engine/salary/util/SalaryLoggerUtil.java b/src/com/engine/salary/util/SalaryLoggerUtil.java index e8d0c60de..72d7aae28 100644 --- a/src/com/engine/salary/util/SalaryLoggerUtil.java +++ b/src/com/engine/salary/util/SalaryLoggerUtil.java @@ -1,73 +1,98 @@ package com.engine.salary.util; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.hrmelog.util.LoggerTemplate; +import com.engine.salary.enums.OperateTypeEnum; +import weaver.hrm.User; + /** - * @Description: 操作日志工具类 - * @Author: wangxiangzhong - * @Date: 2021/11/1 11:31 - */ + * 操作日志工具类 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryLoggerUtil { -// /** -// * 记录单个对象新增操作日志 -// * @param loggerTemplate -// * @param targetId -// * @param targetName -// * @param operateTypeName -// * @param operatedesc -// * @param newValues -// */ -// public static void recordAddSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object newValues) { -// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.ADD.getValue(), operateTypeName, operatedesc, null, newValues); -// } -// -// /** -// * 记录单个对象修改操作日志 -// * @param loggerTemplate -// * @param targetId -// * @param targetName -// * @param operateTypeName -// * @param operatedesc -// * @param oldValues -// * @param newValues -// */ -// public static void recordUpdateSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues, Object newValues) { -// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.UPDATE.getValue(), operateTypeName, operatedesc, oldValues, newValues); -// } -// -// /** -// * 记录单个对象删除操作日志 -// * @param loggerTemplate -// * @param targetId -// * @param targetName -// * @param operateTypeName -// * @param operatedesc -// * @param oldValues -// */ -// public static void recordDeleteSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues) { -// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.DELETE.getValue(), operateTypeName, operatedesc, oldValues, null); -// } -// -// /** -// * 记录单个对象日志 -// * @param loggerTemplate -// * @param targetId -// * @param targetName -// * @param operateType -// * @param operateTypeName -// * @param operatedesc -// * @param oldValues -// * @param newValues -// */ -// private static void recoreSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateType, String operateTypeName, String operatedesc, Object oldValues, Object newValues) { -// LoggerContext loggerContext = new LoggerContext(); -// loggerContext.setTargetId(String.valueOf(targetId)); -// loggerContext.setTargetName(targetName); -// loggerContext.setOperateType(operateType); -// loggerContext.setOperateTypeName(operateTypeName); -// loggerContext.setOperatedesc(operatedesc); -// loggerContext.setOldValues(oldValues); -// loggerContext.setNewValues(newValues); -// loggerTemplate.write(loggerContext); -// } + /** + * 记录单个对象新增操作日志 + * @param loggerTemplate + * @param targetId + * @param targetName + * @param operateTypeName + * @param operatedesc + * @param newValues + * @param user + */ + public static void recordAddSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object newValues, User user) { + recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.ADD.getValue(), operateTypeName, operatedesc, null, newValues, user); + } + + /** + * 记录单个对象修改操作日志 + * @param loggerTemplate + * @param targetId + * @param targetName + * @param operateTypeName + * @param operatedesc + * @param oldValues + * @param newValues + * @param user + */ + public static void recordUpdateSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues, Object newValues, User user) { + recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.UPDATE.getValue(), operateTypeName, operatedesc, oldValues, newValues, user); + } + + /** + * 记录单个对象删除操作日志 + * @param loggerTemplate + * @param targetId + * @param targetName + * @param operateTypeName + * @param operatedesc + * @param oldValues + * @param user + */ + public static void recordDeleteSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues, User user) { + recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.DELETE.getValue(), operateTypeName, operatedesc, oldValues, null, user); + } + + /** + * 记录单个对象导出操作日志 + * @param loggerTemplate + * @param targetId + * @param targetName + * @param operateTypeName + * @param operatedesc + * @param user + */ + public static void recordExportSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, User user) { + recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.EXCEL_EXPORT.getValue(), operateTypeName, operatedesc, null, null, user); + } + + /** + * 记录单个对象日志 + * @param loggerTemplate + * @param targetId + * @param targetName + * @param operateType + * @param operateTypeName + * @param operatedesc + * @param oldValues + * @param newValues + */ + private static void recoreSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateType, String operateTypeName, String operatedesc, Object oldValues, Object newValues, User user) { + LoggerContext loggerContext = new LoggerContext(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(targetId)); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(operateType); + loggerContext.setOperateTypeName(operateTypeName); + loggerContext.setOperatedesc(operatedesc); + loggerContext.setOldValues(oldValues); + loggerContext.setNewValues(newValues); + loggerTemplate.write(loggerContext); + } } diff --git a/src/com/engine/salary/util/SalaryTokenUtil.java b/src/com/engine/salary/util/SalaryTokenUtil.java index ba2509350..68446cf30 100644 --- a/src/com/engine/salary/util/SalaryTokenUtil.java +++ b/src/com/engine/salary/util/SalaryTokenUtil.java @@ -3,7 +3,7 @@ package com.engine.salary.util; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.engine.salary.exception.SalaryRunTimeException; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.lang3.StringUtils; import weaver.conn.RecordSet; import weaver.general.BaseBean; diff --git a/src/com/engine/salary/util/db/IdGenerator.java b/src/com/engine/salary/util/db/IdGenerator.java new file mode 100644 index 000000000..3a900a8d6 --- /dev/null +++ b/src/com/engine/salary/util/db/IdGenerator.java @@ -0,0 +1,46 @@ +package com.engine.salary.util.db; + +import java.util.concurrent.atomic.AtomicLong; + +public class IdGenerator { + private static AtomicLong next = new AtomicLong(1L); + public static final int ID_LENGTH_36 = 36; + + public IdGenerator() { + } + + public static long generate() { + return System.currentTimeMillis() + next.getAndIncrement(); + } + + public static String generateId() { + return System.currentTimeMillis() + String.valueOf(next.getAndIncrement()); + } + + public static String generateStrId() { + return System.currentTimeMillis() + generateStrId(36); + } + + public static String generateStrId(int idLength) { + if (idLength >= 1 && idLength <= 36) { + char[] srcChars = new char[]{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'g', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + char[] chars = new char[idLength]; + + for(int i = 0; i < idLength; ++i) { + if (i != 8 && i != 13 && i != 18 && i != 23) { + if (i == 0) { + chars[i] = srcChars[(int)(Math.random() * 26.0D) % 26]; + } else { + chars[i] = srcChars[(int)(Math.random() * 36.0D) % 36]; + } + } else { + chars[i] = '_'; + } + } + + return new String(chars); + } else { + return ""; + } + } +} diff --git a/src/com/engine/salary/util/excel/DataTypeEnum.java b/src/com/engine/salary/util/excel/DataTypeEnum.java new file mode 100644 index 000000000..15e845cd9 --- /dev/null +++ b/src/com/engine/salary/util/excel/DataTypeEnum.java @@ -0,0 +1,32 @@ +package com.engine.salary.util.excel; + +import java.util.Arrays; +import java.util.Objects; + +public enum DataTypeEnum { + string("string", "字符类型"), + number("string", "数字类型"), + date("string", "日期类型"); + + private String value; + private String name; + + DataTypeEnum(String value, String name) { + this.value = value; + this.name = name; + } + + public String getValue() { + return value; + } + + public String getName() { + return name; + } + + + public static DataTypeEnum parseByValue(String value) { + return Arrays.stream(DataTypeEnum.values()).filter(typeEnum -> Objects.equals(typeEnum.getValue(), value)).findFirst().orElse(null); + } + +} diff --git a/src/com/engine/salary/util/excel/ExcelHead.java b/src/com/engine/salary/util/excel/ExcelHead.java new file mode 100644 index 000000000..cec7da51d --- /dev/null +++ b/src/com/engine/salary/util/excel/ExcelHead.java @@ -0,0 +1,28 @@ +package com.engine.salary.util.excel; + +import java.lang.annotation.*; + +/** + * 数据列表表头 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelHead { + + String title() default ""; + + String dataIndex() default ""; + + DataTypeEnum dataType() default DataTypeEnum.string; + + int labelId() default -1; + + String width() default ""; + +} diff --git a/src/com/engine/salary/util/excel/ExcelUtil.java b/src/com/engine/salary/util/excel/ExcelUtil.java index c50c11d2b..2a482e42d 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -1,6 +1,9 @@ package com.engine.salary.util.excel; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.FillPatternType; @@ -9,6 +12,12 @@ import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.xssf.usermodel.*; import java.awt.*; +import java.beans.BeanInfo; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -67,6 +76,41 @@ public class ExcelUtil { return workbook; } + public static XSSFWorkbook genWorkbook(String sheetName, List rowList) { + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + // 解析表头 + ExcelUtil.parseHeader(TaxDeclarationLaborListDTO.class, headerList, dataIndexList); + + List> rows = new ArrayList<>(); + rows.add(headerList); + for (int i = 0; i < rowList.size(); i++) { + List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); + for (int j = 0; j < dataIndexList.size(); j++) { + Object value = getValue(rowList.get(i), dataIndexList.get(j)); + row.add(value); + } + rows.add(row); + } + return genWorkbookV2(rows, sheetName); + } + + private static Object getValue(T t, String fieldName) { + Object value = null; + try { + BeanInfo beanInfo = Introspector.getBeanInfo(t.getClass()); + PropertyDescriptor[] props = beanInfo.getPropertyDescriptors(); + for (PropertyDescriptor property : props) { + if (fieldName.equals(property.getName())) { + Method method = property.getReadMethod(); + value = method.invoke(t, new Object[]{}); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return value; + } public static XSSFWorkbook genWorkbookV2(List> rowList, String sheetName) { XSSFWorkbook workbook = new XSSFWorkbook(); @@ -267,4 +311,24 @@ public class ExcelUtil { } return workbook; } + + /** + * 解析表头 + * + * @param clazz + * @param headerList + * @param dataIndexList + * @param + */ + public static void parseHeader(Class clazz, List headerList, List dataIndexList) { + Field[] declaredFields = clazz.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(ExcelHead.class)) { + continue; + } + ExcelHead annotation = declaredField.getAnnotation(ExcelHead.class); + headerList.add(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.title())); + dataIndexList.add(declaredField.getName()); + } + } } diff --git a/src/com/engine/salary/util/page/PageInfo.java b/src/com/engine/salary/util/page/PageInfo.java index abba24768..dd9eb6a85 100644 --- a/src/com/engine/salary/util/page/PageInfo.java +++ b/src/com/engine/salary/util/page/PageInfo.java @@ -12,7 +12,7 @@ import java.util.List; @Data @ToString -public class PageInfo extends com.github.pagehelper.PageInfo { +public class PageInfo extends com.engine.salary.component.PageInfo { Class clazz; public void setColumns(List columns) { diff --git a/src/com/engine/salary/util/page/SalaryPageUtil.java b/src/com/engine/salary/util/page/SalaryPageUtil.java index 20e566d86..3b1fbb7fb 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -1,9 +1,11 @@ package com.engine.salary.util.page; -import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; +import java.awt.*; +import java.awt.font.FontRenderContext; +import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -11,13 +13,6 @@ import java.util.List; public class SalaryPageUtil { - public static void start(Integer pageNum, Integer pageSize) { - pageNum = pageNum == null || pageNum <= 0 ? 1 : pageNum; - pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize; - PageHelper.startPage(pageNum, pageSize); - } - - public static PageInfo buildPage(Integer pageNo, Integer pageSize) { pageNo = pageNo == null || pageNo <= 0 ? 1 : pageNo; pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize; @@ -112,16 +107,36 @@ public class SalaryPageUtil { endIndex > source.size() ? source.size() : endIndex); } - public static String selfAdaption(String chars) { -// int adaption = 0; -// -// if (chars != null) { -// adaption = chars.length() * 12 + 55; -// } -// if (adaption < 79) { -// adaption = 79; -// } -// return adaption + ""; - return "150"; + + static Font font = new Font("Arial", Font.PLAIN, 12); // 设置字体样式、大小等属性 + static FontRenderContext frc = new FontRenderContext(null, true, false); +// GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + + /** + * 自适应文字长度 + * @param chars + * @param width + * @return + */ + public static String selfAdaption(String chars, Integer width) { + if (width != null && width != 0) { + return width + ""; + } + Rectangle2D bounds = font.getStringBounds(chars, frc); + int pxLength = (int) Math.ceil(bounds.getWidth()); + return pxLength + 55 + ""; } + +// public static String selfAdaption(String chars) { +// // int adaption = 0; +// // +// // if (chars != null) { +// // adaption = chars.length() * 12 + 55; +// // } +// // if (adaption < 79) { +// // adaption = 79; +// // } +// // return adaption + ""; +// return "150"; +// } } diff --git a/src/com/engine/salary/web/AddUpDeductionController.java b/src/com/engine/salary/web/AddUpDeductionController.java index 4d7db599d..4f5ce859a 100644 --- a/src/com/engine/salary/web/AddUpDeductionController.java +++ b/src/com/engine/salary/web/AddUpDeductionController.java @@ -254,6 +254,10 @@ public class AddUpDeductionController { if (StringUtils.isNotBlank(accumulatedSpecialAdditionalDeductionId)) { param.setAccumulatedSpecialAdditionalDeductionId(Long.valueOf(accumulatedSpecialAdditionalDeductionId)); } + String hasData = request.getParameter("hasData"); + if (StringUtils.isNotBlank(hasData)) { + param.setHasData("true".equals(hasData)); + } return param; } diff --git a/src/com/engine/salary/web/AddUpSituationController.java b/src/com/engine/salary/web/AddUpSituationController.java index 8b11038f4..48bbd83e7 100644 --- a/src/com/engine/salary/web/AddUpSituationController.java +++ b/src/com/engine/salary/web/AddUpSituationController.java @@ -264,6 +264,10 @@ public class AddUpSituationController { if (StringUtils.isNotBlank(accumulatedSituationId)) { param.setAccumulatedSituationId(Long.valueOf(accumulatedSituationId)); } + String hasData = request.getParameter("hasData"); + if (StringUtils.isNotBlank(hasData)) { + param.setHasData("true".equals(hasData)); + } return param; } diff --git a/src/com/engine/salary/web/MySalaryShowSetController.java b/src/com/engine/salary/web/MySalaryShowSetController.java new file mode 100644 index 000000000..538d951ae --- /dev/null +++ b/src/com/engine/salary/web/MySalaryShowSetController.java @@ -0,0 +1,45 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.salaryBill.dto.MySalaryShowSetDTO; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.MySalaryShowSetWrapper; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * @Description: 我的薪资福利显示设置 + * @Author: wangxiangzhong + * @Date: 2021-12-08 14:44 + */ +@Slf4j +public class MySalaryShowSetController { + + private MySalaryShowSetWrapper getMySalaryShowSetWrapper(User user) { + return ServiceUtil.getService(MySalaryShowSetWrapper.class, user); + } + + /** + * 我的薪资福利页签显隐控制 + * + * @return + */ + @GET + @Path("/get") + @Produces(MediaType.APPLICATION_JSON) + public String mySalaryShowSet(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getMySalaryShowSetWrapper(user)::mySalaryShowSet); + } + + /******** 工资单 end ***********************************************************************************************/ +} diff --git a/src/com/engine/salary/web/OtherDeductionController.java b/src/com/engine/salary/web/OtherDeductionController.java index dd3a1ab59..1df43bb7f 100644 --- a/src/com/engine/salary/web/OtherDeductionController.java +++ b/src/com/engine/salary/web/OtherDeductionController.java @@ -257,6 +257,11 @@ public class OtherDeductionController { if (StringUtils.isNotBlank(otherTaxExemptDeductionId)) { param.setOtherTaxExemptDeductionId(Long.valueOf(otherTaxExemptDeductionId)); } + + String hasData = request.getParameter("hasData"); + if (StringUtils.isNotBlank(hasData)) { + param.setHasData("true".equals(hasData)); + } return param; } diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index 9063133e3..408c72431 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -12,6 +12,7 @@ import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO; import com.engine.salary.entity.siaccount.param.*; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.service.SIAccountService; import com.engine.salary.service.impl.SIAccountServiceImpl; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryI18nUtil; @@ -26,7 +27,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; -import com.engine.salary.service.SIAccountService; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -35,15 +35,12 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; - import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.time.LocalDate; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 福利核算控制器 @@ -321,9 +318,9 @@ public class SIAccountController { @Path("/supplementary/delete") @Produces(MediaType.APPLICATION_JSON) public String deleteSummplementaryAccount(@Context HttpServletRequest request, @Context HttpServletResponse response, - @RequestBody List param) { + @RequestBody SaveCommonAccountParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult, String>(user).run(getService(user)::deleteSummplementaryAccount, param); + return new ResponseResult(user).run(getService(user)::deleteSupplementaryAccount, param); } @@ -450,6 +447,36 @@ public class SIAccountController { return new ResponseResult>(user).run(getSalaryFormulaWrapper(user)::welfareList); } + /** + * 社保福利(核算)项列表缓存(正常缴纳、补缴) + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/cacheWelfareList") + @Produces(MediaType.APPLICATION_JSON) + public String cacheWelfareList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceAcctDetailImportTemplateParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, Void>(user).run(getService(user)::cacheWelfareField, param.getWelfareNames()); + } + + /** + * 社保福利(核算)项列表缓存(正常缴纳、补缴) + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/cacheBalanceWelfareList") + @Produces(MediaType.APPLICATION_JSON) + public String cacheBalanceWelfareList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceAcctDetailImportTemplateParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, Void>(user).run(getService(user)::cacheBalanceWelfareField, param.getWelfareNames()); + } + // /** // * 导出“福利核算导入”模板 // */ diff --git a/src/com/engine/salary/web/SIArchivesController.java b/src/com/engine/salary/web/SIArchivesController.java index 7d19ea7af..8345dced4 100644 --- a/src/com/engine/salary/web/SIArchivesController.java +++ b/src/com/engine/salary/web/SIArchivesController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO; import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; diff --git a/src/com/engine/salary/web/SIExportController.java b/src/com/engine/salary/web/SIExportController.java index f99496637..899db2a6b 100644 --- a/src/com/engine/salary/web/SIExportController.java +++ b/src/com/engine/salary/web/SIExportController.java @@ -89,8 +89,9 @@ public class SIExportController { @QueryParam("ids")List ids,@QueryParam("billMonth") String billMonth) { InspectAccountParam param = InspectAccountParam.builder().ids(ids).billMonth(billMonth).build(); User user = HrmUserVarify.getUser(request, response); - SIAccountBiz siAccountBiz = new SIAccountBiz(); - List insuranceAccountInspectPOS = siAccountBiz.allInspects(param.getIds(), param.getBillMonth()); +// SIAccountBiz siAccountBiz = new SIAccountBiz(); +// List insuranceAccountInspectPOS = siAccountBiz.allInspects(param.getIds(), param.getBillMonth()); + List insuranceAccountInspectPOS = getService(user).allInspects(param.getIds(), param.getBillMonth()); InsuranceArchivesListParam req = new InsuranceArchivesListParam(); req.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList())); XSSFWorkbook workbook = getSIExportWrapper(user).export(req); @@ -240,12 +241,13 @@ public class SIExportController { @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) { InsuranceArchivesListParam param = buildParam(request); - SIAccountBiz siAccountBiz = new SIAccountBiz(); + User user = HrmUserVarify.getUser(request, response); +// SIAccountBiz siAccountBiz = new SIAccountBiz(); if (param.getInspectAll() != null && param.getInspectAll()) { - List insuranceAccountInspectPOS = siAccountBiz.allInspects(param.getIds(), param.getBillMonth()); +// List insuranceAccountInspectPOS = siAccountBiz.allInspects(param.getIds(), param.getBillMonth()); + List insuranceAccountInspectPOS = getService(user).allInspects(param.getIds(), param.getBillMonth()); param.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList())); } - User user = HrmUserVarify.getUser(request, response); XSSFWorkbook workbook = getSIImportWrapper(user).exportTemplate(param); String time = LocalDate.now().toString(); String fileName = ""; diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 49040e2ae..6140d06d4 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -166,6 +166,7 @@ public class SalaryAcctController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getSalaryAcctRecordWrapper(user)::backCalculate, param.getSalaryAcctRecordId()); } + /* ********************************薪资核算记录相关 end*********************************/ @@ -474,6 +475,15 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::updateLockStatusByParam, param); } + //批量更新 + @POST + @Path("/acctresult/batchUpdate") + @Produces(MediaType.APPLICATION_JSON) + public String batchUpdate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultBatchUpdateParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::batchUpdate, param); + } + //薪资核算 @POST @Path("/acctresult/accounting") diff --git a/src/com/engine/salary/web/SalaryBillController.java b/src/com/engine/salary/web/SalaryBillController.java index 7611feb6b..0728a16b1 100644 --- a/src/com/engine/salary/web/SalaryBillController.java +++ b/src/com/engine/salary/web/SalaryBillController.java @@ -352,6 +352,12 @@ public class SalaryBillController { @Produces(MediaType.APPLICATION_JSON) public String infoList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendInfoQueryParam queryParam) { User user = HrmUserVarify.getUser(request, response); + if (StringUtils.isNotBlank(queryParam.getDepartmentIdStr())) { + queryParam.setDepartmentIds(Arrays.stream(StringUtils.split(queryParam.getDepartmentIdStr(), ",")).map(Long::valueOf).collect(Collectors.toList())); + } + if (StringUtils.isNotBlank(queryParam.getSubCompanyIdStr())) { + queryParam.setSubCompanyIds(Arrays.stream(StringUtils.split(queryParam.getSubCompanyIdStr(), ",")).map(Long::valueOf).collect(Collectors.toList())); + } return new ResponseResult>(user).run(getSalarySendWrapper(user)::infoList, queryParam); } @@ -492,7 +498,7 @@ public class SalaryBillController { // 处理入参复用方法 SalarySendDetailQueryParam detailQueryParam = SalarySendDetailQueryParam.builder() .userId(queryParam.getUserId()) - .departmentIds(SalaryEntityUtil.isNullOrEmpty(queryParam.getDepartment()) ? null : Collections.singletonList(queryParam.getDepartment())) + .departmentIds(CollectionUtils.isEmpty(queryParam.getDepartmentIds()) ? null : queryParam.getDepartmentIds()) .salarySendId(queryParam.getSalarySendId()) .mergeCountTax(queryParam.getMergeCountTax()) .positionIds(SalaryEntityUtil.isNullOrEmpty(queryParam.getPosition()) ? null : Collections.singletonList(queryParam.getPosition())) @@ -502,6 +508,12 @@ public class SalaryBillController { detailQueryParam.setCurrent(queryParam.getCurrent()); detailQueryParam.setPageSize(queryParam.getPageSize()); + if (StringUtils.isNotBlank(queryParam.getSubCompanyIdStr())) { + detailQueryParam.setSubCompanyIds(Arrays.asList(StringUtils.split(queryParam.getSubCompanyIdStr(), ",")).stream().map(Long::new).collect(Collectors.toList())); + } + if (StringUtils.isNotBlank(queryParam.getDepartmentIdStr())) { + detailQueryParam.setDepartmentIds(Arrays.asList(StringUtils.split(queryParam.getDepartmentIdStr(), ",")).stream().map(Long::new).collect(Collectors.toList())); + } return new ResponseResult>(user).run(getSalarySendWrapper(user)::detailList, detailQueryParam); } diff --git a/src/com/engine/salary/web/SalaryItemController.java b/src/com/engine/salary/web/SalaryItemController.java index a7c2e9472..bb1a1bb1e 100644 --- a/src/com/engine/salary/web/SalaryItemController.java +++ b/src/com/engine/salary/web/SalaryItemController.java @@ -1,7 +1,6 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.common.SalaryContext; import com.engine.salary.component.WeaFormOption; import com.engine.salary.entity.salaryitem.dto.SalaryItemFormDTO; import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO; @@ -41,7 +40,6 @@ import java.util.Map; public class SalaryItemController { private SalaryItemWrapper getSalaryItemWrapper(User user) { - SalaryContext.get().setValue("user",user); return ServiceUtil.getService(SalaryItemWrapper.class, user); } @@ -61,7 +59,7 @@ public class SalaryItemController { @Produces(MediaType.APPLICATION_JSON) public String listSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSearchParam searchParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalaryItemWrapper(user)::listPage, searchParam); + return new ResponseResult>(request, response, user).run(getSalaryItemWrapper(user)::listPage, searchParam); } @@ -169,9 +167,9 @@ public class SalaryItemController { public String saveSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); if (saveParam.getId() == null || saveParam.getId() <= 0) { - return new ResponseResult(user).run(getSalaryItemWrapper(user)::save, saveParam); + return new ResponseResult(request, response, user).run(getSalaryItemWrapper(user)::save, saveParam); } else { - return new ResponseResult(user).run(getSalaryItemWrapper(user)::update, saveParam); + return new ResponseResult(request, response, user).run(getSalaryItemWrapper(user)::update, saveParam); } } diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index c0ff33e1f..1ef33b35e 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -93,6 +93,18 @@ public class SalarySobController { return new ResponseResult>(user).run(getSalarySobWrapper(user)::listPage, queryParam); } + /** + * 薪资账套列表 + */ + @POST + @Path("/listAll") + @Produces(MediaType.APPLICATION_JSON) + public String listAll(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobWrapper(user)::listAll); + } + + /** * 薪资账套基本信息表单 */ diff --git a/src/com/engine/salary/web/SpecialAddDeductionController.java b/src/com/engine/salary/web/SpecialAddDeductionController.java index 73f0a916e..f61ed4588 100644 --- a/src/com/engine/salary/web/SpecialAddDeductionController.java +++ b/src/com/engine/salary/web/SpecialAddDeductionController.java @@ -4,8 +4,10 @@ import com.engine.common.util.ServiceUtil; import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionListDTO; import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionRecordDTO; -import com.engine.salary.entity.datacollection.param.*; -import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.entity.datacollection.param.SpecialAddDeductionImportParam; +import com.engine.salary.entity.datacollection.param.SpecialAddDeductionParam; +import com.engine.salary.entity.datacollection.param.SpecialAddDeductionQueryParam; +import com.engine.salary.entity.datacollection.param.SpecialAddDeductionRecordDeleteParam; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; @@ -18,7 +20,6 @@ import org.jetbrains.annotations.Nullable; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; -import javax.security.sasl.SaslException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.GET; @@ -261,6 +262,10 @@ public class SpecialAddDeductionController { if (StringUtils.isNotBlank(otherTaxExemptDeductionId)) { param.setSpecialAddDeductionId(Long.valueOf(otherTaxExemptDeductionId)); } + String hasData = request.getParameter("hasData"); + if (StringUtils.isNotBlank(hasData)) { + param.setHasData("true".equals(hasData)); + } return param; } diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index bfda2e881..78d4fa9eb 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -103,8 +103,7 @@ public class AddUpDeductionWrapper extends Service { * @return */ public XSSFWorkbook export(AddUpDeductionQueryParam queryParam) { - boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); - return getAddUpDeductionService(user).export(isChief, queryParam); + return getAddUpDeductionService(user).export( queryParam); } /** diff --git a/src/com/engine/salary/wrapper/MySalaryShowSetWrapper.java b/src/com/engine/salary/wrapper/MySalaryShowSetWrapper.java new file mode 100644 index 000000000..4efbd70cb --- /dev/null +++ b/src/com/engine/salary/wrapper/MySalaryShowSetWrapper.java @@ -0,0 +1,32 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salaryBill.dto.MySalaryShowSetDTO; +import com.engine.salary.service.MySalaryShowSetService; +import com.engine.salary.service.impl.MySalaryShowSetServiceImpl; +import org.springframework.stereotype.Component; +import weaver.hrm.User; + +; + +/** + * @Description: 我的薪资福利显示设置 + * @Author: wangxiangzhong + * @Date: 2023/8/7 11:24 + */ +@Component +public class MySalaryShowSetWrapper extends Service { + private MySalaryShowSetService getMySalaryShowSetService(User user) { + return ServiceUtil.getService(MySalaryShowSetServiceImpl.class, user); + } + + /** + * 获取我的薪资福利显示设置 + * + * @return + */ + public MySalaryShowSetDTO mySalaryShowSet() { + return getMySalaryShowSetService(user).get(); + } +} diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index acef7c61f..7cdafca56 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -76,7 +76,7 @@ public class OtherDeductionWrapper extends Service { conditionItems.add(username); - SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "4"); + SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "57"); departmentName.setInputType("browser"); departmentName.setColSpan(2); departmentName.setFieldcol(16); @@ -196,7 +196,7 @@ public class OtherDeductionWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam queryParam) { - return getOtherDeductionService(user).export(queryParam); + return getOtherDeductionService(user).downloadTemplate(queryParam); } /** diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index a01d27fe9..d49df5ba0 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -9,10 +9,7 @@ import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; -import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultUpdateLockStatusParam; +import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; @@ -269,6 +266,13 @@ public class SalaryAcctResultWrapper extends Service { return getSalaryAcctResultService(user).sumForWorkflow(param); } + /** + * 薪资核算结果批量更新 + * @param param + */ + public void batchUpdate(SalaryAcctResultBatchUpdateParam param) { + getSalaryAcctResultService(user).batchUpdate(param); + } /** * 薪资核算-校验 diff --git a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java index 621302824..d755371c7 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java @@ -2,6 +2,8 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemListDTO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveItemFormDTO; @@ -15,6 +17,7 @@ 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.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum; @@ -349,6 +352,16 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt } list.setList(listResult); + // 记录查看日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + // TODO 我的调薪记录setTargetId + // loggerContext.setTargetId(); + loggerContext.setTargetName("我的调薪记录"); + loggerContext.setOperateType(OperateTypeEnum.READ.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "查看调薪记录")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "查看调薪记录")); + SalaryElogConfig.myAdjustRecordLoggerTemplate.write(loggerContext); return list; } diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index 1b6b37ff4..d180118ad 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -5,6 +5,8 @@ import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveBO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveBaseInfoFormDTO; @@ -17,6 +19,7 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryarchive.*; import com.engine.salary.exception.SalaryRunTimeException; @@ -167,6 +170,15 @@ public class SalaryArchiveWrapper extends Service { datas.put("dataKey", result.getResultMap()); datas.put("salaryArchives", salaryArchives); datas.put("listType", listTypeEnum.getValue()); + + //记录操作日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetName(listTypeEnum.getDefaultLabel()); + loggerContext.setOperateType(OperateTypeEnum.READ.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "查看薪资档案列表")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "查看薪资档案列表")); + SalaryElogConfig.salaryArchiveLoggerTemplate.write(loggerContext); return datas; } @@ -453,7 +465,7 @@ public class SalaryArchiveWrapper extends Service { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542370, "列表类型必传")); } else { // 定薪列表导入有调薪导入和初始化导入 - if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED.getValue())) { + if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED)) { Optional optional = Arrays.stream(SalaryArchiveImportTypeEnum.values()) .filter(e -> StringUtils.isNotEmpty(queryParam.getImportType()) && e.getValue().equals(queryParam.getImportType())).findFirst(); if (!optional.isPresent()) { diff --git a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java index 0cf2f3495..505c19e0a 100644 --- a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java @@ -49,6 +49,8 @@ public class SalaryBillBaseSetWrapper extends Service { SalaryBillWatermarkDTO salaryBillWatermark = getSalaryBillBaseSetService(user).getWatermarkSetting(); SalaryBillAckFeedbackDTO salaryBillAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting(); salaryBillViewingLimitSetting salaryBillViewingLimitSetting = getSalaryBillBaseSetService(user).getSalaryBillViewingLimitSetting(); + Integer burningAfterReadingMin = getSalaryBillBaseSetService(user).getBurningAfterReadingMin(); + salaryBillViewingLimitSetting.setBurningAfterReadingMin(burningAfterReadingMin); if (Objects.isNull(salaryBillWatermark)) { dto.setWatermarkStatus(false); diff --git a/src/com/engine/salary/wrapper/SalaryFieldWrapper.java b/src/com/engine/salary/wrapper/SalaryFieldWrapper.java index 708b0807a..5cff6649e 100644 --- a/src/com/engine/salary/wrapper/SalaryFieldWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryFieldWrapper.java @@ -3,6 +3,8 @@ package com.engine.salary.wrapper; import cn.hutool.core.codec.Base64Encoder; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryitem.bo.SalaryItemBO; import com.engine.salary.entity.salaryitem.dto.SalaryFieldListDTO; @@ -12,10 +14,7 @@ import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; -import com.engine.salary.enums.SalaryOnOffEnum; -import com.engine.salary.enums.SalaryRoundingModeEnum; -import com.engine.salary.enums.SalarySystemTypeEnum; -import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.*; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalaryFormulaService; @@ -175,7 +174,17 @@ public class SalaryFieldWrapper extends Service { ValidUtil.doValidator(saveParam); validParam(saveParam); - getSalaryItemService(user).save(saveParam); + SalaryItemPO salaryItemPO = getSalaryItemService(user).save(saveParam); + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryItemPO.getId())); + loggerContext.setTargetName(salaryItemPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建字段")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建字段") + ": " + salaryItemPO.getName()); + loggerContext.setNewValues(salaryItemPO); + SalaryElogConfig.salaryArchiveFieldLoggerTemplate.write(loggerContext); } private void validParam(SalaryItemSaveParam saveParam) { @@ -207,7 +216,20 @@ public class SalaryFieldWrapper extends Service { ValidUtil.doValidator(saveParam, RuntimeTypeEnum.UPDATE); validParam(saveParam); - getSalaryItemService(user).update(saveParam); + SalaryItemPO salaryItemPO = getSalaryItemService(user).update(saveParam); + + // 记录日志 + SalaryItemPO newSalaryItemPO = getSalaryItemService(user).getById(salaryItemPO.getId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(newSalaryItemPO.getId())); + loggerContext.setTargetName(newSalaryItemPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑字段")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑字段") + ": " + newSalaryItemPO.getName()); + loggerContext.setOldValues(salaryItemPO); + loggerContext.setNewValues(newSalaryItemPO); + SalaryElogConfig.salaryArchiveFieldLoggerTemplate.write(loggerContext); } /** diff --git a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java index 6127e5a31..ff00b5646 100644 --- a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java @@ -1,8 +1,10 @@ package com.engine.salary.wrapper; +import com.cloudstore.dev.api.util.Util_DataCache; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SalaryItemBiz; +import com.engine.salary.constant.SalaryItemConstant; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.bo.SalaryFormulaBO; import com.engine.salary.entity.salaryformula.dto.ExpressFormulaDTO; @@ -22,6 +24,7 @@ import com.engine.salary.service.SalaryFormulaService; import com.engine.salary.service.impl.FormulaRunServiceImpl; import com.engine.salary.service.impl.RemoteExcelServiceImpl; import com.engine.salary.service.impl.SalaryFormulaServiceImpl; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; @@ -142,11 +145,20 @@ public class SalaryFormulaWrapper extends Service { } - welfareList.add(new InsuranceAcctDetailImportFieldDTO("socialSum",SalaryI18nUtil.getI18nLabel(user.getLanguage(),542280, "社保合计"))); - welfareList.add(new InsuranceAcctDetailImportFieldDTO("fundSum",SalaryI18nUtil.getI18nLabel(user.getLanguage(),542281, "公积金合计"))); - welfareList.add(new InsuranceAcctDetailImportFieldDTO("otherSum",SalaryI18nUtil.getI18nLabel(user.getLanguage(),542282, "其他福利合计"))); - welfareList.add(new InsuranceAcctDetailImportFieldDTO("total",SalaryI18nUtil.getI18nLabel(user.getLanguage(),358, "合计"))); + welfareList.add(new InsuranceAcctDetailImportFieldDTO("socialSum",SalaryI18nUtil.getI18nLabel(user.getLanguage(),542280, "社保合计", false))); + welfareList.add(new InsuranceAcctDetailImportFieldDTO("fundSum",SalaryI18nUtil.getI18nLabel(user.getLanguage(),542281, "公积金合计",false))); + welfareList.add(new InsuranceAcctDetailImportFieldDTO("otherSum",SalaryI18nUtil.getI18nLabel(user.getLanguage(),542282, "其他福利合计", false))); + welfareList.add(new InsuranceAcctDetailImportFieldDTO("total",SalaryI18nUtil.getI18nLabel(user.getLanguage(),358, "合计", false))); + // 缓存勾选 + String cacheKey = user.getUID() + SalaryItemConstant.SI_ACCOUNT_IMPORT_FIELD_SIGN; + String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); + List checkFields = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); + welfareList.stream().forEach(field -> { + if (checkFields.contains(field.getFieldId())) { + field.setChecked(true); + } + }); return welfareList; } @@ -175,6 +187,16 @@ public class SalaryFormulaWrapper extends Service { } + // 缓存勾选 + String cacheKey = user.getUID() + SalaryItemConstant.SI_ACCOUNT_BALANCE_IMPORT_FIELD_SIGN; + String cacheValue = (String) Util_DataCache.getObjVal(cacheKey); + List checkFields = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class); + welfareList.stream().forEach(field -> { + if (checkFields.contains(field.getFieldId())) { + field.setChecked(true); + } + }); + return welfareList; } diff --git a/src/com/engine/salary/wrapper/SalaryItemWrapper.java b/src/com/engine/salary/wrapper/SalaryItemWrapper.java index ff73e3609..4cf7a712b 100644 --- a/src/com/engine/salary/wrapper/SalaryItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryItemWrapper.java @@ -4,6 +4,8 @@ import cn.hutool.core.codec.Base64Encoder; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.component.WeaFormOption; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryitem.bo.SalaryItemBO; import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; @@ -265,7 +267,17 @@ public class SalaryItemWrapper extends Service { ValidUtil.doValidator(saveParam); validParam(saveParam); - getSalaryItemService(user).save(saveParam); + SalaryItemPO salaryItemPO = getSalaryItemService(user).save(saveParam); + // 记录日志 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryItemPO.getId())); + loggerContext.setTargetName(salaryItemPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新建薪资项目")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新建薪资项目") + ": " + salaryItemPO.getName()); + loggerContext.setNewValues(salaryItemPO); + SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext); } private void validParam(SalaryItemSaveParam saveParam) { @@ -294,7 +306,20 @@ public class SalaryItemWrapper extends Service { public void update(SalaryItemSaveParam saveParam) { ValidUtil.doValidator(saveParam, RuntimeTypeEnum.UPDATE); validParam(saveParam); - getSalaryItemService(user).update(saveParam); + SalaryItemPO salaryItemPO = getSalaryItemService(user).update(saveParam); + + // 记录日志 + SalaryItemPO newSalaryItemPO = getSalaryItemService(user).getById(salaryItemPO.getId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(newSalaryItemPO.getId())); + loggerContext.setTargetName(newSalaryItemPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑字段")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑字段") + ": " + newSalaryItemPO.getName()); + loggerContext.setOldValues(salaryItemPO); + loggerContext.setNewValues(newSalaryItemPO); + SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext); } /** diff --git a/src/com/engine/salary/wrapper/SalarySendWrapper.java b/src/com/engine/salary/wrapper/SalarySendWrapper.java index 6799cab10..3d8f3d3f3 100644 --- a/src/com/engine/salary/wrapper/SalarySendWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySendWrapper.java @@ -152,9 +152,15 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy Optional optional = salaryTemplates.stream().filter(s -> s.getSalarySobId().equals(e.getSalarySobId())).findFirst(); if (optional.isPresent()) { // 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()); + SalaryTemplatePO salaryTemplatePO = optional.get(); + e.setTemplate(NumberUtils.INTEGER_ONE.equals(e.getSalaryAcctType()) ? salaryTemplatePO.getReplenishName() : salaryTemplatePO.getName()); + e.setTemplateId(salaryTemplatePO.getId()); + if ((salaryTemplatePO.getAckFeedbackStatus() != null && salaryTemplatePO.getAckFeedbackStatus() == 1) || + (salaryTemplatePO.getFeedbackStatus() != null && salaryTemplatePO.getFeedbackStatus() == 1) ) { + e.setAckFeedbackStatus(1); + } else { + e.setAckFeedbackStatus(0); + } } }); } @@ -251,8 +257,20 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy taxAgent.setLabel(SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人")); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(taxAgent); + // 分部 + SearchConditionItem subCompany = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "subCompanyIdStr", "194"); + subCompany.setColSpan(2); + subCompany.setFieldcol(16); + subCompany.setLabelcol(8); + subCompany.setViewAttr(2); + subCompany.setIsQuickSearch(false); + subCompany.setLabel("分部"); + subCompany.setInputType(""); + subCompany.getBrowserConditionParam().setIsSingle(false); + conditionItems.add(subCompany); + // 部门 - SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "4"); + SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIdStr", "4"); departmentName.setColSpan(2); departmentName.setFieldcol(16); departmentName.setLabelcol(8); @@ -260,6 +278,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy departmentName.setIsQuickSearch(false); departmentName.setLabel(SalaryI18nUtil.getI18nLabel(user.getLanguage(),27511,"部门")); departmentName.setInputType(""); + departmentName.getBrowserConditionParam().setIsSingle(false); conditionItems.add(departmentName); // 岗位 @@ -412,8 +431,21 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy taxAgent.setLabel(SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人")); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(taxAgent); + // 分部 + SearchConditionItem subCompany = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "subCompanyIdStr", "194"); + subCompany.setColSpan(2); + subCompany.setFieldcol(16); + subCompany.setLabelcol(8); + subCompany.setViewAttr(2); + subCompany.setInputType(""); + subCompany.setIsQuickSearch(false); + subCompany.setLabel("分部"); + subCompany.getBrowserConditionParam().setIsSingle(false); + conditionItems.add(subCompany); + + // 部门 - SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "department", "4"); + SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIdStr", "4"); departmentName.setColSpan(2); departmentName.setFieldcol(16); departmentName.setLabelcol(8); @@ -421,6 +453,8 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy departmentName.setInputType(""); departmentName.setIsQuickSearch(false); departmentName.setLabel(SalaryI18nUtil.getI18nLabel(user.getLanguage(),27511,"部门")); + departmentName.setLabel("部门"); + departmentName.getBrowserConditionParam().setIsSingle(false); conditionItems.add(departmentName); // 岗位 @@ -629,11 +663,14 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy } private List buildMySalaryBillListColumns() { + SalarySysConfPO taxAgentShowStatusPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.TAX_AGENT_SHOW_STATUS); List list = new ArrayList<>(); WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id"); idColumn.setDisplay(WeaBoolAttr.TRUE); list.add(new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(user.getLanguage(),542604, "薪资所属月"), "salaryYearMonth")); - list.add(new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人"), "taxAgent")); + if (taxAgentShowStatusPO == null || taxAgentShowStatusPO.getConfValue().equals("1")) { + list.add(new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(user.getLanguage(),537996, "个税扣缴义务人"), "taxAgent")); + } list.add(new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(user.getLanguage(),25034, "姓名"), "userName")); list.add(new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(user.getLanguage(),545954, "直接上级"), "managerName")); list.add(new WeaTableColumn("20%", SalaryI18nUtil.getI18nLabel(user.getLanguage(),545955, "工资单发放时间"), "sendTime")); diff --git a/src/com/engine/salary/wrapper/SalarySobWrapper.java b/src/com/engine/salary/wrapper/SalarySobWrapper.java index c1a058b7e..92acc5058 100644 --- a/src/com/engine/salary/wrapper/SalarySobWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobWrapper.java @@ -27,7 +27,7 @@ import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.SalarySobUtil; import com.engine.salary.util.page.PageInfo; -import dm.jdbc.util.IdGenerator; +import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; @@ -94,6 +94,16 @@ public class SalarySobWrapper extends Service { return dtoPage; } + + /** + * 薪资账套列表 + * + * @return + */ + public List listAll() { + return getSalarySobService(user).listAll(); + } + private void handleSalarySobBackItemHistory(SalarySobListQueryParam queryParam) { queryParam.setPageSize(100000); List list = getSalarySobService(user).listPageByParam(queryParam).getList(); diff --git a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java index 01d07b965..fb296393d 100644 --- a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java @@ -13,6 +13,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.enums.salarybill.SalaryTemplateReplenishRuleEnum; import com.engine.salary.enums.salarybill.SalaryTemplateVarEnum; @@ -20,6 +21,7 @@ import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper; import com.engine.salary.mapper.salarysob.SalarySobItemGroupMapper; +import com.engine.salary.mapper.salarysob.SalarySobItemGroupMapper; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; import com.engine.salary.util.JsonUtil; @@ -88,7 +90,7 @@ public class SalaryTemplateWrapper extends Service { } private SalarySobItemGroupMapper getSalarySobItemGroupMapper() { - return SqlProxyHandle.getProxy(SalarySobItemGroupMapper.class); + return MapperProxyFactory.getProxy(SalarySobItemGroupMapper.class); } /** @@ -186,6 +188,12 @@ public class SalaryTemplateWrapper extends Service { salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId()); salaryTemplateBaseSetDTO.setAutoSendStatus(po.getAutoSendStatus() != null && po.getAutoSendStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() != null && NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 0); + if (po.getFeedbackStatus() == null) { + salaryTemplateBaseSetDTO.setFeedbackStatus(salaryTemplateBaseSetDTO.getAckFeedbackStatus()); + } else { + salaryTemplateBaseSetDTO.setFeedbackStatus(NumberUtils.compare(po.getFeedbackStatus(), 1) == 0); + } + salaryTemplateBaseSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays()); // 规则赋值 如果为ALL传“” 如果为byRule传薪资项目ID salaryTemplateBaseSetDTO.setReplenishRule(SalaryTemplateReplenishRuleEnum.ALL.getValue().equals(po.getReplenishRule()) ? "" : po.getReplenishRule()); @@ -196,6 +204,7 @@ public class SalaryTemplateWrapper extends Service { } + // 查询所有启用的薪资账套 List salarySobs = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO); List> salarySobOptions = salarySobs.stream().map(salarySobPO -> { @@ -218,8 +227,16 @@ public class SalaryTemplateWrapper extends Service { SalaryBillAckFeedbackDTO defaultAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting(); salaryTemplateBaseSetDTO.setAckFeedbackStatus(StringUtils.equals(defaultAckFeedback.getAckStatus(), "1")); salaryTemplateBaseSetDTO.setAutoAckDays(defaultAckFeedback.getAutoAckDays()); + salaryTemplateBaseSetDTO.setFeedbackStatus(StringUtils.equals(defaultAckFeedback.getFeedbackStatus(), "1")); salaryTemplateBaseSetDTO.setFeedbackUrl(defaultAckFeedback.getFeedBackUrl()); + salaryTemplateBaseSetDTO.setMobileFeedbackUrl(defaultAckFeedback.getMobileFeedbackUrl()); } + + // 如果设置了pc端反馈流程地址,移动端没有设置,则移动端与pc端一致 + if (StringUtils.isNotBlank(salaryTemplateBaseSetDTO.getFeedbackUrl()) && StringUtils.isBlank(salaryTemplateBaseSetDTO.getMobileFeedbackUrl())) { + salaryTemplateBaseSetDTO.setMobileFeedbackUrl(salaryTemplateBaseSetDTO.getFeedbackUrl()); + } + Map salaryTemplateBase = new HashMap<>(); salaryTemplateBase.put("data", salaryTemplateBaseSetDTO); salaryTemplateBase.put("salarySobOptions", salarySobOptions); @@ -638,7 +655,13 @@ public class SalaryTemplateWrapper extends Service { Boolean isReplenish = Optional.ofNullable(param.getIsReplenish()).orElse(false); List salaryItemSet = getSalaryTemplateService(user).getSalaryItemSetContainHide(param.getSalarySobId(), param.getSalaryTemplateId(), isReplenish); Long groupId = param.getGroupId(); - return salaryItemSet.stream().filter(s -> Objects.equals(s.getGroupId(), groupId + "")).map(SalaryTemplateSalaryItemSetListDTO::getItems).findFirst().orElse(Collections.emptyList()).stream().filter(item -> !Optional.ofNullable(param.getExistSalaryItemIds()).orElse(Collections.emptyList()).contains(item.getId())).collect(Collectors.toList()); + //工资单模板copy可能导致groupId不匹配 + List salarySobItemGroupPOS = getSalarySobItemGroupMapper().listSome(SalarySobItemGroupPO.builder().salarySobId(param.getSalarySobId()).name(param.getGroupName()).build()); + if (salarySobItemGroupPOS != null && salarySobItemGroupPOS.size() > 0) { + groupId = salarySobItemGroupPOS.get(0).getId(); + } + Long finalGroupId = groupId; + return salaryItemSet.stream().filter(s -> Objects.equals(s.getGroupId(), finalGroupId + "")).map(SalaryTemplateSalaryItemSetListDTO::getItems).findFirst().orElse(Collections.emptyList()).stream().filter(item -> !Optional.ofNullable(param.getExistSalaryItemIds()).orElse(Collections.emptyList()).contains(item.getId())).collect(Collectors.toList()); } /** diff --git a/src/com/engine/salary/wrapper/SpecialAddDeductionWrapper.java b/src/com/engine/salary/wrapper/SpecialAddDeductionWrapper.java index c884ef7be..665f430a1 100644 --- a/src/com/engine/salary/wrapper/SpecialAddDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/SpecialAddDeductionWrapper.java @@ -61,7 +61,7 @@ public class SpecialAddDeductionWrapper extends Service { username.setLabel(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 25034, "姓名")); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(username); - SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "4"); + SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "57"); departmentName.setInputType("browser"); departmentName.setColSpan(2); departmentName.setFieldcol(16);