10 changed files with 132 additions and 81 deletions
-
93src/main/java/a8k/controler/api_v1/app/AppTubeSettingMgrControler.java
-
48src/main/java/a8k/controler/api_v1/app/DeviceInitControler.java
-
35src/main/java/a8k/service/app/appctrl/AppTubeSettingMgrService.java
-
4src/main/java/a8k/service/app/appctrl/mainflowctrl/action/SEQ1_ENTER_TUBEHOLDER_AND_SCAN.java
-
2src/main/java/a8k/service/test/MainflowCtrlTestService.java
-
2src/main/java/a8k/service/test/TestStateMgrService.java
-
7src/main/java/a8k/type/tube_setting/TubeHolderSetting.java
-
10src/main/java/a8k/type/tube_setting/TubeSetting.java
-
2src/main/java/a8k/type/type/A8kTubeHolderType.java
-
4src/main/java/a8k/type/type/BloodType.java
@ -0,0 +1,93 @@ |
|||||
|
package a8k.controler.api_v1.app; |
||||
|
|
||||
|
import a8k.service.app.appctrl.AppTubeSettingMgrService; |
||||
|
import a8k.service.app.appstate.GStateService; |
||||
|
import a8k.type.appret.ApiV1Ret; |
||||
|
import a8k.type.exception.AppException; |
||||
|
import a8k.type.tube_setting.TubeHolderSetting; |
||||
|
import a8k.type.type.A8kTubeHolderType; |
||||
|
import a8k.type.type.BloodType; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import jakarta.annotation.Resource; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Tag(name = "试管架配置", description = "") |
||||
|
@Slf4j |
||||
|
@Controller |
||||
|
@RequestMapping(value = "/api/v1/app/appTubeSettingMgr/") |
||||
|
@ResponseBody |
||||
|
public class AppTubeSettingMgrControler { |
||||
|
|
||||
|
|
||||
|
@Resource |
||||
|
AppTubeSettingMgrService appTubeSettingMgrService; |
||||
|
@Resource |
||||
|
GStateService gstate; |
||||
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
|
// EXTERNAL API |
||||
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
|
|
||||
|
@Operation(summary = "获取试管架配置") |
||||
|
@PostMapping("/TubeHolderSetting") |
||||
|
public ApiV1Ret<List<TubeHolderSetting>> getTubeHolderSettings() { |
||||
|
return ApiV1Ret.success(gstate.getTubeHolderSettings()); |
||||
|
} |
||||
|
|
||||
|
//添加试管架,返回整个列表 |
||||
|
@Operation(summary = "添加<试管架>配置") |
||||
|
@PostMapping("/newTubeHolderSetting") |
||||
|
public ApiV1Ret<Void> newTubeHolderSetting() { |
||||
|
appTubeSettingMgrService.newTubeHolderSetting(); |
||||
|
return ApiV1Ret.success(); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "删除<试管架>配置") |
||||
|
@PostMapping("/removeTubeHolderSetting") |
||||
|
public ApiV1Ret<Void> removeTubeHolderSetting(String uuid) throws AppException { |
||||
|
appTubeSettingMgrService.removeTubeHolderSetting(uuid); |
||||
|
return ApiV1Ret.success(); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "设置<试管架>激活状态") |
||||
|
@PostMapping("/setActiveState") |
||||
|
public ApiV1Ret<Void> setActiveState(String uuid, Boolean active) throws AppException { |
||||
|
appTubeSettingMgrService.setActiveState(uuid, active); |
||||
|
return ApiV1Ret.success(); |
||||
|
} |
||||
|
|
||||
|
// @Operation(summary = "设置<试管架>类型") |
||||
|
// @PostMapping("/setTubeHolderType") |
||||
|
// public ApiV1Ret<Void> setTubeHolderType(String uuid, A8kTubeHolderType type) throws AppException { |
||||
|
// appTubeSettingMgrService.setTubeHolderType(uuid, type); |
||||
|
// return ApiV1Ret.success(); |
||||
|
// } |
||||
|
|
||||
|
@Operation(summary = "复位<试管>配置") |
||||
|
@PostMapping("/resetTubeSetting") |
||||
|
public ApiV1Ret<Void> resetTubeSetting(String uuid, Integer tubeIndex) throws AppException { |
||||
|
appTubeSettingMgrService.resetTubeSetting(uuid, tubeIndex); |
||||
|
return ApiV1Ret.success(); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "修改<试管>用户信息配置") |
||||
|
@PostMapping("/setTubeSettingUserIdAndSampleBarcode") |
||||
|
public ApiV1Ret<Void> setTubeSettingUserIdAndSampleBarcode(String uuid, Integer tubeIndex, String userid, String sampleBarcode) throws AppException { |
||||
|
appTubeSettingMgrService.setTubeSettingUserIdAndSampleBarcode(uuid, tubeIndex, userid, sampleBarcode); |
||||
|
return ApiV1Ret.success(); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "修改<试管>配置(ps:projIndex格式为逗号分割的数字)") |
||||
|
@PostMapping("/setTubeSetting") |
||||
|
public ApiV1Ret<Void> setTubeSetting(String uuid, Integer tubeIndex, BloodType bloodType, String projIndex) throws AppException { |
||||
|
appTubeSettingMgrService.setTubeSetting(uuid, tubeIndex, bloodType, projIndex); |
||||
|
return ApiV1Ret.success(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,48 +0,0 @@ |
|||||
package a8k.controler.api_v1.app; |
|
||||
|
|
||||
import a8k.service.app.appctrl.AppDeviceCtrlService; |
|
||||
import a8k.service.app.background.BackgroudProcessCtrlService; |
|
||||
import a8k.service.app.devicectrl.ctrlservice.DeviceInitCtrlService; |
|
||||
import a8k.type.appret.ApiV1Ret; |
|
||||
import a8k.type.checkpoint.CheckResult; |
|
||||
import a8k.type.exception.AppException; |
|
||||
import io.swagger.v3.oas.annotations.Operation; |
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
|
||||
import jakarta.annotation.Resource; |
|
||||
import jdk.jfr.Description; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.stereotype.Controller; |
|
||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.ResponseBody; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
@Tag(name = "设备控制", description = "") |
|
||||
@Slf4j |
|
||||
@Controller |
|
||||
@RequestMapping(value = "/api/v1/app/deviceInit/") |
|
||||
@ResponseBody |
|
||||
public class DeviceInitControler { |
|
||||
|
|
||||
|
|
||||
@Resource |
|
||||
BackgroudProcessCtrlService backgroudProcessCtrlService; |
|
||||
|
|
||||
@Resource |
|
||||
DeviceInitCtrlService deviceInitCtrlService; |
|
||||
|
|
||||
|
|
||||
@Operation(summary = "设备初始化前检查") |
|
||||
@PostMapping("/checkBeforeInitDevice") |
|
||||
public ApiV1Ret<List<CheckResult>> checkBeforeInitDevice() throws AppException { |
|
||||
return ApiV1Ret.success(deviceInitCtrlService.checkBeforeInitDevice()); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "设备初始化(阻塞接口)") |
|
||||
@PostMapping("/initDevice") |
|
||||
public ApiV1Ret<List<CheckResult>> initDevice() throws AppException { |
|
||||
backgroudProcessCtrlService.startProcess(); |
|
||||
return ApiV1Ret.success(deviceInitCtrlService.deviceMoveToZero()); |
|
||||
} |
|
||||
} |
|
@ -1,22 +1,28 @@ |
|||||
package a8k.type.tube_setting; |
package a8k.type.tube_setting; |
||||
|
|
||||
import a8k.type.type.BloodType; |
import a8k.type.type.BloodType; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
|
||||
import java.util.ArrayList; |
import java.util.ArrayList; |
||||
import java.util.List; |
import java.util.List; |
||||
|
|
||||
|
@Schema(description = "试管配置") |
||||
public class TubeSetting { |
public class TubeSetting { |
||||
public int tubeIndex; |
public int tubeIndex; |
||||
|
|
||||
|
@Schema(description = "用户输入的样本ID,不做逻辑,只做展示(允许为空)") |
||||
public String userid = ""; //用户输入的样本ID,不做逻辑,只做展示 |
public String userid = ""; //用户输入的样本ID,不做逻辑,只做展示 |
||||
|
@Schema(description = "用于请求用户信息的条码ID") |
||||
public String sampleBarcode = ""; //用于请求用户信息的条码ID |
public String sampleBarcode = ""; //用于请求用户信息的条码ID |
||||
public List<Integer> projIndex = new ArrayList<>(); //项目编码,标明需要做的项目 |
|
||||
|
@Schema(description = "项目编码,标明需要做的项目") |
||||
|
public List<Integer> projId = new ArrayList<>(); //项目编码,标明需要做的项目 |
||||
|
@Schema(description = "血型") |
||||
public BloodType bloodType = BloodType.WHOLE_BLOOD; //血型 |
public BloodType bloodType = BloodType.WHOLE_BLOOD; //血型 |
||||
|
|
||||
public void reset() { |
public void reset() { |
||||
userid = ""; |
userid = ""; |
||||
sampleBarcode = ""; |
sampleBarcode = ""; |
||||
projIndex = new ArrayList<>(); |
|
||||
|
projId = new ArrayList<>(); |
||||
bloodType = BloodType.WHOLE_BLOOD; |
bloodType = BloodType.WHOLE_BLOOD; |
||||
} |
} |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue