| | |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.device.entity.DeviceRepair; |
| | | import com.by4cloud.platformx.device.constant.CommonStatusContant; |
| | | import com.by4cloud.platformx.device.dto.DeviceRepairQueryDTO; |
| | | import com.by4cloud.platformx.device.entity.DeviceScrap; |
| | | import com.by4cloud.platformx.device.service.DeviceScrapService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 设备报废 |
| | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param deviceScrap 设备报废 |
| | | * @param queryDTO 设备报废 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('device_deviceScrap_view')" ) |
| | | public R getDeviceScrapPage(@ParameterObject Page page, @ParameterObject DeviceScrap deviceScrap) { |
| | | LambdaQueryWrapper<DeviceScrap> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.orderByDesc(DeviceScrap::getCreateTime); |
| | | return R.ok(deviceScrapService.page(page, wrapper)); |
| | | public R getDeviceScrapPage(@ParameterObject Page page, @ParameterObject DeviceRepairQueryDTO queryDTO) { |
| | | return R.ok(deviceScrapService.pageNew(page, queryDTO)); |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping |
| | | @PreAuthorize("@pms.hasPermission('device_deviceScrap_add')" ) |
| | | public R save(@RequestBody DeviceScrap deviceScrap) { |
| | | deviceScrap.setStatus(1); |
| | | deviceScrap.setStatus(CommonStatusContant.DEVICE_SCRAP_STATUS_PANDING_APPROVAL); |
| | | return R.ok(deviceScrapService.save(deviceScrap)); |
| | | } |
| | | |