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

modify

parent 675b89bc
......@@ -32,7 +32,7 @@ public class DataInitTest extends CommonIT {
private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
@Test
public void tt(){
public void tt() {
StandardAccount account = new StandardAccount();
account.setId(CommonUtils.getUUID());
account.setCode("2221200103");
......@@ -254,8 +254,9 @@ public class DataInitTest extends CommonIT {
@Test
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);
String lsh = "";
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try {
for (int c = 0; c <= sheet.getRow(r).getLastCellNum(); c++) {
......@@ -279,11 +280,12 @@ public class DataInitTest extends CommonIT {
detail.setFPHXZ(sheet.getRow(r).getCell(16).getStringCellValue());
OutputInvoiceDetailExample example = new OutputInvoiceDetailExample();
example.createCriteria().andFPQQLSHEqualTo(detail.getFPQQLSH());
if (outputInvoiceDetailMapper.selectByExample(example).size() > 0) {
outputInvoiceDetailMapper.updateByExampleSelective(detail, example);
} else {
outputInvoiceDetailMapper.insertSelective(detail);
if (!StringUtils.equals(lsh, detail.getFPQQLSH())) {
outputInvoiceDetailMapper.deleteByExample(example);
lsh = detail.getFPQQLSH();
}
outputInvoiceDetailMapper.insertSelective(detail);
} catch (Exception e) {
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