Commit 15a2b241 authored by hongguangwu's avatar hongguangwu

代扣,只能金额

parent c610a4f3
......@@ -170,7 +170,7 @@ public class SalaryAccountUtil implements Serializable {
}
if (SalaryConstants.RELAY_SALARY_JAVA.equals(scs.getJavaFiedName())) {
try {
relaySalary = new BigDecimal(cellValueStr);
relaySalary = new BigDecimal(cellValueStr.replace(",",""));
sai = new TSalaryAccountItemVo();
sai.setCnName(dbFiedName);
sai.setJavaFiedName(scs.getJavaFiedName());
......@@ -186,7 +186,7 @@ public class SalaryAccountUtil implements Serializable {
}
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(scs.getJavaFiedName())) {
try {
actualSalarySum = new BigDecimal(cellValueStr);
actualSalarySum = new BigDecimal(cellValueStr.replace(",",""));
entity.setActualSalary(actualSalarySum);
} catch (Exception e) {
errorFlag = false;
......@@ -196,12 +196,13 @@ public class SalaryAccountUtil implements Serializable {
}
}
if (SalaryConstants.PDEDUCTION_JAVA.equals(scs.getJavaFiedName())
|| SalaryConstants.UDEDUCTION_JAVA.equals(scs.getJavaFiedName())) {
|| SalaryConstants.UDEDUCTION_JAVA.equals(scs.getJavaFiedName())
|| scs.getJavaFiedName().contains(SalaryConstants.WITHHOLIDING)) {
try {
new BigDecimal(cellValueStr);
new BigDecimal(cellValueStr.replace(",",""));
} catch (Exception ex) {
errorFlag = false;
error = "第" + (i + 2) + "行:个人、单位代扣,只能是金额!";
error = "第" + (i + 2) + "行:代扣 ,只能是金额!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
......@@ -247,7 +248,7 @@ public class SalaryAccountUtil implements Serializable {
sai.setIsTax(CommonConstants.ZERO_INT);
}
try {
cellValueBig = new BigDecimal(cellValueStr);
cellValueBig = new BigDecimal(cellValueStr.replace(",",""));
cellValueBig = cellValueBig.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入
if (cellValueBig.toString().length() > 11) {
if (cellValueBig.toString().length() > 500) {
......
......@@ -432,6 +432,9 @@ public class SalaryCommonUtil implements Serializable {
if (cellValueStr.indexOf('%') != -1) {
cellValueStr = cellValueStr.replace("%", "");
}
if (cellValueStr.indexOf(',') != -1) {
cellValueStr = cellValueStr.replace(",", "");
}
field.set(entity, BigDecimal.valueOf(Double.valueOf(cellValueStr)));
}
......@@ -518,26 +521,4 @@ public class SalaryCommonUtil implements Serializable {
entity.setFormType(salaryType);
}
/**
* @Description: 简单的Set转化为String
* @Author: hgw
* @Date: 2022-1-11 11:16:50
* @return: java.lang.String
**/
public static String setToStrEasy(Set<String> strSet) {
String result = "";
if (strSet != null && !strSet.isEmpty()) {
int i = 0;
for (String str : strSet) {
if (i == 0) {
result = str;
} else {
result = result.concat(",").concat(str);
}
i++;
}
}
return result;
}
}
......@@ -154,6 +154,8 @@ public class SalaryConstants {
public static final String IS_PERSON = "个人承担全部税费";
//个人代扣
public static final String PDEDUCTION_JAVA = "pdeduction";
// 代扣前缀
public static final String WITHHOLIDING = "withholiding";
//单位代扣
public static final String UDEDUCTION_JAVA = "udeduction";
//免个税个人代扣
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment