Authored by gemingdan

提现分批mq

... ... @@ -234,7 +234,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
private String IS_NEED_SIGN_UP = "union.need.signup.switch";
private String RANKLIST_FROM_DATE = "union.rank.from";
private static final int SETTLEMENT_ORDER_SPLIT_NUM=800;
private static final int SETTLEMENT_ORDER_SPLIT_NUM=16;
... ... @@ -3765,13 +3765,12 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
return -1;
}
int count = unionShareOrdersMapper.selectOrderNumByCondition(settlementCode);
if (count < 1) {
return -2;
}
List<UnionShareOrdersBo> orderList = new ArrayList<>();//该提现对应的订单
int size = SETTLEMENT_ORDER_SPLIT_NUM;
int page = count % size > 0 ? (count / size) + 1 : count / size;
boolean isFirst = true;
if (count > 0 ) {
List<UnionShareOrdersBo> orderList = new ArrayList<>();//该提现对应的订单
int page = count % size > 0 ? (count / size) + 1 : count / size;
for (int i = 0; i < page; i++) {
int offset = i * size ;
List<UnionShareOrders> periodOrders = unionShareOrdersMapper.selectOrderByCondition(settlementCode, offset, size);
... ... @@ -3790,12 +3789,15 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
isFirst = false;
orderList.clear();
}
}
//查询活动额外返的返利单
List<Integer> ids = unionShareOrdersMapper.selectIdForActivity(settlementCode);
List<UnionShareOrdersActivityBo> activityBos = new ArrayList<>();
if(CollectionUtils.isNotEmpty(ids)){
page = count % size > 0 ? (count / size) + 1 : count / size;
for (int i = 0; i < page; i++) {
count = ids.size();
int pageA = count % size > 0 ? (count / size) + 1 : count / size;
for (int i = 0; i < pageA; i++) {
int startIndex = i * size ;
int endIndex=startIndex+size-1;
List<UnionShareOrdersActivityLogs> activities = unionShareOrdersActivityLogsMapper.selectByOrderIds(ids.subList(startIndex,endIndex<count?endIndex:count-1));
... ...