From db31190b9e5ffaed1f4bfffc746b0a90e10f3289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 25 Jul 2022 15:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4sql=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sql/档案支持一对多.sql | 2 +- .../salary/service/impl/SalaryFormulaServiceImpl.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/resource/sql/档案支持一对多.sql b/resource/sql/档案支持一对多.sql index 02026be5a..7c45075d7 100644 --- a/resource/sql/档案支持一对多.sql +++ b/resource/sql/档案支持一对多.sql @@ -1,5 +1,5 @@ ALTER TABLE hrsa_salary_archive -ADD COLUMN tax_agent_id bigint(0) NULL COMMENT '个税扣缴义务人id' +ADD COLUMN tax_agent_id bigint(0) NULL COMMENT '个税扣缴义务人id', ADD COLUMN pay_start_date datetime(0) NULL DEFAULT NULL COMMENT '起始发薪日期' , ADD COLUMN pay_end_date datetime(0) NULL DEFAULT NULL COMMENT '最后发薪日期' ; diff --git a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java index 3b48d370e..6b72b7a0a 100644 --- a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java @@ -153,9 +153,7 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe } //试运行公式 - if (ReferenceTypeEnum.parseByValue(param.getReferenceType()) == ReferenceTypeEnum.FORMULA) { - checkRun(param); - } + checkRun(param); FormulaPO formulaPO = new FormulaPO(); String formula = param.getFormula(); @@ -242,6 +240,12 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe } } } + + if (ReferenceTypeEnum.parseByValue(param.getReferenceType()) == ReferenceTypeEnum.SQL) { + if (formulaRunScript.contains(";") || formulaRunScript.contains("--")) { + throw new SalaryRunTimeException("SQL配置异常,请去除';'或者'--'"); + } + } }