| | |
| | | Row row = sheet.getRow(i); |
| | | // 订单编号 |
| | | String uuid = dataFormatter.formatCellValue(row.getCell(0)); |
| | | // 商品名称 |
| | | // 品名 |
| | | String maktx = dataFormatter.formatCellValue(row.getCell(1)); |
| | | // 商品编码 |
| | | // 品号 |
| | | String matnr = dataFormatter.formatCellValue(row.getCell(2)); |
| | | // 品号 |
| | | String batch = dataFormatter.formatCellValue(row.getCell(3)); |
| | | // 数量 |
| | | Double anfme = Double.parseDouble(dataFormatter.formatCellValue(row.getCell(3))); |
| | | Double anfme = Double.parseDouble(dataFormatter.formatCellValue(row.getCell(4))); |
| | | // 下单时间 |
| | | String timeStr = dataFormatter.formatCellValue(row.getCell(4)); |
| | | String timeStr = dataFormatter.formatCellValue(row.getCell(5)); |
| | | |
| | | if (Cools.isEmpty(timeStr)) { |
| | | timeStr = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(now); |
| | | } |
| | | // 单据类型 |
| | | Long orderType = Long.parseLong(dataFormatter.formatCellValue(row.getCell(5))); |
| | | Long orderType = Long.parseLong(dataFormatter.formatCellValue(row.getCell(6))); |
| | | Date time = null; |
| | | try { |
| | | time = DateUtils.convert(timeStr, DateUtils.yyyyMMddHHmmss_F); |
| | |
| | | |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (null == mat) { |
| | | throw new CoolException(matnr + "商品编码的商品不存在,请重新导入!"); |
| | | throw new CoolException(matnr + "品号的商品不存在,请重新导入!"); |
| | | } |
| | | |
| | | Order order = orderService.selectByNo(uuid); |
| | |
| | | if (orderDetl == null) { |
| | | orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setBatch(null); |
| | | orderDetl.setBatch(batch); |
| | | orderDetl.setAnfme(anfme); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |