|
@@ -2,6 +2,7 @@ package com.kgraph.graph.suport.controller;
|
|
|
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -19,7 +20,8 @@ import com.kgraph.common.enums.BusinessType;;
|
|
|
import com.kgraph.graph.suport.domain.TCheckPiont;
|
|
|
import com.kgraph.graph.suport.service.ITCheckPiontService;
|
|
|
import com.kgraph.common.utils.poi.ExcelUtil;;
|
|
|
-import com.kgraph.common.core.page.TableDataInfo;;
|
|
|
+import com.kgraph.common.core.page.TableDataInfo;
|
|
|
+import org.springframework.web.multipart.MultipartFile;;
|
|
|
|
|
|
/**
|
|
|
* 检查点管理Controller
|
|
@@ -101,4 +103,22 @@ public class TCheckPiontController extends BaseController
|
|
|
{
|
|
|
return toAjax(tCheckPiontService.deleteTCheckPiontByIds(ids));
|
|
|
}
|
|
|
+
|
|
|
+ @Log(title = "排故流程导入", businessType = BusinessType.IMPORT)
|
|
|
+ @PreAuthorize("@ss.hasPermi('showInfo:breakdown:add')")
|
|
|
+ @PostMapping("/importData")
|
|
|
+ public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
|
+ {
|
|
|
+ ExcelUtil<TCheckPiont> util = new ExcelUtil<>(TCheckPiont.class);
|
|
|
+ List<TCheckPiont> TCheckPiontList = util.importExcel(file.getInputStream());
|
|
|
+ String message = tCheckPiontService.excelImport(TCheckPiontList);
|
|
|
+ return AjaxResult.success(message);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/importTemplate")
|
|
|
+ public void importTemplate(HttpServletResponse response)
|
|
|
+ {
|
|
|
+ ExcelUtil<TCheckPiont> util = new ExcelUtil<>(TCheckPiont.class);
|
|
|
+ util.importTemplateExcel(response, "检查点管理");
|
|
|
+ }
|
|
|
}
|