| | |
| | | public void invoke(ImportOrderDto data, AnalysisContext context) { |
| | | log.info("解析到第 {} 条数据:{}", ++count, JSON.toJSONString(data)); |
| | | list.add(data); |
| | | if (context.getCurrentRowNum() == 5) { |
| | | if (context.getCurrentRowNum() == 3) { |
| | | String time = DateUtils.convert(new Date(),DateUtils.yyyyMMddHHmmss_F); |
| | | Order order2 = orderService.selectByNo(list.get(0).getColumn2()); // 订单号 |
| | | if(order2 != null) { |
| | |
| | | order.setOrderNo(orderNo); |
| | | order.setOrderTime(time); |
| | | order.setDocType(docType.getDocId()); |
| | | order.setCstmrName(Cools.isEmpty(list.get(2).getColumn2()) ? "" : list.get(2).getColumn2()); // 客户名称 |
| | | order.setMemo(Cools.isEmpty(list.get(3).getColumn2()) ? "" : list.get(3).getColumn2()); // 备注 |
| | | // order.setCstmrName(Cools.isEmpty(list.get(2).getColumn2()) ? "" : list.get(2).getColumn2()); // 客户名称 |
| | | // order.setMemo(Cools.isEmpty(list.get(3).getColumn2()) ? "" : list.get(3).getColumn2()); // 备注 |
| | | order.setSettle(1L); |
| | | order.setStatus(1); |
| | | order.setCreateBy(userId); |
| | |
| | | // |
| | | // log.info("存储数据库成功!"); |
| | | // } |
| | | private static final int MAX_BATCH_SIZE = 150; // 建议 100~200,根据字段数控制 |
| | | private static final int MAX_BATCH_SIZE = 50; // 建议 100~200,根据字段数控制 |
| | | |
| | | /** |
| | | * 分批存储数据库,避免SQL Server参数上限(2100)错误 |
| | |
| | | } |
| | | } else { |
| | | orderDetl.setBrand(importOrderDto.getColumn1()); |
| | | orderDetl.setSupp(importOrderDto.getColumn3()); |
| | | orderDetl.setMemo(importOrderDto.getColumn4()); |
| | | } |
| | | |
| | | orderDetl.setBatch(""); |