1.excel台账导入
2.pom文件添加 3.添加knife4j 4.添加日志
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.njcn.jbsyncdata.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.njcn.jbsyncdata.pojo.DisPhotovoltaic10Excel;
|
||||
import com.njcn.jbsyncdata.pojo.DisPhotovoltaic380Excel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2023/9/26 15:28
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@Api(tags = "冀北数据管理")
|
||||
@RequestMapping("/dataImport")
|
||||
@RequiredArgsConstructor
|
||||
public class DisPhotovoltaicController {
|
||||
|
||||
@ApiOperation(value = "获取10kv分布式光伏接入情况")
|
||||
@PostMapping("/import10")
|
||||
public void importTakeOrder(MultipartFile file) throws Exception {
|
||||
List<DisPhotovoltaic10Excel> list = EasyExcel.read(file.getInputStream())
|
||||
.head(DisPhotovoltaic10Excel.class)
|
||||
.headRowNumber(2)
|
||||
.sheet(2).doReadSync();
|
||||
|
||||
System.out.println();
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取380kv分布式光伏接入情况")
|
||||
@PostMapping("/import380")
|
||||
public void import380(MultipartFile file) throws Exception {
|
||||
List<DisPhotovoltaic380Excel> list = EasyExcel.read(file.getInputStream())
|
||||
.head(DisPhotovoltaic380Excel.class)
|
||||
.headRowNumber(2)
|
||||
.sheet(3).doReadSync();
|
||||
|
||||
System.out.println();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user