Commit 40725c78 authored by hongguangwu's avatar hongguangwu

预估库逻辑变更

parent c0641660
......@@ -393,7 +393,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library.setPersonalPensionFee(BigDecimalUtils.safeAdd(libraryOld.getPersonalPensionFee(), library.getPersonalPensionFee()));
library.setPersonalMedicalFee(BigDecimalUtils.safeAdd(libraryOld.getPersonalMedicalFee(), library.getPersonalMedicalFee()));
library.setPersonalUnemploymentFee(BigDecimalUtils.safeAdd(libraryOld.getPersonalUnemploymentFee(), library.getPersonalUnemploymentFee()));
library.setPersonalInterestFee(BigDecimalUtils.safeAdd(libraryOld.getPersonalUnemploymentFee(), library.getPersonalUnemploymentFee()));
library.setPersonalInterestFee(BigDecimalUtils.safeAdd(libraryOld.getPersonalInterestFee(), library.getPersonalInterestFee()));
library.setPersonalBigailmentFee(BigDecimalUtils.safeAdd(libraryOld.getPersonalBigailmentFee(), library.getPersonalBigailmentFee()));
library.setPersonalSocialSum(BigDecimalUtils.safeAdd(libraryOld.getPersonalSocialSum(), library.getPersonalSocialSum()));
// 单位公积金
......@@ -403,34 +403,35 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
/**
* @param socialFund
* @param libraryNew
* @param libraryOld
* @Description: 获取变更的部分
* @Author: hgw
* @Date: 2022/7/20 11:29
* @return: void
**/
private void getChangeReduceData(TSocialFundInfo socialFund, TForecastLibrary libraryOld) {
private void getChangeReduceData(TForecastLibrary libraryNew, TForecastLibrary libraryOld) {
//单位社保
libraryOld.setUnitPensionFee(BigDecimalUtils.safeSubtract( false, socialFund.getUnitPersionMoney(), libraryOld.getUnitPensionFee()));
libraryOld.setUnitMedicalFee(BigDecimalUtils.safeSubtract( false, socialFund.getUnitMedicalMoney(), libraryOld.getUnitMedicalFee()));
libraryOld.setUnitBirthFee(BigDecimalUtils.safeSubtract( false, socialFund.getUnitBirthMoney(), libraryOld.getUnitBirthFee()));
libraryOld.setUnitWorkInjuryFee(BigDecimalUtils.safeSubtract( false, socialFund.getUnitInjuryMoney(), libraryOld.getUnitWorkInjuryFee()));
libraryOld.setUnitUnemploymentFee(BigDecimalUtils.safeSubtract( false, socialFund.getUnitUnemploymentMoney(), libraryOld.getUnitUnemploymentFee()));
libraryOld.setUnitBitailmentFee(BigDecimalUtils.safeSubtract( false, socialFund.getUnitBigailmentMoney(), libraryOld.getUnitBitailmentFee()));
libraryOld.setUnitInterestFee(BigDecimalUtils.safeSubtract( false, socialFund.getUnitInterestFee(), libraryOld.getUnitInterestFee()));
libraryOld.setUnitSocialSum(BigDecimalUtils.safeSubtract( false, socialFund.getUnitSocialSum(), libraryOld.getUnitSocialSum()));
libraryNew.setUnitPensionFee(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitPensionFee(), libraryOld.getUnitPensionFee()));
libraryNew.setUnitMedicalFee(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitMedicalFee(), libraryOld.getUnitMedicalFee()));
libraryNew.setUnitBirthFee(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitBirthFee(), libraryOld.getUnitBirthFee()));
libraryNew.setUnitWorkInjuryFee(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitWorkInjuryFee(), libraryOld.getUnitWorkInjuryFee()));
libraryNew.setUnitUnemploymentFee(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitUnemploymentFee(), libraryOld.getUnitUnemploymentFee()));
libraryNew.setUnitBitailmentFee(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitBitailmentFee(), libraryOld.getUnitBitailmentFee()));
libraryNew.setUnitInterestFee(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitInterestFee(), libraryOld.getUnitInterestFee()));
libraryNew.setUnitSocialSum(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitSocialSum(), libraryOld.getUnitSocialSum()));
// 个人社保
libraryOld.setPersonalPensionFee(BigDecimalUtils.safeSubtract( false, socialFund.getPersonalPersionMoney(), libraryOld.getPersonalPensionFee()));
libraryOld.setPersonalMedicalFee(BigDecimalUtils.safeSubtract( false, socialFund.getPersonalMedicalMoney(), libraryOld.getPersonalMedicalFee()));
libraryOld.setPersonalUnemploymentFee(BigDecimalUtils.safeSubtract( false, socialFund.getPersonalUnemploymentMoney(), libraryOld.getPersonalUnemploymentFee()));
libraryOld.setPersonalInterestFee(BigDecimalUtils.safeSubtract( false, socialFund.getPersonalUnemploymentMoney(), libraryOld.getPersonalUnemploymentFee()));
libraryOld.setPersonalBigailmentFee(BigDecimalUtils.safeSubtract( false, socialFund.getPersonalBigailmentMoney(), libraryOld.getPersonalBigailmentFee()));
libraryOld.setPersonalSocialSum(BigDecimalUtils.safeSubtract( false, socialFund.getPersonalSocialSum(), libraryOld.getPersonalSocialSum()));
libraryNew.setPersonalPensionFee(BigDecimalUtils.safeSubtract( false, libraryNew.getPersonalPensionFee(), libraryOld.getPersonalPensionFee()));
libraryNew.setPersonalMedicalFee(BigDecimalUtils.safeSubtract( false, libraryNew.getPersonalMedicalFee(), libraryOld.getPersonalMedicalFee()));
libraryNew.setPersonalUnemploymentFee(BigDecimalUtils.safeSubtract( false, libraryNew.getPersonalUnemploymentFee(), libraryOld.getPersonalUnemploymentFee()));
libraryNew.setPersonalInterestFee(BigDecimalUtils.safeSubtract( false, libraryNew.getPersonalInterestFee(), libraryOld.getPersonalInterestFee()));
libraryNew.setPersonalBigailmentFee(BigDecimalUtils.safeSubtract( false, libraryNew.getPersonalBigailmentFee(), libraryOld.getPersonalBigailmentFee()));
libraryNew.setPersonalSocialSum(BigDecimalUtils.safeSubtract( false, libraryNew.getPersonalSocialSum(), libraryOld.getPersonalSocialSum()));
// 单位公积金
libraryOld.setUnitFundSum(BigDecimalUtils.safeSubtract( false, socialFund.getUnitFundSum(), libraryOld.getUnitFundSum()));
libraryNew.setUnitFundSum(BigDecimalUtils.safeSubtract( false, libraryNew.getUnitFundSum(), libraryOld.getUnitFundSum()));
// 个人公积金
libraryOld.setPersonalFundSum(BigDecimalUtils.safeSubtract( false, socialFund.getPersonalFundSum(), libraryOld.getPersonalFundSum()));
libraryNew.setPersonalFundSum(BigDecimalUtils.safeSubtract( false, libraryNew.getPersonalFundSum(), libraryOld.getPersonalFundSum()));
}
......@@ -451,12 +452,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
private void initSocialLibary(String diffType, String payMonth, Map<String, TForecastLibrary> saveLibraryMap
, TSocialFundInfo tSocialInfo, boolean isReduceFund, HashMap<String, TAgentConfig> agentConfigMap
, TForecastLibrary lib, String sfMapKey, TForecastLibrary historyLibrary) {
if (null == lib) {
lib = new TForecastLibrary();
} else if (Common.isNotNull(lib.getId())) {
lib.setId(null);
}
, String sfMapKey, TForecastLibrary historyLibrary) {
TForecastLibrary lib = new TForecastLibrary();
lib.setDataPush(CommonConstants.ZERO_INT);
lib.setSocialHousehold(tSocialInfo.getSocialHousehold());
lib.setSocialHouseholdName(tSocialInfo.getSocialHouseholdName());
......@@ -1250,13 +1247,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
* @Date 2020-07-21
**/
private void initFundLibary(String diffType, String payMonth, Map<String, TForecastLibrary> saveLibraryMap
, TSocialFundInfo providentFund, boolean isReduceSocial, TForecastLibrary lib, String mapKeyStr
, TSocialFundInfo providentFund, boolean isReduceSocial, String mapKeyStr
, TForecastLibrary historyLibrary) {
if (lib == null) {
lib = new TForecastLibrary();
} else if (Common.isNotNull(lib.getId())) {
lib.setId(null);
}
TForecastLibrary lib = new TForecastLibrary();
lib.setDataPush(CommonConstants.ZERO_INT);
lib.setProvidentHousehold(providentFund.getProvidentHousehold());
lib.setProvidentHouseholdName(providentFund.getProvidentHouseholdName());
......@@ -1558,7 +1551,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
negateLib.setPersonalPensionFee(BigDecimalUtils.safeSubtract( false, zero, library.getPersonalPensionFee()));
negateLib.setPersonalMedicalFee(BigDecimalUtils.safeSubtract( false, zero, library.getPersonalMedicalFee()));
negateLib.setPersonalUnemploymentFee(BigDecimalUtils.safeSubtract( false, zero, library.getPersonalUnemploymentFee()));
negateLib.setPersonalInterestFee(BigDecimalUtils.safeSubtract( false, zero, library.getPersonalUnemploymentFee()));
negateLib.setPersonalInterestFee(BigDecimalUtils.safeSubtract( false, zero, library.getPersonalInterestFee()));
negateLib.setPersonalBigailmentFee(BigDecimalUtils.safeSubtract( false, zero, library.getPersonalBigailmentFee()));
negateLib.setPersonalSocialSum(BigDecimalUtils.safeSubtract( false, zero, library.getPersonalSocialSum()));
negateLib.setSumAll(BigDecimalUtils.safeSubtract( false, zero, library.getSumAll()));
......@@ -1790,6 +1783,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
String createMonth;
String sfMapKey;
TForecastLibrary tForecastLibrary;
TForecastLibrary newForecastLibrary;
String diffType;
Date minStartDate;
for (String payMonth : payMonthList) {
......@@ -1822,9 +1816,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else {
historyLibrary = socialHistoryMap.get(sfMapKey);
// 初始化社保
initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, tForecastLibrary, sfMapKey, historyLibrary);
initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
this.getChangeReduceData(tSocialInfo, tForecastLibrary);
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
}
}
}
}
......@@ -1856,9 +1853,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else {
historyLibrary = fundHistoryMap.get(sfMapKey);
// 初始化公积金
initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, tForecastLibrary, sfMapKey, historyLibrary);
initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
this.getChangeReduceData(providentFund, tForecastLibrary);
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
}
}
}
......
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