Commit 40725c78 authored by hongguangwu's avatar hongguangwu

预估库逻辑变更

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