Merge remote-tracking branch 'remotes/origin/release/2.9.8.2311.02' into feature/salary_i18

# Conflicts:
#	src/com/engine/salary/biz/AddUpDeductionBiz.java
#	src/com/engine/salary/biz/AddUpSituationBiz.java
#	src/com/engine/salary/biz/OtherDeductionBiz.java
#	src/com/engine/salary/biz/SalaryArchiveItemBiz.java
#	src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java
#	src/com/engine/salary/entity/salaryformula/dto/SalaryFormulaEmployeeDTO.java
#	src/com/engine/salary/report/entity/bo/SalaryStatisticsReportBO.java
#	src/com/engine/salary/report/enums/UnitTypeEnum.java
#	src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java
#	src/com/engine/salary/service/impl/SISchemeServiceImpl.java
#	src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java
#	src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java
#	src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java
#	src/com/engine/salary/service/impl/SalaryBillServiceImpl.java
#	src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java
#	src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java
#	src/com/engine/salary/util/excel/ExcelUtilPlus.java
#	src/com/engine/salary/web/SIArchivesController.java
#	src/com/engine/salary/web/SISchemeController.java
#	src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java
#	src/com/engine/salary/wrapper/SalaryTemplateWrapper.java
This commit is contained in:
sy 2023-11-30 16:48:22 +08:00
commit efadc32622
172 changed files with 5692 additions and 1003 deletions

View File

@ -0,0 +1,2 @@
appid_id=123456
ip=127.0.0.1:8080

View File

@ -1,6 +1,6 @@
一、删除指定扣缴义务人下的档案
操作前做好数据备份
一、删除指定扣缴义务人下的档案
删除扣缴义务人下的档案(注意删除后,再添加进扣缴义务人,不会自动生成档案)
1、查询hrsa_tax_agent表对应扣缴义务人id
@ -19,8 +19,3 @@ update hrsa_salary_archive set delete_type=3 where tax_agent_id=扣缴义务人
二、删除停薪员工档案
update hrsa_salary_archive set delete_type=3 where run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
.\wkhtmltopdf.exe http://127.0.0.1:8080/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=1694053661638&recipient=92&type=phone C:\baidu.pdf

View File

@ -0,0 +1,4 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316);
/

View File

@ -0,0 +1,22 @@
update hrsa_sys_salary_item set code = 'addUpHousingLoanInterest' where id = 674853617092214800;
/
update hrsa_salary_item set code = 'addUpHousingLoanInterest' where sys_salary_item_id = 674853617092214800;
/
update hrsa_salary_sob_back_item set salary_item_code = 'addUpHousingLoanInterest' where salary_item_code = 'addUpHousingLoannumbererest';
/
update hrsa_formula set formulaRunScript = 'addUpSituation_addUpHousingLoanInterest' where id = 1651739100651;
/
update hrsa_formula set
formulaRunScript='salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly' where id = 1651739411365;
/
update hrsa_formula_var set field_id= 'addUpSituation_addUpHousingLoanInterest' where id = 1651739101122;
/
update hrsa_formula_var set field_id= 'salaryItem_addUpHousingLoanInterest' where id = 1651739411637;
/

View File

@ -0,0 +1,39 @@
CREATE TABLE hrsa_insurance_base_history (
id NUMBER(20,0) NOT NULL,
employee_id NUMBER(20,0) NOT NULL,
payment_organization NUMBER(11,0) NOT NULL,
welfare_type NUMBER(11,0) NOT NULL,
adjust_before_scheme_id NUMBER(11,0) NULL,
adjust_after_scheme_id NUMBER(11,0) NULL,
adjust_before_base_value VARCHAR2(255) NULL,
adjust_after_base_value VARCHAR2(255) NULL,
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
operator NUMBER(20,0) NOT NULL,
operate_time DATE NULL,
create_time DATE NOT NULL,
update_time DATE NOT NULL,
creator NUMBER(20,0) NOT NULL,
delete_type NUMBER(11,0) NOT NULL,
tenant_key VARCHAR2(10) NULL,
PRIMARY KEY (id)
);
/

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) 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(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

@ -0,0 +1,3 @@
alter table hrsa_salary_stats_report add time_type int;
/

View File

@ -0,0 +1,3 @@
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
/

View File

@ -0,0 +1,4 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316);
/

View File

@ -0,0 +1,22 @@
update hrsa_sys_salary_item set code = 'addUpHousingLoanInterest' where id = 674853617092214800;
/
update hrsa_salary_item set code = 'addUpHousingLoanInterest' where sys_salary_item_id = 674853617092214800;
/
update hrsa_salary_sob_back_item set salary_item_code = 'addUpHousingLoanInterest' where salary_item_code = 'addUpHousingLoannumbererest';
/
update hrsa_formula set formulaRunScript = 'addUpSituation_addUpHousingLoanInterest' where id = 1651739100651;
/
update hrsa_formula set
formulaRunScript='salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly' where id = 1651739411365;
/
update hrsa_formula_var set field_id= 'addUpSituation_addUpHousingLoanInterest' where id = 1651739101122;
/
update hrsa_formula_var set field_id= 'salaryItem_addUpHousingLoanInterest' where id = 1651739411637;
/

View File

@ -0,0 +1,39 @@
CREATE TABLE hrsa_insurance_base_history (
id NUMBER(20,0) NOT NULL,
employee_id NUMBER(20,0) NOT NULL,
payment_organization NUMBER(11,0) NOT NULL,
welfare_type NUMBER(11,0) NOT NULL,
adjust_before_scheme_id NUMBER(11,0) NULL,
adjust_after_scheme_id NUMBER(11,0) NULL,
adjust_before_base_value VARCHAR2(255) NULL,
adjust_after_base_value VARCHAR2(255) NULL,
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
operator NUMBER(20,0) NOT NULL,
operate_time DATE NULL,
create_time DATE NOT NULL,
update_time DATE NOT NULL,
creator NUMBER(20,0) NOT NULL,
delete_type NUMBER(11,0) NOT NULL,
tenant_key VARCHAR2(10) NULL,
PRIMARY KEY (id)
);
/

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) 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(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

@ -0,0 +1,3 @@
alter table hrsa_salary_stats_report add time_type int;
/

View File

@ -0,0 +1,3 @@
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
/

View File

@ -0,0 +1,4 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316);
/

View File

@ -0,0 +1,22 @@
update hrsa_sys_salary_item set code = 'addUpHousingLoanInterest' where id = 674853617092214800;
/
update hrsa_salary_item set code = 'addUpHousingLoanInterest' where sys_salary_item_id = 674853617092214800;
/
update hrsa_salary_sob_back_item set salary_item_code = 'addUpHousingLoanInterest' where salary_item_code = 'addUpHousingLoannumbererest';
/
update hrsa_formula set formulaRunScript = 'addUpSituation_addUpHousingLoanInterest' where id = 1651739100651;
/
update hrsa_formula set
formulaRunScript='salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly' where id = 1651739411365;
/
update hrsa_formula_var set field_id= 'addUpSituation_addUpHousingLoanInterest' where id = 1651739101122;
/
update hrsa_formula_var set field_id= 'salaryItem_addUpHousingLoanInterest' where id = 1651739411637;
/

View File

@ -0,0 +1,39 @@
CREATE TABLE hrsa_insurance_base_history (
id NUMBER(20,0) NOT NULL,
employee_id NUMBER(20,0) NOT NULL,
payment_organization NUMBER(11,0) NOT NULL,
welfare_type NUMBER(11,0) NOT NULL,
adjust_before_scheme_id NUMBER(11,0) NULL,
adjust_after_scheme_id NUMBER(11,0) NULL,
adjust_before_base_value VARCHAR2(255) NULL,
adjust_after_base_value VARCHAR2(255) NULL,
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
operator NUMBER(20,0) NOT NULL,
operate_time DATE NULL,
create_time DATE NOT NULL,
update_time DATE NOT NULL,
creator NUMBER(20,0) NOT NULL,
delete_type NUMBER(11,0) NOT NULL,
tenant_key VARCHAR2(10) NULL,
PRIMARY KEY (id)
);
/

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) 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(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

@ -0,0 +1,3 @@
alter table hrsa_salary_stats_report add time_type int;
/

View File

@ -0,0 +1,3 @@
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
/

View File

@ -0,0 +1,2 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316);

View File

@ -0,0 +1,37 @@
CREATE TABLE hrsa_insurance_base_history (
id bigint NOT NULL,
employee_id bigint NOT NULL,
payment_organization int NOT NULL,
welfare_type int NOT NULL,
adjust_before_scheme_id int NULL,
adjust_after_scheme_id int NULL,
adjust_before_base_value varchar(255) NULL,
adjust_after_base_value varchar(255) NULL,
adjust_welfare_item_id bigint NOT NULL,
operator bigint NOT NULL,
operate_time datetime NULL,
create_time datetime NOT NULL,
update_time datetime NOT NULL,
creator bigint NOT NULL,
delete_type int NOT NULL,
tenant_key varchar(10) NULL,
PRIMARY KEY (id)
);

View File

@ -0,0 +1,21 @@
CREATE TABLE hrsa_expand_field_settings (
id bigint(0) NOT NULL,
module varchar(100) NOT NULL ,
module_info varchar(1000) ,
pk varchar(100) NOT NULL,
expand_sql varchar(4000) NOT NULL ,
field_setting varchar(4000) NOT NULL,
create_time datetime(0) NOT NULL ,
update_time datetime(0) NOT NULL ,
creator bigint(0) NOT NULL ,
delete_type int(0) NOT NULL ,
tenant_key varchar(10) NOT NULL ,
PRIMARY KEY (id) USING BTREE
) ;
ALTER TABLE hrsa_salary_statistics_item
ADD COLUMN last_rule varchar(500) ,
ADD COLUMN old_rule varchar(500) ,
ADD COLUMN frequent_rule varchar(500) ,
ADD COLUMN tile_rule varchar(500) ;

View File

@ -0,0 +1,2 @@
alter table hrsa_salary_stats_report add time_type int
;

View File

@ -0,0 +1 @@
ALTER TABLE hrsa_salary_template ADD COLUMN sms_setting text NULL ;

View File

@ -0,0 +1,3 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316)
/

View File

@ -0,0 +1,21 @@
update hrsa_sys_salary_item set code = 'addUpHousingLoanInterest' where id = 674853617092214800
/
update hrsa_salary_item set code = 'addUpHousingLoanInterest' where sys_salary_item_id = 674853617092214800
/
update hrsa_salary_sob_back_item set salary_item_code = 'addUpHousingLoanInterest' where salary_item_code = 'addUpHousingLoannumbererest'
/
update hrsa_formula set formulaRunScript = 'addUpSituation_addUpHousingLoanInterest' where id = 1651739100651
/
update hrsa_formula set
formulaRunScript='salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly' where id = 1651739411365
/
update hrsa_formula_var set field_id= 'addUpSituation_addUpHousingLoanInterest' where id = 1651739101122
/
update hrsa_formula_var set field_id= 'salaryItem_addUpHousingLoanInterest' where id = 1651739411637
/

View File

@ -0,0 +1,38 @@
CREATE TABLE hrsa_insurance_base_history (
id NUMBER(20,0) NOT NULL,
employee_id NUMBER(20,0) NOT NULL,
payment_organization NUMBER(11,0) NOT NULL,
welfare_type NUMBER(11,0) NOT NULL,
adjust_before_scheme_id NUMBER(11,0) NULL,
adjust_after_scheme_id NUMBER(11,0) NULL,
adjust_before_base_value VARCHAR2(255) NULL,
adjust_after_base_value VARCHAR2(255) NULL,
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
operator NUMBER(20,0) NOT NULL,
operate_time DATE NULL,
create_time DATE NOT NULL,
update_time DATE NOT NULL,
creator NUMBER(20,0) NOT NULL,
delete_type NUMBER(11,0) NOT NULL,
tenant_key VARCHAR2(10) NULL,
PRIMARY KEY (id)
)
/

View File

@ -0,0 +1,23 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) 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(10) NOT NULL
)
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL
/

View File

@ -0,0 +1,2 @@
alter table hrsa_salary_stats_report add time_type int
/

View File

@ -0,0 +1,2 @@
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL
/

View File

@ -0,0 +1,3 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316);
/

View File

@ -0,0 +1,37 @@
CREATE TABLE hrsa_insurance_base_history (
id bigint NOT NULL,
employee_id bigint NOT NULL,
payment_organization int NOT NULL,
welfare_type int NOT NULL,
adjust_before_scheme_id int,
adjust_after_scheme_id int,
adjust_before_base_value varchar(255),
adjust_after_base_value varchar(255),
adjust_welfare_item_id bigint NOT NULL,
operator bigint NOT NULL,
operate_time timestamp(0),
create_time timestamp(0) NOT NULL,
update_time timestamp(0) NOT NULL,
creator bigint NOT NULL,
delete_type int NOT NULL,
tenant_key varchar(10),
PRIMARY KEY (id)
);

View File

@ -0,0 +1,20 @@
create table hrsa_expand_field_settings
(
id bigserial not null ,
module varchar(100) NOT NULL ,
module_info varchar(1000) ,
pk varchar(100) NOT NULL,
expand_sql varchar(4000) NOT NULL ,
field_setting varchar(4000) NOT NULL,
create_time timestamp,
update_time timestamp,
creator bigint NOT NULL ,
delete_type int NOT NULL ,
tenant_key varchar(10) NOT NULL ,
PRIMARY KEY ( id )
);
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN last_rule varchar(500) NULL ;
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN old_rule varchar(500) NULL ;
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN frequent_rule varchar(500) NULL ;
ALTER TABLE hrsa_salary_statistics_item ADD COLUMN tile_rule varchar(500) NULL ;

View File

@ -0,0 +1,2 @@
alter table hrsa_salary_stats_report add time_type int;
/

View File

@ -0,0 +1 @@
ALTER TABLE hrsa_salary_template ADD COLUMN sms_setting text NULL ;

View File

@ -0,0 +1,3 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316)
GO

View File

@ -0,0 +1,39 @@
CREATE TABLE [hrsa_insurance_base_history] (
[id] bigint NOT NULL,
[employee_id] bigint NOT NULL,
[payment_organization] int NOT NULL,
[welfare_type] int NOT NULL,
[adjust_before_scheme_id] int NULL,
[adjust_after_scheme_id] int NULL,
[adjust_before_base_value] varchar(255) COLLATE Chinese_PRC_CI_AS NULL,
[adjust_after_base_value] varchar(255) COLLATE Chinese_PRC_CI_AS NULL,
[adjust_welfare_item_id] bigint NOT NULL,
[operator] bigint NOT NULL,
[operate_time] datetime NULL,
[create_time] datetime NOT NULL,
[update_time] datetime NOT NULL,
[creator] bigint NOT NULL,
[delete_type] int NOT NULL,
[tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL,
PRIMARY KEY ([id])
)
GO

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id bigint NOT NULL,
module varchar(100) NOT NULL ,
module_info varchar(1000) NOT NULL ,
pk varchar(100) NULL DEFAULT NULL ,
expand_sql varchar(4000) NOT NULL ,
field_setting varchar(4000) NOT NULL,
create_time datetime NOT NULL ,
update_time datetime NOT NULL ,
creator bigint NOT NULL ,
delete_type int NOT NULL ,
tenant_key varchar(10) NOT NULL ,
PRIMARY KEY (id)
)
GO
ALTER TABLE hrsa_salary_statistics_item ADD last_rule varchar(500) NULL
GO
ALTER TABLE hrsa_salary_statistics_item ADD old_rule varchar(500) NULL
GO
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule varchar(500) NULL
GO
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule varchar(500) NULL
GO

View File

@ -0,0 +1,2 @@
alter table hrsa_salary_stats_report add time_type int
GO

View File

@ -0,0 +1,2 @@
ALTER TABLE hrsa_salary_template ADD sms_setting text NULL
GO

View File

@ -0,0 +1,4 @@
update hrsa_formula set EXTEND_PARAM= '{"sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}'
where id in (1674894163247,1674896933031,1674897014605,1675043440772,1680746056549,1681201555316);
/

View File

@ -0,0 +1,22 @@
update hrsa_sys_salary_item set code = 'addUpHousingLoanInterest' where id = 674853617092214800;
/
update hrsa_salary_item set code = 'addUpHousingLoanInterest' where sys_salary_item_id = 674853617092214800;
/
update hrsa_salary_sob_back_item set salary_item_code = 'addUpHousingLoanInterest' where salary_item_code = 'addUpHousingLoannumbererest';
/
update hrsa_formula set formulaRunScript = 'addUpSituation_addUpHousingLoanInterest' where id = 1651739100651;
/
update hrsa_formula set
formulaRunScript='salaryItem_addUpChildEducation+salaryItem_addUpHousingLoanInterest+salaryItem_addUpHousingRent+salaryItem_addUpContinuingEducation+salaryItem_addUpSupportElderly' where id = 1651739411365;
/
update hrsa_formula_var set field_id= 'addUpSituation_addUpHousingLoanInterest' where id = 1651739101122;
/
update hrsa_formula_var set field_id= 'salaryItem_addUpHousingLoanInterest' where id = 1651739411637;
/

View File

@ -0,0 +1,39 @@
CREATE TABLE hrsa_insurance_base_history (
id NUMBER(20,0) NOT NULL,
employee_id NUMBER(20,0) NOT NULL,
payment_organization NUMBER(11,0) NOT NULL,
welfare_type NUMBER(11,0) NOT NULL,
adjust_before_scheme_id NUMBER(11,0) NULL,
adjust_after_scheme_id NUMBER(11,0) NULL,
adjust_before_base_value VARCHAR2(255) NULL,
adjust_after_base_value VARCHAR2(255) NULL,
adjust_welfare_item_id NUMBER(20,0) NOT NULL,
operator NUMBER(20,0) NOT NULL,
operate_time DATE NULL,
create_time DATE NOT NULL,
update_time DATE NOT NULL,
creator NUMBER(20,0) NOT NULL,
delete_type NUMBER(11,0) NOT NULL,
tenant_key VARCHAR2(10) NULL,
PRIMARY KEY (id)
);
/

View File

@ -0,0 +1,27 @@
CREATE TABLE hrsa_expand_field_settings (
id NUMBER(38,0) primary key NOT NULL,
module varchar2(100) NOT NULL ,
module_info varchar2(1000) ,
pk varchar2(100) NOT NULL,
expand_sql varchar2(4000) NOT NULL ,
field_setting varchar2(4000) 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(10) NOT NULL
);
/
ALTER TABLE hrsa_salary_statistics_item ADD last_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD old_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD frequent_rule VARCHAR2(500) NULL;
/
ALTER TABLE hrsa_salary_statistics_item ADD tile_rule VARCHAR2(500) NULL;
/

View File

@ -0,0 +1,3 @@
alter table hrsa_salary_stats_report add time_type int;
/

View File

@ -0,0 +1,3 @@
ALTER TABLE hrsa_salary_template ADD sms_setting CLOB NULL;
/

View File

@ -0,0 +1,221 @@
package com.engine.salary.action;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportActionParam;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.taxagent.param.TaxAgentManageRangeSaveParam;
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
import com.engine.salary.enums.salarysob.TargetTypeEnum;
import com.engine.salary.mapper.archive.SalaryArchiveMapper;
import com.engine.salary.service.SalaryArchiveService;
import com.engine.salary.service.TaxAgentManageRangeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
import com.engine.salary.service.impl.TaxAgentManageRangeServiceImpl;
import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.wrapper.SalaryArchiveWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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;
@Slf4j
public class RehireAction implements Action {
private SalaryArchiveWrapper getSalaryArchiveWrapper(User user) {
return ServiceUtil.getService(SalaryArchiveWrapper.class, user);
}
private SalaryArchiveService getSalaryArchiveService(User user) {
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
}
private SalaryArchiveMapper getSalaryArchiveMapper() {
return MapperProxyFactory.getProxy(SalaryArchiveMapper.class);
}
private TaxAgentService getTaxAgentService(User user) {
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
private TaxAgentManageRangeService getTaxAgentManageRangeService(User user) {
return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.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 {
User user = new User(1);
Property[] properties = requestInfo.getMainTableInfo().getProperty();
Map<String, String> 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<SalaryField> list = new ArrayList<>();
while (rs.next()) {
String processField = rs.getString("processfield");
String salaryName = rs.getString("salaryname");
String value = fieldMap.get(processField);
list.add(new SalaryField(processField, salaryName, value));
}
Map<String, String> salaryFieldMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
String taxAgentName = salaryFieldMap.get("个税扣缴义务人");
String empIdStr = salaryFieldMap.get("员工id");
if (StringUtils.isBlank(taxAgentName) || StringUtils.isBlank(empIdStr)) {
requestInfo.getRequestManager().setMessage("个税扣缴义务人、或员工id不能为空");
return FAILURE_AND_CONTINUE;
}
// 获取义务人信息
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(taxAgentName).build());
if (CollectionUtils.isEmpty(taxAgentPOS)) {
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在");
return FAILURE_AND_CONTINUE;
}
// 先获取该个税扣缴义务人下该员工的薪资档案
Long taxAgentId = taxAgentPOS.get(0).getId();
Long employeeId = Long.valueOf(empIdStr);
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).build());
if (CollectionUtils.isEmpty(salaryArchivePOS)){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下,该员工不存在薪资档案!");
return FAILURE_AND_CONTINUE;
} else if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())) {
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下,该员工没有发过薪。需取消停薪后,申请定薪流程!");
return FAILURE_AND_CONTINUE;
}
if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
// 停薪来自待停薪 1取消停薪
getSalaryArchiveWrapper(user).cancelStop(Collections.singletonList(salaryArchivePOS.get(0).getId()));
}
if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()) || salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
// 1如果不在人员范围内则把他加入义务人的人员范围2删除待办
addTaxAgentRangeIfNotExist(taxAgentId, employeeId, user);
getSalaryArchiveWrapper(user).deleteSuspendTodo(Collections.singletonList(salaryArchivePOS.get(0).getId()));
}
// 调薪
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue));
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
.importDatas(importData)
.build();
//操作人
String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(RehireAction.SalaryField::getValue).orElse("1");
Map<String, Object> map = getSalaryArchiveWrapper(new User(Integer.parseInt(uid))).adjustmentSalaryArchive(build);
List errorNotice = (List) map.get("errorNotice");
if (CollectionUtils.isNotEmpty(errorNotice)) {
// 回滚档案状态
getSalaryArchiveMapper().update(salaryArchivePOS.get(0));
log.error("调薪存在异常 requestId:{} map:{}", requestInfo.getRequestid(), map);
List<Map<String, String>> excelComments = (List<Map<String, String>>) map.get("errorNotice");
StringBuilder message = new StringBuilder("");
for (Map<String, String> comments : excelComments) {
message.append(comments.get("message")).append("\n");
}
requestInfo.getRequestManager().setMessage(message.toString());
return FAILURE_AND_CONTINUE;
}
} catch (Exception e) {
log.error("返聘调薪异常", e);
requestInfo.getRequestManager().setMessage(e.getMessage());
return FAILURE_AND_CONTINUE;
}
return SUCCESS;
}
private void addTaxAgentRangeIfNotExist(Long taxAgentId, Long employeeId, User user){
// 获取该义务人下人员范围
Collection<Long> empIds = getTaxAgentService(user).listEmployeeIdsInTaxAgent(taxAgentId);
if (!empIds.contains(employeeId)) {
//将人员添加进个税扣缴义务人中
TaxAgentManageRangeSaveParam.TaxAgentSubAdminRangeTargetParam taxAgentSubAdminRangeTargetParam = new TaxAgentManageRangeSaveParam.TaxAgentSubAdminRangeTargetParam();
taxAgentSubAdminRangeTargetParam.setTargetId(employeeId);
taxAgentSubAdminRangeTargetParam.setTargetType(TargetTypeEnum.EMPLOYEE);
TaxAgentRangeSaveParam taxAgentRangeSaveParam = new TaxAgentRangeSaveParam();
taxAgentRangeSaveParam.setTaxAgentId(taxAgentId);
taxAgentRangeSaveParam.setIncludeType(1);
taxAgentRangeSaveParam.setEmployeeStatus(Arrays.asList("0", "1", "2", "3", "4", "5", "6"));
taxAgentRangeSaveParam.setTargetParams(Collections.singletonList(taxAgentSubAdminRangeTargetParam));
taxAgentRangeSaveParam.setSync(true);
getTaxAgentManageRangeService(user).save(taxAgentRangeSaveParam);
}
}
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;
}
}
}

View File

@ -33,7 +33,7 @@ public class AddUpDeductionBiz extends BaseBean {
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
List<AddUpDeductionDTO> list = mapper.list(param);
list = encryptUtil.decryptList(list, AddUpDeductionDTO.class, user);
return list;
return list;
} finally {
sqlSession.close();
}
@ -49,8 +49,18 @@ public class AddUpDeductionBiz extends BaseBean {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
List<AddUpDeduction> addUpDeductions = mapper.listSome(param);
return encryptUtil.decryptList(addUpDeductions, AddUpDeduction.class, user);
if (CollectionUtils.isNotEmpty(param.getEmployeeIds())) {
List<AddUpDeduction> addUpDeductions = new ArrayList<>();
List<List<Long>> partition = Lists.partition(param.getEmployeeIds(), 500);
partition.forEach(l -> {
param.setEmployeeIds(l);
addUpDeductions.addAll(mapper.listSome(param));
});
return encryptUtil.decryptList(addUpDeductions, AddUpDeduction.class, user);
} else {
List<AddUpDeduction> addUpDeductions = mapper.listSome(param);
return encryptUtil.decryptList(addUpDeductions, AddUpDeduction.class, user);
}
} finally {
sqlSession.close();
}

View File

@ -47,8 +47,18 @@ public class AddUpSituationBiz extends BaseBean {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class);
List<AddUpSituation> addUpSituations = mapper.listSome(param);
if(CollectionUtils.isNotEmpty(param.getEmployeeIds())){
List<AddUpSituation> addUpSituations = new ArrayList<>();
List<List<Long>> partition = Lists.partition((List<Long>) param.getEmployeeIds(), 500);
partition.forEach(l->{
param.setEmployeeIds(l);
addUpSituations.addAll(mapper.listSome(param));
});
return encryptUtil.decryptList(addUpSituations, AddUpSituation.class, user);
}else {
List<AddUpSituation> addUpSituations = mapper.listSome(param);
return encryptUtil.decryptList(addUpSituations, AddUpSituation.class, user);
}
} finally {
sqlSession.close();
}

View File

@ -29,8 +29,18 @@ public class OtherDeductionBiz extends BaseBean {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
OtherDeductionMapper mapper = sqlSession.getMapper(OtherDeductionMapper.class);
List<OtherDeductionPO> otherDeductionPOS = mapper.listSome(param);
return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class, user);
if (CollectionUtils.isNotEmpty(param.getEmployeeIds())) {
List<List<Long>> partition = Lists.partition(param.getEmployeeIds(), 500);
List<OtherDeductionPO> otherDeductionPOS = new ArrayList<>();
partition.forEach(l -> {
param.setEmployeeIds(l);
otherDeductionPOS.addAll(mapper.listSome(param));
});
return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class, user);
}else {
List<OtherDeductionPO> otherDeductionPOS = mapper.listSome(param);
return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class, user);
}
} finally {
sqlSession.close();
}
@ -116,10 +126,6 @@ public class OtherDeductionBiz extends BaseBean {
}
/**
* 处理导入数据
*
@ -184,8 +190,8 @@ public class OtherDeductionBiz extends BaseBean {
/**
* @description 批量删除
* @return void
* @description 批量删除
* @author Harryxzy
* @date 2022/10/27 16:07
*/

