Commit 7380f8b2 authored by fangxinjiang's avatar fangxinjiang

社保批量办理事务控制范围减少-fxj

parent b619bd72
......@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
......@@ -34,6 +35,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* 派单信息记录表
......@@ -84,7 +86,10 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
// isAutoFlag:是否社保士兵的自动办理,true :是
R<List<ErrorMessage>> addApplyHandle(List<String> ids, String typeSub, String handleStatus, String handleRemark, String socialType, String remark, YifuUser user, boolean isAutoHandle);
/**
//代码优化-解决死锁问题:fxj 2024-12-18 事务控制集中到每次循环,而不是所有for循环
boolean extracted(ConcurrentHashMap<String, String> socialMap, ConcurrentHashMap<String, String> fundMap, String typeSub, YifuUser user, int flag, String handleStatus, String handleRemark, String socialType, String remark, boolean isAutoHandle, List<ErrorMessage> errorList, Map<String, TSocialFundInfo> socialFundMap, TDispatchInfo dis);
/**
* @Description: 社保士兵导出
* @Author: hgw
* @Date: 2024/5/13 11:34
......
......@@ -3944,7 +3944,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Author fxj
* @Date 2022-07-26
**/
@Transactional(rollbackFor = Exception.class)
//@Transactional(rollbackFor = Exception.class)
public List<ErrorMessage> addBatchApplyHandle(ConcurrentHashMap<String, String> socialMap,ConcurrentHashMap<String, String> fundMap,
List<String> idsList, String typeSub, YifuUser user
, int flag, String handleStatus, String handleRemark, String socialType, String remark, boolean isAutoHandle) {
......@@ -3958,436 +3958,445 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 获取所有派单查询信息
Map<String,TSocialFundInfo> socialFundMap = initSocialFundMap(disList);
try {
TSocialInfo socialInfo = null;
TProvidentFund providentFund = null;
TAuditInfo auditInfo = null;
StringBuilder socialTypeRemark = new StringBuilder();
TSocialFundInfo sf = null;
Date now = new Date();
StringBuilder temp = new StringBuilder();
// 预估库同步社保还是公积金的标志,0:全部;1仅社保;2仅公积金
int forecastFlag = CommonConstants.ZERO_INT;
// auditFlag 表示社保办理无办理项是不保存
boolean auditFlag = true;
boolean partSuccess = false;
TDispatchSocialFundInfo socialFundInfo;
for (TDispatchInfo dis : disList) {
auditFlag = true;
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
forecastFlag = CommonConstants.ONE_INT;
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
forecastFlag = CommonConstants.TWO_INT;
}
auditInfo = new TAuditInfo();
if (Common.isNotNull(socialFundMap)){
sf = socialFundMap.get(dis.getEmpIdcard());
}
if (Common.isEmpty(sf)){
errorList.add(new ErrorMessage(-1, "找不到员工社保公积金查询数据:" + dis.getEmpName()));
if (extracted(socialMap, fundMap, typeSub, user, flag, handleStatus, handleRemark, socialType, remark, isAutoHandle, errorList, socialFundMap, dis))
continue;
}
partSuccess = Common.isNotNull(sf) && Common.isNotNull(dis.getSocialId())
&& (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getPensionHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBirthHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getUnemployHandle())
|| ((CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBigailmentHandle()))
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness()))
))
&& !((CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getPensionHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getMedicalHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getWorkInjuryHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBirthHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getUnemployHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBigailmentHandle())
|| Common.isEmpty(sf.getBigailmentHandle()))
);
if (!CommonConstants.TWO_STRING.equals(dis.getStatus())) {
errorList.add(new ErrorMessage(-1, "已办理完结,请勿重复操作:" + dis.getEmpName()));
continue;
}
if (Common.isNotNull(dis.getSocialId())) {
// 无更新直接跳过
if (Common.isEmpty(socialTypeRemark)
&& CommonConstants.ZERO_STRING.equals(typeSub)
&& Common.isEmpty(socialType)) {
continue;
}
socialInfo = socialMapper.selectById(dis.getSocialId());
socialTypeRemark = getHandleRemark(socialType, socialInfo,dis.getType(),sf);
// 无更新直接跳过
if (Common.isEmpty(socialTypeRemark.toString()) && CommonConstants.ZERO_STRING.equals(typeSub)) {
continue;
}
} catch(Exception e){
log.error(DispatchConstants.DISPATCH_EXCEPTION, e);
errorList.add(new ErrorMessage(-1, DispatchConstants.DISPATCH_EXCEPTION + e.getMessage()));
return errorList;
}
} else{
errorList.add(new ErrorMessage(-1, DispatchConstants.NO_OPERATOR_DATA));
return errorList;
}
return errorList;
}
//代码优化-解决死锁问题:fxj 2024-12-18 事务控制集中到每次循环,而不是所有for循环 TODO参数过多需要二次优化
@Override
@Transactional(rollbackFor = Exception.class)
public boolean extracted(ConcurrentHashMap<String, String> socialMap, ConcurrentHashMap<String, String> fundMap, String typeSub, YifuUser user, int flag, String handleStatus, String handleRemark, String socialType, String remark, boolean isAutoHandle, List<ErrorMessage> errorList, Map<String, TSocialFundInfo> socialFundMap, TDispatchInfo dis) {
TSocialInfo socialInfo = null;
TProvidentFund providentFund = null;
TAuditInfo auditInfo = null;
StringBuilder socialTypeRemark = new StringBuilder();
TSocialFundInfo sf = null;
Date now = new Date();
StringBuilder temp = new StringBuilder();
// 预估库同步社保还是公积金的标志,0:全部;1仅社保;2仅公积金
int forecastFlag = CommonConstants.ZERO_INT;
// auditFlag 表示社保办理无办理项是不保存
boolean auditFlag = true;
boolean partSuccess = false;
TDispatchSocialFundInfo socialFundInfo;
auditFlag = true;
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
forecastFlag = CommonConstants.ONE_INT;
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
forecastFlag = CommonConstants.TWO_INT;
}
auditInfo = new TAuditInfo();
if (Common.isNotNull(socialFundMap)){
sf = socialFundMap.get(dis.getEmpIdcard());
}
if (Common.isEmpty(sf)){
errorList.add(new ErrorMessage(-1, "找不到员工社保公积金查询数据:" + dis.getEmpName()));
return true;
}
partSuccess = Common.isNotNull(sf) && Common.isNotNull(dis.getSocialId())
&& (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getPensionHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBirthHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getUnemployHandle())
|| ((CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBigailmentHandle()))
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness()))
))
&& !((CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getPensionHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getMedicalHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getWorkInjuryHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBirthHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getUnemployHandle()))
&& (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
|| CommonConstants.FOUR_STRING.equals(sf.getBigailmentHandle())
|| Common.isEmpty(sf.getBigailmentHandle()))
);
if (!CommonConstants.TWO_STRING.equals(dis.getStatus())) {
errorList.add(new ErrorMessage(-1, "已办理完结,请勿重复操作:" + dis.getEmpName()));
return true;
}
if (Common.isNotNull(dis.getSocialId())) {
// 无更新直接跳过
if (Common.isEmpty(socialTypeRemark)
&& CommonConstants.ZERO_STRING.equals(typeSub)
&& Common.isEmpty(socialType)) {
return true;
}
socialInfo = socialMapper.selectById(dis.getSocialId());
socialTypeRemark = getHandleRemark(socialType, socialInfo, dis.getType(),sf);
// 无更新直接跳过
if (Common.isEmpty(socialTypeRemark.toString()) && CommonConstants.ZERO_STRING.equals(typeSub)) {
return true;
}
} else {
socialInfo = null;
}
if (Common.isNotNull(dis.getFundId())) {
providentFund = fundMapper.selectById(dis.getFundId());
} else {
providentFund = null;
}
//派增处理
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
//社保派增办理
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (Common.isNotNull(socialInfo) && Common.isNotNull(socialInfo.getId())) {
socialInfo.setHandleStatus(handleStatus);
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId());
socialInfo.setHandleUserName(user.getNickname());
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf, isAutoHandle);
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
auditFlag = Common.isNotNull(Common.isNullToString(socialTypeRemark));
if (auditFlag){
auditInfo.setType(CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_INT == flag) {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.THREE_STRING, user, temp.toString().concat(ServiceUtil.ifNullToEmpty(handleRemark)), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.FOUR_STRING, user, temp.toString().concat(ServiceUtil.ifNullToEmpty(handleRemark)), remark);
}
} else {
socialInfo = null;
auditInfo.setSocialId(dis.getId());
}
if (Common.isNotNull(dis.getFundId())) {
providentFund = fundMapper.selectById(dis.getFundId());
} else {
providentFund = null;
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保派增派单数据:" + dis.getEmpName()));
return true;
}
//公积金办理
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
if (null != providentFund && Common.isNotNull(providentFund.getId())) {
// 办理状态(0待办理/1已办理2办理失败3已派减)
providentFund.setHandleStatus(handleStatus);
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId());
providentFund.setHandleUserName(user.getNickname());
dis.setFundHandleStatus(handleStatus);
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ZERO_INT == flag) {
//派增办理通过 改成可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);
sf.setFundAddStatus(CommonConstants.TWO_STRING);
sf.setFundStatus(CommonConstants.THREE_STRING);
} else if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ONE_INT == flag) {
//派增办理不通过 改成不可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[1]);
sf.setFundAddStatus(CommonConstants.THREE_STRING);
sf.setFundStatus(CommonConstants.FOUR_STRING);
}
//派增处理
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
//社保派增办理
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (Common.isNotNull(socialInfo) && Common.isNotNull(socialInfo.getId())) {
socialInfo.setHandleStatus(handleStatus);
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId());
socialInfo.setHandleUserName(user.getNickname());
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf, isAutoHandle);
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
auditFlag = Common.isNotNull(Common.isNullToString(socialTypeRemark));
if (auditFlag){
auditInfo.setType(CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_INT == flag) {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.THREE_STRING, user, temp.toString().concat(ServiceUtil.ifNullToEmpty(handleRemark)), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.FOUR_STRING, user, temp.toString().concat(ServiceUtil.ifNullToEmpty(handleRemark)), remark);
fundMapper.updateById(providentFund);
//公积金办理成功增加收入
if (Common.isNotNull(dis.getFundId()) &&
CommonConstants.THREE_STRING.equals(sf.getFundStatus())){
int monthDiff;
// 获取最小的起缴月
Date minStartDate = this.getMinDate(sf);
// 再计算月份
monthDiff = DateUtil.getMonthDiff(minStartDate, new Date()) + 2;
List<TForecastLibrary> libraryFundInfoList;
for (int i = 0; i < monthDiff; i++) {
//获取所有的预估数据
//List<TForecastLibrary> libraryFundInfoList1 = new ArrayList<>();
libraryFundInfoList = forecastLibraryService.list(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, sf.getEmpIdcard())
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
.eq(TForecastLibrary::getSettleDomainId,sf.getSettleDomainFund())
.eq(TForecastLibrary::getProvidentPayMonth, DateUtil.addMonth(1 - i)));
if (Common.isNotNull(libraryFundInfoList)) {
for (TForecastLibrary library :libraryFundInfoList) {
//办理成功生成收入
if (Common.isNotNull(library.getDataPush())){
socialTask.asynchronousDisPatchHandleForDispatch(library,CommonConstants.ZERO_INT == library.getDataPush().intValue());
}
auditInfo.setSocialId(dis.getId());
}
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保派增派单数据:" + dis.getEmpName()));
continue;
}
//公积金办理
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
if (null != providentFund && Common.isNotNull(providentFund.getId())) {
// 办理状态(0待办理/1已办理2办理失败3已派减)
providentFund.setHandleStatus(handleStatus);
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId());
providentFund.setHandleUserName(user.getNickname());
dis.setFundHandleStatus(handleStatus);
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ZERO_INT == flag) {
//派增办理通过 改成可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);
sf.setFundAddStatus(CommonConstants.TWO_STRING);
sf.setFundStatus(CommonConstants.THREE_STRING);
} else if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ONE_INT == flag) {
//派增办理不通过 改成不可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[1]);
sf.setFundAddStatus(CommonConstants.THREE_STRING);
sf.setFundStatus(CommonConstants.FOUR_STRING);
}
fundMapper.updateById(providentFund);
//公积金办理成功增加收入
if (Common.isNotNull(dis.getFundId()) &&
CommonConstants.THREE_STRING.equals(sf.getFundStatus())){
int monthDiff;
// 获取最小的起缴月
Date minStartDate = this.getMinDate(sf);
// 再计算月份
monthDiff = DateUtil.getMonthDiff(minStartDate, new Date()) + 2;
List<TForecastLibrary> libraryFundInfoList;
for (int i = 0; i < monthDiff; i++) {
//获取所有的预估数据
//List<TForecastLibrary> libraryFundInfoList1 = new ArrayList<>();
libraryFundInfoList = forecastLibraryService.list(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, sf.getEmpIdcard())
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
.eq(TForecastLibrary::getSettleDomainId,sf.getSettleDomainFund())
.eq(TForecastLibrary::getProvidentPayMonth, DateUtil.addMonth(1 - i)));
if (Common.isNotNull(libraryFundInfoList)) {
for (TForecastLibrary library :libraryFundInfoList) {
//办理成功生成收入
if (Common.isNotNull(library.getDataPush())){
socialTask.asynchronousDisPatchHandleForDispatch(library,CommonConstants.ZERO_INT == library.getDataPush().intValue());
}
}
}
}
}
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_ADD_SUCCESS + handleRemark), CommonConstants.THREE_STRING, user, (DispatchConstants.DISPATCH_FUND_ADD_SUCCESS + handleRemark), remark);
} else {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_ADD_FAIL + handleRemark), CommonConstants.FOUR_STRING, user, (DispatchConstants.DISPATCH_FUND_ADD_FAIL + handleRemark), remark);
}
auditInfo.setProvidentId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工公积金派增派单数据:" + dis.getEmpName()));
continue;
}
}
//派减处理
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
//社保派减办理
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (Common.isNotNull(socialInfo) && Common.isNotNull(socialInfo.getId())) {
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf, isAutoHandle);
socialInfo.setReduceHandleUser(user.getId());
socialInfo.setReduceHandleTime(now);
//社保派减办理成功才变更社保的办理状态
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId());
socialInfo.setHandleUserName(user.getNickname());
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
auditInfo = new TAuditInfo();
auditInfo.setType(CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_INT == flag) {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.THREE_STRING, user, temp.toString(), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
}
auditInfo.setSocialId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保数据:" + dis.getEmpName()));
continue;
}
//公积金派减办理
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
if (Common.isNotNull(providentFund) && Common.isNotNull(providentFund.getId())) {
//公积金派减办理成功才变更公积金的办理状态
if (CommonConstants.ZERO_INT == flag) {
providentFund.setHandleStatus(CommonConstants.THREE_STRING);
providentFund.setReduceHandleTime(now);
providentFund.setReduceHandleUser(user.getId());
if (Common.isNotNull(dis.getFundReduceDate())) {
providentFund.setFundReduceDate(dis.getFundReduceDate());
sf.setFundReduceDate(dis.getFundReduceDate());
}
sf.setFundReduceStatus(CommonConstants.TWO_STRING);
sf.setFundStatus(CommonConstants.SEVEN_STRING);
}
if (CommonConstants.ONE_INT == flag) {
//派减办理不通过
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
sf.setFundReduceStatus(CommonConstants.THREE_STRING);
sf.setFundStatus(CommonConstants.EIGHT_STRING);
sf.setFundReduceDate(null);
}
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId());
providentFund.setHandleUserName(user.getNickname());
fundMapper.updateFundInfoById(providentFund);
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), CommonConstants.SIX_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark);
dis.setFundHandleStatus(CommonConstants.ONE_STRING);
} else {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_FAIL + handleRemark), CommonConstants.FOUR_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark);
dis.setFundHandleStatus(CommonConstants.TWO_STRING);
}
auditInfo.setProvidentId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工公积金数据:" + dis.getEmpName()));
continue;
}
}
}
//更新派单状态
if (Common.isNotNull(auditInfo)) {
//派增判断
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
if (Common.isNotNull(dis.getSocialHandleStatus())
&& Common.isNotNull(dis.getFundHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getSocialHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if ((CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))
&& Common.isEmpty(dis.getFundHandleStatus())) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
//派减判断
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
if (Common.isNotNull(dis.getSocialId())
&& Common.isNotNull(dis.getFundId())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getSocialId()) && Common.isNotNull(dis.getFundId())
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getFundId()) && Common.isNotNull(dis.getSocialId())
&&(CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
}
dis.setHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
//新增办理记录信息
auditInfo.setDispatchInfoId(dis.getId());
auditInfo.setEmpIdcard(dis.getEmpIdcard());
if (auditFlag){
auditInfoMapper.insert(auditInfo);
}
baseMapper.updateById(dis);
//v1.8.9更新社保公积金缴纳地和户数据
socialFundMapper.updateById(sf);
//派减的申请审核完更新社保公积金查询快照表
if (CommonConstants.ONE_STRING.equals(dis.getType())) {
socialFundInfo = infoService.getOne(Wrappers.<TDispatchSocialFundInfo>query().lambda()
.eq(TDispatchSocialFundInfo::getReduceSocialFundId, dis.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(socialFundInfo)) {
String reduceSocialFundId = socialFundInfo.getReduceSocialFundId();
String id = socialFundInfo.getId();
BeanUtils.copyProperties(sf,socialFundInfo);
socialFundInfo.setId(id);
socialFundInfo.setReduceSocialFundId(reduceSocialFundId);
infoService.updateById(socialFundInfo);
}
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_ADD_SUCCESS + handleRemark), CommonConstants.THREE_STRING, user, (DispatchConstants.DISPATCH_FUND_ADD_SUCCESS + handleRemark), remark);
} else {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_ADD_FAIL + handleRemark), CommonConstants.FOUR_STRING, user, (DispatchConstants.DISPATCH_FUND_ADD_FAIL + handleRemark), remark);
}
auditInfo.setProvidentId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工公积金派增派单数据:" + dis.getEmpName()));
return true;
}
}
//派减处理
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
//社保派减办理
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (Common.isNotNull(socialInfo) && Common.isNotNull(socialInfo.getId())) {
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf, isAutoHandle);
socialInfo.setReduceHandleUser(user.getId());
socialInfo.setReduceHandleTime(now);
//社保派减办理成功才变更社保的办理状态
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId());
socialInfo.setHandleUserName(user.getNickname());
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
auditInfo = new TAuditInfo();
auditInfo.setType(CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_INT == flag) {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.THREE_STRING, user, temp.toString(), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
}
auditInfo.setSocialId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保数据:" + dis.getEmpName()));
return true;
}
//公积金派减办理
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
if (Common.isNotNull(providentFund) && Common.isNotNull(providentFund.getId())) {
//公积金派减办理成功才变更公积金的办理状态
if (CommonConstants.ZERO_INT == flag) {
providentFund.setHandleStatus(CommonConstants.THREE_STRING);
providentFund.setReduceHandleTime(now);
providentFund.setReduceHandleUser(user.getId());
if (Common.isNotNull(dis.getFundReduceDate())) {
providentFund.setFundReduceDate(dis.getFundReduceDate());
sf.setFundReduceDate(dis.getFundReduceDate());
}
sf.setFundReduceStatus(CommonConstants.TWO_STRING);
sf.setFundStatus(CommonConstants.SEVEN_STRING);
}
if (CommonConstants.ONE_INT == flag) {
//派减办理不通过
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
sf.setFundReduceStatus(CommonConstants.THREE_STRING);
sf.setFundStatus(CommonConstants.EIGHT_STRING);
sf.setFundReduceDate(null);
}
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId());
providentFund.setHandleUserName(user.getNickname());
fundMapper.updateFundInfoById(providentFund);
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), CommonConstants.SIX_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark);
dis.setFundHandleStatus(CommonConstants.ONE_STRING);
} else {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_FAIL + handleRemark), CommonConstants.FOUR_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark);
dis.setFundHandleStatus(CommonConstants.TWO_STRING);
}
auditInfo.setProvidentId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工公积金数据:" + dis.getEmpName()));
return true;
}
}
//1.派增办理失败 刷新预估数据
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
// 全部办理失败 社保和公积金派增办理失败 减少预估
if (CommonConstants.ONE_INT == flag
&& (CommonConstants.FIVE_STRING.equals(sf.getSocialStatus())
|| CommonConstants.FOUR_STRING.equals(sf.getFundStatus()))) {
// 派增办理,全部失败 同步预估库数据
socialTask.asynchronousDisPatchHandle(socialMap,fundMap,sf, forecastFlag, null, null, CommonConstants.ZERO_INT);
}
// 社保办理只要办理成功就刷新预估数据 公积金办理不用处理(前面公积金办理成功的时候处理过了)
if (CommonConstants.ZERO_STRING.equals(typeSub)
&& (Common.isNotNull(dis.getSocialId())
&& CommonConstants.FOUR_STRING.equals(sf.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(sf.getSocialStatus()))) {
if (partSuccess) {
forecastLibraryService.updateForecastLibaryByDispatch(socialMap,fundMap,sf);
} else {
socialTask.asynchronousDisPatchHandle(socialMap,fundMap,sf, 0, null, null, CommonConstants.ONE_INT);
}
}
}
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
if (CommonConstants.ONE_STRING.equals(dis.getType())
&& CommonConstants.ZERO_INT == flag
&& (CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())
|| CommonConstants.SEVEN_STRING.equals(sf.getFundStatus()))){
// 同步预估库数据
socialTask.asynchronousDisPatchHandle(socialMap,fundMap,sf, forecastFlag,null,null,CommonConstants.ZERO_INT);
}
//社保公积金派减办理成功
if ((CommonConstants.ONE_STRING.equals(dis.getType()) && CommonConstants.ZERO_INT == flag
&& CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())
&& (CommonConstants.SEVEN_STRING.equals(sf.getFundStatus())
|| Common.isEmpty(sf.getFundStatus()))) ||
(CommonConstants.ZERO_STRING.equals(dis.getType()) && CommonConstants.ONE_INT == flag &&
CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())
&& (CommonConstants.FOUR_STRING.equals(sf.getFundStatus())
|| CommonConstants.NINE_STRING.equals(sf.getFundStatus())))) {
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus(socialInfo, providentFund, vo,sf);
vo.setEmpIdCard(dis.getEmpIdcard());
vo.setDepartNo(dis.getSettleDomainCode());
if (Common.isNotNull(dis.getChangeContractAndEmployee())
&& CommonConstants.ZERO_STRING.equals(dis.getChangeContractAndEmployee())
&& (Common.isNotNull(vo.getSocialStatus()) || Common.isNotNull(vo.getFundStatus()))) {
vo.setChangeContractAndEmployee(dis.getChangeContractAndEmployee());
vo.setUserId(user.getId());
vo.setUserName(user.getNickname());
vo.setEmpName(dis.getEmpName());
vo.setDeptName(dis.getSettleDomainName());
vo.setDetailId(dis.getId());
}
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()) {
errorList.add(new ErrorMessage(-1, vo.getEmpIdCard() + DispatchConstants.DISPATCH_SYN_DOC_EXE, CommonConstants.RED, dis.getEmpName()));
continue;
}
// 派减公积金办理失败不同步档案的相关字段信息
} else if (!(CommonConstants.ONE_STRING.equals(dis.getType())
&& CommonConstants.ONE_INT == flag
&& CommonConstants.ONE_STRING.equals(typeSub))){
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus(socialInfo, providentFund, vo,sf);
if (Common.isNotNull(vo.getSocialStatus()) || Common.isNotNull(vo.getFundStatus())){
vo.setEmpIdCard(dis.getEmpIdcard());
vo.setDepartNo(dis.getSettleDomainCode());
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){
errorList.add(new ErrorMessage(-1, vo.getEmpIdCard()+DispatchConstants.DISPATCH_SYN_DOC_EXE,CommonConstants.RED,dis.getEmpName()));
continue;
}
}
}
}
//更新派单状态
if (Common.isNotNull(auditInfo)) {
//派增判断
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
if (Common.isNotNull(dis.getSocialHandleStatus())
&& Common.isNotNull(dis.getFundHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getSocialHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if ((CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))
&& Common.isEmpty(dis.getFundHandleStatus())) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
//派减判断
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
if (Common.isNotNull(dis.getSocialId())
&& Common.isNotNull(dis.getFundId())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getSocialId()) && Common.isNotNull(dis.getFundId())
&& (CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getFundId()) && Common.isNotNull(dis.getSocialId())
&&(CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.THREE_STRING.equals(dis.getSocialHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
}
dis.setHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
//新增办理记录信息
auditInfo.setDispatchInfoId(dis.getId());
auditInfo.setEmpIdcard(dis.getEmpIdcard());
if (auditFlag){
auditInfoMapper.insert(auditInfo);
}
baseMapper.updateById(dis);
//v1.8.9更新社保公积金缴纳地和户数据
socialFundMapper.updateById(sf);
//派减的申请审核完更新社保公积金查询快照表
if (CommonConstants.ONE_STRING.equals(dis.getType())) {
socialFundInfo = infoService.getOne(Wrappers.<TDispatchSocialFundInfo>query().lambda()
.eq(TDispatchSocialFundInfo::getReduceSocialFundId, dis.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(socialFundInfo)) {
String reduceSocialFundId = socialFundInfo.getReduceSocialFundId();
String id = socialFundInfo.getId();
BeanUtils.copyProperties(sf,socialFundInfo);
socialFundInfo.setId(id);
socialFundInfo.setReduceSocialFundId(reduceSocialFundId);
infoService.updateById(socialFundInfo);
}
}
//1.派增办理失败 刷新预估数据
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
// 全部办理失败 社保和公积金派增办理失败 减少预估
if (CommonConstants.ONE_INT == flag
&& (CommonConstants.FIVE_STRING.equals(sf.getSocialStatus())
|| CommonConstants.FOUR_STRING.equals(sf.getFundStatus()))) {
// 派增办理,全部失败 同步预估库数据
socialTask.asynchronousDisPatchHandle(socialMap, fundMap,sf, forecastFlag, null, null, CommonConstants.ZERO_INT);
}
// 社保办理只要办理成功就刷新预估数据 公积金办理不用处理(前面公积金办理成功的时候处理过了)
if (CommonConstants.ZERO_STRING.equals(typeSub)
&& (Common.isNotNull(dis.getSocialId())
&& CommonConstants.FOUR_STRING.equals(sf.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(sf.getSocialStatus()))) {
if (partSuccess) {
forecastLibraryService.updateForecastLibaryByDispatch(socialMap, fundMap,sf);
} else {
errorList.add(new ErrorMessage(-1, "派单数据错误!"));
socialTask.asynchronousDisPatchHandle(socialMap, fundMap,sf, 0, null, null, CommonConstants.ONE_INT);
}
}
} catch(Exception e){
log.error(DispatchConstants.DISPATCH_EXCEPTION, e);
errorList.add(new ErrorMessage(-1, DispatchConstants.DISPATCH_EXCEPTION + e.getMessage()));
return errorList;
}
} else{
errorList.add(new ErrorMessage(-1, DispatchConstants.NO_OPERATOR_DATA));
return errorList;
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
if (CommonConstants.ONE_STRING.equals(dis.getType())
&& CommonConstants.ZERO_INT == flag
&& (CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())
|| CommonConstants.SEVEN_STRING.equals(sf.getFundStatus()))){
// 同步预估库数据
socialTask.asynchronousDisPatchHandle(socialMap, fundMap,sf, forecastFlag,null,null,CommonConstants.ZERO_INT);
}
//社保公积金派减办理成功
if ((CommonConstants.ONE_STRING.equals(dis.getType()) && CommonConstants.ZERO_INT == flag
&& CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())
&& (CommonConstants.SEVEN_STRING.equals(sf.getFundStatus())
|| Common.isEmpty(sf.getFundStatus()))) ||
(CommonConstants.ZERO_STRING.equals(dis.getType()) && CommonConstants.ONE_INT == flag &&
CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())
&& (CommonConstants.FOUR_STRING.equals(sf.getFundStatus())
|| CommonConstants.NINE_STRING.equals(sf.getFundStatus())))) {
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus(socialInfo, providentFund, vo,sf);
vo.setEmpIdCard(dis.getEmpIdcard());
vo.setDepartNo(dis.getSettleDomainCode());
if (Common.isNotNull(dis.getChangeContractAndEmployee())
&& CommonConstants.ZERO_STRING.equals(dis.getChangeContractAndEmployee())
&& (Common.isNotNull(vo.getSocialStatus()) || Common.isNotNull(vo.getFundStatus()))) {
vo.setChangeContractAndEmployee(dis.getChangeContractAndEmployee());
vo.setUserId(user.getId());
vo.setUserName(user.getNickname());
vo.setEmpName(dis.getEmpName());
vo.setDeptName(dis.getSettleDomainName());
vo.setDetailId(dis.getId());
}
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()) {
errorList.add(new ErrorMessage(-1, vo.getEmpIdCard() + DispatchConstants.DISPATCH_SYN_DOC_EXE, CommonConstants.RED, dis.getEmpName()));
return true;
}
// 派减公积金办理失败不同步档案的相关字段信息
} else if (!(CommonConstants.ONE_STRING.equals(dis.getType())
&& CommonConstants.ONE_INT == flag
&& CommonConstants.ONE_STRING.equals(typeSub))){
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus(socialInfo, providentFund, vo,sf);
if (Common.isNotNull(vo.getSocialStatus()) || Common.isNotNull(vo.getFundStatus())){
vo.setEmpIdCard(dis.getEmpIdcard());
vo.setDepartNo(dis.getSettleDomainCode());
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){
errorList.add(new ErrorMessage(-1, vo.getEmpIdCard()+DispatchConstants.DISPATCH_SYN_DOC_EXE,CommonConstants.RED, dis.getEmpName()));
return true;
}
}
}
} else {
errorList.add(new ErrorMessage(-1, "派单数据错误!"));
}
return errorList;
return false;
}
/**
......
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