| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.device.dto.DeviceLedgerDto; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | |
| | | |
| | | @ApiModelProperty("设备台账列表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceLedger deviceLedger) { |
| | | public AjaxResult page(Page page , DeviceLedgerDto deviceLedger) { |
| | | return AjaxResult.success(deviceLedgerService.queryPage(page,deviceLedger)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @ApiModelProperty("添加设备台账") |
| | | public AjaxResult add(DeviceLedger deviceLedger) { |
| | | public AjaxResult add(@RequestBody DeviceLedger deviceLedger) { |
| | | |
| | | return deviceLedgerService.saveDeviceLedger(deviceLedger); |
| | | } |
| | |
| | | |
| | | @PutMapping () |
| | | @ApiModelProperty("修改设备台账") |
| | | public AjaxResult update(DeviceLedger deviceLedger) { |
| | | |
| | | public AjaxResult update(@RequestBody DeviceLedger deviceLedger) { |
| | | return deviceLedgerService.updateDeviceLedger(deviceLedger); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @DeleteMapping("/{ids}") |
| | | @ApiModelProperty("删除设备台账") |
| | | public AjaxResult delete(@PathVariable ArrayList<Long> ids) { |
| | | public AjaxResult delete(@PathVariable("ids") ArrayList<Long> ids) { |
| | | boolean b = deviceLedgerService.removeBatchByIds(ids); |
| | | if (!b) { |
| | | return AjaxResult.error("删除失败"); |