Commit ff973d2d authored by hongguangwu's avatar hongguangwu

优化sonar

parent d9a0036b
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.service.SalaryUploadService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryDetailVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -46,23 +40,9 @@ public class SalaryUploadController {
@Operation(description = "上传:jsonString:表格json;settleDepart:结算主体id;configId:工资配置结算月等信息的id;salaryType:工资类型")
@SysLog("上传薪资表")
@PostMapping("/upload")
public R upload(@RequestBody String jsonString, @RequestParam String settleDepart, @RequestParam(required = false) String configId
public R<List<ErrorMessage>> upload(@RequestBody String jsonString, @RequestParam String settleDepart, @RequestParam(required = false) String configId
, @RequestParam String salaryType, @RequestParam(required = false) String orderId) {
return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType,orderId);
}
/**
* @param savList 工资表volist
* @Description: 保存并提交报账表
* @Author: hgw
* @Date: 2019/9/18 18:17
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Operation(description = "保存并提交")
@SysLog("保存并提交薪资表")
@PostMapping("/saveAndSubmit")
public R saveAndSubmit(@RequestBody List<TSalaryAccountVo> savList, @RequestParam(required = false)String orderId) {
return salaryUploadService.saveAndSubmit(savList,orderId);
return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType, orderId);
}
@Operation(description = "打开结算单")
......@@ -72,11 +52,4 @@ public class SalaryUploadController {
return salaryUploadService.getBill(salaryFormId);
}
@Operation(description = "获取缴费库-测试使用")
@SysLog("获取缴费库-测试使用")
@PostMapping("/getForecast")
public List<TPaymentBySalaryVo> openBill(@RequestParam String deptId, @RequestParam String createMonth) {
return salaryUploadService.getForecast(deptId, createMonth);
}
}
package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryDetailVo;
import java.util.List;
......@@ -26,20 +25,8 @@ public interface SalaryUploadService extends IService<TSalaryStandard> {
* @Date: 2019/9/4 15:58
* @return: com.yifu.cloud.v1.common.core.util.R
**/
R salaryUpload(String jsonString, String settleDepart, String configId, String formType, String orderId);
/**
* @param savList
* @param orderId
* @Description: 保存并提交报账表
* @Author: hgw
* @Date: 2019/9/18 18:42
* @return: com.yifu.cloud.v1.common.core.util.R
**/
R<String> saveAndSubmit(List<TSalaryAccountVo> savList, String orderId);
R<List<ErrorMessage>> salaryUpload(String jsonString, String settleDepart, String configId, String formType, String orderId);
R<TSalaryDetailVo> getBill(String salaryFormId);
List<TPaymentBySalaryVo> getForecast(String deptId, String createMonth);
}
......@@ -29,8 +29,6 @@ import java.math.BigDecimal;
import java.net.URLDecoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 标准薪酬工资表
......@@ -81,18 +79,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
private final TApprovalRecordService auditLogService;
@Override
public List<TPaymentBySalaryVo> getForecast(String deptId, String createMonth) {
TPaymentBySalaryVo forecast = new TPaymentBySalaryVo();
forecast.setSettleDomainId(deptId);
forecast.setSocialCreateMonth(createMonth);
R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) {
return tPaymentVoR.getData().getPaymentList();
}
return null;
}
/**
* @param jsonString 客户原表数据
* repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
......@@ -103,7 +89,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Override
public R salaryUpload(String jsonString, String settleDepart, String configId, String salaryType, String orderId) {
public R<List<ErrorMessage>> salaryUpload(String jsonString, String settleDepart, String configId, String salaryType, String orderId) {
if (Common.isNotNull(jsonString) && Common.isNotNull(settleDepart) && Common.isNotNull(salaryType)) {
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
......@@ -162,8 +148,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
TSalaryEmployee es;//筛选人员,添加判断:非在职,或开户行为空,或 结算主体等于选择的结算主体且在职,都可以存入Map优先备用
for (TSalaryEmployee e : empList) {
es = empIdCardMap.get(e.getEmpIdcard());
if (es == null || CommonConstants.ZERO_STRING != es.getFileStatus() || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_STRING == e.getFileStatus()
if (es == null || !CommonConstants.ZERO_STRING.equals(es.getFileStatus()) || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_STRING.equals(e.getFileStatus())
&& Common.isNotNull(e.getBankName()))) {
empIdCardMap.put(e.getEmpIdcard(), e);
empNameMap.put(e.getEmpName().replace(" ", ""), e);
......@@ -185,11 +171,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<String> checkListY = new ArrayList<>();
// 劳务费和稿酬 薪资类型互斥校验Map格式:本年度#身份证号
if (CommonConstants.THREE_STRING.equals(salaryType) || CommonConstants.FOUR_STRING.equals(salaryType)) {
if (Common.isNotNull(configSalary)) {
if ((CommonConstants.THREE_STRING.equals(salaryType) || CommonConstants.FOUR_STRING.equals(salaryType)) && Common.isNotNull(configSalary)) {
checkListY = tSalaryAccountService.getAccountYearCheckMap();
}
}
util1.getJsonStringToList(user, jsonString, dept, configSalary, salaryConfigMap, isMustMap,
empIdCardMap, empNameMap, isDuplicateName, salaryType, checkListY, invoiceTitle,
......@@ -207,14 +191,13 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
//劳务费和稿酬导入
if (CommonConstants.THREE_STRING.equals(salaryType) || CommonConstants.FOUR_STRING.equals(salaryType)) {
return this.saveLaborSubmit(saList, dept, salaryType,orderId);
return this.saveLaborSubmit(saList, dept, salaryType, orderId);
}
} else {
return R.failed("导入数据不可为空");
}
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
return R.failed("数据导入解析失败!");
}
......@@ -242,17 +225,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return result.toString();
}
// 判断一个字符串是否含有数字
public static boolean HasNumber(String content) {
boolean flag = false;
Pattern p = Pattern.compile(".*\\d+.*");
Matcher m = p.matcher(content);
if (m.matches()) {
flag = true;
}
return flag;
}
/**
* @param sav 报账表vo
* @param dept 结算主体
......@@ -313,12 +285,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Date: 2019/9/20 17:05
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Override
public R saveAndSubmit(List<TSalaryAccountVo> savList, String orderId) {
private R saveAndSubmit(List<TSalaryAccountVo> savList, String orderId) {
if (Common.isNotNull(savList) && !savList.isEmpty()) {
TSalaryAccountVo salaryAccountVo = savList.get(0);
List<TSalaryAccountItem> saiList = null; //报账明细List
TSalaryAccountItem sai = null; //报账明细
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", salaryAccountVo.getDeptId(), TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
//结算主体
......@@ -377,7 +347,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//设置订单号 20220831
salary.setOrderId(orderId);
// 薪资核心导入代码
return this.doCoreSalary(savList, salaryAccountVo, saiList, sai, dept, invoiceTitle, user, nowTime, salary, isActual);
return this.doCoreSalary(savList, salaryAccountVo, saiList, dept, invoiceTitle, user, nowTime, salary, isActual);
} catch (Exception e) {
lockUpdate = new TSalaryLock();
lockUpdate.setId(lock.getId());
......@@ -409,7 +379,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
**/
@Transactional
public R doCoreSalary(List<TSalaryAccountVo> savList, TSalaryAccountVo salaryAccountVo
, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai, TSettleDomainSelectVo dept
, List<TSalaryAccountItem> saiList, TSettleDomainSelectVo dept
, String invoiceTitle, YifuUser user, LocalDateTime nowTime, TSalaryStandard salary
, boolean isActual) {
// 社保类型0:缴费库;1:预估库
......@@ -557,6 +527,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if ("3".equals(salaryAccountVo.getFormType())) {
isLabor = true;
}
TSalaryAccountItem sai;
for (int i = CommonConstants.ZERO_INT; i < size; i++) {
modelPersonSocialFlag = true;
modelPersonFundFlag = true;
......@@ -637,12 +608,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
a.setIsDeductSocial(SalaryConstants.IS_DEDUCT_ONE);
//社保公积金金额扣缴: true : 从库里扣除社保等;false : 走代扣
if (modelPersonSocialFlag) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_SOCIAL,
personalDebt = personalDebt.add(this.saveNewItems(saiList, SalaryConstants.PERSONAL_SOCIAL,
SalaryConstants.PERSONAL_SOCIAL_JAVA,
this.getSocialOrFundMoneyForForecast(socialType, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT));
}
if (modelUnitSocialFlag) {
this.saveNewItems(sai, saiList, SalaryConstants.UNIT_SOCIAL,
this.saveNewItems(saiList, SalaryConstants.UNIT_SOCIAL,
SalaryConstants.UNIT_SOCIAL_JAVA,
this.getSocialOrFundMoneyForForecast(socialType, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT);
}
......@@ -651,12 +622,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
a.setFundType(fundType);
a.setIsDeductFund(SalaryConstants.IS_DEDUCT_ONE);
if (modelPersonFundFlag) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_FUND,
personalDebt = personalDebt.add(this.saveNewItems(saiList, SalaryConstants.PERSONAL_FUND,
SalaryConstants.PERSONAL_FUND_JAVA,
this.getSocialOrFundMoneyForForecast(fundType, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT));
}
if (modelUnitFundFlag) {
this.saveNewItems(sai, saiList, SalaryConstants.UNIT_FUND,
this.saveNewItems(saiList, SalaryConstants.UNIT_FUND,
SalaryConstants.UNIT_FUND_JAVA,
this.getSocialOrFundMoneyForForecast(fundType, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT);
}
......@@ -677,32 +648,32 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
preSupply = preSupply.add(saips.getSalaryMoney());
}
if (preSupply.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL) {
this.saveNewItems(sai, saiList, SalaryConstants.PRE_CURRENT_SUPPLY,
this.saveNewItems(saiList, SalaryConstants.PRE_CURRENT_SUPPLY,
SalaryConstants.PRE_CURRENT_SUPPLY_JAVA, preSupply, CommonConstants.ZERO_INT);
}
//专项信息
sds = sdsMap.get(a.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + invoiceTitle);
if (sds != null && Common.isNotNull(sds.getId())) {
//累计子女教育
sdSum = sdSum.add(this.saveNewItems(sai, saiList, SalaryConstants.SUM_CHILD_EDU_MONEY,
sdSum = sdSum.add(this.saveNewItems(saiList, SalaryConstants.SUM_CHILD_EDU_MONEY,
SalaryConstants.SUM_CHILD_EDU_MONEY_JAVA, sds.getSumChildEduMoney(), CommonConstants.ZERO_INT));
//累计住房贷款利息
sdSum = sdSum.add(this.saveNewItems(sai, saiList, SalaryConstants.SUM_HOUSING_LOAN_MONEY,
sdSum = sdSum.add(this.saveNewItems(saiList, SalaryConstants.SUM_HOUSING_LOAN_MONEY,
SalaryConstants.SUM_HOUSING_LOAN_MONEY_JAVA, sds.getSumHousingLoanMoney(), CommonConstants.ZERO_INT));
//累计住房租金
sdSum = sdSum.add(this.saveNewItems(sai, saiList, SalaryConstants.SUM_HOUSING_RENT_MONEY,
sdSum = sdSum.add(this.saveNewItems(saiList, SalaryConstants.SUM_HOUSING_RENT_MONEY,
SalaryConstants.SUM_HOUSING_RENT_MONEY_JAVA, sds.getSumHousingRentMoney(), CommonConstants.ZERO_INT));
//累计赡养老人
sdSum = sdSum.add(this.saveNewItems(sai, saiList, SalaryConstants.SUM_SUPPORT_ELDERLY_MONEY,
sdSum = sdSum.add(this.saveNewItems(saiList, SalaryConstants.SUM_SUPPORT_ELDERLY_MONEY,
SalaryConstants.SUM_SUPPORT_ELDERLY_MONEY_JAVA, sds.getSumSupportElderlyMoney(), CommonConstants.ZERO_INT));
//累计继续教育
sdSum = sdSum.add(this.saveNewItems(sai, saiList, SalaryConstants.SUM_CONTINUING_EDUCATION_MONEY,
sdSum = sdSum.add(this.saveNewItems(saiList, SalaryConstants.SUM_CONTINUING_EDUCATION_MONEY,
SalaryConstants.SUM_CONTINUING_EDUCATION_MONEY_JAVA, sds.getSumContinuingEducationMoney(), CommonConstants.ZERO_INT));
//累计婴幼儿照护费用
sdSum = sdSum.add(this.saveNewItems(sai, saiList, SalaryConstants.SUM_BABY_MONEY,
sdSum = sdSum.add(this.saveNewItems(saiList, SalaryConstants.SUM_BABY_MONEY,
SalaryConstants.SUM_BABY_MONEY_JAVA, sds.getSumBabyMoney(), CommonConstants.ZERO_INT));
//累计专项扣除总额
this.saveNewItems(sai, saiList, SalaryConstants.SPECIAL_DEDU_MONEY_SUM,
this.saveNewItems(saiList, SalaryConstants.SPECIAL_DEDU_MONEY_SUM,
SalaryConstants.SPECIAL_DEDU_MONEY_SUM_JAVA, sdSum, CommonConstants.ZERO_INT);
}
//累计扣税list
......@@ -724,20 +695,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (!yearEndError) {
yearEndError = true;
}
errorInfo.add(new ErrorMessage((i + 2), a.getEmpIdcard()+"年终奖重复发放"));
errorInfo.add(new ErrorMessage((i + 2), a.getEmpIdcard() + "年终奖重复发放"));
} else {
//年终奖优化方案 2:自动计算
if (CommonConstants.TWO_STRING.equals(checkYearFinalStyle)) {
checkYearFinalStyle = checkYearFinalStyle(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary, annualBonus, annousTax, a);
checkYearFinalStyle = checkYearFinalStyle(isActual, asList, sdSum
, costReduction, personTax, saiList, annualBonus, annousTax, a);
}
//年终奖单独扣税
if (CommonConstants.ONE_STRING.equals(checkYearFinalStyle)) {
if (!isActual) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.ANNUAL_BONUS_TAX,
personalDebt = personalDebt.add(this.saveNewItems(saiList, SalaryConstants.ANNUAL_BONUS_TAX,
SalaryConstants.ANNUAL_BONUS_TAX_JAVA, calculation2FinalSalary(annualBonus, annousTax), CommonConstants.ZERO_INT));
} else {
this.saveNewItems(sai, saiList, SalaryConstants.ANNUAL_BONUS_TAX,
this.saveNewItems(saiList, SalaryConstants.ANNUAL_BONUS_TAX,
SalaryConstants.ANNUAL_BONUS_TAX_JAVA, calculation2FinalSalary(annualBonus, annousTax), CommonConstants.ZERO_INT);
}
if (annousSai != null) {
......@@ -749,20 +720,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 薪资扣税 1:扣税
// 应发顺推个税
if (!isActual) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
personalDebt = personalDebt.add(this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculation2PersonSalary(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary, a), CommonConstants.ZERO_INT));
calculation2PersonSalary(isActual, saiList, asList, sdSum
, costReduction, personTax, saiList, a), CommonConstants.ZERO_INT));
} else {
// 实发倒推个税应发
if (!isLabor) {
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculation2PersonSalary(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary, a), CommonConstants.ZERO_INT);
calculation2PersonSalary(isActual, saiList, asList, sdSum
, costReduction, personTax, saiList, a), CommonConstants.ZERO_INT);
} else {
// 实发劳务费,按月累计扣税 2022-3-2 17:32:40 樊青青提的需求
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculation2Labor(saiList, asList
, saiList), CommonConstants.ZERO_INT);
......@@ -771,16 +742,16 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (!isActual) { //导入应发,顺推实发
// 个人实发合计
this.saveNewItems(sai, saiList, SalaryConstants.ACTUAL_SALARY_SUM,
this.saveNewItems(saiList, SalaryConstants.ACTUAL_SALARY_SUM,
SalaryConstants.ACTUAL_SALARY_SUM_JAVA,
calculation(a, relaySalary, saiList), CommonConstants.ZERO_INT);
}
if (relaySalary.compareTo(BigDecimal.ZERO) <=0) {
if (relaySalary.compareTo(BigDecimal.ZERO) <= 0) {
relaySalary = a.getRelaySalary();
}
//计算个人社保、公积金欠款————工资不够扣缴社保的
if (relaySalary.compareTo(personalDebt) == SalaryConstants.LESS_THAN) {
this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_DEBT,
if (relaySalary.compareTo(personalDebt) < SalaryConstants.EQUAL) {
this.saveNewItems(saiList, SalaryConstants.PERSONAL_DEBT,
SalaryConstants.PERSONAL_DEBT_JAVA, relaySalary.subtract(personalDebt), CommonConstants.ZERO_INT);
}
a.setSaiList(saiList);
......@@ -1028,13 +999,13 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
**/
private static BigDecimal calculation2FinalSalary(BigDecimal yearFinal, List<TSalaryTaxConfig> annousTax) {
//年终奖
if (yearFinal != null && yearFinal.compareTo(SalaryConstants.B_ZERO) == SalaryConstants.MORE_THAN
if (yearFinal != null && yearFinal.compareTo(SalaryConstants.B_ZERO) > SalaryConstants.EQUAL
&& annousTax != null && annousTax.size() > CommonConstants.ZERO_INT) {
BigDecimal month = yearFinal.divide(SalaryConstants.B_TWELVE, SalaryConstants.TAX_FEE_PLACES, BigDecimal.ROUND_HALF_UP);
// 应纳税额
for (TSalaryTaxConfig sub : annousTax) {
if (month.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
&& month.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
if (month.compareTo(sub.getMinIncome()) > SalaryConstants.EQUAL
&& month.compareTo(sub.getMaxIncome()) <= SalaryConstants.EQUAL) {
return yearFinal.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.TAX_FEE_PLACES, BigDecimal.ROUND_HALF_UP))
.subtract(sub.getQuickDeducation());
......@@ -1045,7 +1016,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
/**
* @param sai 报账明细
* @param saiList 报账明细list
* @param cnName 中文名-表头名
* @param javaName 属性
......@@ -1056,9 +1026,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Date: 2019/9/30 17:02
* @return: java.math.BigDecimal - 报账明细金额
**/
private BigDecimal saveNewItems(TSalaryAccountItem sai, List<TSalaryAccountItem> saiList,
private BigDecimal saveNewItems(List<TSalaryAccountItem> saiList,
String cnName, String javaName, BigDecimal money, Integer isTax) {
sai = new TSalaryAccountItem();
TSalaryAccountItem sai = new TSalaryAccountItem();
sai.setCnName(cnName);
sai.setJavaFiedName(javaName);
if (money == null) {
......@@ -1092,7 +1062,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal money = SalaryConstants.B_ZERO;
BigDecimal sub = SalaryConstants.B_ZERO;
if (isSocial && deptSet.getUnitSeriousIllnessProp() != null
&& deptSet.getUnitSeriousIllnessProp().compareTo(SalaryConstants.B_ONEHUNDRED) == SalaryConstants.LESS_THAN) {
&& deptSet.getUnitSeriousIllnessProp().compareTo(SalaryConstants.B_ONEHUNDRED) < SalaryConstants.EQUAL) {
sub = (new BigDecimal("100").subtract(deptSet.getUnitSeriousIllnessProp()))
.divide(SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
}
......@@ -1152,53 +1122,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return money;
}
/**
* @param noSalaryEstmateList 无工资人员-预估库数据列表
* @param money 金额
* @param isSocial true:社保 false:公积金
* @param isPerson true:个人 false:单位
* @param noSalarySocialList 预估库id,社保list
* @param noSalaryFundList 预估库id,公积金list
* @Description: 无工资人员社保、公积金信息
* @Author: hgw
* @Date: 2019/9/26 16:39
* @return: java.math.BigDecimal
**/
public BigDecimal getNoSalarySocialOrFundMoneyForForecast(List<TPaymentBySalaryVo> noSalaryEstmateList
, BigDecimal money, boolean isSocial, boolean isPerson, Set<String> noSalarySocialList, Set<String> noSalaryFundList) {
money = SalaryConstants.B_ZERO;
if (noSalaryEstmateList != null && noSalaryEstmateList.size() > CommonConstants.ZERO_INT) {
money = money.setScale(2, BigDecimal.ROUND_HALF_UP);
for (TPaymentBySalaryVo m : noSalaryEstmateList) {
//社保
if (isSocial && (!Common.isNotNull(m.getSalarySocialFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalarySocialFlag()))) {
if (isPerson && m.getPersonalSocialSum() != null) {
money = money.add(m.getPersonalSocialSum());
}
if (!isPerson && m.getUnitSocialSum() != null) {
money = money.add(m.getUnitSocialSum());
}
noSalarySocialList.add(m.getId());
}
//公积金
if (!isSocial && (!Common.isNotNull(m.getSalaryFundFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalaryFundFlag()))) {
if (isPerson && m.getPersonalFundSum() != null) {
money = money.add(m.getPersonalFundSum());
}
if (!isPerson && m.getUnitFundSum() != null) {
money = money.add(m.getUnitFundSum());
}
noSalaryFundList.add(m.getId());
}
}
}
return money;
}
/**
* @param isActual false:有应发顺推;true:有实发,倒推应发
* @param itemList 本次报账金额
* @param checkYearFinalStyle //薪资和年终奖扣税方案(0:合并(默认);1:单独)
* @param itemHistoryList 历史报账金额
* @param specialDeductionSum 专项信息
* @param costReduction 减除费用
......@@ -1209,9 +1135,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @return: java.math.BigDecimal
**/
private static BigDecimal calculation2PersonSalary(boolean isActual, List<TSalaryAccountItem> itemList
, String checkYearFinalStyle, List<TSalaryAccountItem> itemHistoryList, BigDecimal specialDeductionSum
, BigDecimal costReduction, List<TSalaryTaxConfig> subs, TSalaryAccountItem sai
, List<TSalaryAccountItem> saiList, BigDecimal relaySalary, TSalaryAccount a) {
, List<TSalaryAccountItem> itemHistoryList, BigDecimal specialDeductionSum
, BigDecimal costReduction, List<TSalaryTaxConfig> subs, List<TSalaryAccountItem> saiList, TSalaryAccount a) {
//本次纳税额
BigDecimal res = SalaryConstants.B_ZERO;
BigDecimal annualBonus = SalaryConstants.B_ZERO;
......@@ -1270,9 +1195,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
if (!isActual) {
for (TSalaryTaxConfig sub : subs) {
if (res.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
&& res.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
//res = realDeduSalary * ((double) ((sub.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
if (res.compareTo(sub.getMinIncome()) > SalaryConstants.EQUAL
&& res.compareTo(sub.getMaxIncome()) <= SalaryConstants.EQUAL) {
//res = realDeduSalary * ((double) ((sub.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick()
res = res.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP))
.subtract(sumTax).subtract(sub.getQuickDeducation());// 应纳税额
......@@ -1287,6 +1212,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// (历史应发)
// =
// 本次应发
TSalaryAccountItem sai;
BigDecimal relaySalary;
for (TSalaryTaxConfig sub : subs) {
//res = realDeduSalary / (1- (double) ((sub.getTaxRate() * 1.0) / 100))
// - (sub.getQuick()/ (1- (double) ((sub.getTaxRate() * 1.0) / 100)))
......@@ -1297,11 +1224,11 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)), SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP))
.add(addRelaySalary);
testArea = res.subtract(costReduction);
if (testArea.compareTo(SalaryConstants.B_ZERO) == SalaryConstants.LESS_THAN) {
if (testArea.compareTo(SalaryConstants.B_ZERO) < SalaryConstants.EQUAL) {
testArea = SalaryConstants.B_ZERO;
}
if (testArea.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
&& testArea.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
if (testArea.compareTo(sub.getMinIncome()) > SalaryConstants.EQUAL
&& testArea.compareTo(sub.getMaxIncome()) <= SalaryConstants.EQUAL) {
//res = res - realSalary - tf.getActualSalarySum(); //应发-历史应发=本次应发;本次应发-本次实发=税
relaySalary = res.subtract(realSalaryHistory);
res = relaySalary.subtract(actualSalarySumNow);
......@@ -1310,7 +1237,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
sai.setCnName(SalaryConstants.RELAY_SALARY);
sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA);
sai.setIsTax(CommonConstants.ZERO_INT);
if (res.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.MORE_THAN) {
if (res.compareTo(SalaryConstants.B_ZERO) <= SalaryConstants.EQUAL) {
sai.setSalaryMoney(actualSalarySumNow);
a.setRelaySalary(actualSalarySumNow);
} else {
......@@ -1322,7 +1249,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
}
if (res.compareTo(SalaryConstants.B_ZERO) == SalaryConstants.LESS_THAN) {
if (res.compareTo(SalaryConstants.B_ZERO) < SalaryConstants.EQUAL) {
return SalaryConstants.B_ZERO;
}
res = res.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
......@@ -1412,15 +1339,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @createDate 2020-4-22 18:59:02
* @author hgw
*/
public static String checkYearFinalStyle(boolean isActual, List<TSalaryAccountItem> itemList
, String checkYearFinalStyle, List<TSalaryAccountItem> asList, BigDecimal sdSum
, BigDecimal costReduction, List<TSalaryTaxConfig> personTax, TSalaryAccountItem sai
, List<TSalaryAccountItem> saiList, BigDecimal relaySalary, BigDecimal annualBonus
public static String checkYearFinalStyle(boolean isActual, List<TSalaryAccountItem> asList, BigDecimal sdSum
, BigDecimal costReduction, List<TSalaryTaxConfig> personTax
, List<TSalaryAccountItem> saiList, BigDecimal annualBonus
, List<TSalaryTaxConfig> annousTax, TSalaryAccount a) {
BigDecimal finalSalaryWithSalary = calculation2PersonSalary(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary, a);
BigDecimal finalSalaryWithSalary = calculation2PersonSalary(isActual, saiList, asList, sdSum
, costReduction, personTax, saiList, a);
BigDecimal finalSalaryNoSalary = calculation2FinalSalary(annualBonus, annousTax);
if (finalSalaryWithSalary.compareTo(finalSalaryNoSalary) == SalaryConstants.MORE_THAN) {
if (finalSalaryWithSalary.compareTo(finalSalaryNoSalary) > SalaryConstants.EQUAL) {
return "1";
}
return "0";
......@@ -1484,7 +1410,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (Common.isNotNull(savList) && !savList.isEmpty()) {
TSalaryAccountVo salaryAccountVo = savList.get(0);
List<TSalaryAccountItem> saiList = null; //报账明细List
TSalaryAccountItem sai = null; //报账明细
YifuUser user = SecurityUtils.getUser();
TSalaryStandard salary;
LocalDateTime nowTime = LocalDateTime.now();
......@@ -1521,9 +1446,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
try {
// 薪资核心导入代码
if (CommonConstants.THREE_STRING.equals(salaryType)) {
return this.doLaborCoreSalary(savList, saiList, sai, dept, invoiceTitle, salary, user);
return this.doLaborCoreSalary(savList, saiList, dept, invoiceTitle, salary, user);
} else {
return this.doRemuCoreSalary(savList, saiList, sai, dept, invoiceTitle, salary, user);
return this.doRemuCoreSalary(savList, saiList, dept, salary, user);
}
} catch (Exception e) {
lockUpdate = new TSalaryLock();
......@@ -1554,15 +1479,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Author: huyc
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public R doLaborCoreSalary(List<TSalaryAccountVo> savList, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai,
public R doLaborCoreSalary(List<TSalaryAccountVo> savList, List<TSalaryAccountItem> saiList,
TSettleDomainSelectVo dept, String invoiceTitle, TSalaryStandard salary, YifuUser user) {
List<TSalaryAccount> aList = new ArrayList<>();
TSalaryAccount a;//定库:
BigDecimal money = new BigDecimal(CommonConstants.ZERO_STRING); //初始化金额备用
BigDecimal relaySalarySum = BigDecimal.ZERO; //工资应发
List<TSalaryAccountItem> asList; //累计扣税
// 历史个税合计
BigDecimal sumTax = BigDecimal.ZERO;
int size = savList.size();
// 自有员工人数
int ownNum = 0;
......@@ -1584,6 +1506,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 工资查询所需的全部list,组装Map来使用
Map<String, List<TSalaryAccountItem>> itemMap = tSalaryAccountItemService.getAllItemVoList(idCardList, invoiceTitle);
TSalaryAccountItem sai;
for (int i = CommonConstants.ZERO_INT; i < size; i++) {
a = new TSalaryAccount();
// 本次实发
......@@ -1617,7 +1540,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
asList = this.getLaborAsList(itemMap.get(a.getEmpIdcard()), a.getSettlementMonth());
// 实发劳务费,按月累计扣税
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculationLabor(saiList, asList
, saiList, a), CommonConstants.ZERO_INT);
......@@ -1704,7 +1627,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 本次实发
BigDecimal actualSalarySumNow = BigDecimal.ZERO;
// 当月累计应发合计
BigDecimal actualSalarySumT = BigDecimal.ZERO;
BigDecimal actualSalarySumT;
// 当月实发合计
BigDecimal actualSalarySum = BigDecimal.ZERO;
// 历史个税合计
......@@ -1731,9 +1654,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
//个人承担部分税费
BigDecimal nowTaxT = BigDecimal.ZERO;
BigDecimal nowTaxT;
//个人不承担部分税费
BigDecimal nowTaxY = BigDecimal.ZERO;
BigDecimal nowTaxY;
BigDecimal relaySalary;
BigDecimal salaryTax = BigDecimal.ZERO;
if (CommonConstants.ONE_STRING.equals(a.getIsPersonTax())) {
......@@ -1754,7 +1677,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
a.setSalaryTaxUnit(nowTaxT);
a.setActualSalary(BigDecimalUtils.safeSubtract(actualSalarySumNow, salaryTax));
} else {
nowTaxT = getNowTax(actualSalarySumNow);
getNowTax(actualSalarySumNow);
nowTaxY = getNowTax(actualSalarySum);
a.setActualSalary(actualSalarySumNow);
if (sumTax.compareTo(BigDecimal.ZERO) != 0) {
......@@ -1831,8 +1754,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Author: huyc
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public R doRemuCoreSalary(List<TSalaryAccountVo> savList, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai,
TSettleDomainSelectVo dept, String invoiceTitle, TSalaryStandard salary, YifuUser user) {
public R doRemuCoreSalary(List<TSalaryAccountVo> savList, List<TSalaryAccountItem> saiList,
TSettleDomainSelectVo dept, TSalaryStandard salary, YifuUser user) {
List<TSalaryAccount> aList = new ArrayList<>();
TSalaryAccount a;//定库:
BigDecimal relaySalarySum = BigDecimal.ZERO; //工资应发
......@@ -1852,10 +1775,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
idCardList.add(vo.getEmpIdcard());
}
}
// 工资查询所需的全部list,组装Map来使用
Map<String, List<TSalaryAccountItem>> itemMap = tSalaryAccountItemService.getAllItemVoList(idCardList, invoiceTitle);
TSalaryAccountItem sai;
for (int i = CommonConstants.ZERO_INT; i < size; i++) {
a = new TSalaryAccount();
// 本次实发
......@@ -1886,7 +1806,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
// 实发稿酬,按月累计扣税
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
this.saveNewItems(saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculationRemu(saiList, saiList, a), CommonConstants.ZERO_INT);
......@@ -1967,8 +1887,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
TSalaryAccount a) {
// 本次实发
BigDecimal actualSalarySumNow = BigDecimal.ZERO;
// 历史个税合计
BigDecimal sumTax = BigDecimal.ZERO;
// 本次实发
for (TSalaryAccountItem item : itemList) {
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
......@@ -1976,10 +1894,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
//个人税费
BigDecimal nowTaxT = BigDecimal.ZERO;
BigDecimal nowTaxT = getNowTaxRemu(actualSalarySumNow);
BigDecimal relaySalary;
nowTaxT = getNowTaxRemu(actualSalarySumNow);
relaySalary = BigDecimalUtils.safeSubtract(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
a.setSalaryTax(nowTaxT);
a.setActualSalary(relaySalary);
......
......@@ -65,7 +65,7 @@ public class SalaryAccountUtil implements Serializable {
public void getJsonStringToList(YifuUser user, String jsonStr, TSettleDomainSelectVo dept
, TConfigSalary configSalary, Map<String, TSalaryConfigStandard> salaryConfigMap, Map<String, Boolean> isMustMap
, Map<String, TSalaryEmployee> empIdCardMap, Map<String, TSalaryEmployee> empNameMap, boolean isDuplicateName
, String salaryType, List<String> checkListY,String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, String salaryType, List<String> checkListY, String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, Map<String, Integer> checkMap, Map<String, BigDecimal> specialMap, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService) {
List<TSalaryAccountVo> tList = new ArrayList<>();
......@@ -92,7 +92,7 @@ public class SalaryAccountUtil implements Serializable {
}
String error; //校验字段是否符合要求 返回错误信息
TSalaryAccountVo entity; // 从第1行开始取数据
HashMap temp; // 得到一行中的所有单元格对象.
HashMap<String, Object> temp; // 得到一行中的所有单元格对象.
ExcelAttribute attr; //获取属性对应的注解属性
Object cellValueObj; //单元格值
String cellValueStr; //单元格字符串值
......@@ -132,7 +132,6 @@ public class SalaryAccountUtil implements Serializable {
boolean annualBonusFlag;
for (int i = 0; i < rows; i++) {
annualBonusFlag = false;
error = "";
errorFlag = true;
temp = list.get(i);
entity = new TSalaryAccountVo();
......@@ -283,7 +282,6 @@ public class SalaryAccountUtil implements Serializable {
if (null != error) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
}
}
......@@ -580,22 +578,22 @@ public class SalaryAccountUtil implements Serializable {
entity.setEmpPhone(emp.getEmpPhone());
if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle) && salaryGiveTimeFlag) {
if (Common.isEmpty(emp.getBankName())) {
error = "第" + (i + 2) + "行:员工:" + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!";
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
if (Common.isEmpty(emp.getBankNo())) {
error = "第" + (i + 2) + "行:员工:" + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请去薪酬人员查询处更新!";
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
if (Common.isEmpty(emp.getBankProvince())) {
error = "第" + (i + 2) + "行:员工:" + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请去薪酬人员查询处更新!";
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
if (Common.isEmpty(emp.getBankCity())) {
error = "第" + (i + 2) + "行:员工:" + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请去薪酬人员查询处更新!";
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
......@@ -746,7 +744,7 @@ public class SalaryAccountUtil implements Serializable {
* @param hashMap
* @return
*/
private static Object getFieldValueByName(String fieldName, HashMap hashMap) {
private static Object getFieldValueByName(String fieldName, HashMap<String, Object> hashMap) {
try {
return hashMap.get(fieldName);
} catch (Exception e) {
......@@ -826,7 +824,7 @@ public class SalaryAccountUtil implements Serializable {
//最小值校验
if (attr.min() > 0) {
if (Common.isNumber(c)) {
if (Integer.valueOf(c).intValue() > attr.maxLength()) {
if (Integer.parseInt(c) > attr.maxLength()) {
return errorInfo(attr, "_小于最小值", i);
}
} else {
......
......@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.salary.util;
import java.math.BigDecimal;
public class SalaryConstants {
private SalaryConstants() {
}
//cellValueBig.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入
//在使用BigDecmial进行比较的时候不能使用equals与==比较了,需要使用compareTo()进行比较
//if ( temp1.compareTo(temp2)==0)
......@@ -13,19 +15,6 @@ public class SalaryConstants {
//减法 - bigDecimal1.subtract(bigDecimal2)
//乘法 x bigDecimal1.multiply(bigDecimal2)
//除法 / bigDecimal1.divide(bigDecimal2)
// 项目报销的 数据来源:0企业微信;1固资划转
public static final Integer[] DATA_SOURCE = {0,1};
// 保存类型:0:保存;1不保存
public static final Integer[] SAVE_TYPE = {0,1};
//应发工资、年终奖、薪资扣税、年终奖扣税、个人社保扣缴、代扣个人社保、个人公积金扣缴、代扣个人公积金、年个税个人代扣、企业年金、专项扣除、减除费用、实发工资
public static final String[] ACCOUNT_SORT = {"应发工资", "年终奖", "个税", "年终奖单独扣税", "个人社保", "代扣个人社保"
, "个人公积金", "代扣个人公积金", "免个税个人代扣", "企业(职业)年金", "累计专项扣除总额", "减除费用", "实发工资", "个人实发合计"};
//通用身份证号长度
public static final int idCardLength = 18;
public static final String NON_TAX = "非扣税项";
/*
* @Description: 0待提交1待审核 3待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印
* @Author: hgw
......@@ -35,57 +24,18 @@ public class SalaryConstants {
public static final Integer[] AUDIT_STATUS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
public static final int[] STATUS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
public static final String[] AUDIT_STATUS_STRING = {"待提交", "待审核", "-", "待发放", "已发放", "审核不通过", "确认不通过", "财务退回", "结算单调整待审核", "结算单调整待打印"};
//发放失败-认领状态 0待认领1待出账2已发放3再次失败待认领
public static final Integer[] LOST_STATUS = {0, 1, 2, 3};
//申请垫付流程状态( 0:未申请 1已申请 2申请不通过 3申请已通过)
public static final Integer[] ADVANCE_STATUS = {0, 1, 2, 3};
//收入表(TIncomeTable)//来源类型(fromType):(1工资结算单/2代理预估单/3商险结算单/4一次性业务结算单/5其他收入)/6工程工资结算单/7纯收入
public static final Integer[] INCOME_TABLE_FROM_TYPE = {0, 1, 2, 3, 4, 5, 6, 7};
//发放失败关联报账类型:0工资;1工程工资 2:非扣税项3暂停发 4自定义暂停发
public static final Integer[] ACCOUNT_TYPE = {0, 1, 2, 3, 4};
//开票关联结算单类型:0普通工资/1工程工资/2商险/3预估结算单/4一次性业务结算单
public static final String[] INVOICE_TYPE = {"0", "1", "2", "3", "4"};
//开票审核状态(0待提交/1待审核/2审核通过/3审核不通过)
public static final String[] INVOICE_AUDITFLAG = {"0", "1", "2", "3"};
//开票状态(0待开票/1已开票)
public static final String[] INVOICE_STATUS = {"0", "1"};
//附件类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4薪资打印记录;5核准表打印记录;6:非扣税项 7发放失败 8自有员工附件 10换人换卡附件
public static final Integer[] LINK_TYPE = {0, 1, 2, 3, 4, 5, 6, 7, 8, 10};
//打印来源:0:工资结算单;1:工程结算单;2:暂停发发放记录;
public static final Integer[] PRINT_FROM_TYPE = {0, 1, 2};
//暂停发发放记录类型:0:工资暂停发;1:工程工资暂停发;2:普通自定义项暂停发 5:工程自定义项暂停发
public static final Integer[] TYPE_OF_CHARGE = {0, 1, 2, 3, 4, 5};
//工程文件类型:0三方协议;1委托付款函;2劳务费;3其他
public static final Integer[] ENGINEER_TYPE = {0, 1, 2, 3};
//发放状态 0: 未发放 1: 发放成功 2:发放失败
public static final String[] DISTRIBUTION_FLAG = {"0", "1", "2"};
//暂停发-发放状态 0: 待发放 1: 发放成功 2:发放失败;3:待审核4:审核退回 5失败待认领 6失败待发放 7失败已发放 8再次失败待认领9不发放
public static final Integer[] CHARGE_STATUS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
public static final String[] SALARY_FORM_TYPE = {"工资", "绩效", "其他", "劳务费", "", "", "", "非扣税项"};
//款项来源(0客户到款/1垫付)
public static final Integer[] MONEY_FROM = {0, 1};
//暂停发类型 0: 工资 1: 工程
public static final Integer[] PAUSE_TYPE = {0, 1};
//付款方式 0: 现金 1: 银行
public static final Integer[] SALARY_PAY_TYPE = {0, 1};
//所得税类型:0:工资;1:年终奖
public static final Integer[] SALARY_TAX_TYPE = {0, 1};
//小数位
public static final int PLACES = 2;
public static final int TAX_FEE_PLACES = 6;
public static final BigDecimal B_ZERO = new BigDecimal("0");
public static final BigDecimal B_ONE = new BigDecimal("1");
public static final BigDecimal B_TWELVE = new BigDecimal("12");
public static final BigDecimal B_ONEHUNDRED = new BigDecimal("100");
//小于
public static final int LESS_THAN = -1;
//等于
public static final int EQUAL = 0;
//大于
public static final int MORE_THAN = 1;
//模板列必填
public static final String IS_MUST = "1";
public static final String EMP_NAME = "姓名";
......@@ -93,16 +43,7 @@ public class SalaryConstants {
public static final String IS_NEW_EMPLOYEE = "是否新员工";
public static final String IS_NEW = "是";
public static final String ID_NUMBER = "身份证号";
public static final String CHECK_ID_NUMBER = "身份证号码";
public static final String SALARY_GIVE_TIME = "暂停发";
public static final String SOCIAL_CRATE_MONTH = "社保生成月份";
public static final String SOCIAL_MONTH = "社保缴纳月份";
public static final String FUND_CRATE_MONTH = "公积金生成月份";
public static final String FUND_MONTH = "公积金缴纳月份";
//结算主体-管理费项目
public static final String MANAGE_SERVER_ITEM = "MANAGE_SERVER_ITEM";
//结算主体-风险金项目
public static final String RISK_SERVER_ITEM = "RISK_SERVER_ITEM";
//暂停发
public static final String SALARY_GIVE_TIME_VALUE = "1";
//0:生成月;
......@@ -115,25 +56,14 @@ public class SalaryConstants {
public static final Integer DELETED = 1;
//扣缴(社保、公积金)
public static final String IS_DEDUCT_ONE = "1";
//扣缴(社保、公积金)int
public static final Integer IS_DEDUCT_ONE_INT = 1;
//社保
public static final Integer IS_SOCIAL_ZERO = 0;
//公积金
public static final Integer IS_FUND_ONE = 1;
//正常扣缴社保
public static final Integer NOT_IS_NO_SALARY_ZERO = 0;
//无工资人员扣缴社保
public static final Integer IS_NO_SALARY_ONE = 1;
public static final String CASH = "现金";
//工资发放方式-现金
public static final String SALARY_STYLE_CASH = "0";
//工资发放方式-银行
public static final String SALARY_STYLE_BANK = "1";
//工资发放方式-线下
public static final Integer SALARY_STYLE_OFFLINE = 2;
//发放方式 1: 银付 0.现金 2:线下
public static final Integer[] CHARGE_TYPE = {0, 1, 2};
public static final String COST_REDUCTION = "减除费用";
//减除费用
......@@ -153,8 +83,6 @@ public class SalaryConstants {
public static final String UNIT_FUND = "单位公积金";
public static final String PERSONAL_DEBT = "个人社保、公积金欠款";
public static final String PERSONAL_DEBT_JAVA = "personalDebt";
// 工程工资的叫法
public static final String ENG_SALARY_RELAY = "工资应发";
public static final String RELAY_SALARY = "应发工资";
//工资应发
public static final String RELAY_SALARY_JAVA = "relaySalary";
......@@ -166,12 +94,6 @@ public class SalaryConstants {
public static final String UNIT_SOCIAL_JAVA = "unitSocial";
//单位公积金
public static final String UNIT_FUND_JAVA = "unitFund";
//商险
public static final String TAKING_RISKS_JAVA = "takingRisks";
//单位待补足——报账表,计算的是个人社保、公积金欠款——PERSONAL_DEBT_JAVA
public static final String UNIT_SUPPLEMENT_JAVA = "unitSupplement";
//个人待补足
public static final String CURRENT_SUPPLY_JAVA = "currentSupply";
//年终奖
public static final String ANNUAL_BONUS_JAVA = "annualBonus";
// 年终奖扣税方式:0合并/1单独
......@@ -229,8 +151,6 @@ public class SalaryConstants {
public static final String EXEMPTION_PERSION_TAX_JAVA = "exemptionPersionTax";
//企业(职业)年金
public static final String ENTERPRISE_ANNUITY_JAVA = "enterpriseAnnuity";
//独保费
public static final String ONLY_CHILD_JAVA = "onlyChild";
//风险抵押金
public static final String RISK_MORTGAGE_MONEY_JAVA = "riskMortgageMoney";
//单位补足扣返
......@@ -241,47 +161,11 @@ public class SalaryConstants {
public static final String OTHER_MONEY_TWO_JAVA = "otherMoneyTwo";
//其他费用3
public static final String OTHER_MONEY_THREE_JAVA = "otherMoneyThree";
//个人社保卡费
public static final String PERSONAL_SOCIAL_CARD_JAVA = "personalSocialCard";
//单位社保卡费
public static final String UNIT_SOCIAL_CARD_JAVA = "unitSocialCard";
//工程类设置:
//应发工资
public static final String SALARY_SUM_JAVA = "relaySalary";
/**
* 未找到工资表
**/
public static final String NO_SALARY = "未找到工资表";
/**
* 未找到工程工资表
**/
public static final String NO_ENGINEER_SALARY = "未找到工程工资表";
//标记发放失败
public static final String FAILUE_MARK = "标记“发放失败”";
//发放失败重新发放
public static final String FAILUE_RESENDER = "重新发放";
//发放失败出账
public static final String FAILUE_SENDER = "“发放失败”出账";
//发放失败出账退回
public static final String FAILUE_SENDER_BACK = "“发放失败”出账退回";
//员工姓名/收款单位
public static final String FILE_EMPNAME_ORGNAME = "员工姓名/收款单位";
//银行账号
public static final String FILE_BANK_NO = "银行账号";
//派单限制统计表更新类型(0认领更新/1撤销认领更新/2匹配更新/3取消匹配更新)
public static final Integer[] DISPATCH_UPDTYPE= {0, 1, 2, 3};
//项目薪资配置重复
public static final String CONFIG_SALARY_REPEAT = "项目薪资配置重复";
//项目薪资权限重复
public static final String DEPT_SEE_REPEAT = "项目薪资权限重复";
public static final String CHECK_NO_RESPONSE = "校验服务器未返回,请联系管理员!";
public static final String LINE_EMP = "行:员工:";
}
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