Commit b961e366 authored by libin's avatar libin

购房车

parent 7ab1dc79
package com.xxfc.platform.vehicle;
import com.github.wxiaoqi.security.common.util.excel.Excel2003Reader;
import com.github.wxiaoqi.security.common.util.excel.Excel2007Reader;
import com.xxfc.platform.vehicle.biz.BranchCompanyBiz;
import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper;
import lombok.SneakyThrows;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.List;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/31 15:26
*/
//@RunWith(SpringJUnit4ClassRunner.class)
//@SpringBootTest(classes = {VehicleApplication.class})
public class CompanyDataUpdateTest {
@Autowired
private BranchCompanyMapper branchCompanyMapper;
@Autowired
private BranchCompanyBiz branchCompanyBiz;
@SneakyThrows
@Test
public void updateCompanyInfo(){
Excel2007Reader excel2007Reader = new Excel2007Reader();
Excel2003Reader excel2003Reader = new Excel2003Reader();
InputStream fileInputStream = new FileInputStream("C:\\Users\\Administrator\\Desktop\\company.xls");
excel2003Reader.process(fileInputStream);
List<String[]> sheetData = excel2003Reader.getSheetData(0);
sheetData.forEach(System.out::println);
/* FileInputStream fileInputStream = new FileInputStream("C:\\Users\\Administrator\\Desktop\\company.xls");
HSSFWorkbook sheets = new HSSFWorkbook(fileInputStream);
HSSFSheet sheetAt = sheets.getSheetAt(0);
int lastRowNum = sheetAt.getLastRowNum();
List<BranComV> branComVList = new ArrayList<>();
for (int i=1;i<=lastRowNum;i++){
HSSFRow row = sheetAt.getRow(i);
HSSFCell cell1 = row.getCell(0);
cell1.setCellType(CellType.STRING);
String company_id = cell1.getStringCellValue();
HSSFCell cell2 = row.getCell(2);
cell2.setCellType(CellType.STRING);
String actual_area_id = cell2.getStringCellValue();
System.out.println("公司id:"+ company_id);
System.out.println("片区id:"+actual_area_id);
System.out.println("***********************");
BranComV branComV = new BranComV();
branComV.setId(Integer.valueOf(company_id));
branComV.setZoneId(Integer.valueOf(actual_area_id));
branComVList.add(branComV);
}
branchCompanyBiz.updatein(branComVList);
fileInputStream.close();*/
}
}
package com.xxfc.platform.vehicle;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.junit.Test;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;
public class ListTest {
@Test
public void ListTest(){
List<Object> objects = Arrays.asList();
DateTime startDay= DateTime.parse("2019-07-30 00:00:00", DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"));
System.out.println(startDay);
}
}
package com.xxfc.platform.vehicle;
import com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler;
import lombok.SneakyThrows;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/1 17:33
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = VehicleApplication.class)
public class VehicleServiceTest {
@Autowired
VehicleJobHandler vehicleJobHandler;
@Test
@SneakyThrows
public void testVehicleJob(){
vehicleJobHandler.execute("");
}
}
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