Commit 325f1f86 authored by hongguangwu's avatar hongguangwu

工资-按照项目的配置来取社保公积金

parent 44935282
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.entity; package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -328,5 +330,19 @@ public class TSettleDomain extends BaseEntity { ...@@ -328,5 +330,19 @@ public class TSettleDomain extends BaseEntity {
@Schema(description = "回款周期1-12") @Schema(description = "回款周期1-12")
private String backPayCycle; private String backPayCycle;
/**
* 社保类型0:缴费库;1:预估库
*/
@ExcelAttribute(name = "社保类型0:缴费库;1:预估库")
@ExcelProperty("社保类型0:缴费库;1:预估库")
@Schema(description = "社保类型0:缴费库;1:预估库")
private String socialType;
/**
* 公积金类型0:缴费库;1:预估库
*/
@ExcelAttribute(name = "公积金类型0:缴费库;1:预估库")
@ExcelProperty("公积金类型0:缴费库;1:预估库")
@Schema(description = "公积金类型0:缴费库;1:预估库")
private String fundType;
} }
...@@ -71,64 +71,65 @@ ...@@ -71,64 +71,65 @@
<result property="exceptionRemark" column="EXCEPTION_REMARK"/> <result property="exceptionRemark" column="EXCEPTION_REMARK"/>
<result property="existAdvancePayment" column="EXIST_ADVANCE_PAYMENT"/> <result property="existAdvancePayment" column="EXIST_ADVANCE_PAYMENT"/>
<result property="backPayCycle" column="BACK_PAY_CYCLE"/> <result property="backPayCycle" column="BACK_PAY_CYCLE"/>
<result property="socialType" column="SOCIAL_TYPE"/>
<result property="fundType" column="FUND_TYPE"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a a.ID,
. a.DEPART_NO,
ID a.DEPART_NAME,
, a.IS_NEW,
a.DEPART_NO, a.NEW_REMARK,
a.DEPART_NAME, a.DELETE_FLAG,
a.IS_NEW, a.DP_AUDIT_FLAG,
a.NEW_REMARK, a.OLD_ID,
a.DELETE_FLAG, a.BELONG_CONTRACT,
a.DP_AUDIT_FLAG, a.DP_AUDIT_OPINION,
a.OLD_ID, a.DP_AUDIT_MAN,
a.BELONG_CONTRACT, a.DP_AUDIT_MAN_NAME,
a.DP_AUDIT_OPINION, a.LAST_AUDIT_DATE,
a.DP_AUDIT_MAN, a.SERVER_ITEM,
a.DP_AUDIT_MAN_NAME, a.INCOME_BELONG,
a.LAST_AUDIT_DATE, a.INCOME_BELONG_SUB,
a.SERVER_ITEM, a.CUSTOMER_ID,
a.INCOME_BELONG, a.CREATE_USER_NAME,
a.INCOME_BELONG_SUB, a.COMMIT_USER,
a.CUSTOMER_ID, a.COMMIT_USER_NAME,
a.CREATE_USER_NAME, a.BALANCE,
a.COMMIT_USER, a.INVOICE_BALANCE,
a.COMMIT_USER_NAME, a.FIRST_PASS_FLAG,
a.BALANCE, a.FIRST_PASS_TIME,
a.INVOICE_BALANCE, a.PROVINCE,
a.FIRST_PASS_FLAG, a.CITY,
a.FIRST_PASS_TIME, a.TOWN,
a.PROVINCE, a.STOP_FLAG,
a.CITY, a.employee_num,
a.TOWN, a.STOP_DATE,
a.STOP_FLAG, a.STOP_REASON,
a.employee_num, a.STOP_USER,
a.STOP_DATE, a.STOP_USER_NAME,
a.STOP_REASON, a.TYPE,
a.STOP_USER, a.BUSINESS_PRIMARY_TYPE,
a.STOP_USER_NAME, a.BUSINESS_SECOND_TYPE,
a.TYPE, a.BUSINESS_THIRD_TYPE,
a.BUSINESS_PRIMARY_TYPE, a.MANAGER_AUDIT_OPINION,
a.BUSINESS_SECOND_TYPE, a.MANAGER_AUDIT_MAN,
a.BUSINESS_THIRD_TYPE, a.MANAGER_AUDIT_MAN_NAME,
a.MANAGER_AUDIT_OPINION, a.AUDIT_TIME,
a.MANAGER_AUDIT_MAN, a.MANAGER_AUDIT_TIME,
a.MANAGER_AUDIT_MAN_NAME, a.CREATE_TYPE,
a.AUDIT_TIME, a.RELATE_FLAG,
a.MANAGER_AUDIT_TIME, a.EXCEPTION_REMARK,
a.CREATE_TYPE, a.EXIST_ADVANCE_PAYMENT,
a.RELATE_FLAG, a.BACK_PAY_CYCLE,
a.EXCEPTION_REMARK, a.CREATE_BY,
a.EXIST_ADVANCE_PAYMENT, a.CREATE_NAME,
a.BACK_PAY_CYCLE, a.CREATE_TIME,
a.CREATE_BY, a.UPDATE_BY,
a.CREATE_NAME, a.UPDATE_TIME,
a.CREATE_TIME, a.SOCIAL_TYPE,
a.UPDATE_BY, a.FUND_TYPE
a.UPDATE_TIME
</sql> </sql>
<resultMap id="tSettleDomainSelectVoMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo"> <resultMap id="tSettleDomainSelectVoMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo">
......
...@@ -292,7 +292,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -292,7 +292,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (Common.isEmpty(invoiceTitle)) { if (Common.isEmpty(invoiceTitle)) {
return R.failed("新建工资主表失败-获取结算主体的-封面抬头-信息为空,请去<客户管理-结算主体>模块,编辑封面抬头后再导入"); return R.failed("新建工资主表失败-获取结算主体的-封面抬头-信息为空,请去<客户管理-结算主体>模块,编辑封面抬头后再导入");
} }
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) { if (null == user || null == user.getId()) {
return R.failed("新建工资主表失败-获取登录人信息为空"); return R.failed("新建工资主表失败-获取登录人信息为空");
...@@ -369,8 +368,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -369,8 +368,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai, TSettleDomainSelectVo dept , List<TSalaryAccountItem> saiList, TSalaryAccountItem sai, TSettleDomainSelectVo dept
, String invoiceTitle, YifuUser user, LocalDateTime nowTime, TSalaryStandard salary , String invoiceTitle, YifuUser user, LocalDateTime nowTime, TSalaryStandard salary
, boolean isActual) { , boolean isActual) {
// 社保类型0:缴费库;1:预估库
String socialType = CommonConstants.ZERO_STRING;
if (Common.isNotNull(dept.getSocialType())) {
socialType = dept.getSocialType();
}
// 公积金类型0:缴费库;1:预估库
String fundType = CommonConstants.ZERO_STRING;
if (Common.isNotNull(dept.getFundType())) {
fundType = dept.getFundType();
}
List<TSalaryAccount> aList; List<TSalaryAccount> aList;
TSalaryAccount a;//定库: TSalaryAccount a;
//定库:
List<TPaymentBySalaryVo> socialEstmateList = null; //社保缴费库 List<TPaymentBySalaryVo> socialEstmateList = null; //社保缴费库
List<TPaymentBySalaryVo> fundEstmateList = null; //公积金缴费库 List<TPaymentBySalaryVo> fundEstmateList = null; //公积金缴费库
List<TPaymentBySalaryVo> socialForecastList = null; //社保预估库 List<TPaymentBySalaryVo> socialForecastList = null; //社保预估库
...@@ -386,16 +397,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -386,16 +397,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
} else { } else {
forecast.setSocialPayMonth(SalaryConstants.PRIORITY_ZERO); //没优先级,则限制住 forecast.setSocialPayMonth(SalaryConstants.PRIORITY_ZERO); //没优先级,则限制住
} }
R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId() if (CommonConstants.ZERO_STRING.equals(socialType)) {
, "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN); R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) { , "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
socialEstmateList = tPaymentVoR.getData().getPaymentList(); if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) {
socialEstmateList = tPaymentVoR.getData().getPaymentList();
}
} }
// 预估数据 if (CommonConstants.ONE_STRING.equals(socialType)) {
R<TPaymentVo> tForecastVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId() // 预估数据
, "/tforecastlibrary/inner/selectTForecastBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN); R<TPaymentVo> tForecastVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
if (tForecastVoR != null && tForecastVoR.getData() != null && tForecastVoR.getData().getPaymentList() != null) { , "/tforecastlibrary/inner/selectTForecastBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
socialForecastList = tForecastVoR.getData().getPaymentList(); if (tForecastVoR != null && tForecastVoR.getData() != null && tForecastVoR.getData().getPaymentList() != null) {
socialForecastList = tForecastVoR.getData().getPaymentList();
}
} }
} }
if (salaryAccountVo != null && !CommonConstants.ZERO_STRING.equals(salaryAccountVo.getIsDeductFund())) { if (salaryAccountVo != null && !CommonConstants.ZERO_STRING.equals(salaryAccountVo.getIsDeductFund())) {
...@@ -408,16 +423,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -408,16 +423,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
} else { } else {
forecast.setProvidentPayMonth(SalaryConstants.PRIORITY_ZERO); //没优先级,则限制住 forecast.setProvidentPayMonth(SalaryConstants.PRIORITY_ZERO); //没优先级,则限制住
} }
R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId() if (CommonConstants.ZERO_STRING.equals(fundType)) {
, "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN); R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) { , "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
fundEstmateList = tPaymentVoR.getData().getPaymentList(); if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) {
fundEstmateList = tPaymentVoR.getData().getPaymentList();
}
} }
// 预估数据 if (CommonConstants.ONE_STRING.equals(fundType)) {
R<TPaymentVo> tForecastVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId() // 预估数据
, "/tforecastlibrary/inner/selectTForecastBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN); R<TPaymentVo> tForecastVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
if (tForecastVoR != null && tForecastVoR.getData() != null && tForecastVoR.getData().getPaymentList() != null) { , "/tforecastlibrary/inner/selectTForecastBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
fundForecastList = tForecastVoR.getData().getPaymentList(); if (tForecastVoR != null && tForecastVoR.getData() != null && tForecastVoR.getData().getPaymentList() != null) {
fundForecastList = tForecastVoR.getData().getPaymentList();
}
} }
} }
aList = new ArrayList<>(); aList = new ArrayList<>();
...@@ -571,30 +590,32 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -571,30 +590,32 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
} }
} }
if (Common.isEmpty(a.getIsDeductSocial()) || SalaryConstants.IS_DEDUCT_ONE.equals(a.getIsDeductSocial())) { if (Common.isEmpty(a.getIsDeductSocial()) || SalaryConstants.IS_DEDUCT_ONE.equals(a.getIsDeductSocial())) {
a.setSocialType(socialType);
a.setIsDeductSocial(SalaryConstants.IS_DEDUCT_ONE); a.setIsDeductSocial(SalaryConstants.IS_DEDUCT_ONE);
//社保公积金金额扣缴: true : 从库里扣除社保等;false : 走代扣 //社保公积金金额扣缴: true : 从库里扣除社保等;false : 走代扣
if (modelPersonSocialFlag) { if (modelPersonSocialFlag) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_SOCIAL, personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_SOCIAL,
SalaryConstants.PERSONAL_SOCIAL_JAVA, SalaryConstants.PERSONAL_SOCIAL_JAVA,
this.getSocialOrFundMoneyForForecast(a, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT)); this.getSocialOrFundMoneyForForecast(socialType, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT));
} }
if (modelUnitSocialFlag) { if (modelUnitSocialFlag) {
this.saveNewItems(sai, saiList, SalaryConstants.UNIT_SOCIAL, this.saveNewItems(sai, saiList, SalaryConstants.UNIT_SOCIAL,
SalaryConstants.UNIT_SOCIAL_JAVA, SalaryConstants.UNIT_SOCIAL_JAVA,
this.getSocialOrFundMoneyForForecast(a, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT); this.getSocialOrFundMoneyForForecast(socialType, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT);
} }
} }
if (Common.isEmpty(a.getIsDeductFund()) || SalaryConstants.IS_DEDUCT_ONE.equals(a.getIsDeductFund())) { if (Common.isEmpty(a.getIsDeductFund()) || SalaryConstants.IS_DEDUCT_ONE.equals(a.getIsDeductFund())) {
a.setFundType(fundType);
a.setIsDeductFund(SalaryConstants.IS_DEDUCT_ONE); a.setIsDeductFund(SalaryConstants.IS_DEDUCT_ONE);
if (modelPersonFundFlag) { if (modelPersonFundFlag) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_FUND, personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_FUND,
SalaryConstants.PERSONAL_FUND_JAVA, SalaryConstants.PERSONAL_FUND_JAVA,
this.getSocialOrFundMoneyForForecast(a, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT)); this.getSocialOrFundMoneyForForecast(fundType, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT));
} }
if (modelUnitFundFlag) { if (modelUnitFundFlag) {
this.saveNewItems(sai, saiList, SalaryConstants.UNIT_FUND, this.saveNewItems(sai, saiList, SalaryConstants.UNIT_FUND,
SalaryConstants.UNIT_FUND_JAVA, SalaryConstants.UNIT_FUND_JAVA,
this.getSocialOrFundMoneyForForecast(a, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT); this.getSocialOrFundMoneyForForecast(fundType, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT);
} }
} }
} }
...@@ -1008,7 +1029,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1008,7 +1029,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Date: 2019/9/26 15:38 * @Date: 2019/9/26 15:38
* @return: java.math.BigDecimal * @return: java.math.BigDecimal
**/ **/
public BigDecimal getSocialOrFundMoneyForForecast(TSalaryAccount a, TDepartSettlementInfo deptSet, String idNumber public BigDecimal getSocialOrFundMoneyForForecast(String socialFundType, TDepartSettlementInfo deptSet, String idNumber
, List<TPaymentBySalaryVo> estmateList, List<TPaymentBySalaryVo> forecastList, boolean isSocial, boolean isPerson , List<TPaymentBySalaryVo> estmateList, List<TPaymentBySalaryVo> forecastList, boolean isSocial, boolean isPerson
, Set<String> socialList, Set<String> fundList, Set<String> forecastSocialList, Set<String> forecastFundList) { , Set<String> socialList, Set<String> fundList, Set<String> forecastSocialList, Set<String> forecastFundList) {
BigDecimal money = SalaryConstants.B_ZERO; BigDecimal money = SalaryConstants.B_ZERO;
...@@ -1018,87 +1039,56 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1018,87 +1039,56 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
sub = (new BigDecimal("100").subtract(deptSet.getUnitSeriousIllnessProp())) sub = (new BigDecimal("100").subtract(deptSet.getUnitSeriousIllnessProp()))
.divide(SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP); .divide(SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
} }
boolean typeFlag = true; if (CommonConstants.ZERO_STRING.equals(socialFundType) && estmateList != null && !estmateList.isEmpty()) {
if (estmateList != null && !estmateList.isEmpty()) { money = this.getSocialFundMoney(idNumber, estmateList, isSocial, isPerson, socialList, fundList, money, sub);
money = money.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP); }
for (TPaymentBySalaryVo m : estmateList) { // 缴费库没找到,从预估库找
if (Common.isNotNull(idNumber) && idNumber.equals(m.getEmpIdcard())) { if (CommonConstants.ONE_STRING.equals(socialFundType) && forecastList != null && !forecastList.isEmpty()) {
//社保 money = this.getSocialFundMoney(idNumber, forecastList, isSocial, isPerson, forecastSocialList, forecastFundList, money, sub);
if (isSocial && (m.getPersonalSocialSum() != null || m.getUnitSocialSum() != null)) { }
typeFlag = false; return money;
if (Common.isEmpty(m.getSalarySocialFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalarySocialFlag())) { }
if (isPerson && m.getPersonalSocialSum() != null) {
money = money.add(m.getPersonalSocialSum()); /**
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL * @Description: 按类型拉取社保公积金
&& m.getUnitBitmailmentFee() != null) { * @Author: hgw
money = money.add(m.getUnitBitmailmentFee().multiply(sub)); * @Date: 2022/8/17 11:38
} * @return: java.math.BigDecimal
} **/
if (!isPerson && m.getUnitSocialSum() != null) { private BigDecimal getSocialFundMoney(String idNumber, List<TPaymentBySalaryVo> estmateList, boolean isSocial
money = money.add(m.getUnitSocialSum()); , boolean isPerson, Set<String> socialList, Set<String> fundList, BigDecimal money, BigDecimal sub) {
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL money = money.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
&& m.getUnitBitmailmentFee() != null) { for (TPaymentBySalaryVo m : estmateList) {
money = money.subtract(m.getUnitBitmailmentFee().multiply(sub)); if (Common.isNotNull(idNumber) && idNumber.equals(m.getEmpIdcard())) {
} //社保
} if (isSocial && (!Common.isNotNull(m.getSalarySocialFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalarySocialFlag()))
a.setSocialType(CommonConstants.ZERO_STRING); && (m.getPersonalSocialSum() != null || m.getUnitSocialSum() != null)) {
socialList.add(m.getId()); if (isPerson && m.getPersonalSocialSum() != null) {
money = money.add(m.getPersonalSocialSum());
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
&& m.getUnitBitmailmentFee() != null) {
money = money.add(m.getUnitBitmailmentFee().multiply(sub));
} }
} }
//公积金 if (!isPerson && m.getUnitSocialSum() != null) {
if (!isSocial && (m.getPersonalFundSum() != null || m.getUnitFundSum() != null)) { money = money.add(m.getUnitSocialSum());
typeFlag = false; if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
if (Common.isEmpty(m.getSalaryFundFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalaryFundFlag())) { && m.getUnitBitmailmentFee() != null) {
if (isPerson && m.getPersonalFundSum() != null) { money = money.subtract(m.getUnitBitmailmentFee().multiply(sub));
money = money.add(m.getPersonalFundSum());
}
if (!isPerson && m.getUnitFundSum() != null) {
money = money.add(m.getUnitFundSum());
}
a.setFundType(CommonConstants.ZERO_STRING);
fundList.add(m.getId());
} }
} }
socialList.add(m.getId());
} }
} //公积金
} if (!isSocial && (!Common.isNotNull(m.getSalaryFundFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalaryFundFlag()))
// 缴费库没找到,从预估库找 && (m.getPersonalFundSum() != null || m.getUnitFundSum() != null)) {
if (typeFlag && forecastList != null && !forecastList.isEmpty()) { if (isPerson && m.getPersonalFundSum() != null) {
money = money.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP); money = money.add(m.getPersonalFundSum());
for (TPaymentBySalaryVo m : forecastList) {
if (Common.isNotNull(idNumber) && idNumber.equals(m.getEmpIdcard())) {
//社保
if (isSocial && (!Common.isNotNull(m.getSalarySocialFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalarySocialFlag()))
&& (m.getPersonalSocialSum() != null || m.getUnitSocialSum() != null)) {
if (isPerson && m.getPersonalSocialSum() != null) {
money = money.add(m.getPersonalSocialSum());
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
&& m.getUnitBitmailmentFee() != null) {
money = money.add(m.getUnitBitmailmentFee().multiply(sub));
}
}
if (!isPerson && m.getUnitSocialSum() != null) {
money = money.add(m.getUnitSocialSum());
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
&& m.getUnitBitmailmentFee() != null) {
money = money.subtract(m.getUnitBitmailmentFee().multiply(sub));
}
}
a.setSocialType(CommonConstants.ONE_STRING);
forecastSocialList.add(m.getId());
} }
//公积金 if (!isPerson && m.getUnitFundSum() != null) {
if (!isSocial && (!Common.isNotNull(m.getSalaryFundFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalaryFundFlag())) money = money.add(m.getUnitFundSum());
&& (m.getPersonalFundSum() != null || m.getUnitFundSum() != null)) {
if (isPerson && m.getPersonalFundSum() != null) {
money = money.add(m.getPersonalFundSum());
}
if (!isPerson && m.getUnitFundSum() != null) {
money = money.add(m.getUnitFundSum());
}
a.setFundType(CommonConstants.ONE_STRING);
forecastFundList.add(m.getId());
} }
fundList.add(m.getId());
} }
} }
} }
......
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