Authored by mingdan.ge

限制导出全部的数量不超过5000

... ... @@ -81,9 +81,7 @@
and create_time >= #{beginTime}
</if>
order by id desc
<if test="!queryAll">
limit #{start},#{size}
</if>
</select>
<select id="selectTotalByCondition" resultType="java.lang.Integer"
parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo">
... ...
... ... @@ -32,7 +32,8 @@ public class UnionShareApplyExportImpl implements IBusinessExportService {
@Override
public List<? extends Object> batchExport(String confStr){
UnionShareUserApplyListReqBo req = JSONObject.parseObject(confStr, UnionShareUserApplyListReqBo.class);
req.setQueryAll(true);
// req.setQueryAll(true);
req.setSize(5000);
List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(req);
for(UnionShareUserApplyListBo bo:applys){
covertSocialMedia(bo);
... ...
... ... @@ -3282,7 +3282,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
throw new ServiceException(400, "没有要导出的数据");
}
request.setSize(5000);
int totalPage = count / 5000 + (count % 5000 > 1 ? 1 : 0);
int totalPage =1;//限制导出数量,避免大批量导出
// int totalPage = count / 5000 + (count % 5000 > 1 ? 1 : 0);
ordersDOList = new ArrayList<>();
for (int i = 1; i <= totalPage; i++) {
request.setPage(i);
... ...