yangys
2024-04-04 ed4a5236bab800094be4a8378f5098eebe3de6ac
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
package com.qianwen.smartman.modules.tpm.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.mp.support.Query;
import com.qianwen.core.oss.model.BladeFile;
import com.qianwen.core.scanner.modular.annotation.GetResource;
import com.qianwen.core.scanner.modular.annotation.PostResource;
import com.qianwen.core.scanner.modular.stereotype.ApiResource;
import com.qianwen.core.secure.annotation.PreAuth;
import com.qianwen.core.tenant.annotation.NonDS;
import com.qianwen.core.tool.api.R;
import com.qianwen.smartman.modules.cps.vo.MaintainPlanAddVO;
import com.qianwen.smartman.modules.cps.vo.MaintainPlanAutoAddVO;
import com.qianwen.smartman.modules.cps.vo.MaintainPlanExportVO;
import com.qianwen.smartman.modules.cps.vo.MaintainPlanIdListVO;
import com.qianwen.smartman.modules.cps.vo.MaintainPlanSearchByPlanStatusVO;
import com.qianwen.smartman.modules.cps.vo.MaintainPlanSearchVO;
import com.qianwen.smartman.modules.cps.vo.MaintainPlanUpdateVO;
import com.qianwen.smartman.modules.notify.service.IBusinessNotifyService;
import com.qianwen.smartman.modules.tpm.entity.MaintainPlan;
import com.qianwen.smartman.modules.tpm.service.IMaintainPlanService;
import com.qianwen.smartman.modules.tpm.vo.MaintainPlanItemVO;
import com.qianwen.smartman.modules.tpm.vo.MaintainPlanVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
@Api(value = "保养计划", tags = {"保养计划"})
@RestController
@ApiResource({"blade-tpm/maintain-plan"})
@NonDS
@Validated
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/tpm/controller/MaintainPlanController.class */
public class MaintainPlanController extends BladeController {
    private final IMaintainPlanService maintainPlanService;
    private final IBusinessNotifyService businessNotifyService;
 
    public MaintainPlanController(final IMaintainPlanService maintainPlanService, final IBusinessNotifyService businessNotifyService) {
        this.maintainPlanService = maintainPlanService;
        this.businessNotifyService = businessNotifyService;
    }
 
    @ApiOperationSupport(order = 1)
    @PostResource({"/create-maintain-plan"})
    @ApiOperation("添加临时保养计划")
    @PreAuth
    public R<MaintainPlan> createMaintainPlan(@Validated @RequestBody MaintainPlanAddVO maintainPlanAddVO) {
        return R.data(this.maintainPlanService.createMaintainPlan(maintainPlanAddVO));
    }
 
    @ApiOperationSupport(order = 2)
    @PostResource({"/edit-maintain-plan"})
    @ApiOperation("编辑保养计划")
    @PreAuth
    public R<MaintainPlan> editMaintainPlan(@Validated @RequestBody MaintainPlanUpdateVO maintainPlanUpdateVO) {
        return R.data(this.maintainPlanService.editMaintainPlan(maintainPlanUpdateVO));
    }
 
    @ApiOperationSupport(order = 3)
    @GetResource({"/get-maintain-plan"})
    @ApiOperation("查看保养计划")
    public R<MaintainPlanVO> getMaintainPlan(@RequestParam("id") @ApiParam("保养计划ID") String id) {
        return R.data(this.maintainPlanService.getMaintainPlan(Long.valueOf(id)));
    }
 
    @ApiOperationSupport(order = 4)
    @PostResource({"/list"})
    @ApiOperation("通过设备类型查看保养计划(不分页)")
    @PreAuth
    public R<List<MaintainPlanVO>> queryMaintainPlanList(@RequestBody MaintainPlanSearchVO maintainPlanSearchVO) {
        return R.data(this.maintainPlanService.queryMaintainPlanList(maintainPlanSearchVO));
    }
 
    @ApiOperationSupport(order = RegionCache.VILLAGE_LEVEL)
    @PostResource({"/page"})
    @ApiOperation("通过设备类型查看保养计划(分页)")
    public R<IPage<MaintainPlanVO>> queryMaintainPlanPage(@RequestBody MaintainPlanSearchVO maintainPlanSearchVO, Query query) {
        return R.data(this.maintainPlanService.queryMaintainPlanPage(maintainPlanSearchVO, query));
    }
 
    @ApiOperationSupport(order = 6)
    @GetResource({"/item-list"})
    @ApiOperation("通过保养计划ID查看保养项列表(不分页)")
    @PreAuth
    public R<List<MaintainPlanItemVO>> queryMaintainPlanItemList(@RequestParam("planId") @ApiParam("保养计划Id") String planId) {
        return R.data(this.maintainPlanService.queryMaintainPlanItemList(Long.valueOf(planId)));
    }
 
    @ApiOperationSupport(order = 7)
    @GetResource({"/item-page"})
    @ApiOperation("通过保养计划ID查看保养项列表(分页)")
    @PreAuth
    public R<IPage<MaintainPlanItemVO>> queryMaintainPlanItemListPage(@RequestParam("planId") @ApiParam("保养计划Id") String planId, Query query) {
        return R.data(this.maintainPlanService.queryMaintainPlanItemListPage(Long.valueOf(planId), query));
    }
 
    @ApiOperationSupport(order = 8)
    @PostResource({"/delete-maintain-plan"})
    @ApiOperation("删除保养计划")
    @PreAuth
    public R<Boolean> deleteMaintainPlan(@Validated @RequestBody MaintainPlanIdListVO maintainPlanIdListVO) {
        return R.data(this.maintainPlanService.deleteMaintainPlan(maintainPlanIdListVO));
    }
 
    @ApiOperationSupport(order = 9)
    @PostResource({"/perform-maintain-plan"})
    @ApiOperation("执行保养计划")
    public R<Boolean> performMaintainPlan(@RequestParam("id") @ApiParam("保养计划Id") String id) {
        return R.data(this.maintainPlanService.performMaintainPlan(Long.valueOf(id)));
    }
 
    @ApiOperationSupport(order = 10)
    @PostResource({"/list-by-status"})
    @ApiOperation("根据状态查询计划列表")
    @PreAuth
    public R<List<MaintainPlanVO>> queryMaintainPlanListByStatus(@RequestParam(value = "planStatus", required = false) @ApiParam("状态") Integer planStatus) {
        return R.data(this.maintainPlanService.queryMaintainPlanListByStatus(planStatus));
    }
 
    @ApiOperationSupport(order = 11)
    @PostResource({"/export"})
    @ApiOperation("导出")
    @PreAuth
    public R<BladeFile> exportMaintainPlan(@RequestBody MaintainPlanExportVO maintainPlanExportVO, HttpServletResponse response) {
        return R.data(this.maintainPlanService.exportMaintainPlan(maintainPlanExportVO, response));
    }
 
    @ApiOperationSupport(order = RegionCache.VILLAGE_LEVEL)
    @PostResource({"/page-by-plan-status"})
    @ApiOperation("查看保养计划(分页)")
    @PreAuth
    public R<IPage<MaintainPlanVO>> queryMaintainPlanPageByPlanStatus(@RequestBody MaintainPlanSearchByPlanStatusVO maintainPlanSearchByPlanStatusVO, Query query) {
        return R.data(this.maintainPlanService.queryMaintainPlanPageByPlanStatus(maintainPlanSearchByPlanStatusVO, query));
    }
 
    @PreAuth
    @PostResource({"/create-maintain-plan-auto"})
    @ApiOperation("生成周期保养计划")
    public R<Boolean> createMaintainPlanAuto(@Validated @RequestBody MaintainPlanAutoAddVO maintainPlanAutoAddVO) {
        Boolean maintainPlanAuto = this.maintainPlanService.createMaintainPlanAuto(maintainPlanAutoAddVO);
        return R.data(maintainPlanAuto);
    }
}