| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.DeviceMaintainDTO; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.DeviceMaintain; |
| | | import com.whyc.service.DeviceMaintainService; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | /** |
| | | * 这里维保计划创建后, |
| | | * 存在首次维保时间和维保周期,从理论上来说,创建了一次维保计划后是永久循环生效的,计划维保时间一次次按周期推 |
| | | * 从表结构上说,存在维保计划表和维保记录表; |
| | | * |
| | | * demo,采取一张表进行功能实现 |
| | | * |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("deviceMaintain") |
| | |
| | | @Autowired |
| | | private DeviceMaintainService service; |
| | | |
| | | /*@PostMapping("page") |
| | | @ApiOperation(value = "查询计划分页") |
| | | public Response getPageByCondition(@RequestParam Integer pageNum, @RequestParam Integer pageSize, |
| | | @RequestBody DeviceMaintainDTO maintainDTO |
| | | ) { |
| | | return service.getPageByCondition(pageNum, pageSize,maintainDTO); |
| | | }*/ |
| | | |
| | | @PostMapping("page") |
| | | @ApiOperation(value = "查询计划分页") |
| | | public Response getPageByCondition(@RequestParam Integer pageNum, @RequestParam Integer pageSize, |
| | | @RequestBody DeviceMaintainDTO maintainDTO |
| | | ) { |
| | | return service.getPageByCondition2(pageNum, pageSize,maintainDTO); |
| | | } |
| | | |
| | | @GetMapping |
| | | @ApiOperation(value = "查询") |
| | | public Response get(@RequestParam Integer deviceId){ |
| | | @ApiOperation(value = "查询计划") |
| | | public Response get(@RequestParam Integer deviceId) { |
| | | return service.get(deviceId); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "创建") |
| | | public Response add(@RequestBody DeviceMaintain deviceMaintain){ |
| | | @ApiOperation(value = "创建计划") |
| | | public Response add(@RequestBody DeviceMaintain deviceMaintain) { |
| | | return service.add(deviceMaintain); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改") |
| | | public Response update(@RequestBody DeviceMaintain deviceMaintain){ |
| | | @ApiOperation(value = "修改计划") |
| | | public Response update(@RequestBody DeviceMaintain deviceMaintain) { |
| | | return service.update(deviceMaintain); |
| | | } |
| | | |
| | | @PutMapping("confirm") |
| | | @ApiOperation(value = "确认记录",notes = "传入deviceId(设备id),actualTime(实际维护日期),actualOwner2(实际维护人员),content(主要维护内容)") |
| | | public Response confirm(@RequestBody DeviceMaintain deviceMaintain){ |
| | | @ApiOperation(value = "确认记录", notes = "传入deviceId(设备id),actualTime(实际维护日期),actualOwner2(实际维护人员),content(主要维护内容)") |
| | | public Response confirm(@RequestBody DeviceMaintain deviceMaintain) { |
| | | return service.confirm(deviceMaintain); |
| | | } |
| | | |
| | | @GetMapping("record") |
| | | @ApiOperation(value = "查询维保记录") |
| | | public Response getRecord(@RequestParam Integer deviceId){ |
| | | @ApiOperation(value = "查询记录") |
| | | public Response getRecord(@RequestParam Integer deviceId) { |
| | | return service.getRecord(deviceId); |
| | | } |
| | | |