11 changed files with 341 additions and 187 deletions
-
5pom.xml
-
136src/main/java/a8k/controler/AppSettingControler.java
-
18src/main/java/a8k/controler/UsrControler.java
-
70src/main/java/a8k/service/app/appsetting/AppSettingsMgrService.java
-
8src/main/java/a8k/service/app/background/TemperatureCtrlService.java
-
5src/main/java/a8k/service/db/AppSettingDBService.java
-
63src/main/java/a8k/service/db/type/AppSetting.java
-
7src/main/java/a8k/type/appret/AppRetV1.java
-
2src/main/java/a8k/type/appret/AppRetV2.java
-
4src/main/java/a8k/type/ecode/AppCodeError.java
@ -0,0 +1,136 @@ |
|||||
|
package a8k.controler; |
||||
|
|
||||
|
import a8k.service.app.appsetting.AppSettingsMgrService; |
||||
|
import a8k.service.db.type.AppSetting; |
||||
|
import a8k.service.db.type.appsetting.settingenum.*; |
||||
|
import a8k.type.appret.AppRetV2; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.Parameter; |
||||
|
import io.swagger.v3.oas.annotations.Parameters; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import jakarta.annotation.Resource; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.util.Assert; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
|
||||
|
@Tag(name = "系统设置", description = "") |
||||
|
@Slf4j |
||||
|
@Controller |
||||
|
@RequestMapping(value = "/api/v1/app/AppSetting/") |
||||
|
@ResponseBody |
||||
|
public class AppSettingControler { |
||||
|
@Resource |
||||
|
AppSettingsMgrService appSettingsMgrService; |
||||
|
|
||||
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
|
// EXT FUNC |
||||
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||||
|
|
||||
|
@Operation(summary = "获取系统设置") |
||||
|
@PostMapping("/getAppSettings") |
||||
|
public AppRetV2<AppSetting> getAppSettings() { |
||||
|
return AppRetV2.success(appSettingsMgrService.getAppSettings()); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置语言") |
||||
|
@PostMapping("/setLanguage") |
||||
|
public AppRetV2<Void> setLanguage(@NotNull LanguageType val) { |
||||
|
appSettingsMgrService.setLanguage(val); |
||||
|
return AppRetV2.success(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置自动打印报告") |
||||
|
@PostMapping("/setAutoPrint") |
||||
|
public AppRetV2<Void> setAutoPrint(@NotNull Boolean val) { |
||||
|
appSettingsMgrService.setAutoPrint(val); |
||||
|
return AppRetV2.success(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置自动登出") |
||||
|
@PostMapping("/setAutoLogout") |
||||
|
public AppRetV2<Void> setAutoLogout(@NotNull Boolean val) { |
||||
|
appSettingsMgrService.setAutoLogout(val); |
||||
|
return AppRetV2.success(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置LIS类型") |
||||
|
@PostMapping("/setLISType") |
||||
|
public AppRetV2<Void> setLISType(@NotNull LISTypeEnum val) { |
||||
|
appSettingsMgrService.setLISType(val); |
||||
|
return AppRetV2.success(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置LIS协议") |
||||
|
@PostMapping("/setLISProtocol") |
||||
|
public AppRetV2<Void> setLISProtocol(@NotNull LISProtocolEnum val) { |
||||
|
appSettingsMgrService.setLISProtocol(val); |
||||
|
return AppRetV2.success(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置LIS接口") |
||||
|
@PostMapping("/setLIFIf") |
||||
|
public AppRetV2<Void> setLIFIf(@NotNull LISIFType val) { |
||||
|
appSettingsMgrService.setLIFIf(val); |
||||
|
return AppRetV2.success(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置LIS是否自动上报报告") |
||||
|
@PostMapping("/setLISAutoExport") |
||||
|
public AppRetV2<Void> setLISAutoExport( @NotNull Boolean val) { |
||||
|
appSettingsMgrService.setLISAutoExport(val); |
||||
|
return AppRetV2.success(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置LIS串口波特率") |
||||
|
@PostMapping("/setLISSerialBaudrate") |
||||
|
public AppRetV2<Void> setLISSerialBaudrate(@NotNull LISSerialBaudrateType val) { |
||||
|
appSettingsMgrService.setLISSerialBaudrate(val); |
||||
|
return AppRetV2.success(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置LISIP") |
||||
|
@PostMapping("/setLISNetIp") |
||||
|
public AppRetV2<Void> setLISNetIp(@NotNull String val) { |
||||
|
appSettingsMgrService.setLISNetIp(val); |
||||
|
return AppRetV2.success(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置LIS端口") |
||||
|
@PostMapping("/setLISNetPort") |
||||
|
public AppRetV2<Void> setLISNetPort(@NotNull Integer val) { |
||||
|
appSettingsMgrService.setLISNetPort(val); |
||||
|
return AppRetV2.success(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Operation(summary = "设置设备温度") |
||||
|
@PostMapping("/setTemperature") |
||||
|
public AppRetV2<Void> setTemperature(Integer val) { |
||||
|
log.info("setTemperature:{}", val); |
||||
|
appSettingsMgrService.setTemperature(val); |
||||
|
return AppRetV2.success(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,20 +1,61 @@ |
|||||
package a8k.service.db.type; |
package a8k.service.db.type; |
||||
|
|
||||
import a8k.service.db.type.appsetting.settingenum.*; |
import a8k.service.db.type.appsetting.settingenum.*; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import jakarta.validation.constraints.Max; |
||||
|
import jakarta.validation.constraints.Min; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
import lombok.Data; |
import lombok.Data; |
||||
|
|
||||
@Data |
@Data |
||||
|
@Schema(description = "AppSetting") |
||||
public class AppSetting { |
public class AppSetting { |
||||
public int id = 0; |
|
||||
public LanguageType language = LanguageType.zh_CN; |
|
||||
public Boolean autoPrint = false; |
|
||||
public Boolean autoLogout = false; |
|
||||
public LISTypeEnum LISType = LISTypeEnum.SINGLE_TRACK; |
|
||||
public LISProtocolEnum LISProtocol = LISProtocolEnum.Boditech; |
|
||||
public LISIFType LIFIf = LISIFType.NETWORK; |
|
||||
public Boolean LISAutoExport = true; |
|
||||
|
public int id = 0; |
||||
|
|
||||
|
@Schema(description = "语言") |
||||
|
@NotNull |
||||
|
public LanguageType language = LanguageType.zh_CN; |
||||
|
|
||||
|
@Schema(description = "自动打印报告") |
||||
|
@NotNull |
||||
|
public Boolean autoPrint = false; |
||||
|
|
||||
|
@Schema(description = "自动登出") |
||||
|
@NotNull |
||||
|
public Boolean autoLogout = false; |
||||
|
|
||||
|
@Schema(description = "LIS类型") |
||||
|
@NotNull |
||||
|
public LISTypeEnum LISType = LISTypeEnum.SINGLE_TRACK; |
||||
|
|
||||
|
@Schema(description = "LIS协议") |
||||
|
@NotNull |
||||
|
public LISProtocolEnum LISProtocol = LISProtocolEnum.Boditech; |
||||
|
|
||||
|
@Schema(description = "LIS接口") |
||||
|
@NotNull |
||||
|
public LISIFType LIFIf = LISIFType.NETWORK; |
||||
|
|
||||
|
@Schema(description = "LIS是否自动上报报告") |
||||
|
@NotNull |
||||
|
public Boolean LISAutoExport = true; |
||||
|
|
||||
|
@Schema(description = "LIS串口波特率") |
||||
|
@NotNull |
||||
public LISSerialBaudrateType LISSerialBaudrate = LISSerialBaudrateType.B9600; |
public LISSerialBaudrateType LISSerialBaudrate = LISSerialBaudrateType.B9600; |
||||
public String LISNetIp = "127.0.0.1"; |
|
||||
public Integer LISNetPort = 9973; |
|
||||
public Integer temperature = 25; |
|
||||
|
|
||||
|
@Schema(description = "LISIP") |
||||
|
@NotNull |
||||
|
public String LISNetIp = "127.0.0.1"; |
||||
|
|
||||
|
@Schema(description = "LIS端口") |
||||
|
@NotNull |
||||
|
public Integer LISNetPort = 9973; |
||||
|
|
||||
|
@Schema(description = "设备温度") |
||||
|
@NotNull |
||||
|
@Min(15) |
||||
|
@Max(35) |
||||
|
public Integer temperature = 25; |
||||
|
|
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue