Commit 76fa0947 authored by fangxinjiang's avatar fangxinjiang

收入推送优化,防止大批量数据 异常

parent 1a3a290f
...@@ -156,6 +156,10 @@ public interface CommonConstants { ...@@ -156,6 +156,10 @@ public interface CommonConstants {
* number 5000 * number 5000
*/ */
int FIVES_INT = 5000; int FIVES_INT = 5000;
/**
* number 5000
*/
int TEN_THOUSAND_INT = 10000;
/** /**
* number 1 * number 1
......
...@@ -2513,13 +2513,25 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2513,13 +2513,25 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override @Override
public void createPaymentSocialInfo() { public void createPaymentSocialInfo() {
//获取所有未推送的社保实缴明细数据 //获取所有未推送的社保实缴明细数据
List<TPaymentInfo> unPushInfo = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda() long count = baseMapper.selectCount(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING) .eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING) .eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getSocialId)); .isNotNull(TPaymentInfo::getSocialId));
if (Common.isNotNull(unPushInfo)) { if (count > 0){
List<TPaymentInfo> unPushs;
int i = (int)Math.ceil((double)count/CommonConstants.TEN_THOUSAND_INT);
for (int j=0;j<i;j++){
unPushs = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getSocialId).last(" limit 0,10000"));
synchronized (this){
if (Common.isNotNull(unPushs)) {
//推送数据封装并推送 //推送数据封装并推送
initEkpPushSocialParam(unPushInfo); initEkpPushSocialParam(unPushs);
}
}
}
} }
} }
......
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