“linengliang”
2023-12-13 ae33e68baf21878ce145d75ac377d14c1e2b2a82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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("删除成功!");
    }
 
}