|
@@ -1,46 +1,38 @@
|
|
|
package com.cpms.project.process.controller;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.util.List;
|
|
|
-import java.util.ArrayList;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
+import com.cpms.common.annotation.Log;
|
|
|
+import com.cpms.common.core.controller.BaseController;
|
|
|
+import com.cpms.common.core.domain.AjaxResult;
|
|
|
+import com.cpms.common.core.page.TableDataInfo;
|
|
|
+import com.cpms.common.enums.BusinessType;
|
|
|
import com.cpms.common.utils.file.ExcelUtils;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
+import com.cpms.common.utils.poi.ExcelUtil;
|
|
|
+import com.cpms.project.process.domain.TSifOverview;
|
|
|
+import com.cpms.project.process.service.ITSifOverviewService;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-import com.cpms.common.annotation.Log;
|
|
|
-import com.cpms.common.core.controller.BaseController;
|
|
|
-import com.cpms.common.core.domain.AjaxResult;
|
|
|
-import com.cpms.common.enums.BusinessType;
|
|
|
-import com.cpms.project.process.domain.TSifOverview;
|
|
|
-import com.cpms.project.process.service.ITSifOverviewService;
|
|
|
-import com.cpms.common.utils.poi.ExcelUtil;
|
|
|
-import com.cpms.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* SIF Overview ListController
|
|
|
- *
|
|
|
+ *
|
|
|
* @author admin
|
|
|
* @date 2024-04-12
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/process/overview")
|
|
|
-public class TSifOverviewController extends BaseController
|
|
|
-{
|
|
|
+public class TSifOverviewController extends BaseController {
|
|
|
@Autowired
|
|
|
private ITSifOverviewService tSifOverviewService;
|
|
|
|
|
@@ -49,8 +41,7 @@ public class TSifOverviewController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('process:overview:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(TSifOverview tSifOverview)
|
|
|
- {
|
|
|
+ public TableDataInfo list(TSifOverview tSifOverview) {
|
|
|
startPage();
|
|
|
List<TSifOverview> list = tSifOverviewService.selectTSifOverviewList(tSifOverview);
|
|
|
return getDataTable(list);
|
|
@@ -60,10 +51,9 @@ public class TSifOverviewController extends BaseController
|
|
|
* 导出SIF Overview List列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('process:overview:export')")
|
|
|
- @Log(title = "SIF Overview List", businessType = BusinessType.EXPORT)
|
|
|
+ @Log(title = "SIF Overview List" , businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, TSifOverview tSifOverview)
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, TSifOverview tSifOverview) {
|
|
|
List<TSifOverview> list = tSifOverviewService.selectTSifOverviewList(tSifOverview);
|
|
|
ExcelUtil<TSifOverview> util = new ExcelUtil<TSifOverview>(TSifOverview.class);
|
|
|
util.exportExcel(response, list, "SIF Overview List数据");
|
|
@@ -74,8 +64,7 @@ public class TSifOverviewController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('process:overview:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return success(tSifOverviewService.selectTSifOverviewById(id));
|
|
|
}
|
|
|
|
|
@@ -83,10 +72,9 @@ public class TSifOverviewController extends BaseController
|
|
|
* 新增SIF Overview List
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('process:overview:add')")
|
|
|
- @Log(title = "SIF Overview List", businessType = BusinessType.INSERT)
|
|
|
+ @Log(title = "SIF Overview List" , businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody TSifOverview tSifOverview)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody TSifOverview tSifOverview) {
|
|
|
return toAjax(tSifOverviewService.insertTSifOverview(tSifOverview));
|
|
|
}
|
|
|
|
|
@@ -94,10 +82,9 @@ public class TSifOverviewController extends BaseController
|
|
|
* 修改SIF Overview List
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('process:overview:edit')")
|
|
|
- @Log(title = "SIF Overview List", businessType = BusinessType.UPDATE)
|
|
|
+ @Log(title = "SIF Overview List" , businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody TSifOverview tSifOverview)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody TSifOverview tSifOverview) {
|
|
|
return toAjax(tSifOverviewService.updateTSifOverview(tSifOverview));
|
|
|
}
|
|
|
|
|
@@ -105,15 +92,14 @@ public class TSifOverviewController extends BaseController
|
|
|
* 删除SIF Overview List
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('process:overview:remove')")
|
|
|
- @Log(title = "SIF Overview List", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
- {
|
|
|
+ @Log(title = "SIF Overview List" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(tSifOverviewService.deleteTSifOverviewByIds(ids));
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Log(title = "SIF Overview List批量导入", businessType = BusinessType.INSERT)
|
|
|
+ @Log(title = "SIF Overview List批量导入" , businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/importData")
|
|
|
public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
|
|
|
//获取操作人员ID
|
|
@@ -138,7 +124,47 @@ public class TSifOverviewController extends BaseController
|
|
|
}
|
|
|
String cellValue = ExcelUtils.getCellValue(cell);
|
|
|
logger.info("cellValue:" + cellValue);
|
|
|
- // TODO 添加属性值
|
|
|
+ switch (j) {
|
|
|
+ case 0:
|
|
|
+ entity.setSifNo(cellValue);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ entity.setDeviation(cellValue);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ entity.setSheNo(cellValue);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ entity.setCac(cellValue);
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ entity.setRequriedSil(cellValue);
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ entity.setSensors(cellValue);
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ entity.setsVoting(cellValue);
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ entity.setFinalElements(cellValue);
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ entity.setfVoting(cellValue);
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ entity.setAction(cellValue);
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ entity.setAchievedSil(cellValue);
|
|
|
+ break;
|
|
|
+ case 11:
|
|
|
+ entity.setPfdCr(cellValue);
|
|
|
+ break;
|
|
|
+ case 12:
|
|
|
+ entity.setRemarks(cellValue);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
entity.setCreaterCode(String.valueOf(userId));
|
|
|
logger.info("entity:" + entity);
|