View File

@ -20,10 +20,7 @@ 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;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesFundSchemeDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesOtherSchemeDTO;
import com.engine.salary.entity.siarchives.dto.InsuranceArchivesSocialSchemeDTO;
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;
@ -35,10 +32,7 @@ import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.enums.sicategory.*;
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.mapper.siarchives.*;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
@ -61,6 +55,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StopWatch;
import weaver.conn.mybatis.MyBatisFactory;
import weaver.general.Util;
@ -679,8 +674,22 @@ public class SIArchivesBiz extends Service {
otherIds.add(param.getId());
List<InsuranceArchivesOtherSchemePO> oldOtherInfoList = otherSchemeMapper.getOtherById(otherIds);
//设置福利档案基数调整记录数据
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(param.getOtherSchemeId())
.adjustAfterBaseJson(paramReq.getPaymentForm())
.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());
//新数据
InsuranceArchivesOtherSchemePO updateOtherInfo =
InsuranceArchivesOtherSchemePO.builder()
.id(oldOtherInfo.getId())
@ -757,10 +766,13 @@ public class SIArchivesBiz extends Service {
} else {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 544305, "档案不存在!"));
}
}
//生成福利档案基数调整记录数据
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = createAdjustInfo(adjustInfo, employeeId);
//福利档案基数调整记录数据入库
batchInsertAdjustHistory(adjustHistoryList, employeeId);
} finally {
sqlSession.close();
}
@ -788,8 +800,22 @@ public class SIArchivesBiz extends Service {
fundIds.add(param.getId());
List<InsuranceArchivesFundSchemePO> oldFundInfoList = fundSchemeMapper.getFundById(fundIds);
//设置福利档案基数调整记录数据
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(param.getFundSchemeId())
.adjustAfterBaseJson(paramReq.getPaymentForm())
.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());
//新数据
InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder()
.id(oldFundInfo.getId())
.fundSchemeId(param.getFundSchemeId())
@ -872,6 +898,11 @@ public class SIArchivesBiz extends Service {
}
//生成福利档案基数调整记录数据
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = createAdjustInfo(adjustInfo, employeeId);
//福利档案基数调整记录数据入库
batchInsertAdjustHistory(adjustHistoryList, employeeId);
} finally {
sqlSession.close();
}
@ -905,10 +936,25 @@ public class SIArchivesBiz extends Service {
List<Long> socialIds = new ArrayList();
socialIds.add(param.getId());
List<InsuranceArchivesSocialSchemePO> oldSocialInfoList = socialSchemeMapper.getSocialById(socialIds);
//设置福利档案基数调整记录数据
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(param.getSocialSchemeId())
.adjustAfterBaseJson(paramReq.getPaymentForm())
.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());
//新数据
InsuranceArchivesSocialSchemePO updateSocialInfo =
InsuranceArchivesSocialSchemePO.builder()
.id(oldSocialInfo.getId())
@ -991,6 +1037,10 @@ public class SIArchivesBiz extends Service {
}
//生成福利档案基数调整记录数据
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = createAdjustInfo(adjustInfo, employeeId);
//福利档案基数调整记录数据入库
batchInsertAdjustHistory(adjustHistoryList, employeeId);
} finally {
sqlSession.close();
}
@ -1752,15 +1802,6 @@ public class SIArchivesBiz extends Service {
}
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
encryptList.forEach(item -> {
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
});
return encryptList;
}
/**
* 判断是否需要生成历史福利档案基本信息
*/
@ -1869,4 +1910,233 @@ public class SIArchivesBiz extends Service {
}
return getInsuranceBaseInfoMapper().listEndDateIsNull(employeeIds);
}
public List<InsuranceArchivesBaseHistoryPO> dealSocialBaseAdjustInfoList(List<InsuranceArchivesSocialSchemePO> adjustList, Long creator) {
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = new ArrayList<>();
if (adjustList.size() > 0) {
//遍历待更新的福利档案数据对每组档案生成基数调整记录基数单元未变化则忽略
for (InsuranceArchivesSocialSchemePO po : adjustList) {
List<InsuranceArchivesSocialSchemePO> oldBaseInfoList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build());
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getSocialSchemeId())
.adjustAfterBaseJson(po.getSocialPaymentBaseString())
.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.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!"));
}
adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator));
}
}
return adjustHistoryList;
}
public List<InsuranceArchivesBaseHistoryPO> dealFundBaseAdjustInfoList(List<InsuranceArchivesFundSchemePO> adjustList, Long creator) {
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = new ArrayList<>();
if (adjustList.size() > 0) {
//遍历待更新的福利档案数据对每组档案生成基数调整记录基数单元未变化则忽略
for (InsuranceArchivesFundSchemePO po : adjustList) {
List<InsuranceArchivesFundSchemePO> oldBaseInfoList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build());
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getFundSchemeId())
.adjustAfterBaseJson(po.getFundPaymentBaseString())
.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.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!"));
}
adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator));
}
}
return adjustHistoryList;
}
public List<InsuranceArchivesBaseHistoryPO> dealOtherBaseAdjustInfoList(List<InsuranceArchivesOtherSchemePO> adjustList, Long creator) {
List<InsuranceArchivesBaseHistoryPO> adjustHistoryList = new ArrayList<>();
if (adjustList.size() > 0) {
//遍历待更新的福利档案数据对每组档案生成基数调整记录基数单元未变化则忽略
for (InsuranceArchivesOtherSchemePO po : adjustList) {
List<InsuranceArchivesOtherSchemePO> oldBaseInfoList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.paymentOrganization(po.getPaymentOrganization()).employeeId(po.getEmployeeId()).build());
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getOtherSchemeId())
.adjustAfterBaseJson(po.getOtherPaymentBaseString())
.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.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利档案存在冗余数据!"));
}
adjustHistoryList.addAll(createAdjustInfo(adjustInfo, creator));
}
}
return adjustHistoryList;
}
//生成基数调整记录基数单元未变化则忽略
public List<InsuranceArchivesBaseHistoryPO> createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) {
Date now = new Date();
List<InsuranceArchivesBaseHistoryPO> toCreateAdjustHistoryList = new ArrayList<>();
//旧档案不存在基数信息则直接遍历新的基数数据生成调整记录旧档案存在基数信息则合并新旧基数数据遍历合并后的技术数据中的key生成调整记录
if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) {
Map<String, Object> adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference<Map<String, Object>>() {
});
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());
toCreateAdjustHistoryList.add(adjustItem);
}
} else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) {
Map<String, Object> adjustAfterBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterBaseJson(), new TypeReference<Map<String, Object>>() {
});
Map<String, Object> adjustBeforeBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeBaseJson(), new TypeReference<Map<String, Object>>() {
});
Map<String, Object> 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());
toCreateAdjustHistoryList.add(adjustItem);
}
}
}
return toCreateAdjustHistoryList;
}
/**
* 新增福利档案基数调整记录
*
*/
public void batchInsertAdjustHistory(List<InsuranceArchivesBaseHistoryPO> adjustHistoryList, long employeeId) {
if (CollectionUtils.isEmpty(adjustHistoryList)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceBaseAdjustHistoryMapper mapper = sqlSession.getMapper(InsuranceBaseAdjustHistoryMapper.class);
List<List<InsuranceArchivesBaseHistoryPO>> partition = Lists.partition(adjustHistoryList, 100);
partition.forEach(mapper::batchSave);
sqlSession.commit();
} finally {
sqlSession.close();
}
}
/**
* 获取福利档案基数调整记录
*
*/
public List<InsuranceArchivesBaseHistoryDTO> 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<InsuranceArchivesBaseHistoryDTO> list = mapper.listByEmployeeIdAndPayOrg(paymentOrganization, employeeId);
return list;
} finally {
sqlSession.close();
}
}
/**
* 获取福利档案基数调整记录
*
*/
public List<InsuranceArchivesBaseHistoryDTO> getBaseHistoryByEmployeeIdAndOperator(Long operator, Long employeeId) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
InsuranceBaseAdjustHistoryMapper mapper = sqlSession.getMapper(InsuranceBaseAdjustHistoryMapper.class);
List<InsuranceArchivesBaseHistoryDTO> empList = mapper.listByEmployeeIdAndOperator(operator, employeeId);
List<InsuranceArchivesBaseHistoryDTO> extEmpList = mapper.listByExtEmpIdAndOperator(operator, employeeId);
if (extEmpList != null) {
empList.addAll(extEmpList);
empList = empList.stream().filter(f -> StringUtils.isNotBlank(f.getEmployeeName()))
.sorted(Comparator.comparing(InsuranceArchivesBaseHistoryDTO::getOperateTime).reversed()).collect(Collectors.toList());
}
return empList;
} finally {
sqlSession.close();
}
}
public List<WeaTableColumn> buildAdjustHistoryColumns(long operateId) {
List<WeaTableColumn> list = new ArrayList<>();
WeaTableColumn nameColumn = new WeaTableColumn("100px", "福利项名称", "welfareItemName");
nameColumn.setFixed("left");
list.add(nameColumn);
list.add(new WeaTableColumn("150px", "调整前方案", "adjustBeforeSchemeName"));
list.add(new WeaTableColumn("150px", "调整前基数", "adjustBeforeBaseValue"));
list.add(new WeaTableColumn("150px", "调整后方案", "adjustAfterSchemeName"));
list.add(new WeaTableColumn("150px", "调整后基数", "adjustAfterBaseValue"));
list.add(new WeaTableColumn("150px", "操作人", "operatorName"));
list.add(new WeaTableColumn("150px", "操作时间", "operatorTime"));
return list;
}
}

View File

@ -3,7 +3,6 @@ package com.engine.salary.biz;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.core.impl.Service;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.sischeme.bo.InsuranceSchemeBO;
@ -425,7 +424,7 @@ public class SISchemeBiz extends Service {
insuranceSchemeMapper.insert(batchPO);
List<InsuranceSchemeDetailPO> detailList = insuranceSchemeDetailMapper.queryListBySchemeId(id);
detailList = decryptSchemeDetailList(detailList);
detailList = encryptUtil.decryptList(detailList,InsuranceSchemeDetailPO.class);
if (CollectionUtils.isNotEmpty(detailList)) {
List<InsuranceSchemeDetailPO> detailPOS = detailList.stream().map(item -> InsuranceSchemeDetailPO.builder()
.creator(employeeId)
@ -477,16 +476,6 @@ public class SISchemeBiz extends Service {
}
private List<InsuranceSchemeDetailPO> decryptSchemeDetailList(List<InsuranceSchemeDetailPO> encryptList) {
encryptList.forEach(item -> {
item.setUpperLimit(AESEncryptUtil.decrypt(item.getUpperLimit()));
item.setFixedCost(AESEncryptUtil.decrypt(item.getFixedCost()));
item.setLowerLimit(AESEncryptUtil.decrypt(item.getLowerLimit()));
});
return encryptList;
}
public int checkBeforeDeleteSocialscheme(Map<String, Object> params) {
return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection<Long>) params.get("ids")).get(0).getNum();
}

View File

@ -36,8 +36,18 @@ public class SalaryArchiveItemBiz extends Service {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalaryArchiveItemMapper mapper = sqlSession.getMapper(SalaryArchiveItemMapper.class);
List<SalaryArchiveItemPO> salaryArchiveItemPOS = mapper.listByParam(build);
return encryptUtil.decryptList(salaryArchiveItemPOS, SalaryArchiveItemPO.class, user);
if (CollectionUtils.isNotEmpty(build.getEmployeeIds())) {
List<SalaryArchiveItemPO> salaryArchiveItemPOS = new ArrayList<>();
List<List<Long>> partition = Lists.partition((List<Long>) build.getEmployeeIds(), 500);
partition.forEach(l -> {
build.setEmployeeIds(l);
salaryArchiveItemPOS.addAll(mapper.listByParam(build));
});
return encryptUtil.decryptList(salaryArchiveItemPOS, SalaryArchiveItemPO.class, user);
} else {
List<SalaryArchiveItemPO> salaryArchiveItemPOS = mapper.listByParam(build);
return encryptUtil.decryptList(salaryArchiveItemPOS, SalaryArchiveItemPO.class, user);
}
} finally {
sqlSession.close();
}
@ -142,7 +152,20 @@ public class SalaryArchiveItemBiz extends Service {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalaryArchiveItemMapper mapper = sqlSession.getMapper(SalaryArchiveItemMapper.class);
return encryptUtil.decryptList(mapper.salaryItemAdjustRecordList(queryParam, salaryItemIds), SalaryItemAdjustRecordListDTO.class, user);
List<Long> salaryArchiveIds = queryParam.getSalaryArchiveIds();
if (CollectionUtils.isEmpty(salaryArchiveIds)) {
List<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordListDTOS = mapper.salaryItemAdjustRecordList(queryParam, salaryItemIds);
return encryptUtil.decryptList(salaryItemAdjustRecordListDTOS, SalaryItemAdjustRecordListDTO.class, user);
} else {
List<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordListDTOS = new ArrayList<>();
List<List<Long>> salaryArchiveIdsPartition = Lists.partition(salaryArchiveIds, 500);
salaryArchiveIdsPartition.forEach(l -> {
queryParam.setSalaryArchiveIds(l);
salaryItemAdjustRecordListDTOS.addAll(mapper.salaryItemAdjustRecordList(queryParam, salaryItemIds));
});
return encryptUtil.decryptList(salaryItemAdjustRecordListDTOS, SalaryItemAdjustRecordListDTO.class, user);
}
} finally {
sqlSession.close();
}
@ -163,12 +186,28 @@ public class SalaryArchiveItemBiz extends Service {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalaryArchiveItemMapper mapper = sqlSession.getMapper(SalaryArchiveItemMapper.class);
List<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordListDTOS = mapper.salaryItemAdjustRecordList(queryParam, salaryItemIds);
PageInfo<SalaryItemAdjustRecordListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
salaryItemAdjustRecordListDTOS,
SalaryItemAdjustRecordListDTO.class, user);
encryptUtil.decryptList(page.getList(), SalaryItemAdjustRecordListDTO.class, user);
return page;
List<Long> salaryArchiveIds = queryParam.getSalaryArchiveIds();
if (CollectionUtils.isEmpty(salaryArchiveIds)) {
List<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordListDTOS = mapper.salaryItemAdjustRecordList(queryParam, salaryItemIds);
PageInfo<SalaryItemAdjustRecordListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
salaryItemAdjustRecordListDTOS,
SalaryItemAdjustRecordListDTO.class, user);
encryptUtil.decryptList(page.getList(), SalaryItemAdjustRecordListDTO.class, user);
return page;
} else {
List<SalaryItemAdjustRecordListDTO> salaryItemAdjustRecordListDTOS = new ArrayList<>();
List<List<Long>> salaryArchiveIdsPartition = Lists.partition(salaryArchiveIds, 500);
salaryArchiveIdsPartition.forEach(l -> {
queryParam.setSalaryArchiveIds(l);
salaryItemAdjustRecordListDTOS.addAll(mapper.salaryItemAdjustRecordList(queryParam, salaryItemIds));
});
PageInfo<SalaryItemAdjustRecordListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
salaryItemAdjustRecordListDTOS,
SalaryItemAdjustRecordListDTO.class, user);
encryptUtil.decryptList(page.getList(), SalaryItemAdjustRecordListDTO.class, user);
return page;
}
} finally {
sqlSession.close();
}

