|
|
@ -5,6 +5,7 @@ import com.iflytop.digester.underframework.controller.UfApiResponse; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
import java.util.Map; |
|
|
|
@Controller |
|
|
@ -18,4 +19,29 @@ public class HeatSlotController extends UfApiControllerBase { |
|
|
|
var heatSlots = this.device.heatingTurntable.getSlots(); |
|
|
|
return this.success(Map.of("slots", heatSlots)); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/heat-slot/alloc") |
|
|
|
public UfApiResponse alloc(@RequestBody Map<String,Object> params) { |
|
|
|
String tubeRackNo = (String)params.get("tubeRackNo"); |
|
|
|
try { |
|
|
|
var slot = this.device.heatingTurntable.allocSlot(tubeRackNo); |
|
|
|
return this.success(slot); |
|
|
|
} catch ( Exception e ) { |
|
|
|
return this.error(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/heat-slot/release") |
|
|
|
public UfApiResponse release(@RequestBody Map<String,Object> params) { |
|
|
|
Integer slotIndex = (Integer)params.get("slotIndex"); |
|
|
|
try { |
|
|
|
var slot = this.device.heatingTurntable.getSlotByIndex(slotIndex); |
|
|
|
slot.setTubeRackNo(null); |
|
|
|
return this.success(); |
|
|
|
} catch ( Exception e ) { |
|
|
|
return this.error(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |