package org.jeecg.modules.eam.controller;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.modules.eam.entity.MaintenanceStandardPlanningMaterial;
|
import org.jeecg.modules.eam.entity.PredictiveWorkPlan;
|
import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart;
|
import org.jeecg.modules.eam.service.IPredictiveWorkPlanService;
|
import org.jeecg.modules.eam.service.IPredictiveWorkPlanSparePartService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Map;
|
|
@RestController
|
@RequestMapping("/eam/predictiveworkplansparepart")
|
@Slf4j
|
public class PredictiveWorkPlanSparePartController extends JeecgController<PredictiveWorkPlanSparePart, IPredictiveWorkPlanSparePartService> {
|
|
@Autowired
|
private IPredictiveWorkPlanSparePartService predictiveWorkPlanSparePartService;
|
|
/**
|
* 备件控制列表
|
*/
|
@GetMapping("pagePredictiveWorkPlanSparePart")
|
public Result<?> pagePredictiveWorkPlanSparePart(@RequestParam("pageNo") Integer pageNo,
|
@RequestParam("pageSize") Integer pageSize,
|
@RequestParam Map<String, Object> params) {
|
IPage<Map<String, Object>> materials = predictiveWorkPlanSparePartService.pagePredictiveWorkPlanSparePart(pageNo, pageSize, params);
|
return Result.ok(materials);
|
}
|
|
|
/**
|
* 添加
|
*/
|
@PostMapping(value = "/add")
|
public Result<String> add(@RequestBody PredictiveWorkPlanSparePart predictiveWorkPlanSparePart) {
|
predictiveWorkPlanSparePartService.save(predictiveWorkPlanSparePart);
|
return Result.OK("添加成功!");
|
}
|
|
|
/**
|
* 编辑
|
*/
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
public Result<String> edit(@RequestBody PredictiveWorkPlanSparePart predictiveWorkPlanSparePart) {
|
predictiveWorkPlanSparePartService.updateById(predictiveWorkPlanSparePart);
|
return Result.OK("编辑成功!");
|
}
|
|
@DeleteMapping(value = "/delete")
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
predictiveWorkPlanSparePartService.removeById(id);
|
return Result.OK("删除成功!");
|
}
|
|
}
|