|
@@ -1,36 +1,29 @@
|
|
|
package com.phm.manage.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;
|
|
|
-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.phm.common.annotation.Log;
|
|
|
import com.phm.common.core.controller.BaseController;
|
|
|
import com.phm.common.core.domain.AjaxResult;
|
|
|
+import com.phm.common.core.page.TableDataInfo;
|
|
|
import com.phm.common.enums.BusinessType;
|
|
|
+import com.phm.common.utils.poi.ExcelUtil;
|
|
|
import com.phm.manage.domain.LifePartConfig;
|
|
|
import com.phm.manage.service.ILifePartConfigService;
|
|
|
-import com.phm.common.utils.poi.ExcelUtil;
|
|
|
-import com.phm.common.core.page.TableDataInfo;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 寿命件配置库信息Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author phm
|
|
|
* @date 2023-08-23
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/manage/lifePartConfig")
|
|
|
-public class LifePartConfigController extends BaseController
|
|
|
-{
|
|
|
+public class LifePartConfigController extends BaseController {
|
|
|
@Autowired
|
|
|
private ILifePartConfigService lifePartConfigService;
|
|
|
|
|
@@ -39,8 +32,7 @@ public class LifePartConfigController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('manage:lifePartConfig:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(LifePartConfig lifePartConfig)
|
|
|
- {
|
|
|
+ public TableDataInfo list(LifePartConfig lifePartConfig) {
|
|
|
startPage();
|
|
|
List<LifePartConfig> list = lifePartConfigService.selectLifePartConfigList(lifePartConfig);
|
|
|
return getDataTable(list);
|
|
@@ -52,8 +44,7 @@ public class LifePartConfigController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('manage:lifePartConfig:export')")
|
|
|
@Log(title = "寿命件配置库信息", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, LifePartConfig lifePartConfig)
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, LifePartConfig lifePartConfig) {
|
|
|
List<LifePartConfig> list = lifePartConfigService.selectLifePartConfigList(lifePartConfig);
|
|
|
ExcelUtil<LifePartConfig> util = new ExcelUtil<LifePartConfig>(LifePartConfig.class);
|
|
|
util.exportExcel(response, list, "寿命件配置库信息数据");
|
|
@@ -64,8 +55,7 @@ public class LifePartConfigController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('manage:lifePartConfig:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return success(lifePartConfigService.selectLifePartConfigById(id));
|
|
|
}
|
|
|
|
|
@@ -75,8 +65,7 @@ public class LifePartConfigController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('manage:lifePartConfig:add')")
|
|
|
@Log(title = "寿命件配置库信息", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody LifePartConfig lifePartConfig)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody LifePartConfig lifePartConfig) {
|
|
|
return toAjax(lifePartConfigService.insertLifePartConfig(lifePartConfig));
|
|
|
}
|
|
|
|
|
@@ -86,8 +75,7 @@ public class LifePartConfigController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('manage:lifePartConfig:edit')")
|
|
|
@Log(title = "寿命件配置库信息", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody LifePartConfig lifePartConfig)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody LifePartConfig lifePartConfig) {
|
|
|
return toAjax(lifePartConfigService.updateLifePartConfig(lifePartConfig));
|
|
|
}
|
|
|
|
|
@@ -96,9 +84,8 @@ public class LifePartConfigController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('manage:lifePartConfig:remove')")
|
|
|
@Log(title = "寿命件配置库信息", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(lifePartConfigService.deleteLifePartConfigByIds(ids));
|
|
|
}
|
|
|
}
|