Commit d77a75d1 authored by hongguangwu's avatar hongguangwu

判空

parent 8c6f0072
...@@ -86,7 +86,7 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> { ...@@ -86,7 +86,7 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
* @Date: 2022/7/26 19:02 * @Date: 2022/7/26 19:02
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo); R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo, int forecastFlag);
/** /**
* @Description: 基数变更,同步社保公积金查询、预估库 * @Description: 基数变更,同步社保公积金查询、预估库
......
...@@ -2487,7 +2487,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2487,7 +2487,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TAuditInfo auditInfo; TAuditInfo auditInfo;
TSocialFundInfo sf = null; TSocialFundInfo sf = null;
Date now = new Date(); Date now = new Date();
// 预估库同步社保还是公积金的标志,0:全部;1仅社保;2仅公积金
int forecastFlag;
for (TDispatchInfo dis : dispatchs) { for (TDispatchInfo dis : dispatchs) {
forecastFlag = getForecastFlag(dis);
auditInfo = new TAuditInfo(); auditInfo = new TAuditInfo();
remarkTemp = ""; remarkTemp = "";
if (Common.isNotNull(socialFundMap)){ if (Common.isNotNull(socialFundMap)){
...@@ -2662,7 +2665,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2662,7 +2665,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType())
&& CommonConstants.ONE_INT == flag.intValue()){ && CommonConstants.ONE_INT == flag.intValue()){
// 更新预估数据 // 更新预估数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf); forecastLibraryService.updateForecastLibaryByDispatchReduce(sf, forecastFlag);
// 更新人员档案和项目档案的社保公积金状态 // 更新人员档案和项目档案的社保公积金状态
UpProjectSocialFundVo vo = new UpProjectSocialFundVo(); UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
if (Common.isNotNull(dis.getSocialId())){ if (Common.isNotNull(dis.getSocialId())){
...@@ -2769,6 +2772,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2769,6 +2772,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
/** /**
* 社保派单批量办理 * 社保派单批量办理
* @param typeSub 0社保办理;1公积金办理
* @param idsList * @param idsList
* @param user * @param user
* @param flag 0审核通过; 1审核不通过 * @param flag 0审核通过; 1审核不通过
...@@ -2801,7 +2805,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2801,7 +2805,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TSocialFundInfo sf = null; TSocialFundInfo sf = null;
Date now = new Date(); Date now = new Date();
StringBuilder temp = new StringBuilder(); StringBuilder temp = new StringBuilder();
// 预估库同步社保还是公积金的标志,0:全部;1仅社保;2仅公积金
int forecastFlag = CommonConstants.ZERO_INT;
for (TDispatchInfo dis : disList) { for (TDispatchInfo dis : disList) {
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
forecastFlag = CommonConstants.ONE_INT;
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
forecastFlag = CommonConstants.TWO_INT;
}
auditInfo = new TAuditInfo(); auditInfo = new TAuditInfo();
if (Common.isNotNull(socialFundMap)){ if (Common.isNotNull(socialFundMap)){
sf = socialFundMap.get(dis.getEmpIdcard()); sf = socialFundMap.get(dis.getEmpIdcard());
...@@ -3066,14 +3077,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3066,14 +3077,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 办理失败 // 办理失败
if (CommonConstants.ONE_INT == flag){ if (CommonConstants.ONE_INT == flag){
// 派增办理,全部失败 同步预估库数据 // 派增办理,全部失败 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf); forecastLibraryService.updateForecastLibaryByDispatchReduce(sf, forecastFlag);
} }
// 2.派减办理成功 处理预估 // 2.派减办理成功 处理预估
if (CommonConstants.ONE_STRING.equals(dis.getType()) if (CommonConstants.ONE_STRING.equals(dis.getType())
&& CommonConstants.ZERO_INT == flag){ && CommonConstants.ZERO_INT == flag){
// 同步预估库数据 // 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf); forecastLibraryService.updateForecastLibaryByDispatchReduce(sf, forecastFlag);
} }
} }
UpProjectSocialFundVo vo = new UpProjectSocialFundVo(); UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
...@@ -3101,6 +3112,27 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3101,6 +3112,27 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return errorList; return errorList;
} }
/**
* @param dis
* @Description: 获取办理/审核时,要变更的预估库的种类
* @Author: hgw
* @Date: 2022/8/9 11:24
* @return: int
**/
private int getForecastFlag(TDispatchInfo dis) {
int forecastFlag;
forecastFlag = CommonConstants.ZERO_INT;
if (Common.isNotNull(dis.getSocialId())) {
forecastFlag = CommonConstants.ONE_INT;
if (Common.isNotNull(dis.getFundId())) {
forecastFlag = CommonConstants.ZERO_INT;
}
} else if (Common.isNotNull(dis.getFundId())) {
forecastFlag = CommonConstants.TWO_INT;
}
return forecastFlag;
}
private void initSocialFundStatus(TSocialInfo socialInfo, TProvidentFund providentFund, UpProjectSocialFundVo vo, TSocialFundInfo sf) { private void initSocialFundStatus(TSocialInfo socialInfo, TProvidentFund providentFund, UpProjectSocialFundVo vo, TSocialFundInfo sf) {
if (Common.isNotNull(socialInfo)){ if (Common.isNotNull(socialInfo)){
// 办理失败或审核不通过 // 办理失败或审核不通过
......
...@@ -1485,28 +1485,30 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1485,28 +1485,30 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
@Override @Override
public R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo) { public R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo, int forecastFlag) {
String empIdCard = socialFundInfo.getEmpIdcard(); String empIdCard = socialFundInfo.getEmpIdcard();
if (Common.isNotNull(empIdCard)) { if (Common.isNotNull(empIdCard)) {
Date minStartDate = this.getMinSocialDate(socialFundInfo); Date minStartDate = this.getMinSocialDate(socialFundInfo);
BigDecimal zero = BigDecimal.ZERO; BigDecimal zero = BigDecimal.ZERO;
// 查询已经生成的预估数据 if (forecastFlag == CommonConstants.ZERO_INT || forecastFlag == CommonConstants.ONE_INT) {
List<TForecastLibrary> socialLibraryList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() // 查询已经生成的预估数据
.eq(TForecastLibrary::getEmpIdcard, empIdCard) List<TForecastLibrary> socialLibraryList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)); .eq(TForecastLibrary::getEmpIdcard, empIdCard)
if (Common.isNotNull(socialLibraryList)) { .eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT));
// 社保 if (Common.isNotNull(socialLibraryList)) {
Date socialReduceDate = socialFundInfo.getSocialReduceDate(); // 社保
for (TForecastLibrary library : socialLibraryList) { Date socialReduceDate = socialFundInfo.getSocialReduceDate();
if (Common.isNotNull(library.getSocialPayMonth())) { for (TForecastLibrary library : socialLibraryList) {
if (socialReduceDate != null) { if (Common.isNotNull(library.getSocialPayMonth())) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据 if (socialReduceDate != null) {
if (DateUtil.formatDateInt(socialReduceDate) <= Integer.parseInt(library.getSocialPayMonth())) { // 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
this.calculateSocialType(zero, library); if (DateUtil.formatDateInt(socialReduceDate) <= Integer.parseInt(library.getSocialPayMonth())) {
} this.calculateSocialType(zero, library);
} else { }
if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getSocialPayMonth())) { } else {
this.calculateSocialType(zero, library); if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getSocialPayMonth())) {
this.calculateSocialType(zero, library);
}
} }
} }
} }
...@@ -1514,22 +1516,24 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1514,22 +1516,24 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
// 公积金 // 公积金
List<TForecastLibrary> fundLibraryList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() if (forecastFlag == CommonConstants.ZERO_INT || forecastFlag == CommonConstants.TWO_INT) {
.eq(TForecastLibrary::getEmpIdcard, empIdCard) List<TForecastLibrary> fundLibraryList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)); .eq(TForecastLibrary::getEmpIdcard, empIdCard)
if (Common.isNotNull(fundLibraryList)) { .eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT));
minStartDate = socialFundInfo.getProvidentStart(); if (Common.isNotNull(fundLibraryList)) {
Date fundReduceDate = socialFundInfo.getFundReduceDate(); minStartDate = socialFundInfo.getProvidentStart();
for (TForecastLibrary library : fundLibraryList) { Date fundReduceDate = socialFundInfo.getFundReduceDate();
if (Common.isNotNull(library.getProvidentPayMonth())) { for (TForecastLibrary library : fundLibraryList) {
if (fundReduceDate != null) { if (Common.isNotNull(library.getProvidentPayMonth())) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据 if (fundReduceDate != null) {
if (DateUtil.formatDateInt(fundReduceDate) <= Integer.parseInt(library.getProvidentPayMonth())) { // 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
this.calculateFundType(zero, library); if (DateUtil.formatDateInt(fundReduceDate) <= Integer.parseInt(library.getProvidentPayMonth())) {
} this.calculateFundType(zero, library);
} else { }
if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getProvidentPayMonth())) { } else {
this.calculateFundType(zero, library); if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getProvidentPayMonth())) {
this.calculateFundType(zero, library);
}
} }
} }
} }
......
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