From a252d055abb28fbade03738794e0e84f4dc0ba90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com>
Date: Mon, 1 Aug 2022 14:15:09 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=A0=B8=E7=AE=97=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E4=BB=A3=E7=90=86=202=E3=80=81=E8=8E=B7=E5=8F=96=E5=BC=82?=
=?UTF-8?q?=E5=B8=B8=E7=9C=9F=E5=AE=9E=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
resource/sql/公式修改.sql | 4 +-
src/CI.java | 2 +-
.../salary/exception/ExceptionUtil.java | 17 ++++++
.../engine/salary/util/ResponseResult.java | 4 +-
.../wrapper/SalaryAcctRecordWrapper.java | 25 ++++-----
.../proxy/SalaryAcctRecordWrapperProxy.java | 54 +++++++++++++++++++
6 files changed, 90 insertions(+), 16 deletions(-)
create mode 100644 src/com/engine/salary/exception/ExceptionUtil.java
create mode 100644 src/com/engine/salary/wrapper/proxy/SalaryAcctRecordWrapperProxy.java
diff --git a/resource/sql/公式修改.sql b/resource/sql/公式修改.sql
index 8631c0196..1eb4eac79 100644
--- a/resource/sql/公式修改.sql
+++ b/resource/sql/公式修改.sql
@@ -1 +1,3 @@
-update hrsa_formula set formula = 'if({薪资项目.当前累计应纳税所得额}<=36000){0;}else if({薪资项目.当前累计应纳税所得额}<=144000){2520;}else if({薪资项目.当前累计应纳税所得额}<=300000){16920;}else if({薪资项目.当前累计应纳税所得额}<=420000){31920;}else if({薪资项目.当前累计应纳税所得额}<=660000){52920;}else if({薪资项目.当前累计应纳税所得额}<=960000){85920;}else{181920;}' where id = 1651742702735
\ No newline at end of file
+update hrsa_formula set formula = 'if({薪资项目.当前累计应纳税所得额}<=36000){0;}else if({薪资项目.当前累计应纳税所得额}<=144000){2520;}else if({薪资项目.当前累计应纳税所得额}<=300000){16920;}else if({薪资项目.当前累计应纳税所得额}<=420000){31920;}else if({薪资项目.当前累计应纳税所得额}<=660000){52920;}else if({薪资项目.当前累计应纳税所得额}<=960000){85920;}else{181920;}' where id = 1651742702735 ;
+
+update hrsa_formula set formulaRunScript = 'if(salaryItem_addUpTaxableIncome<=36000){0;}else if(salaryItem_addUpTaxableIncome<=144000){2520;}else if(salaryItem_addUpTaxableIncome<=300000){16920;}else if(salaryItem_addUpTaxableIncome<=420000){31920;}else if(salaryItem_addUpTaxableIncome<=660000){52920;}else if(salaryItem_addUpTaxableIncome<=960000){85920;}else{181920;}' where id = 1651742702735 ;
\ No newline at end of file
diff --git a/src/CI.java b/src/CI.java
index bba6abdaf..a2b5582b8 100644
--- a/src/CI.java
+++ b/src/CI.java
@@ -2,7 +2,7 @@ import java.io.*;
import java.time.LocalDate;
/**
- * 怀恋Jenkins的第365天
+ * 怀念Jenkins的第365天
*
Copyright: Copyright (c) 2022
* Company: 泛微软件
*
diff --git a/src/com/engine/salary/exception/ExceptionUtil.java b/src/com/engine/salary/exception/ExceptionUtil.java
new file mode 100644
index 000000000..4c33b16e4
--- /dev/null
+++ b/src/com/engine/salary/exception/ExceptionUtil.java
@@ -0,0 +1,17 @@
+package com.engine.salary.exception;
+
+public class ExceptionUtil {
+ public static String getRealMessage(Throwable e) {
+ while (e != null) {
+ Throwable cause = e.getCause();
+ if (cause == null) {
+ return e.getMessage();
+ }
+ e = cause;
+ }
+ return "";
+ }
+}
+
+
+
diff --git a/src/com/engine/salary/util/ResponseResult.java b/src/com/engine/salary/util/ResponseResult.java
index 14f2117cd..32a8e8069 100644
--- a/src/com/engine/salary/util/ResponseResult.java
+++ b/src/com/engine/salary/util/ResponseResult.java
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import com.engine.common.service.HrmCommonService;
import com.engine.common.service.impl.HrmCommonServiceImpl;
import com.engine.core.exception.ECException;
+import com.engine.salary.exception.ExceptionUtil;
import com.engine.salary.exception.SalaryRunTimeException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -80,8 +81,7 @@ public class ResponseResult {
return Error(e.getMessage());
} catch (ECException e) {
log.error("salary api run fail", e);
- Throwable cause = e.getCause();
- return Error(cause.getMessage());
+ return Error(ExceptionUtil.getRealMessage(e));
} catch (Exception e) {
log.error("salary api run fail", e);
return Error("系统异常!", e);
diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java
index 7d4f8d091..4899cfd07 100644
--- a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java
+++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java
@@ -24,6 +24,7 @@ import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
+import com.engine.salary.wrapper.proxy.SalaryAcctRecordWrapperProxy;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.hrm.User;
@@ -39,22 +40,22 @@ import java.util.stream.Collectors;
* @author qiantao
* @version 1.0
**/
-public class SalaryAcctRecordWrapper extends Service {
+public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecordWrapperProxy {
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
- return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
+ return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
}
private SalarySobService getSalarySobService(User user) {
- return (SalarySobService) ServiceUtil.getService(SalarySobServiceImpl.class, user);
+ return ServiceUtil.getService(SalarySobServiceImpl.class, user);
}
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
- return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
+ return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
}
// private ComInfoCache comInfoCache;
- public PageInfo listPage(SalaryAcctRecordQueryParam queryParam) {
+ public PageInfo listPage(SalaryAcctRecordQueryParam queryParam) {
EmployBiz employBiz = new EmployBiz();
// 查询薪资核算记录(分页)
PageInfo page = getSalaryAcctRecordService(user).listPageByParam(queryParam);
@@ -103,16 +104,16 @@ public class SalaryAcctRecordWrapper extends Service {
* @param id 薪资核算记录id
* @return
*/
- public Map getForm(Long id) {
+ public Map getForm(Long id) {
SalaryAcctRecordFormDTO formDTO = new SalaryAcctRecordFormDTO();
// 查询所有启用的薪资账套
List salarySobPOS = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO);
// 薪资核算详情表单中"薪资账套"的下拉选择项
List