当前位置: 首页 > news >正文

网站开发人员工资水平合肥网站开发哪家好

网站开发人员工资水平,合肥网站开发哪家好,全国注册安全工程师官网,阳谷建网站1、在导出Excel时经常会碰到文件过大#xff0c;导出特别慢 2、微服务限制了请求超时时间#xff0c;文件过大情况必然超时 优化思路#xff1a; 1、文件过大时通过文件拆分、打包压缩zip#xff0c;然后上传到oss,并设置有效期#xff08;30天过期#xff09; 2、把…1、在导出Excel时经常会碰到文件过大导出特别慢 2、微服务限制了请求超时时间文件过大情况必然超时 优化思路 1、文件过大时通过文件拆分、打包压缩zip然后上传到oss,并设置有效期30天过期 2、把同步下载改成异步 3、文件生成完成更新任务状态 4、通过oss的下载链接下载文件 5、多模块复用只需要实现各自查询Excel业务数据的接口即可 以下是部分参考代码 public class TxnETExecutor extends AbstractExportTaskExecutor {private final MposScene mposScene;private final OssService ossService;Overridepublic boolean support(int taskType) {return ExportTaskType.MPOS_TXN_BILL_EXPORT.ordinal() taskType;}Overridepublic int getFileSize(String reqBody, String audClientId, Long groupId) {TxnMposBillItemFindReq req JSON.parseObject(reqBody, TxnMposBillItemFindReq.class);req.setAudClientId(audClientId);req.setLoginGroupId(groupId);req.setPage(1);req.setPageSize(1);req.setDiffStatus(true);Pageable pageable mposScene.findByChannelBillItem(req);return pageable.getTotalPages().intValue();}public void execute(Long taskId, int fileSize, String reqBody, String audClientId, Long groupId) {TxnMposBillItemFindReq req JSON.parseObject(reqBody, TxnMposBillItemFindReq.class);req.setAudClientId(audClientId);req.setLoginGroupId(groupId);req.setPage(1);req.setDiffStatus(true);int pageSize Math.min(fileSize, DEFAULT_PAGE_SIZE);req.setPageSize(pageSize);Pageable pageable mposScene.findByChannelBillItem(req);Long totalPages pageable.getTotalPages();ListMapString, Object first parse(pageable.getItems());ByteArrayOutputStream outputStream WebFluxUtils.buildExcelOutputStream(first, null);if (totalPages 1) {OssPutObjectResp objectResp upload(audClientId, xlsx, new ByteArrayInputStream(outputStream.toByteArray()));String fileUrl objectResp.getFileUrl();update(CashierExportTaskUpdateReq.newBuilder().setId(taskId).setFileStatus(ExportTaskFileStatus.SUCCESS.ordinal()).setFileFormat(xlsx).setFileProgressRate(100%).setFileUrl(fileUrl).build());return;}MapString, ByteArrayOutputStream files new HashMap();files.put(String.format(渠道对账单[%s-%s].xlsx, 1, totalPages), outputStream);for (int i 2; i totalPages; i) {req.setPage(i);Pageable pageableExportMore mposScene.findByChannelBillItem(req);ByteArrayOutputStream j WebFluxUtils.buildExcelOutputStream(parse(pageableExportMore.getItems()), null);files.put(String.format(渠道对账单[%s-%s].xlsx, i, totalPages), j);}Path tmp zip(files);if (tmp null) {update(CashierExportTaskUpdateReq.newBuilder().setId(taskId).setFileStatus(ExportTaskFileStatus.FAIL.ordinal()).setFileFormat(zip).setFileProgressRate(100%).build());return;}InputStream inputStream;try {inputStream Files.newInputStream(tmp);} catch (IOException e) {e.printStackTrace();update(CashierExportTaskUpdateReq.newBuilder().setId(taskId).setFileStatus(ExportTaskFileStatus.FAIL.ordinal()).setFileFormat(zip).setFileProgressRate(100%).build());return;}try {OssPutObjectResp objectResp upload(audClientId, zip, inputStream);update(CashierExportTaskUpdateReq.newBuilder().setId(taskId).setFileStatus(ExportTaskFileStatus.SUCCESS.ordinal()).setFileFormat(zip).setFileProgressRate(100%).setFileUrl(objectResp.getFileUrl()).build());} catch (Exception e) {e.printStackTrace();update(CashierExportTaskUpdateReq.newBuilder().setId(taskId).setFileStatus(ExportTaskFileStatus.FAIL.ordinal()).setFileFormat(zip).setFileProgressRate(100%).build());} finally {try {Files.delete(tmp);} catch (IOException ignore) {}}}private ListMapString, Object parse(CollectionTxnMposBillItemFindResp items) {ListMapString, Object result new ArrayList();if (items null || items.isEmpty()) {throw FibException.ofNotFound(暂无数据);}items.forEach(item - {MapString, Object map new LinkedHashMap();map.put(创建时间, item.getCreateTime().format(DateTimeFormatter.ofPattern(yyyy-MM-dd HH:mm:ss)));map.put(批次号, item.getBatchNo());map.put(交易时间, item.getTransTime());map.put(交易月份, item.getTransMonth());map.put(平台订单号, item.getServerOrderId());......result.add(map);});return result;}private OssPutObjectResp upload(String audClientId, String suffix, InputStream inputStream) {return ossService.putObject(OssPutObjectReq.newBuilder().setBucketName(DEFAULT_BUCKET).setAudClientId(audClientId).setDirectoryPath(***).setSuffix(suffix).build(), inputStream);} } 效果图
http://www.hkea.cn/news/14275537/

相关文章:

  • 学做网站多久wordpress特定账户注册
  • 网站建设属于网站开发和推广的不同
  • 做网站需要Excel表格吗网站重构案例
  • 折扣券网站怎么做九龙坡网站建设
  • 关于网站运营平台网站建设后台源码
  • 网站建设代理开发科技企业服务网站建设制作微商授权书
  • 分包合同建设局网站下载三合一网站介绍
  • wordpress后台轮播图设置莱阳seo外包
  • 在建设厅网站上下载资质标准公司做网站需要什么条件
  • cms 类网站深圳短视频seo搜索排名如何做
  • 空间站建设开发者模式是干什么的
  • 果业局网站建设怎么做网络乞丐网站
  • 建设银行手机银行网站登录怎么做站旅游网站上泡到妞
  • 模板网站有利于优化广告牌大全图片
  • 网站seo 文章转载 修改标题产品界面设计
  • app开发网站排行网站底部浮动
  • 软件开发工具是什么意思河北网站seo地址
  • 教人做衣服的网站南京科技网站设计费用
  • 好看的手机网站布局微网站开发教材
  • 欧赛科技网站建设商务网站模板
  • 软件公司网站设计网站网格
  • 汉唐皓月网站推广方案上海外贸公司最新招聘
  • 大兴网站建设一条龙东莞最好的网站
  • 怎么把个人做的网站上传到网上官方网站建设需要哪个部门审批
  • 企业网站系统有哪些网架公司办公室规章制度范本
  • 网站查询工具ps制作网站首页界面
  • 宁德企业网站建设南通设计网站建设
  • 一条龙搭建网站高端网站的建设
  • 网站开发的技术问题虚拟主机销售网站源码
  • 海口模板建站哪家好wordpress all in one seo pack