View File

@ -3,7 +3,6 @@ package com.engine.salary.encrypt;
import com.engine.salary.sys.constant.SalarySysConstant;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.enums.OpenEnum;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import org.apache.commons.lang3.StringUtils;
import weaver.general.AES;
import weaver.general.BaseBean;
@ -20,7 +19,6 @@ public class AESEncryptUtil {
static BaseBean bb = new BaseBean();
static String aesEncryptScrect = bb.getPropValue("hrmSalary", "AESEncryptScrect");
static SalarySysConfServiceImpl salarySysConfService = new SalarySysConfServiceImpl();
/**
* AES加密
@ -61,8 +59,7 @@ public class AESEncryptUtil {
* @param encryptStr 加密字符串
* @return 解密字符串
*/
public static String closeEncryptSetting(String encryptStr) {
SalarySysConfPO sysConfPo = salarySysConfService.getOneByCode(SalarySysConstant.OPEN_APPLICATION_ENCRYPT);
public static String closeEncryptSetting(String encryptStr,SalarySysConfPO sysConfPo) {
if (encryptStr == null) {
return null;
} else {

View File

@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
* 数据采集-累计专项附加扣除表
@ -113,7 +114,7 @@ public class AddUpDeduction {
*/
private String tenantKey;
Collection<Long> employeeIds;
List<Long> employeeIds;
Collection<Long> taxAgentIds;

View File

@ -6,6 +6,8 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* 员工基本信息
* <p>Copyright: Copyright (c) 2022</p>
@ -70,6 +72,8 @@ public class DataCollectionEmployee {
@SalaryFormulaVar(defaultLabel = "状态编码", labelId = 544644, dataType = "string")
private String status;
@SalaryFormulaVar(defaultLabel = "状态", labelId = 98622, dataType = "string")
private String statusName;
//工号
@ -99,6 +103,7 @@ public class DataCollectionEmployee {
private Double workYear;
private Double companyWorkYear;
@SalaryFormulaVar(defaultLabel = "证件号码", labelId = 98624, dataType = "string")
private String idNo;
//是否是系统管理员
@ -107,5 +112,10 @@ public class DataCollectionEmployee {
//是否外部人员
private boolean extEmp;
/**
* 扩展数据
*/
private Map<String,String> extendData;
}

View File

@ -0,0 +1,53 @@
package com.engine.salary.entity.hrm.dto;
import com.engine.salary.util.valid.Modify;
import com.engine.salary.util.valid.ModifyTypeEnum;
import com.engine.salary.util.valid.ValueTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 人员扩展参数
* <p>Copyright: Copyright (c) 2023</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmployeeInfoExpandDTO {
private Long id;
/**
* 功能模块
*/
private String module;
/**
* 模块信息
*/
private String moduleInfo;
/**
* 主键
*/
private String pk;
/**
* sql
*/
@Modify(modifyType = ModifyTypeEnum.RESTORE_SQL)
private String expandSql;
/**
* 字段设置
*/
@Modify(valueType = ValueTypeEnum.ARRAY)
private List<FieldSetting> fieldSettings;
}

View File

@ -0,0 +1,35 @@
package com.engine.salary.entity.hrm.dto;
import com.engine.salary.util.valid.Modify;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FieldSetting {
/**
* 字段
*/
@Modify()
private String field;
/**
* 显示
*/
private String name;
/**
*
*/
private String value;
/**
* 排序
*/
private Integer index;
}

View File

@ -0,0 +1,74 @@
package com.engine.salary.entity.hrm.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
/**
* 人员维度扩展表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExpandFieldSettingsPO {
private Long id;
/**
* 功能模块
*/
private String module;
/**
* 模块信息
*/
private String moduleInfo;
/**
* 主键
*/
private String pk;
/**
* sql
*/
private String expandSql;
/**
* 字段设置
*/
private String fieldSetting;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Long creator;
/**
* 是否已删除0未删除1已删除
*/
private Integer deleteType;
/**
* 租户ID
*/
private String tenantKey;
//主键id集合
private Collection<Long> ids;
}

View File

@ -10,10 +10,7 @@ import com.engine.salary.constant.SalaryArchiveConstant;
import com.engine.salary.constant.SalaryBillConstant;
import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryBill.dto.SalaryBillSendDTO;
import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO;
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemListDTO;
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
import com.engine.salary.entity.salaryBill.dto.*;
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO;
import com.engine.salary.enums.salarybill.MessageChannelEnum;
@ -27,6 +24,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.commons.lang3.math.NumberUtils;
import org.apache.pdfbox.multipdf.PDFMergerUtility;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
@ -43,6 +41,7 @@ import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
@ -130,21 +129,21 @@ public class SalaryBillBO {
if (employeeInformation == null || simpleEmployee == null) {
return;
}
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(employeeInformation.getItems())) {
if (CollectionUtils.isNotEmpty(employeeInformation.getItems())) {
//获取员工信息的字段名和中文描述的map关系
SalaryFormulaEmployeeDTO salaryFormulaEmployeeDTO = SalaryFormulaEmployeeDTO.builder().employeeId(simpleEmployee.getEmployeeId())
SalaryFormulaEmployeeDTO salaryFormulaEmployeeDTO = SalaryFormulaEmployeeDTO.builder()
.employeeId(simpleEmployee.getEmployeeId())
.taxAgentName(salaryBillSendParam.getTaxAgentName())
.departmentName(simpleEmployee.getDepartmentName())
.email(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail())
// .gradeName(simpleEmployee.getGrade() == null ? "" : simpleEmployee.getGrade().getName())
// .hireDate(SalaryDateUtil.getFormatLocalDate(simpleEmployee.getHiredate()))
// .sex(simpleEmployee.getSex() == null ? "" : simpleEmployee.getSex().getDescription())
.mobile(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile())
.jobtitleName(simpleEmployee.getJobtitleName())
// .status(StringUtils.isEmpty(simpleEmployee.getPersonnelStatus()) ? "" : simpleEmployee.getPersonnelStatus())
.telephone(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
.username(org.apache.commons.lang3.StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
.email(StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail())
.sex(simpleEmployee.getSex() == null ? "" : simpleEmployee.getSex())
.mobile(StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile()).jobtitleName(simpleEmployee.getJobtitleName())
.status(StringUtils.isEmpty(simpleEmployee.getStatus()) ? "" : simpleEmployee.getStatus())
.telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
.username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
.workcode(simpleEmployee.getWorkcode())
.idNo(simpleEmployee.getIdNo())
.statusName(simpleEmployee.getStatusName())
.build();
List<SalaryTemplateSalaryItemListDTO> items = employeeInformation.getItems();
// 1.SalaryAcctResultBO.buildEmployeeFieldName()的取法
@ -153,7 +152,7 @@ public class SalaryBillBO {
// Optional<Map.Entry<String, String>> entry = entries.stream().filter(f -> Objects.equals(e.getName(), f.getValue())).findFirst();
// if (entry.isPresent()) {
// String key = entry.get().getKey();
// if (org.apache.commons.lang3.StringUtils.isNotBlank(key)) {
// if (StringUtils.isNotBlank(key)) {
// String getter = "get" + key.substring(0, 1).toUpperCase() + key.substring(1);
// try {
// Method method = salaryFormulaEmployeeDTO.getClass().getMethod(getter);
@ -204,9 +203,7 @@ public class SalaryBillBO {
}
}
return theme
.replace("${companyName}", companyName)
.replace("${salaryMonth}", new SimpleDateFormat("yyyy年MM月").format(salaryMonth));
return theme.replace("${companyName}", companyName).replace("${salaryMonth}", new SimpleDateFormat("yyyy年MM月").format(salaryMonth));
}
// /**
@ -290,7 +287,7 @@ public class SalaryBillBO {
File touch = FileUtil.touch(htmlPath);
FileUtil.appendUtf8String(content, touch);
String pdfPath = HrmSalaryPayrollConf.GEN_PATH + yyyyMM + File.separator+ sendId + File.separator + id + ".pdf";
String pdfPath = HrmSalaryPayrollConf.GEN_PATH + yyyyMM + File.separator + sendId + File.separator + id + ".pdf";
FileUtil.del(pdfPath);
HtmlToPdf.convert(HrmSalaryPayrollConf.TO_PDF_TOOL_PATH, htmlPath, pdfPath);
}
@ -363,14 +360,39 @@ public class SalaryBillBO {
return data;
}
public static void sendSMS(SalaryBillSendDTO salaryBillSendParam, Long id, Long employeeId) {
public static void sendSMS(Map<String, Object> e, SalaryBillSendDTO salaryBillSendParam) {
// try {
// MessageUtil.sendSMS(mobile, content);
// } catch (Exception e) {
// kqLog.info("SendSMS error.resourceId:" + resourceId + ">>>>>>mobile>>>>>>" + mobile);
// log.writeLog(e);
// }
SalaryTemplateSMSSetDTO smsSetting = salaryBillSendParam.getSmsSetting();
String content = smsSetting != null ? smsSetting.getContent() : "";
if (StringUtils.isBlank(content)) {
return;
}
content = content.replace("{薪资所属月}", SalaryDateUtil.getFormatYearMonth(salaryBillSendParam.getSalaryDate()));
for (SalaryTemplateSalaryItemListDTO item : salaryBillSendParam.getEmployeeInformation().getItems()) {
content = content.replace("{" + item.getName() + "}", item.getSalaryItemValue());
}
for (SalaryTemplateSalaryItemSetListDTO salaryTemplateSalaryItemSetListDTO : salaryBillSendParam.getSalaryItemSetList()) {
for (SalaryTemplateSalaryItemListDTO item : salaryTemplateSalaryItemSetListDTO.getItems()) {
if (content.contains("{" + item.getName() + "}")) {
content = content.replace("{" + item.getName() + "}", e.getOrDefault(item.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX, "").toString());
}
}
}
try {
log.info("发送短信内容, {}", content);
if (e.get("mobile") != null) {
MessageUtil.sendSMS(e.get("mobile").toString(), content);
} else {
log.error("发送短信失败,{}手机号为空", e.getOrDefault("username", ""));
}
} catch (Exception ex) {
log.error("发送短信失败", ex);
}
}
// /**
@ -562,9 +584,7 @@ public class SalaryBillBO {
InputStream imageInputStream = ImageFileManager.getInputStreamById(imagefileid);
byte[] data = readInputStream(imageInputStream);
String imageBase64 = "data:image/jpeg;base64," + Base64Utils.encodeToString(data);
emailContent.append("<div style='width: 100%;margin-top: 16px;text-align: right;line-height: 1.5715;font-family: PingFangSC-Regular;font-size: 12px;color: #111111;'>\n" +
" <img style='width: 140px;height: 70px;' src='" + imageBase64 + "'>" +
" </div>");
emailContent.append("<div style='width: 100%;margin-top: 16px;text-align: right;line-height: 1.5715;font-family: PingFangSC-Regular;font-size: 12px;color: #111111;'>\n" + " <img style='width: 140px;height: 70px;' src='" + imageBase64 + "'>" + " </div>");
}
}
emailContent.append("</div>");
@ -622,15 +642,20 @@ public class SalaryBillBO {
} else {
for (Object keyName : e.keySet()) {
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
boolean isHide = (isHideNull && e.get(keyName.toString()) != null) || (isHideZero && "0.00".equals(e.get(keyName.toString())));
// 4.2.薪资项目
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
emailContent.append(salaryItem.getName());
emailContent.append("</th>");
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);
if (!isHide) {
// 4.2.薪资项目
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
emailContent.append(salaryItem.getName());
emailContent.append("</th>");
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
emailContent.append(e.get(keyName.toString()));
emailContent.append("</td>");
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
emailContent.append(e.get(keyName.toString()));
emailContent.append("</td>");
}
break;
}
}
@ -697,15 +722,20 @@ public class SalaryBillBO {
SalaryTemplateSalaryItemListDTO salaryItem = itemPartition.get(i);
for (Object keyName : e.keySet()) {
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
boolean isHide = (isHideNull && e.get(keyName.toString()) != null) || (isHideZero && "0.00".equals(e.get(keyName.toString())));
// 4.2.薪资项目
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
emailContent.append(salaryItem.getName());
emailContent.append("</th>");
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);
if (!isHide) {
// 4.2.薪资项目
emailContent.append("<th style=\"background-color:#fafafa;padding:16px 24px;color:#000000d9;font-weight:400;font-size:12px;line-height:1.5715;text-align:start;border:1px solid rgba(0,0,0,.06);min-width:100px;max-width:100px\">");
emailContent.append(salaryItem.getName());
emailContent.append("</th>");
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
emailContent.append(e.get(keyName.toString()));
emailContent.append("</td>");
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
emailContent.append(e.get(keyName.toString()));
emailContent.append("</td>");
}
break;
}
}

View File

@ -64,6 +64,9 @@ public class SalaryBillSendDTO {
//工资单模板-薪资项目设置
private List<SalaryTemplateSalaryItemSetListDTO> salaryItemSetList;
//短信模板
private SalaryTemplateSMSSetDTO smsSetting;
//工资单模板-员工基本信息
private SalaryTemplateSalaryItemSetListDTO employeeInformation;
@ -74,7 +77,7 @@ public class SalaryBillSendDTO {
private String remarkI18n;
//邮件是否可以发送邮件
private boolean isEnableEmail;
// private boolean isEnableEmail;
//工资单发放
private SalarySendPO salarySend;

View File

@ -55,6 +55,16 @@ public class SalaryTemplateBaseSetDTO {
//消息中心")
private Boolean msgStatus;
/**
* 短信开启状态01默认关闭
*/
private Integer smsStatus;
/**
* 短信模板设置
*/
private String smsSetting;
// 是否启用工资单定时发送
private Boolean autoSendStatus;

View File

@ -0,0 +1,23 @@
package com.engine.salary.entity.salaryBill.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryTemplateSMSDTO {
//展示名称
private String itemName;
//薪资项目
private String itemKey;
//来源
private String source;
}

View File

@ -0,0 +1,26 @@
package com.engine.salary.entity.salaryBill.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 短信模板设置
* <p>Copyright: Copyright (c) 2023</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryTemplateSMSSetDTO {
/**
* 内容
*/
private String content;
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.salaryBill.param;
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSMSSetDTO;
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
import com.engine.salary.enums.salarybill.SalaryTemplateTextContentPositionEnum;
import com.engine.salary.exception.SalaryRunTimeException;
@ -46,6 +47,9 @@ public class SalaryTemplateSaveParam {
// 消息中心开启状态falsetrue
private Boolean msgStatus;
// 短信开关 falsetrue
private Boolean smsStatus;
// 主题
private String theme;
@ -79,6 +83,9 @@ public class SalaryTemplateSaveParam {
// 薪资项目设置
private List<SalaryTemplateSalaryItemSetListDTO> salaryItemSetting;
//短信模板
private SalaryTemplateSMSSetDTO smsSetting;
// 补发工资单模板名称
private String replenishName;
@ -101,7 +108,6 @@ public class SalaryTemplateSaveParam {
/**
* 反馈流程地址
*
*/
private String feedbackUrl;
@ -154,11 +160,11 @@ public class SalaryTemplateSaveParam {
}
if (saveParam.getAutoSendStatus() == Boolean.TRUE) {
if(StringUtils.isBlank(saveParam.getAutoSendDayOfMonth()))
if (StringUtils.isBlank(saveParam.getAutoSendDayOfMonth()))
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544201, "自动发放日期不能为空"));
if(Objects.isNull(saveParam.getAutoSendCycleType()))
if (Objects.isNull(saveParam.getAutoSendCycleType()))
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544202, "自动发放周期不能为空"));
if(StringUtils.isBlank(saveParam.getAutoSendTimeOfDay()))
if (StringUtils.isBlank(saveParam.getAutoSendTimeOfDay()))
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544203, "自动发放时间不能为空"));
}
}

View File

@ -68,6 +68,11 @@ public class SalaryTemplatePO {
*/
private Integer smsStatus;
/**
* 短信模板设置
*/
private String smsSetting;
/**
* 薪酬水印
*/

View File

@ -98,8 +98,10 @@ public class ExpressFormulaBO {
// 公式变量的值
String formulaVarValue = formulaVarValueMap.getOrDefault(formulaVar.getFieldId(), StringUtils.EMPTY);
// 如果公式的返回值类型为number公式中的变量的值如果为空公式运行的时候会报错所以需要替换成0
if (StringUtils.isEmpty(formulaVarValue) && "number".equals(expressFormula.getReturnType())) {
if (StringUtils.isEmpty(formulaVarValue) && "number".equals(formulaVar.getFieldType())) {
formulaVarValue = BigDecimal.ZERO.toPlainString();
} else if (StringUtils.isEmpty(formulaVarValue) && "string".equals(formulaVar.getFieldType())) {
formulaVarValue = "";
}
formulaVar.setContent(formulaVarValue);
}

View File

@ -117,6 +117,7 @@ public class SalaryAcctFormulaBO {
.companystartdate(simpleEmployee.getCompanystartdate())
.birthday(simpleEmployee.getBirthday())
.workcode(simpleEmployee.getWorkcode())
.idNo(simpleEmployee.getIdNo())
.build();
return JsonUtil.parseMap(JsonUtil.toJsonString(formulaEmployee), String.class);
}

View File

@ -47,6 +47,9 @@ public class SalaryAcctImportFieldDTO {
//薪资项目名称
private String salaryItemName;
//薪资项目类型
private String dataType;
}
@Data

View File

@ -30,6 +30,7 @@ public class SalaryItemAdjustRecordQueryParam extends BaseQueryParam {
//薪资档案id
private Long salaryArchiveId;
private List<Long> salaryArchiveIds;
//关键字姓名部门薪资项目名称
private String keyword;

View File

@ -114,6 +114,7 @@ public class SalaryArchivePO {
//---------条件-------
private Collection<Long> ids;
private Collection<Long> taxAgentIds;
private Collection<Long> employeeIds;
/**
* 状态

View File

@ -60,7 +60,7 @@ public class SalaryFormulaEmployeeDTO {
private String dissmissdate;
//状态
@SalaryFormulaVar(defaultLabel = "状态", labelId = 98621, dataType = "string")
@SalaryFormulaVar(defaultLabel = "状态编码", labelId = 98621, dataType = "string")
private String status;
@SalaryFormulaVar(defaultLabel = "状态", labelId = 98622, dataType = "string")
@ -75,8 +75,8 @@ public class SalaryFormulaEmployeeDTO {
private String sex;
// @SalaryFormulaVar(defaultLabel = "证件号码", labelId = 1839, dataType = "string")
// private String idNo;
@SalaryFormulaVar(defaultLabel = "证件号码", labelId = 1839, dataType = "string")
private String idNo;
//邮件
@SalaryFormulaVar(defaultLabel = "邮件", labelId = 71, dataType = "string")

View File

@ -2,6 +2,8 @@ package com.engine.salary.entity.salaryformula.param;
import com.engine.salary.entity.salaryformula.po.FormulaVar;
import com.engine.salary.util.valid.DataCheck;
import com.engine.salary.util.valid.Modify;
import com.engine.salary.util.valid.ModifyTypeEnum;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -61,6 +63,7 @@ public class SalaryFormulaSaveParam {
* 公式内容
*/
@DataCheck(require = true,message = "公式内容为空")
@Modify(modifyType = ModifyTypeEnum.RESTORE_SQL)
private String formula;

View File

@ -245,7 +245,10 @@ public class InsuranceComparisonResultBO {
map.put(welfare.getId() + baseTypeInfo + welfareStand, temp);
// 薪资项目字段的字段类型
map.put(welfare.getId() + baseTypeInfo + welfareStand + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !temp.get("acctResultValue").equals(temp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !temp.get("acctResultValue").equals(temp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(temp.get("acctResultValue").toString()).compareTo(SalaryEntityUtil.empty2Zero(temp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
}
@ -260,7 +263,11 @@ public class InsuranceComparisonResultBO {
socialPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialPerSum()));
map.put("socialPerSum", socialPerSumTemp);
map.put("socialPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialPerSumTemp.get("acctResultValue").equals(socialPerSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !socialPerSumTemp.get("acctResultValue").equals(socialPerSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(socialPerSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(socialPerSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -269,7 +276,11 @@ public class InsuranceComparisonResultBO {
fundPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundPerSum()));
map.put("fundPerSum", fundPerSumTemp);
map.put("fundPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundPerSumTemp.get("acctResultValue").equals(fundPerSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !fundPerSumTemp.get("acctResultValue").equals(fundPerSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(fundPerSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(fundPerSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -278,7 +289,11 @@ public class InsuranceComparisonResultBO {
otherPerSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherPerSum()));
map.put("otherPerSum", otherPerSumTemp);
map.put("otherPerSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherPerSumTemp.get("acctResultValue").equals(otherPerSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !otherPerSumTemp.get("acctResultValue").equals(otherPerSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(otherPerSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(otherPerSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -287,7 +302,11 @@ public class InsuranceComparisonResultBO {
perSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getPerSum()));
map.put("perSum", perSumTemp);
map.put("perSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !perSumTemp.get("acctResultValue").equals(perSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !perSumTemp.get("acctResultValue").equals(perSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(perSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(perSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -297,7 +316,11 @@ public class InsuranceComparisonResultBO {
socialComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialComSum()));
map.put("socialComSum", socialComSumTemp);
map.put("socialComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialComSumTemp.get("acctResultValue").equals(socialComSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !socialComSumTemp.get("acctResultValue").equals(socialComSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(socialComSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(socialComSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -306,7 +329,11 @@ public class InsuranceComparisonResultBO {
fundComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundComSum()));
map.put("fundComSum", fundComSumTemp);
map.put("fundComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundComSumTemp.get("acctResultValue").equals(fundComSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !fundComSumTemp.get("acctResultValue").equals(fundComSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(fundComSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(fundComSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -315,7 +342,11 @@ public class InsuranceComparisonResultBO {
otherComSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherComSum()));
map.put("otherComSum", otherComSumTemp);
map.put("otherComSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherComSumTemp.get("acctResultValue").equals(otherComSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !otherComSumTemp.get("acctResultValue").equals(otherComSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(otherComSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(otherComSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -324,7 +355,11 @@ public class InsuranceComparisonResultBO {
perComTemp.put("excelResultValue", dealNull(excelAccountExportPO.getComSum()));
map.put("comSum", perComTemp);
map.put("comSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !perComTemp.get("acctResultValue").equals(perComTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !perComTemp.get("acctResultValue").equals(perComTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(perComTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(perComTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -334,7 +369,11 @@ public class InsuranceComparisonResultBO {
socialSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getSocialSum()));
map.put("socialSum", socialSumTemp);
map.put("socialSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !socialSumTemp.get("acctResultValue").equals(socialSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !socialSumTemp.get("acctResultValue").equals(socialSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(socialSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(socialSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -343,7 +382,11 @@ public class InsuranceComparisonResultBO {
fundSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getFundSum()));
map.put("fundSum", fundSumTemp);
map.put("fundSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !fundSumTemp.get("acctResultValue").equals(fundSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !fundSumTemp.get("acctResultValue").equals(fundSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(fundSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(fundSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -352,7 +395,11 @@ public class InsuranceComparisonResultBO {
otherSumTemp.put("excelResultValue", dealNull(excelAccountExportPO.getOtherSum()));
map.put("otherSum", otherSumTemp);
map.put("otherSum" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !otherSumTemp.get("acctResultValue").equals(otherSumTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !otherSumTemp.get("acctResultValue").equals(otherSumTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(otherSumTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(otherSumTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}
@ -361,7 +408,11 @@ public class InsuranceComparisonResultBO {
totalTemp.put("excelResultValue", dealNull(excelAccountExportPO.getTotal()));
map.put("total", totalTemp);
map.put("total" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
if (map.get("different").equals("false") && !totalTemp.get("acctResultValue").equals(totalTemp.get("excelResultValue"))) {
// if (map.get("different").equals("false") && !totalTemp.get("acctResultValue").equals(totalTemp.get("excelResultValue"))) {
// map.put("different", "true");
// }
if (map.get("different").equals("false") && SalaryEntityUtil.empty2Zero(totalTemp.get("acctResultValue").toString())
.compareTo(SalaryEntityUtil.empty2Zero(totalTemp.get("excelResultValue").toString())) != 0) {
map.put("different", "true");
}

View File

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.Collection;
import java.util.List;
@Getter
@ -21,7 +21,7 @@ public class InsuranceAcctDetailImportTemplateParam {
* 薪资项目id薪资项目包含了福利项
*/
@DataCheck(require = true,message = "福利核算项目name不能为空")
private Collection<String> welfareNames;
private List<String> welfareNames;
private String billMonth;

View File

@ -0,0 +1,91 @@
package com.engine.salary.entity.siarchives.dto;
import com.engine.salary.annotation.TableTitle;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author: sy
* @Description:
* @Date: 2023/10/16
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceArchivesBaseHistoryDTO {
private Long id;
/**
* 人员id
*/
private Long employeeId;
/**
*个税扣缴义务人id
*/
private Long paymentOrganization;
/**
* 福利类型
*/
private Integer welfareType;
/**
* 调整前方案id
*/
private Long adjustBeforeSchemeId;
/**
* 调整后方案id
*/
private Long adjustAfterSchemeId;
/**
* 调整的福利项id
*/
private Long adjustWelfareItemId;
/**
* 操作人
*/
private Long operator;
private String tenantKey;
private Long creator;
private Integer deleteType;
private Date createTime;
private Date updateTime;
private String adjustBeforeBaseJson;
private String adjustAfterBaseJson;
@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 = "adjustBeforeSchemeName", key = "adjustBeforeSchemeName")
private String adjustBeforeSchemeName;
@TableTitle(title = "调整前基数", dataIndex = "adjustBeforeBaseValue", key = "adjustBeforeBaseValue")
private String adjustBeforeBaseValue;
@TableTitle(title = "调整后方案", dataIndex = "adjustAfterSchemeName", key = "adjustAfterSchemeName")
private String adjustAfterSchemeName;
@TableTitle(title = "调整后基数", dataIndex = "adjustAfterBaseValue", key = "adjustAfterBaseValue")
private String adjustAfterBaseValue;
@TableTitle(title = "操作人", dataIndex = "operatorName", key = "operatorName")
private String operatorName;
@TableTitle(title = "操作时间", dataIndex = "operateTime", key = "operateTime")
private Date operateTime;
}

View File

@ -0,0 +1,28 @@
package com.engine.salary.entity.siarchives.param;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: sy
* @Description: 基数调整历史列表查询参数
* @Date: 2023/10/17
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SIArchiveBaseHistoryListParam {
private WelfareTypeEnum welfareTypeEnum;
private Long employeeId;
private Long operator;
private Long paymentOrganization;
private int current;
private int pageSize;
}

View File

@ -0,0 +1,80 @@
package com.engine.salary.entity.siarchives.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author: sy
* @Description: 福利档案基数调整记录
* @Date: 2023/10/16
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//hrsa_insurance_base_history
public class InsuranceArchivesBaseHistoryPO {
private Long id;
/**
* 人员id
*/
private Long employeeId;
/**
* 个税扣缴义务人id
*/
private Long paymentOrganization;
/**
* 福利类别
*/
private Integer welfareType;
/**
* 调整前方案id
*/
private Long adjustBeforeSchemeId;
/**
* 调整后方案id
*/
private Long adjustAfterSchemeId;
/**
* 调整前基数值
*/
private String adjustBeforeBaseValue;
/**
* 调整后基数值
*/
private String adjustAfterBaseValue;
/**
* 调整的福利项id
*/
private Long adjustWelfareItemId;
/**
* 操作人
*/
private Long operator;
/**
* 操作时间
*/
private Date operateTime;
private String tenantKey;
private Long creator;
private Integer deleteType;
private Date createTime;
private Date updateTime;
}

View File

@ -8,24 +8,36 @@ import java.math.BigDecimal;
import java.util.List;
import java.util.function.Predicate;
public enum FilterEnum implements BaseEnum<String> {
public enum FilterEnum implements BaseEnum<String> {
BT("BT", "包含", 346) {
@Override
public Predicate<String> filter(List<String> params) {
return a -> a.contentEquals(params.get(0));
return a -> a.contains(params.get(0));
}
},
EQ("EQ", "等于", 545305) {
@Override
public Predicate<String> filter(List<String> params) {
return a -> a.equals(params.get(0));
return a -> {
if (NumberUtils.isCreatable(a) && NumberUtils.isCreatable(params.get(0))) {
return new BigDecimal(a).compareTo(new BigDecimal(params.get(0))) == 0;
} else {
return a.equals(params.get(0));
}
};
}
},
NE("NE", "不等于", 545306) {
@Override
public Predicate<String> filter(List<String> params) {
return a -> !a.equals(params.get(0));
return a -> {
if (NumberUtils.isCreatable(a) && NumberUtils.isCreatable(params.get(0))) {
return new BigDecimal(a).compareTo(new BigDecimal(params.get(0))) != 0;
} else {
return !a.equals(params.get(0));
}
};
}
},
GT("GT", "大于", 545307) {

View File

@ -0,0 +1,26 @@
package com.engine.salary.enums.salaryarchive;
/**
* 薪资档案调薪记录列表类型
* <p>Copyright: Copyright (c) 2023</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public enum SalaryArchiveAdjustRecordTypeEnum {
MYADJUSTRECORD("myAdjustRecordList"),
ADJUSTRECORD("adjustRecordList"),
ADJUSTRECORDFORDELETE("adjustRecordForDeleteList");
private String pageUid;
SalaryArchiveAdjustRecordTypeEnum(String pageUid) {
this.pageUid = pageUid;
}
public String getPageUid() {
return pageUid;
}
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.enums.salaryarchive;
import com.engine.salary.enums.BaseEnum;
import com.engine.salary.util.SalaryI18nUtil;
import java.util.*;
@ -13,7 +14,7 @@ import java.util.stream.Collectors;
* @author qiantao
* @version 1.0
**/
public enum SalaryArchiveItemAdjustReasonEnum {
public enum SalaryArchiveItemAdjustReasonEnum implements BaseEnum<String> {
ONBOARD("ONBOARD", SalaryI18nUtil.getI18nLabel(16250, "入职"), 16250),
PROBATION_REVIEW("PROBATION_REVIEW", SalaryI18nUtil.getI18nLabel(6088, "转正"), 6088),
@ -43,7 +44,7 @@ public enum SalaryArchiveItemAdjustReasonEnum {
return defaultLabel;
}
public int getLabelId() {
public Integer getLabelId() {
return labelId;
}

View File

@ -36,6 +36,7 @@ public class QlExpress {
static {
runner = new ExpressRunner(true, false);
runner.setShortCircuit(true);
}
private static boolean isInitialRunner = false;

View File

@ -154,7 +154,7 @@ public class EqOperator extends OperatorEqualsLessMore {
}
}
// buildFilterParam(result,op1,op2);
return result;
return result.getContent();
}
/**

View File

@ -89,7 +89,7 @@ public class GreaterEqOperator extends OperatorEqualsLessMore {
result.setContent(false);
}
// Compareutils.buildLessMoreFilterParam(result,this.name,op1,op2);
return result;
return result.getContent();
}
public GreaterEqOperator(String aAliasName, String aName, String aErrorInfo) {

View File

@ -92,7 +92,7 @@ public class GreaterOperator extends OperatorEqualsLessMore {
result.setContent(false);
}
// Compareutils.buildLessMoreFilterParam(result, this.name, op1, op2);
return result;
return result.getContent();
}
public GreaterOperator(String aName) {

View File

@ -90,7 +90,7 @@ public class LessEqOperator extends OperatorEqualsLessMore {
result.setContent(false);
}
// Compareutils.buildLessMoreFilterParam(result,this.name,op1,op2);
return result;
return result.getContent();
}
public LessEqOperator(String aName) {

View File

@ -90,7 +90,7 @@ public class LessOperator extends OperatorEqualsLessMore {
result.setContent(false);
}
// Compareutils.buildLessMoreFilterParam(result,this.name,op1,op2);
return result;
return result.getContent();
}
public LessOperator(String aName) {

View File

@ -89,7 +89,7 @@ public class NotEqueOperator extends OperatorEqualsLessMore {
result.setContent(false);
}
// Compareutils.buildNotEqFilterParam(result, op1, op2);
return result;
return result.getContent();
}
public NotEqueOperator(String aName) {

View File

@ -16,82 +16,83 @@ import org.slf4j.LoggerFactory;
public class IfOperator extends OperatorIf {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public OperateData executeInner(InstructionSetContext parent, ArraySwap list) throws Exception {
Integer number= IgnoreParamFilter.getSetFuncNumber("IF");
if(list==null ||list.length !=3){
JSONObject errorJson= ErrorUtil.buildError("IF",number,number,"IF函数只允许三个参数");
throw new ExcelRunTimeException("IF函数只允许三个参数");
}
Object obj = list.get(0).getObject(parent);
logger.info("IF参数"+ JSON.toJSONString(obj));
boolean isDataTypeBool=false;
DataType boolDtaType=null;
if(obj!=null && obj instanceof DataType){
boolDtaType=(DataType)obj;
if(boolDtaType.getContent() !=null && ( boolDtaType.getContent() instanceof Boolean )){
isDataTypeBool=true;
obj=boolDtaType.getContent();
}else{
switch (obj+""){
case "true":
obj=true;
isDataTypeBool=true;
break;
case "false":
obj=false;
isDataTypeBool=true;
break;
default:
isDataTypeBool=false;
break;
}
}
}else if(obj instanceof Boolean){
isDataTypeBool=true;
}
if (obj == null) {
JSONObject errorJson=ErrorUtil.buildError("IF",number,number,"IF函数参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
} else if (!(obj instanceof Boolean) && (! (obj instanceof DataType) )) {
JSONObject errorJson=ErrorUtil.buildError("IF",number,number,"IF函数判断条件必须是真假值");
throw new RuntimeException(errorJson.getString("msg"));
}else if(!isDataTypeBool){
JSONObject errorJson=ErrorUtil.buildError("IF",number,number,"IF函数判断条件必须是真假值");
throw new RuntimeException(errorJson.getString("msg"));
}else {
if (((Boolean)obj).booleanValue() == true){
OperateData operateData=list.get(1);
Object object=operateData.getObject(parent);
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public OperateData executeInner(InstructionSetContext parent, ArraySwap list) throws Exception {
Integer number = IgnoreParamFilter.getSetFuncNumber("IF");
if (list == null || list.length != 3) {
JSONObject errorJson = ErrorUtil.buildError("IF", number, number, "IF函数只允许三个参数");
throw new ExcelRunTimeException("IF函数只允许三个参数");
}
Object obj = list.get(0).getObject(parent);
logger.info("IF参数" + JSON.toJSONString(obj));
boolean isDataTypeBool = false;
DataType boolDtaType = null;
if (obj != null && obj instanceof DataType) {
boolDtaType = (DataType) obj;
if (boolDtaType.getContent() != null && (boolDtaType.getContent() instanceof Boolean)) {
isDataTypeBool = true;
obj = boolDtaType.getContent();
} else {
switch (obj + "") {
case "true":
obj = true;
isDataTypeBool = true;
break;
case "false":
obj = false;
isDataTypeBool = true;
break;
default:
isDataTypeBool = false;
break;
}
}
} else if (obj instanceof Boolean) {
isDataTypeBool = true;
}
if (obj == null) {
JSONObject errorJson = ErrorUtil.buildError("IF", number, number, "IF函数参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
} else if (!(obj instanceof Boolean) && (!(obj instanceof DataType))) {
JSONObject errorJson = ErrorUtil.buildError("IF", number, number, "IF函数判断条件必须是真假值");
throw new RuntimeException(errorJson.getString("msg"));
} else if (!isDataTypeBool) {
JSONObject errorJson = ErrorUtil.buildError("IF", number, number, "IF函数判断条件必须是真假值");
throw new RuntimeException(errorJson.getString("msg"));
} else {
if (((Boolean) obj).booleanValue() == true) {
OperateData operateData = list.get(1);
Object object = operateData.getObject(parent);
// if(object instanceof DataType){
// String type= ExcelParamUtil.getParamType(object);
// if(type.equalsIgnoreCase("date")){
// object=ExcelParamUtil.getParamContent(object,"string");
// }
// }
OperateData operateData1=new OperateData(ExcelParamUtil.getParamContent(object,""),operateData.getType(parent));
return operateData1;
}else{
OperateData operateData=list.get(2);
Object object=operateData.getObject(parent);
OperateData operateData1 = new OperateData(ExcelParamUtil.getParamContent(object, ""), operateData.getType(parent));
return operateData1;
} else {
OperateData operateData = list.get(2);
Object object = operateData.getObject(parent);
// if(object instanceof DataType){
// String type=ExcelParamUtil.getParamType(object);
// if(type.equalsIgnoreCase("date")){
// object=ExcelParamUtil.getParamContent(object,"string");
// }
// }
OperateData operateData1=new OperateData(ExcelParamUtil.getParamContent(object,""),operateData.getType(parent));
return operateData1;
}
}
}
OperateData operateData1 = new OperateData(ExcelParamUtil.getParamContent(object, ""), operateData.getType(parent));
return operateData1;
}
}
}
public IfOperator(String aName) {
super(aName);
}
public IfOperator(String aName) {
super(aName);
}
public IfOperator(String aAliasName, String aName, String aErrorInfo) {
super(aAliasName, aName, aErrorInfo);
}
public IfOperator(String aAliasName, String aName, String aErrorInfo) {
super(aAliasName, aName, aErrorInfo);
}
}

View File

@ -4,13 +4,13 @@ import com.engine.salary.formlua.entity.parameter.DataType;
public interface LogicService {
public DataType not(Object... object);
public Boolean not(Object... object);
public DataType isEmpty(Object... objs);
public Boolean isEmpty(Object... objs);
public DataType isTrue(Object... objs);
public Boolean isTrue(Object... objs);
public DataType isFalse(Object... objs);
public Boolean isFalse(Object... objs);
public DataType and(Object... objs);

View File

@ -24,7 +24,7 @@ public class LogicServiceImpl implements LogicService {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public DataType not(Object... objects) {
public Boolean not(Object... objects) {
DataType resultdataType = new DataType();
resultdataType.setDataType(DataType.BOOL);
Class[] typeObjects = new Class[]{boolean.class};
@ -32,7 +32,7 @@ public class LogicServiceImpl implements LogicService {
Object object = objects[0];
if (object == null) {
resultdataType.setContent(false);
return resultdataType;
return false;
}
Boolean cnd;
if (object instanceof DataType) {
@ -43,11 +43,11 @@ public class LogicServiceImpl implements LogicService {
}
resultdataType.setContent(!cnd);
return resultdataType;
return (Boolean) resultdataType.getContent();
}
@Override
public DataType isEmpty(Object... objs) {
public Boolean isEmpty(Object... objs) {
int number = IgnoreParamFilter.getSetFuncNumber(FuncNames.ISEMPTY.toString());
if (objs.length != 1) {
throw new RuntimeException("ISEMPTY函数只允许一个参数");
@ -57,7 +57,7 @@ public class LogicServiceImpl implements LogicService {
DataType dataType = new DataType();
dataType.setDataType(DataType.BOOL);
dataType.setContent(true);
return dataType;
return true;
}
for (int i = 0; i < objs.length; i++) {
Object obj = objs[i];
@ -65,7 +65,7 @@ public class LogicServiceImpl implements LogicService {
DataType dataType = new DataType();
dataType.setDataType(DataType.BOOL);
dataType.setContent(true);
return dataType;
return true;
}
if (obj instanceof DataType) {
DataType objDataType = (DataType) obj;
@ -86,11 +86,11 @@ public class LogicServiceImpl implements LogicService {
DataType dataType = new DataType();
dataType.setDataType(DataType.BOOL);
dataType.setContent(result);
return dataType;
return result;
}
@Override
public DataType isTrue(Object... objects) {
public Boolean isTrue(Object... objects) {
int number = IgnoreParamFilter.getSetFuncNumber(FuncNames.TRUE.toString());
if (objects.length > 0) {
throw new RuntimeException("TRUE函数不能有参数");
@ -98,11 +98,11 @@ public class LogicServiceImpl implements LogicService {
DataType dataType = new DataType();
dataType.setDataType(DataType.BOOL);
dataType.setContent(true);
return dataType;
return (Boolean) dataType.getContent();
}
@Override
public DataType isFalse(Object... objects) {
public Boolean isFalse(Object... objects) {
int number = IgnoreParamFilter.getSetFuncNumber(FuncNames.FALSE.toString());
if (objects.length > 0) {
JSONObject errorJson = ErrorUtil.buildError(FuncNames.FALSE.toString(), number, number, "FALSE函数不能有参数");
@ -111,7 +111,7 @@ public class LogicServiceImpl implements LogicService {
DataType dataType = new DataType();
dataType.setDataType(DataType.BOOL);
dataType.setContent(false);
return dataType;
return (Boolean) dataType.getContent();
}
@ -335,7 +335,7 @@ public class LogicServiceImpl implements LogicService {
} else {
value = param;
}
if (Objects.equals(source.toString(),value.toString())) {
if (Objects.equals(source.toString(), value.toString())) {
result = objects[i + 1];
break;
}

View File

@ -2,6 +2,7 @@ package com.engine.salary.formlua.util;
import com.alibaba.fastjson.JSONObject;
import com.engine.salary.formlua.entity.parameter.FormulaContext;
import org.apache.commons.lang3.StringUtils;
import java.util.HashMap;
import java.util.Map;
@ -11,217 +12,223 @@ import java.util.regex.PatternSyntaxException;
public class ExpressRegularUtil {
private static final String[] checkRegularNullParameter=new String[]{"TRUE","FALSE","NOW","TODAY"};
private static final String[] operSymbs=new String[]{">",">=","=","<","<=","\\+","-","\\*","\\/","!="};
private static final String checkRegularParameter="AND|OR|IF|NOT|LIKE|DATEDIFF|DATEADD|WEEKNUM|WEEKDAY|DATEFORMAT|Y|M|D|H|I|S|COUNT|SUM|MAX|MIN|CONCAT|SEARCH|TEXT|PAD|REPLACE|VALUE|LEN|LEFT|RIGHT|MID";
private final static String leftCircleBracket="Unmatched closing '('";
private final static String rightCircleBracket="Unmatched closing ')'";
private final static String leftSquareBracket="Unmatched closing '['";
private final static String rightSquareeBracket="Unmatched closing ']'";
private final static String leftBigBracket="Unmatched closing '{'";
private final static String rightBigBracket="Unmatched closing '}'";
public static boolean checkFuncExpress(String str){
filter(str);
return true;
}
private static final String[] checkRegularNullParameter = new String[]{"TRUE", "FALSE", "NOW", "TODAY"};
private static final String[] operSymbs = new String[]{">", ">=", "=", "<", "<=", "\\+", "-", "\\*", "\\/", "!="};
private static final String checkRegularParameter = "AND|OR|IF|NOT|LIKE|DATEDIFF|DATEADD|WEEKNUM|WEEKDAY|DATEFORMAT|Y|M|D|H|I|S|COUNT|SUM|MAX|MIN|CONCAT|SEARCH|TEXT|PAD|REPLACE|VALUE|LEN|LEFT|RIGHT|MID";
private final static String leftCircleBracket = "Unmatched closing '('";
private final static String rightCircleBracket = "Unmatched closing ')'";
private final static String leftSquareBracket = "Unmatched closing '['";
private final static String rightSquareeBracket = "Unmatched closing ']'";
private final static String leftBigBracket = "Unmatched closing '{'";
private final static String rightBigBracket = "Unmatched closing '}'";
public static boolean isContainChinese(String str) {
Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\|\\|\\。|\\|\\|\\《|\\》|\\“|\\”|\\|\\|\\|\\【|\\】]");
Matcher m = p.matcher(str);
if (m.find()) {
return true;
}
return false;
}
public static boolean checkFuncExpress(String str) {
filter(str);
return true;
}
private static void filter(String formula){
try {
testSymbol(formula);
checkNullRegular(formula);
checkOperatorNullParam(formula);
formula=formula.replaceAll("","#");
String leftReplace="";
String rightReplace="";
leftReplace=formula.replaceAll("\\(","");
rightReplace=formula.replaceAll("\\)","");
if(leftReplace.length()>rightReplace.length()){
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(leftCircleBracket,formula,formula.lastIndexOf(")"));
throw patternSyntaxException;
}
if(leftReplace.length()<rightReplace.length()){
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(rightCircleBracket,formula,formula.indexOf("("));
throw patternSyntaxException;
}
public static boolean isContainChinese(String str) {
Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\|\\|\\。|\\|\\|\\《|\\》|\\“|\\”|\\|\\|\\|\\【|\\】]");
Matcher m = p.matcher(str);
if (m.find()) {
return true;
}
return false;
}
leftReplace=formula.replaceAll("\\{","");
rightReplace=formula.replaceAll("}","");
if(leftReplace.length()>rightReplace.length()){
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(leftBigBracket,formula,formula.lastIndexOf("}"));
throw patternSyntaxException;
}
if(leftReplace.length()<rightReplace.length()){
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(rightBigBracket,formula,formula.indexOf("{"));
throw patternSyntaxException;
}
private static void filter(String formula) {
try {
testSymbol(formula);
checkNullRegular(formula);
checkOperatorNullParam(formula);
formula = formula.replaceAll("", "#");
String leftReplace = "";
String rightReplace = "";
leftReplace = formula.replaceAll("\\(", "");
rightReplace = formula.replaceAll("\\)", "");
if (leftReplace.length() > rightReplace.length()) {
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(leftCircleBracket, formula, formula.lastIndexOf(")"));
throw patternSyntaxException;
}
if (leftReplace.length() < rightReplace.length()) {
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(rightCircleBracket, formula, formula.indexOf("("));
throw patternSyntaxException;
}
leftReplace=formula.replaceAll("\\[","");
rightReplace=formula.replaceAll("]","");
if(leftReplace.length()>rightReplace.length()){
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(leftSquareBracket,formula,formula.lastIndexOf("]"));
throw patternSyntaxException;
}
if(leftReplace.length()<rightReplace.length()){
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(rightSquareeBracket,formula,formula.indexOf("["));
throw patternSyntaxException;
}
leftReplace = formula.replaceAll("\\{", "");
rightReplace = formula.replaceAll("}", "");
if (leftReplace.length() > rightReplace.length()) {
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(leftBigBracket, formula, formula.lastIndexOf("}"));
throw patternSyntaxException;
}
if (leftReplace.length() < rightReplace.length()) {
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(rightBigBracket, formula, formula.indexOf("{"));
throw patternSyntaxException;
}
} catch (PatternSyntaxException e) {
String error=e.getDescription().trim();
int errorIdx=e.getIndex();
int errorEndIdx=-1;
switch (error){
case leftCircleBracket:
error="'('括号没有找到";
errorEndIdx=-1;
break;
case rightCircleBracket:
error="'('括号没有闭合";
errorEndIdx=-1;
break;
case leftSquareBracket:
error="'['括号没有找到";
errorEndIdx=-1;
break;
case rightSquareeBracket:
error="'['括号没有闭合";
errorEndIdx=-1;
break;
case leftBigBracket:
error="'{'括号没有找到";
errorEndIdx=-1;
break;
case rightBigBracket:
error="'{'括号没有闭合";
errorEndIdx=-1;
break;
case "TRUE函数不能有参数":
errorEndIdx=errorIdx+4;
break;
case "FALSE函数不能有参数":
errorEndIdx=errorIdx+5;
break;
case "NOW函数不能有参数":
errorEndIdx=errorIdx+3;
break;
case "TODAY函数不能有参数":
errorEndIdx=errorIdx+5;
break;
leftReplace = formula.replaceAll("\\[", "");
rightReplace = formula.replaceAll("]", "");
if (leftReplace.length() > rightReplace.length()) {
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(leftSquareBracket, formula, formula.lastIndexOf("]"));
throw patternSyntaxException;
}
if (leftReplace.length() < rightReplace.length()) {
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(rightSquareeBracket, formula, formula.indexOf("["));
throw patternSyntaxException;
}
}
JSONObject catchJson=null;
if(errorEndIdx<0){
catchJson= ErrorUtil.buildError(formula,errorIdx+1,null,error);
}else {
catchJson= ErrorUtil.buildError(formula,errorIdx+1,errorEndIdx,null,error);
}
} catch (PatternSyntaxException e) {
String error = e.getDescription().trim();
int errorIdx = e.getIndex();
int errorEndIdx = -1;
switch (error) {
case leftCircleBracket:
error = "'('括号没有找到";
errorEndIdx = -1;
break;
case rightCircleBracket:
error = "'('括号没有闭合";
errorEndIdx = -1;
break;
case leftSquareBracket:
error = "'['括号没有找到";
errorEndIdx = -1;
break;
case rightSquareeBracket:
error = "'['括号没有闭合";
errorEndIdx = -1;
break;
case leftBigBracket:
error = "'{'括号没有找到";
errorEndIdx = -1;
break;
case rightBigBracket:
error = "'{'括号没有闭合";
errorEndIdx = -1;
break;
case "TRUE函数不能有参数":
errorEndIdx = errorIdx + 4;
break;
case "FALSE函数不能有参数":
errorEndIdx = errorIdx + 5;
break;
case "NOW函数不能有参数":
errorEndIdx = errorIdx + 3;
break;
case "TODAY函数不能有参数":
errorEndIdx = errorIdx + 5;
break;
catchJson.put("formula",formula);
throw new PatternSyntaxException(catchJson.toJSONString(),null,errorIdx+1);
}
}
}
JSONObject catchJson = null;
if (errorEndIdx < 0) {
catchJson = ErrorUtil.buildError(formula, errorIdx + 1, null, error);
} else {
catchJson = ErrorUtil.buildError(formula, errorIdx + 1, errorEndIdx, null, error);
}
private static void checkNullRegular(String formula){
String filterPattern=null;
for(int i=0;i<checkRegularNullParameter.length;i++){
int eidx=formula.indexOf(checkRegularNullParameter[i]);
if(eidx>=0){
if(FormulaContext.get().getValue(checkRegularNullParameter[i])!=null){
Integer paramCount=FormulaContext.get().getValue(checkRegularNullParameter[i]);
paramCount++;
FormulaContext.get().setValue(checkRegularNullParameter[i]);
}else {
FormulaContext.get().setValue(checkRegularNullParameter[i]);
}
filterPattern=checkRegularNullParameter[i]+"{1}\\({1}\\){1}";
Pattern pattern= Pattern.compile(filterPattern);
Matcher matcher=pattern.matcher(formula);
boolean excuteBool=matcher.find();
if(!excuteBool){
eidx=0;
Integer errorCount=FormulaContext.get().getFormulaJson().getInteger(checkRegularNullParameter[i]);
String [] errorCutArray=formula.split(checkRegularNullParameter[i]);
for (int fi=0;fi<errorCount;fi++){
eidx+=errorCutArray[fi].length();
if(errorCutArray.length>1&&fi>0){
eidx+=checkRegularNullParameter[i].length();
}
}
PatternSyntaxException patternSyntaxException=new PatternSyntaxException(checkRegularNullParameter[i]+"函数不能有参数",formula,eidx);
throw patternSyntaxException;
}
}else {
catchJson.put("formula", formula);
throw new PatternSyntaxException(catchJson.toJSONString(), null, errorIdx + 1);
}
}
}
}
}
private static void checkNullRegular(String formula) {
String filterPattern = null;
for (int i = 0; i < checkRegularNullParameter.length; i++) {
int eidx = formula.indexOf(checkRegularNullParameter[i]);
if (eidx >= 0) {
if (FormulaContext.get().getValue(checkRegularNullParameter[i]) != null) {
Integer paramCount = FormulaContext.get().getValue(checkRegularNullParameter[i]);
paramCount++;
FormulaContext.get().setValue(checkRegularNullParameter[i]);
} else {
FormulaContext.get().setValue(checkRegularNullParameter[i]);
}
filterPattern = checkRegularNullParameter[i] + "{1}\\({1}\\){1}";
Pattern pattern = Pattern.compile(filterPattern);
Matcher matcher = pattern.matcher(formula);
boolean excuteBool = matcher.find();
if (!excuteBool) {
eidx = 0;
Integer errorCount = FormulaContext.get().getFormulaJson().getInteger(checkRegularNullParameter[i]);
String[] errorCutArray = formula.split(checkRegularNullParameter[i]);
for (int fi = 0; fi < errorCount; fi++) {
eidx += errorCutArray[fi].length();
if (errorCutArray.length > 1 && fi > 0) {
eidx += checkRegularNullParameter[i].length();
}
}
PatternSyntaxException patternSyntaxException = new PatternSyntaxException(checkRegularNullParameter[i] + "函数不能有参数", formula, eidx);
throw patternSyntaxException;
}
} else {
private static void checkOperatorNullParam(String formula){
formula=formula.trim();
JSONObject errorJson=new JSONObject();
Map<String,Integer> operMap=new HashMap<>();
}
}
}
for (int i=0;i<operSymbs.length;i++){
String operSymb=operSymbs[i];
if(formula.indexOf(operSymb)<0){
continue;
}
if(operMap.get(operSymb)==null){
operMap.put(operSymb,1);
}else{
operMap.put(operSymb,operMap.get(operSymb)+1);
}
String commonP="("+operSymb+")";
Pattern wrongPone=Pattern.compile("^.+"+commonP+"+?$");
Pattern wrongPtwo=Pattern.compile("^"+commonP+"+?.+$");
Pattern wrongPthree=Pattern.compile("^"+commonP+"+?$");
private static void checkOperatorNullParam(String formula) {
formula = formula.trim();
JSONObject errorJson = new JSONObject();
Map<String, Integer> operMap = new HashMap<>();
Matcher m=wrongPone.matcher(formula);
for (int i = 0; i < operSymbs.length; i++) {
String operSymb = operSymbs[i];
if (formula.indexOf(operSymb) < 0) {
continue;
}
if (operMap.get(operSymb) == null) {
operMap.put(operSymb, 1);
} else {
operMap.put(operSymb, operMap.get(operSymb) + 1);
}
String commonP = "(" + operSymb + ")";
Pattern wrongPone = Pattern.compile("^.+" + commonP + "+?$");
Pattern wrongPtwo = Pattern.compile("^" + commonP + "+?.+$");
Pattern wrongPthree = Pattern.compile("^" + commonP + "+?$");
if(m.find()){
errorJson= ErrorUtil.buildError(operSymb,formula.length(),operMap.get(operSymb),"操作符两端的参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
}
Matcher m = wrongPone.matcher(formula);
Matcher mtwo=wrongPtwo.matcher(formula);
if(mtwo.find()){
errorJson= ErrorUtil.buildError(operSymb,1,operMap.get(operSymb),"操作符两端的参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
}
if (m.find()) {
errorJson = ErrorUtil.buildError(operSymb, formula.length(), operMap.get(operSymb), "操作符两端的参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
}
Matcher mthree=wrongPthree.matcher(formula);
if(mthree.find()){
errorJson= ErrorUtil.buildError(operSymb,1,operMap.get(operSymb),"操作符两端的参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
}
Matcher mtwo = wrongPtwo.matcher(formula);
if (mtwo.find()) {
//-负数特殊处理
if (StringUtils.equals(operSymb, "-")) {
return;
}
errorJson = ErrorUtil.buildError(operSymb, 1, operMap.get(operSymb), "操作符两端的参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
}
}
Matcher mthree = wrongPthree.matcher(formula);
if (mthree.find()) {
errorJson = ErrorUtil.buildError(operSymb, 1, operMap.get(operSymb), "操作符两端的参数不能为空");
throw new RuntimeException(errorJson.getString("msg"));
}
}
}
public static void testSymbol(String formula){
Pattern pattern=Pattern.compile(",+?\\s*\\)");
Matcher m=pattern.matcher(formula);
if(m.find()){
int idx=formula.indexOf(m.group());
PatternSyntaxException patternSyntaxException=new PatternSyntaxException("参数格式错误",formula,idx);
throw patternSyntaxException;
}
}
}
public static void main(String args[]){
public static void testSymbol(String formula) {
Pattern pattern = Pattern.compile(",+?\\s*\\)");
Matcher m = pattern.matcher(formula);
if (m.find()) {
int idx = formula.indexOf(m.group());
PatternSyntaxException patternSyntaxException = new PatternSyntaxException("参数格式错误", formula, idx);
throw patternSyntaxException;
}
}
checkOperatorNullParam(" abc>=");
}
public static void main(String args[]) {
checkOperatorNullParam(" abc>=");
}
}

View File

@ -563,11 +563,10 @@
<if test="param.salaryArchiveId != null">
AND t1.salary_archive_id = #{param.salaryArchiveId}
</if>
<!-- 部门 -->
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND d.id IN
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
#{id}
<if test="param.salaryArchiveIds != null and param.salaryArchiveIds.size()>0">
AND t1.salary_archive_id IN
<foreach collection="param.salaryArchiveIds" open="(" item="salaryArchiveId" separator="," close=")">
#{salaryArchiveId}
</foreach>
</if>
<!-- 调整原因 -->
@ -638,7 +637,12 @@
<if test="param.salaryArchiveId != null">
AND t1.salary_archive_id = #{param.salaryArchiveId}
</if>
<if test="param.salaryArchiveIds != null and param.salaryArchiveIds.size()>0">
AND t1.salary_archive_id IN
<foreach collection="param.salaryArchiveIds" open="(" item="salaryArchiveId" separator="," close=")">
#{salaryArchiveId}
</foreach>
</if>
<if test="param.adjustReason != null and param.adjustReason != ''">
AND t1.adjust_reason = #{param.adjustReason}
</if>
@ -713,11 +717,10 @@
AND t1.salary_archive_id = #{param.salaryArchiveId}
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND d.id IN
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
#{id}
<if test="param.salaryArchiveIds != null and param.salaryArchiveIds.size()>0">
AND t1.salary_archive_id IN
<foreach collection="param.salaryArchiveIds" open="(" item="salaryArchiveId" separator="," close=")">
#{salaryArchiveId}
</foreach>
</if>
@ -739,7 +742,6 @@
#{id}
</foreach>
</if>
ORDER BY t1.effective_time DESC,t1.id DESC
</select>

View File

@ -658,6 +658,12 @@
#{id}
</foreach>
</if>
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
AND t.tax_agent_id IN
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
#{taxAgentId}
</foreach>
</if>
ORDER BY t.id DESC
</select>
@ -786,8 +792,7 @@
run_status='FIXED',
pay_end_date= null
</set>
WHERE run_status = 'SUSPEND'
and id IN
WHERE id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>

View File

@ -0,0 +1,73 @@
package com.engine.salary.mapper.hrm;
import com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface ExpandFieldSettingsMapper {
/**
* 查询所有记录
*
* @return 返回集合没有返回空List
*/
List<ExpandFieldSettingsPO> listAll();
/**
* 条件查询
*
* @return 返回集合没有返回空List
*/
List<ExpandFieldSettingsPO> listSome(ExpandFieldSettingsPO expandFieldSettings);
/**
* 根据主键查询
*
* @param id 主键
* @return 返回记录没有返回null
*/
ExpandFieldSettingsPO getById(Long id);
/**
* 新增忽略null字段
*
* @param expandFieldSettings 新增的记录
* @return 返回影响行数
*/
int insertIgnoreNull(ExpandFieldSettingsPO expandFieldSettings);
/**
* 修改修改所有字段
*
* @param expandFieldSettings 修改的记录
* @return 返回影响行数
*/
int update(ExpandFieldSettingsPO expandFieldSettings);
/**
* 修改忽略null字段
*
* @param expandFieldSettings 修改的记录
* @return 返回影响行数
*/
int updateIgnoreNull(ExpandFieldSettingsPO expandFieldSettings);
/**
* 删除记录
*
* @param expandFieldSettings 待删除的记录
* @return 返回影响行数
*/
int delete(ExpandFieldSettingsPO expandFieldSettings);
/**
* 批量删除记录
* @param ids 主键id集合
*/
void deleteByIds(@Param("ids") Collection<Long> ids);
ExpandFieldSettingsPO getByModule(String module);
}

View File

@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
<result column="id" property="id"/>
<result column="module" property="module"/>
<result column="module_info" property="moduleInfo"/>
<result column="pk" property="pk"/>
<result column="expand_sql" property="expandSql"/>
<result column="field_setting" property="fieldSetting"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.module
, t.module_info
, t.pk
, t.expand_sql
, t.field_setting
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap"
parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE delete_type = 0
<if test="module != null">
AND module = #{module}
</if>
<if test="moduleInfo != null">
AND module_info = #{moduleInfo}
</if>
<if test="pk != null">
AND pk = #{pk}
</if>
<if test="expandSql != null">
AND expand_sql = #{expandSql}
</if>
<if test="fieldSetting != null">
AND field_setting = #{fieldSetting}
</if>
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
INSERT INTO hrsa_expand_field_settings
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="module != null">
module,
</if>
<if test="moduleInfo != null">
module_info,
</if>
<if test="pk != null">
pk,
</if>
<if test="expandSql != null">
expand_sql,
</if>
<if test="fieldSetting != null">
field_setting,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="module != null">
#{module},
</if>
<if test="moduleInfo != null">
#{moduleInfo},
</if>
<if test="pk != null">
#{pk},
</if>
<if test="expandSql != null">
#{expandSql},
</if>
<if test="fieldSetting != null">
#{fieldSetting},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
UPDATE hrsa_expand_field_settings
<set>
module=#{module},
module_info=#{moduleInfo},
pk=#{pk},
expand_sql=#{expandSql},
field_setting=#{fieldSetting},
create_time=#{createTime},
update_time=#{updateTime},
creator=#{creator},
delete_type=#{deleteType},
tenant_key=#{tenantKey},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO">
UPDATE hrsa_expand_field_settings
<set>
<if test="module != null">
module=#{module},
</if>
<if test="moduleInfo != null">
module_info=#{moduleInfo},
</if>
<if test="pk != null">
pk=#{pk},
</if>
<if test="expandSql != null">
expand_sql=#{expandSql},
</if>
<if test="fieldSetting != null">
field_setting=#{fieldSetting},
</if>
<if test="createTime != null">
create_time=#{createTime},
</if>
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="creator != null">
creator=#{creator},
</if>
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete">
UPDATE hrsa_expand_field_settings
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
</delete>
<delete id="deleteByIds">
UPDATE hrsa_expand_field_settings
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 根据主键获取单条记录 -->
<select id="getByModule" resultMap="BaseResultMap" >
SELECT
<include refid="baseColumns"/>
FROM hrsa_expand_field_settings t
WHERE module = #{module} AND delete_type = 0
</select>
</mapper>

View File

@ -19,6 +19,10 @@
<result column="tenant_key" property="tenantKey"/>
<result column="unit_type" property="unitType"/>
<result column="update_time" property="updateTime"/>
<result column="last_rule" property="lastRule"/>
<result column="old_rule" property="oldRule"/>
<result column="frequent_rule" property="frequentRule"/>
<result column="tile_rule" property="tileRule"/>
</resultMap>
<!-- 表字段 -->
@ -42,6 +46,10 @@
, t.tenant_key
, t.unit_type
, t.update_time
, t.last_rule
, t.old_rule
, t.frequent_rule
, t.tile_rule
</sql>
<!-- 查询全部 -->
@ -184,6 +192,18 @@
<if test="updateTime != null">
update_time,
</if>
<if test="lastRule != null">
last_rule,
</if>
<if test="oldRule != null">
old_rule,
</if>
<if test="frequentRule != null">
frequent_rule,
</if>
<if test="tileRule != null">
tile_rule,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="avgRule != null">
@ -237,6 +257,18 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="lastRule != null">
#{lastRule},
</if>
<if test="oldRule != null">
#{oldRule},
</if>
<if test="frequentRule != null">
#{frequentRule},
</if>
<if test="tileRule != null">
#{tileRule},
</if>
</trim>
</insert>
@ -260,6 +292,10 @@
tenant_key=#{tenantKey},
unit_type=#{unitType},
update_time=#{updateTime},
last_rule=#{lastRule},
old_rule=#{oldRule},
frequent_rule=#{frequentRule},
tile_rule=#{tileRule},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -317,6 +353,18 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="lastRule != null">
last_rule=#{lastRule},
</if>
<if test="oldRule != null">
old_rule=#{oldRule},
</if>
<if test="frequentRule != null">
frequent_rule=#{frequentRule},
</if>
<if test="tileRule != null">
tile_rule=#{tileRule},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -16,6 +16,7 @@
<result column="position_setting" property="positionSetting"/>
<result column="remark" property="remark"/>
<result column="report_name" property="reportName"/>
<result column="time_type" property="timeType"/>
<result column="salary_end_month" property="salaryEndMonth"/>
<result column="salary_start_month" property="salaryStartMonth"/>
<result column="second_dimension" property="secondDimension"/>
@ -56,6 +57,7 @@
, t.tax_agent_setting
, t.tenant_key
, t.update_time
, t.time_type
</sql>
<!-- 查询全部 -->
@ -123,6 +125,9 @@
<if test="reportName != null">
AND report_name = #{reportName}
</if>
<if test="timeType != null">
AND time_type = #{timeType}
</if>
<if test="salaryEndMonth != null">
AND salary_end_month = #{salaryEndMonth}
</if>
@ -210,6 +215,9 @@
<if test="reportName != null">
report_name,
</if>
<if test="timeType != null">
time_type,
</if>
<if test="salaryEndMonth != null">
salary_end_month,
</if>
@ -284,6 +292,9 @@
<if test="reportName != null">
#{reportName},
</if>
<if test="timeType != null">
#{timeType},
</if>
<if test="salaryEndMonth != null">
#{salaryEndMonth},
</if>
@ -334,6 +345,7 @@
position_setting=#{positionSetting},
remark=#{remark},
report_name=#{reportName},
time_type=#{timeType},
salary_end_month=#{salaryEndMonth},
salary_start_month=#{salaryStartMonth},
second_dimension=#{secondDimension},
@ -392,6 +404,9 @@
<if test="reportName != null">
report_name=#{reportName},
</if>
<if test="timeType != null">
time_type=#{timeType},
</if>
<if test="salaryEndMonth != null">
salary_end_month=#{salaryEndMonth},
</if>

View File

@ -101,7 +101,7 @@ public interface SalaryAcctResultMapper {
* @param salaryAcctEmpIds
* @param salaryItemIds
*/
void deleteByAcctEmpIdsAndSalaryItemIds(@Param("salaryAcctEmpIds") Collection<Long> salaryAcctEmpIds,
void deleteByAcctEmpIdsAndSalaryItemIds(@Param("salaryAcctEmpIds") List<Long> salaryAcctEmpIds,
@Param("salaryItemIds") Collection<Long> salaryItemIds);
/**

Some files were not shown because too many files have changed in this diff Show More