Commit 72fda5cf authored by huyuchen's avatar huyuchen

社保配置修改

parent feed4723
......@@ -1950,6 +1950,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
detailList.add(detail);
this.updateById(detail);
try {
//获取项目信息
if (null != mapSelectVo) {
......@@ -2042,9 +2043,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
log.info("登记保单保费一条耗时:" + (d2 - d1));
}
//批量更新和插入数据
if (!detailList.isEmpty()) {
this.updateBatchById(detailList);
}
if (!settleList.isEmpty()) {
tInsuranceSettleService.updateBatchById(settleList);
settleList.clear();
......
......@@ -476,8 +476,7 @@ public class TPaymentInfoController {
@SysLog("手动推送社保缴费库明细的数据")
@PostMapping("/pushPaymentSocialFundInfo")
public R<Boolean> pushPaymentSocialFundInfo(@RequestBody TPaymentInfoSearchVo searchVo) {
tPaymentInfoService.pushPaymentSocialFundInfo(searchVo);
return R.ok();
return tPaymentInfoService.pushPaymentSocialFundInfo(searchVo);
}
/**
......
......@@ -149,7 +149,7 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
TPaymentVo getPaymentSocialAndFound(TPaymentInfo info);
void pushPaymentSocialFundInfo(TPaymentInfoSearchVo searchVo);
R<Boolean> pushPaymentSocialFundInfo(TPaymentInfoSearchVo searchVo);
/**
* 批量标识可以推送的数据
......
......@@ -38,9 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.ErrorDetailVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
......@@ -272,7 +270,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public R<Boolean> removeInFoById(String id) {
YifuUser user = SecurityUtils.getUser();
String key = CacheConstants.PAYMENT_SOCIAL_PUSH + CommonConstants.DOWN_LINE_STRING + user.getId();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CacheConstants.PAYMENT_SOCIAL_PUSH;
if (Common.isNotNull(redisUtil.get(key))) {
return R.failed("用户正在推送实缴数据中禁止删除!");
}
......@@ -300,7 +298,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
String key = CacheConstants.PAYMENT_SOCIAL_PUSH + CommonConstants.DOWN_LINE_STRING + user.getId();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CacheConstants.PAYMENT_SOCIAL_PUSH;
if (Common.isNotNull(redisUtil.get(key))) {
return R.failed("用户正在推送实缴数据中禁止删除!");
}
......@@ -342,7 +340,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String socialCreateMonth, String socialPayMonth) {
YifuUser user = SecurityUtils.getUser();
String key = CacheConstants.PAYMENT_SOCIAL_PUSH + CommonConstants.DOWN_LINE_STRING + user.getId();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CacheConstants.PAYMENT_SOCIAL_PUSH;
if (Common.isNotNull(redisUtil.get(key))) {
return R.failed("用户正在推送实缴数据中禁止删除!");
}
......@@ -2814,17 +2812,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
@Override
public void pushPaymentSocialFundInfo(TPaymentInfoSearchVo searchVo) {
public R<Boolean> pushPaymentSocialFundInfo(TPaymentInfoSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
// 获取redis分布式事务锁
String key = CacheConstants.PAYMENT_SOCIAL_PUSH + CommonConstants.DOWN_LINE_STRING + user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA);
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CacheConstants.PAYMENT_SOCIAL_PUSH;
if (Common.isNotNull(redisUtil.get(key))) {
return R.failed("用户正在推送实缴数据中,禁止重复推送!");
} else {
redisUtil.set(key, user.getId(), 1200L);
}
redisUtil.set(key, user.getId(), 36000L);
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
//手动推送未推送的社保公积金明细数据
createPaymentSocialInfoReal(user, searchVo, mapSelectVo);
......@@ -2840,10 +2836,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
doJointSocialTask.asynchronousEkpIncomePaymentT(income);
}
redisUtil.remove(redisKey);
redisUtil.remove(key);
}
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
redisUtil.remove(key);
return R.ok();
}
@Override
......
......@@ -326,6 +326,7 @@
a.UPDATE_TIME,
a.UPDATE_BY,
a.CREATE_NAME,
a.BPO_FLAG,
a.CREATE_TIME
</sql>
<sql id="tPaymentInfo_where">
......
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