53 lines
1.6 KiB
Java
53 lines
1.6 KiB
Java
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();
|
|
|
|
}
|
|
}
|