Commit c61f1776 authored by eddie.woo's avatar eddie.woo

modify

parent 675b89bc
...@@ -32,7 +32,7 @@ public class DataInitTest extends CommonIT { ...@@ -32,7 +32,7 @@ public class DataInitTest extends CommonIT {
private OutputInvoiceDetailMapper outputInvoiceDetailMapper; private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
@Test @Test
public void tt(){ public void tt() {
StandardAccount account = new StandardAccount(); StandardAccount account = new StandardAccount();
account.setId(CommonUtils.getUUID()); account.setId(CommonUtils.getUUID());
account.setCode("2221200103"); account.setCode("2221200103");
...@@ -254,8 +254,9 @@ public class DataInitTest extends CommonIT { ...@@ -254,8 +254,9 @@ public class DataInitTest extends CommonIT {
@Test @Test
public void initOutputDetail() throws Exception { public void initOutputDetail() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项明细_绿能_201809.xlsx")); Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项明细_乐叶_201807.xlsx"));
Sheet sheet = workbook.getSheetAt(0); Sheet sheet = workbook.getSheetAt(0);
String lsh = "";
for (int r = 1; r <= sheet.getLastRowNum(); r++) { for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try { try {
for (int c = 0; c <= sheet.getRow(r).getLastCellNum(); c++) { for (int c = 0; c <= sheet.getRow(r).getLastCellNum(); c++) {
...@@ -279,11 +280,12 @@ public class DataInitTest extends CommonIT { ...@@ -279,11 +280,12 @@ public class DataInitTest extends CommonIT {
detail.setFPHXZ(sheet.getRow(r).getCell(16).getStringCellValue()); detail.setFPHXZ(sheet.getRow(r).getCell(16).getStringCellValue());
OutputInvoiceDetailExample example = new OutputInvoiceDetailExample(); OutputInvoiceDetailExample example = new OutputInvoiceDetailExample();
example.createCriteria().andFPQQLSHEqualTo(detail.getFPQQLSH()); example.createCriteria().andFPQQLSHEqualTo(detail.getFPQQLSH());
if (outputInvoiceDetailMapper.selectByExample(example).size() > 0) { if (!StringUtils.equals(lsh, detail.getFPQQLSH())) {
outputInvoiceDetailMapper.updateByExampleSelective(detail, example); outputInvoiceDetailMapper.deleteByExample(example);
} else { lsh = detail.getFPQQLSH();
outputInvoiceDetailMapper.insertSelective(detail);
} }
outputInvoiceDetailMapper.insertSelective(detail);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment