| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.device.constant.CommonStatusContant; |
| | | import com.by4cloud.platformx.device.constant.MaxSizeContant; |
| | | import com.by4cloud.platformx.device.dto.DeviceRepairQueryDTO; |
| | | import com.by4cloud.platformx.device.entity.DeviceInventory; |
| | |
| | | @Override |
| | | public R approved(Long id) { |
| | | DeviceRepair repair = baseMapper.selectById(id); |
| | | repair.setStatus(2); |
| | | repair.setStatus(CommonStatusContant.DEVICE_REPAIR_STATUS_REPAIRING); |
| | | baseMapper.updateById(repair); |
| | | DeviceInventory inventory = inventoryMapper.selectById(repair.getInventoryId()); |
| | | inventory.setInventoryStatus(3); |
| | | inventory.setInventoryStatus(CommonStatusContant.DEVICE_INVENTORY_REPAIRING); |
| | | inventoryMapper.updateById(inventory); |
| | | return R.ok(); |
| | | } |
| | |
| | | @Override |
| | | public R complete(Long id) { |
| | | DeviceRepair repair = baseMapper.selectById(id); |
| | | repair.setStatus(3); |
| | | repair.setStatus(CommonStatusContant.DEVICE_REPAIR_STATUS_COMPLETE); |
| | | baseMapper.updateById(repair); |
| | | DeviceInventory inventory = inventoryMapper.selectById(repair.getInventoryId()); |
| | | inventory.setInventoryStatus(1); |
| | | inventory.setInventoryStatus(CommonStatusContant.DEVICE_INVENTORY_USABLE); |
| | | inventoryMapper.updateById(inventory); |
| | | return R.ok(); |
| | | } |
| | |
| | | workOrder.setRepairId(id); |
| | | workOrder.setWoCode(maxSizeService.nextNo(MaxSizeContant.DEVICE_PURCHASE_CODE)); |
| | | workOrder.setWoDesc(repair.getRepairDesc()); |
| | | workOrder.setWoType(1); |
| | | workOrder.setWoStatus(1); |
| | | workOrder.setWoType(CommonStatusContant.WORK_ORDER_TYPE_REPAIR); |
| | | workOrder.setWoStatus(CommonStatusContant.WORK_ORDER_STATUS_ALLOCATED); |
| | | workOrderMapper.insert(workOrder); |
| | | repair.setWoFlag(1); |
| | | repair.setWoFlag(CommonStatusContant.DEVICE_REPAIR_FLAG_Y); |
| | | baseMapper.updateById(repair); |
| | | return R.ok(); |
| | | } |