|
@@ -28,13 +28,28 @@ public class AspenController extends AbstractController {
|
|
|
@Autowired
|
|
|
private TDashboarddataService tDashboarddataService;
|
|
|
|
|
|
- @Scheduled(cron = "0/9 * * * * ?")
|
|
|
+ @Scheduled(cron = "0/15 * * * * ?")
|
|
|
+// @Scheduled(cron = "0 */15 * * * ?")
|
|
|
public void getExcelData(){
|
|
|
- Workbook workbook = ExcelUtils.getWorkBook("D://ssyFile/K300.xlsm");
|
|
|
+// Workbook workbook = ExcelUtils.getWorkBook("B://GLOBAL/7430-BYC/NANJING/CB/CBP/CBP_C/15 CBP Cracker Share 乙烯装置共享文件夹/Dashboard data/物料.xlsx");
|
|
|
+ Workbook workbook = ExcelUtils.getWorkBook("D://ssyFile/ceshi.xlsx");
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
int rowNum = sheet.getPhysicalNumberOfRows();
|
|
|
TDashboarddataEntity dashboarddataEntity = new TDashboarddataEntity();
|
|
|
+ logger.info("rowNum:" + rowNum);
|
|
|
for (int i = 0; i < rowNum; i++) {
|
|
|
+ if (i == 0) {
|
|
|
+ logger.info("i:" + i);
|
|
|
+ Row row = sheet.getRow(i);
|
|
|
+ int cellNum = row.getPhysicalNumberOfCells();
|
|
|
+ for (int j = 0; j < cellNum; j++) {
|
|
|
+ Cell cell = row.getCell(j);
|
|
|
+ String cellValue = ExcelUtils.getCellValue(cell);
|
|
|
+ if (j == 2) {
|
|
|
+ logger.info(cellValue);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (i == 4) {
|
|
|
logger.info("i:" + i);
|
|
|
Row row = sheet.getRow(i);
|
|
@@ -101,7 +116,5 @@ public class AspenController extends AbstractController {
|
|
|
dashboarddataEntity.setCreatedate(new Date());
|
|
|
logger.info("dashboardData:" + dashboarddataEntity);
|
|
|
tDashboarddataService.save(dashboarddataEntity);
|
|
|
- List<TDashboarddataEntity> menuList = tDashboarddataService.list();
|
|
|
- logger.info(JSON.toJSONString(menuList));
|
|
|
}
|
|
|
}
|