zbj//1.新增导出台账模板(离线装置)接口
This commit is contained in:
@@ -306,6 +306,18 @@ public class TerminalBaseController extends BaseController {
|
|||||||
terminalBaseService.downTerminalTemplate(response);
|
terminalBaseService.downTerminalTemplate(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出台账生成的excel(离线装置)
|
||||||
|
*
|
||||||
|
* @author zbj
|
||||||
|
* @date 2023/4/26
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出台账模板(离线装置)")
|
||||||
|
@GetMapping(value = "downTerminalAutonomeTemplate")
|
||||||
|
public void downTerminalAutonomeTemplate(HttpServletResponse response) {
|
||||||
|
terminalBaseService.downTerminalAutonomeTemplate(response);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入excel台账模板
|
* 导入excel台账模板
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -181,6 +181,13 @@ public interface TerminalBaseService {
|
|||||||
*/
|
*/
|
||||||
void downTerminalTemplate(HttpServletResponse response);
|
void downTerminalTemplate(HttpServletResponse response);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出台账生成的excel(离线装置)
|
||||||
|
* @author zbj
|
||||||
|
* @date 2023/4/26
|
||||||
|
*/
|
||||||
|
void downTerminalAutonomeTemplate(HttpServletResponse response);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将台账数据导入终端相关表
|
* 将台账数据导入终端相关表
|
||||||
* @param file 原始数据信息
|
* @param file 原始数据信息
|
||||||
|
|||||||
@@ -1534,6 +1534,45 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
PoiUtil.exportFileByWorkbook(workbook, "台账导入模板.xlsx", response);
|
PoiUtil.exportFileByWorkbook(workbook, "台账导入模板.xlsx", response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downTerminalAutonomeTemplate(HttpServletResponse response) {
|
||||||
|
ExportParams exportParams = new ExportParams("批量导入模板(请严格按照模板标准填入数据)", "台账信息");
|
||||||
|
exportParams.setStyle(ExcelStyleUtil.class);
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, TerminalBaseExcel.class, new ArrayList<TerminalBaseExcel>());
|
||||||
|
List<DictData> businessList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName()).getData();
|
||||||
|
List<DictData> loadTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName()).getData();
|
||||||
|
List<DictData> manufacturerList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName()).getData();
|
||||||
|
List<DictData> devTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_TYPE.getName()).getData();
|
||||||
|
List<DictData> frontList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.FRONT_TYPE.getName()).getData();
|
||||||
|
List<DictData> scaleList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName()).getData();
|
||||||
|
List<Node> nodeList = nodeService.nodeAllList();
|
||||||
|
|
||||||
|
|
||||||
|
//这里是自己加的 带下拉框的代码
|
||||||
|
ExcelUtil.selectList(workbook, 8, 8, new String[]{"离线设备"});
|
||||||
|
ExcelUtil.selectList(workbook, 9, 9, new String[]{"暂态系统", "稳态系统", "双系统"});
|
||||||
|
ExcelUtil.selectList(workbook, 10, 10, new String[]{"投运", "热备用", "停运"});
|
||||||
|
ExcelUtil.selectList(workbook, 11, 11, manufacturerList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 12, 12, devTypeList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 17, 17, new String[]{"周期触发", "变为触发"});
|
||||||
|
ExcelUtil.selectList(workbook, 18, 18, nodeList.stream().map(Node::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 19, 19, frontList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
|
||||||
|
/*母线序号*/
|
||||||
|
ExcelUtil.selectList(workbook, 23, 23, new String[]{"1", "2", "3", "3", "4", "5", "6"});
|
||||||
|
ExcelUtil.selectList(workbook, 24, 24, scaleList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 25, 25, new String[]{"虚拟母线", "实际母线"});
|
||||||
|
ExcelUtil.selectList(workbook, 27, 27, new String[]{"1", "2", "3", "3", "4", "5", "6"});
|
||||||
|
ExcelUtil.selectList(workbook, 28, 28, new String[]{"极重要", "重要", "普通", "不重要"});
|
||||||
|
ExcelUtil.selectList(workbook, 35, 35, new String[]{"星型接法", "三角型接法", "开口三角型接法"});
|
||||||
|
ExcelUtil.selectList(workbook, 36, 36, new String[]{"3", "5", "10"});
|
||||||
|
ExcelUtil.selectList(workbook, 37, 37, loadTypeList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 38, 38, businessList.stream().map(DictData::getName).collect(Collectors.toList()).toArray(new String[]{}));
|
||||||
|
ExcelUtil.selectList(workbook, 41, 41, new String[]{"电网侧", "非电网侧"});
|
||||||
|
ExcelUtil.selectList(workbook, 42, 42, new String[]{"不参与统计", "参与统计"});
|
||||||
|
PoiUtil.exportFileByWorkbook(workbook, "台账导入模板.xlsx", response);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void importTerminalBase(MultipartFile file, HttpServletResponse response) {
|
public void importTerminalBase(MultipartFile file, HttpServletResponse response) {
|
||||||
|
|||||||
Reference in New Issue
Block a user