Commit eacb6b4c authored by huyuchen's avatar huyuchen

优化修改

parent 9b1849bb
......@@ -69,6 +69,8 @@ public interface TForecastLibraryMapper extends BaseMapper<TForecastLibrary> {
int updateForecastFundStatusByIdList(@Param("idList")List<String> idList, @Param("status") String status);
int deleteForecastSocial(@Param("idCard") String idCard, @Param("socialPayMonth") String socialPayMonth, @Param("socialCreateMonth") String socialCreateMonth);
void updateForSocialAndFound(@Param("infoVo") UpdateSocialFoundVo infoVo);
/**
......
......@@ -3872,22 +3872,20 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 全部办理失败 社保和公积金派增办理失败 减少预估
if (CommonConstants.ONE_INT == flag
&& (CommonConstants.FIVE_STRING.equals(sf.getSocialStatus())
|| CommonConstants.FOUR_STRING.equals(sf.getFundStatus()))){
|| CommonConstants.FOUR_STRING.equals(sf.getFundStatus()))) {
// 派增办理,全部失败 同步预估库数据
socialTask.asynchronousDisPatchHandle(sf, forecastFlag,null,null,CommonConstants.ZERO_INT);
socialTask.asynchronousDisPatchHandle(sf, forecastFlag, null, null, CommonConstants.ZERO_INT);
}
// 社保办理只要办理成功就刷新预估数据 公积金办理不用处理(前面公积金办理成功的时候处理过了)
if (CommonConstants.ZERO_STRING.equals(typeSub)
&& (Common.isNotNull(dis.getSocialId())
&& CommonConstants.FOUR_STRING.equals(sf.getSocialStatus())
|| CommonConstants.TWO_STRING.equals(sf.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(sf.getSocialStatus()))){
if (partSuccess){
|| CommonConstants.THREE_STRING.equals(sf.getSocialStatus()))) {
if (partSuccess) {
forecastLibraryService.updateForecastLibaryByDispatch(sf);
}else {
synchronized (this) {
socialTask.asynchronousDisPatchHandle(sf, 0, null, null, CommonConstants.ONE_INT);
}
} else {
socialTask.asynchronousDisPatchHandle(sf, 0, null, null, CommonConstants.ONE_INT);
}
}
}
......
......@@ -1862,6 +1862,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
return R.failed("无需要重新生成的数据(无数据或数据已结算不可重新生成!)");
}
//先删除然后重新生成
boolean isSaveAndUpdate = false;
synchronized (this) {
if (Common.isNotNull(librarySocialList)) {
baseMapper.deleteBatchIds(librarySocialList);
......@@ -1879,14 +1881,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 组建基础Map
this.getBaseMap(librarySocialList, librarySocialListTemp, libraryFundList, libraryFundListTemp
, socialHistoryMap, fundHistoryMap, socialPushMap, fundPushMap);
Map<String, TForecastLibrary> saveLibraryMap = new HashMap<>();
boolean isReduceSocial = false;
boolean isReduceFund = false;
Map<String, TForecastLibrary> saveLibraryMap = new HashMap<>();
// 核心刷新
R<String> coreR = this.doCore(payMonthList, socialInfoList, fundList, agentConfigHashMap, socialHistoryMap
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund, isOnly);
if (coreR != null) return coreR;
boolean isSaveAndUpdate = false;
YifuUser user = SecurityUtils.getUser();
String userId = "305";
String userName = "系统";
......@@ -1894,6 +1895,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
userId = user.getId();
userName = user.getNickname();
}
TForecastLibrary library1;
for (TForecastLibrary library : saveLibraryMap.values()) {
if (Common.isEmpty(library.getSocialId()) && Common.isEmpty(library.getProvidentId())) {
continue;
......@@ -1906,16 +1908,21 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
log.error("更新一条预估耗时:" + times + "毫秒");
isSaveAndUpdate = true;
} else {
if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != CommonConstants.ZERO_INT
|| BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitFundSum())) != CommonConstants.ZERO_INT) {
library.setCreateBy(userId);
library.setCreateName(userName);
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
isSaveAndUpdate = true;
synchronized (this) {
if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != CommonConstants.ZERO_INT
|| BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitFundSum())) != CommonConstants.ZERO_INT) {
//判断是否有重复数据有则删除
baseMapper.deleteForecastSocial(library.getEmpIdcard(),library.getSocialPayMonth(),library.getSocialCreateMonth());
library.setCreateBy(userId);
library.setCreateName(userName);
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
isSaveAndUpdate = true;
}
}
}
}
saveLibraryMap.clear();
if (Common.isNotNull(socialFundInfo.getSocialId()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
......
......@@ -678,6 +678,11 @@
</foreach>
</update>
<delete id="deleteForecastSocial">
delete from t_forecast_library where SOCIAL_PAY_MONTH = #{socialPayMonth} and SOCIAL_CREATE_MONTH = #{socialCreateMonth}
and EMP_IDCARD = #{idCard} and DATA_PUSH = 0
</delete>
<!-- 更改薪资公积金结算状态 -->
<update id="updateForSocialAndFound">
update t_forecast_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