lcq

lcq

V2EX 第 456266 号会员,加入于 2019-11-29 14:20:53 +08:00
根据 lcq 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
lcq 最近回复了
2022-09-21 23:51:00 +08:00
回复了 JerAxxxx 创建的主题 求职 [深圳 Java 后端] 求职
期望薪资多少
2022-08-10 18:46:48 +08:00
回复了 lcq 创建的主题 程序员 微服务架构,怎么输出报表的?
@thtznet 用什么搭建
2021-12-13 16:27:39 +08:00
回复了 lcq 创建的主题 Java 生成二位码后导出到 execl 缓慢,大佬有什么解决方法
List<CouponCodeExchangeListVO> list;

public ExportCouponCodeTask(List<CouponCodeExchangeListVO> list){
this.list = list;
}

@Override
public List<CouponCodeExchangeListExcelVO> call() throws Exception {
log.info("执行任务");
List<CouponCodeExchangeListExcelVO> couponCodeExchangeListExcelVOS = new ArrayList<>();
for (CouponCodeExchangeListVO couponCodeExchangeListVO : list) {
CouponCodeExchangeListExcelVO couponCodeExchangeListExcelVO = new CouponCodeExchangeListExcelVO();
BeanUtils.copyProperties(couponCodeExchangeListVO, couponCodeExchangeListExcelVO);
couponCodeExchangeListExcelVO.setByteArray(generateJpg(couponCodeExchangeListVO.getQrCodeUrl(), 500, 500));
if (StringUtils.isNotBlank(couponCodeExchangeListVO.getSuWxSubscribe())){
couponCodeExchangeListExcelVO.setSuWxSubscribe(couponCodeExchangeListVO.getSuWxSubscribe().split(":")[1]);
}
if (StringUtils.isNotBlank(couponCodeExchangeListVO.getEnterpriseWechat())){
couponCodeExchangeListExcelVO.setEnterpriseWechat(couponCodeExchangeListVO.getEnterpriseWechat().split(":")[1]);
}
couponCodeExchangeListExcelVOS.add(couponCodeExchangeListExcelVO);
}
return couponCodeExchangeListExcelVOS;
}

private static byte[] generateJpg(String content, int width, int height) {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
generate(content, width, height, ImgUtil.IMAGE_TYPE_JPG, out);
return out.toByteArray();
}
2021-12-13 16:27:04 +08:00
回复了 lcq 创建的主题 Java 生成二位码后导出到 execl 缓慢,大佬有什么解决方法
//获取全部数据
ResultBody<List<CouponCodeExchangeListVO>> resultBody = couponCodeFeignClientService.getListByRuleId(map.get("ruleId").toString());
List<CouponCodeExchangeListVO> records = resultBody.getData();
List<CouponCodeExchangeListExcelVO> couponCodeExchangeListExcelVOS = new ArrayList<>();
List<Future<List<CouponCodeExchangeListExcelVO>>> futures = new ArrayList<>();
if (CollectionUtil.isNotEmpty(records)) {
int totalNum = records.size();
int batchNum;
if (totalNum <= 1000){
batchNum = 200;
}else {
batchNum = 500;
}
int pageNum = totalNum % batchNum == 0 ? totalNum / batchNum : totalNum / batchNum + 1;
List<CouponCodeExchangeListVO> subData;
int toIndex, fromIndex;
List<ExportCouponCodeTask> tasks = new ArrayList<>();
for (int i = 0; i < pageNum; i++) {
fromIndex = i * batchNum;
toIndex = Math.min(totalNum, fromIndex + batchNum);
subData = records.subList(fromIndex, toIndex);
tasks.add(new ExportCouponCodeTask(subData));
}
//分批使用多线程处理
if(!exportCouponCodeThreadPoolExecutor.isShutdown()){
futures = exportCouponCodeThreadPoolExecutor.invokeAll(tasks);
}
}
for (Future<List<CouponCodeExchangeListExcelVO>> future : futures) {
List<CouponCodeExchangeListExcelVO> couponCodeExchangeListExcelVOS1 = future.get();
couponCodeExchangeListExcelVOS.addAll(couponCodeExchangeListExcelVOS1);
}
2021-10-20 16:14:23 +08:00
回复了 Voyty 创建的主题 MacBook Pro Macbook Pro 大家准备下单什么配置呢?最好附上你的使用场景
@bingheath 教育优惠不是只能分三期吗
2021-10-19 10:42:39 +08:00
回复了 glacial 创建的主题 MacBook Pro spring 全干工程师,选 14 寸 还是 16 寸的
14 寸乞丐版 32G 感觉够了
@CharmingCheung 是的 断电可以买 UPS 通知服务 断网的话这个是怎么处理的
@midpoint 划水大王
2020-09-14 16:05:20 +08:00
回复了 lcq 创建的主题 Java 类似百度百科的弹出词条功能该怎么实现比较好?
@RiESA 想知道这种是怎么实现的,是你刚刚说的就是编辑的时候去维护的还是用另外一种方式做的?
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   6087 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 06:16 · PVG 14:16 · LAX 22:16 · JFK 01:16
Developed with CodeLauncher
♥ Do have faith in what you're doing.