|
@@ -1,26 +1,30 @@
|
|
package com.ruoyi.ems.controller;
|
|
package com.ruoyi.ems.controller;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.io.IOException;
|
|
|
|
|
|
+
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
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.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import com.ruoyi.common.core.utils.DateUtils;
|
|
|
|
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
|
|
+import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
|
+import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
|
+import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
import com.ruoyi.common.log.annotation.Log;
|
|
import com.ruoyi.common.log.annotation.Log;
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
|
|
+import com.ruoyi.common.security.utils.SecurityUtils;
|
|
import com.ruoyi.ems.domain.AdmOpInspectionReport;
|
|
import com.ruoyi.ems.domain.AdmOpInspectionReport;
|
|
import com.ruoyi.ems.service.IAdmOpInspectionReportService;
|
|
import com.ruoyi.ems.service.IAdmOpInspectionReportService;
|
|
-import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
|
-import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
|
-import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
|
|
-import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 巡检报告Controller
|
|
* 巡检报告Controller
|
|
@@ -30,8 +34,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/inspectionReport")
|
|
@RequestMapping("/inspectionReport")
|
|
-public class AdmOpInspectionReportController extends BaseController
|
|
|
|
-{
|
|
|
|
|
|
+public class AdmOpInspectionReportController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private IAdmOpInspectionReportService admOpInspectionReportService;
|
|
private IAdmOpInspectionReportService admOpInspectionReportService;
|
|
|
|
|
|
@@ -40,8 +43,7 @@ public class AdmOpInspectionReportController extends BaseController
|
|
*/
|
|
*/
|
|
@RequiresPermissions("ems:inspection-report:list")
|
|
@RequiresPermissions("ems:inspection-report:list")
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
- public TableDataInfo list(AdmOpInspectionReport admOpInspectionReport)
|
|
|
|
- {
|
|
|
|
|
|
+ public TableDataInfo list(AdmOpInspectionReport admOpInspectionReport) {
|
|
startPage();
|
|
startPage();
|
|
List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
|
|
List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
@@ -53,8 +55,7 @@ public class AdmOpInspectionReportController extends BaseController
|
|
@RequiresPermissions("ems:inspection-report:export")
|
|
@RequiresPermissions("ems:inspection-report:export")
|
|
@Log(title = "巡检报告", businessType = BusinessType.EXPORT)
|
|
@Log(title = "巡检报告", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
@PostMapping("/export")
|
|
- public void export(HttpServletResponse response, AdmOpInspectionReport admOpInspectionReport)
|
|
|
|
- {
|
|
|
|
|
|
+ public void export(HttpServletResponse response, AdmOpInspectionReport admOpInspectionReport) {
|
|
List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
|
|
List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
|
|
ExcelUtil<AdmOpInspectionReport> util = new ExcelUtil<AdmOpInspectionReport>(AdmOpInspectionReport.class);
|
|
ExcelUtil<AdmOpInspectionReport> util = new ExcelUtil<AdmOpInspectionReport>(AdmOpInspectionReport.class);
|
|
util.exportExcel(response, list, "巡检报告数据");
|
|
util.exportExcel(response, list, "巡检报告数据");
|
|
@@ -65,8 +66,7 @@ public class AdmOpInspectionReportController extends BaseController
|
|
*/
|
|
*/
|
|
@RequiresPermissions("ems:inspection-report:query")
|
|
@RequiresPermissions("ems:inspection-report:query")
|
|
@GetMapping(value = "/{id}")
|
|
@GetMapping(value = "/{id}")
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
return success(admOpInspectionReportService.selectAdmOpInspectionReportById(id));
|
|
return success(admOpInspectionReportService.selectAdmOpInspectionReportById(id));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -76,8 +76,9 @@ public class AdmOpInspectionReportController extends BaseController
|
|
@RequiresPermissions("ems:inspection-report:add")
|
|
@RequiresPermissions("ems:inspection-report:add")
|
|
@Log(title = "巡检报告", businessType = BusinessType.INSERT)
|
|
@Log(title = "巡检报告", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
@PostMapping
|
|
- public AjaxResult add(@RequestBody AdmOpInspectionReport admOpInspectionReport)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult add(@RequestBody AdmOpInspectionReport admOpInspectionReport) {
|
|
|
|
+ admOpInspectionReport.setSubTime(DateUtils.getNowDate());
|
|
|
|
+ admOpInspectionReport.setSubmitter(SecurityUtils.getUsername());
|
|
return toAjax(admOpInspectionReportService.insertAdmOpInspectionReport(admOpInspectionReport));
|
|
return toAjax(admOpInspectionReportService.insertAdmOpInspectionReport(admOpInspectionReport));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -87,8 +88,9 @@ public class AdmOpInspectionReportController extends BaseController
|
|
@RequiresPermissions("ems:inspection-report:edit")
|
|
@RequiresPermissions("ems:inspection-report:edit")
|
|
@Log(title = "巡检报告", businessType = BusinessType.UPDATE)
|
|
@Log(title = "巡检报告", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
@PutMapping
|
|
- public AjaxResult edit(@RequestBody AdmOpInspectionReport admOpInspectionReport)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult edit(@RequestBody AdmOpInspectionReport admOpInspectionReport) {
|
|
|
|
+ admOpInspectionReport.setSubTime(DateUtils.getNowDate());
|
|
|
|
+ admOpInspectionReport.setSubmitter(SecurityUtils.getUsername());
|
|
return toAjax(admOpInspectionReportService.updateAdmOpInspectionReport(admOpInspectionReport));
|
|
return toAjax(admOpInspectionReportService.updateAdmOpInspectionReport(admOpInspectionReport));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -97,9 +99,8 @@ public class AdmOpInspectionReportController extends BaseController
|
|
*/
|
|
*/
|
|
@RequiresPermissions("ems:inspection-report:remove")
|
|
@RequiresPermissions("ems:inspection-report:remove")
|
|
@Log(title = "巡检报告", businessType = BusinessType.DELETE)
|
|
@Log(title = "巡检报告", businessType = BusinessType.DELETE)
|
|
- @DeleteMapping("/{ids}")
|
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
|
- {
|
|
|
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
return toAjax(admOpInspectionReportService.deleteAdmOpInspectionReportByIds(ids));
|
|
return toAjax(admOpInspectionReportService.deleteAdmOpInspectionReportByIds(ids));
|
|
}
|
|
}
|
|
}
|
|
}
|