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

modify

parent 6e55d634
...@@ -31,6 +31,25 @@ public class DataInitTest extends CommonIT { ...@@ -31,6 +31,25 @@ public class DataInitTest extends CommonIT {
@Resource @Resource
private OutputInvoiceDetailMapper outputInvoiceDetailMapper; private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
@Test
public void tt(){
StandardAccount account = new StandardAccount();
account.setId(CommonUtils.getUUID());
account.setCode("2221200103");
account.setName("代扣代缴增值税");
account.setFullName("应交税费-应交增值税-进项税额-代扣代缴增值税");
account.setParentCode("22212001");
account.setAcctProp(2);
account.setAcctLevel(4);
account.setDirection(1);
account.setIsLeaf(true);
account.setRuleType(2);
account.setIsActive(true);
account.setEnglishName("应交税费-应交增值税-进项税额-代扣代缴增值税");
account.setIndustryId("0");
standardAccountMapper.insertSelective(account);
}
@Test @Test
public void initStandardAccount() { public void initStandardAccount() {
try { try {
...@@ -93,7 +112,7 @@ public class DataInitTest extends CommonIT { ...@@ -93,7 +112,7 @@ public class DataInitTest extends CommonIT {
@Test @Test
public void initInput() throws Exception { public void initInput() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_进项主表_乐叶_201807.xls")); Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_进项主表_绿能_201809.xlsx"));
Sheet sheet = workbook.getSheetAt(0); Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) { for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try { try {
...@@ -124,7 +143,13 @@ public class DataInitTest extends CommonIT { ...@@ -124,7 +143,13 @@ public class DataInitTest extends CommonIT {
invoice.setRZJG(sheet.getRow(r).getCell(32).getStringCellValue()); invoice.setRZJG(sheet.getRow(r).getCell(32).getStringCellValue());
invoice.setCJSJ(sheet.getRow(r).getCell(34).getStringCellValue()); invoice.setCJSJ(sheet.getRow(r).getCell(34).getStringCellValue());
invoice.setLRRQ(sheet.getRow(r).getCell(38).getStringCellValue()); invoice.setLRRQ(sheet.getRow(r).getCell(38).getStringCellValue());
inputInvoiceMapper.insertSelective(invoice); InputInvoiceExample example = new InputInvoiceExample();
example.createCriteria().andFPDMEqualTo(invoice.getFPDM()).andFPHMEqualTo(invoice.getFPHM());
if (inputInvoiceMapper.selectByExample(example).size() > 0) {
inputInvoiceMapper.updateByExampleSelective(invoice, example);
} else {
inputInvoiceMapper.insertSelective(invoice);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -134,7 +159,7 @@ public class DataInitTest extends CommonIT { ...@@ -134,7 +159,7 @@ public class DataInitTest extends CommonIT {
@Test @Test
public void initInputDetail() throws Exception { public void initInputDetail() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_进项明细_绿能_201809.xls")); Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_进项明细_绿能_201809.xls"));
Sheet sheet = workbook.getSheetAt(0); Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) { for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try { try {
...@@ -162,7 +187,14 @@ public class DataInitTest extends CommonIT { ...@@ -162,7 +187,14 @@ public class DataInitTest extends CommonIT {
// continue; // continue;
// } // }
// detail.setFPID(); // detail.setFPID();
inputInvoiceDetailMapper.insertSelective(detail); InputInvoiceDetailExample example = new InputInvoiceDetailExample();
example.createCriteria().andFPDMEqualTo(detail.getFPDM()).andFPHMEqualTo(detail.getFPHM());
if (inputInvoiceDetailMapper.selectByExample(example).size() > 0) {
inputInvoiceDetailMapper.updateByExampleSelective(detail, example);
} else {
inputInvoiceDetailMapper.insertSelective(detail);
}
// inputInvoiceDetailMapper.insertSelective(detail);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -172,7 +204,7 @@ public class DataInitTest extends CommonIT { ...@@ -172,7 +204,7 @@ public class DataInitTest extends CommonIT {
@Test @Test
public void initOutput() throws Exception { public void initOutput() 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);
for (int r = 1; r <= sheet.getLastRowNum(); r++) { for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try { try {
......
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