13 changed files with 193 additions and 50 deletions
-
15src/main/java/com/qyft/ms/app/controller/SysSettingsController.java
-
35src/main/java/com/qyft/ms/app/controller/SystemController.java
-
37src/main/java/com/qyft/ms/app/core/properties/FactoryResetProperties.java
-
16src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java
-
18src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java
-
10src/main/java/com/qyft/ms/app/model/entity/Position.java
-
7src/main/java/com/qyft/ms/app/model/entity/SysSettings.java
-
16src/main/java/com/qyft/ms/app/service/PositionService.java
-
16src/main/java/com/qyft/ms/app/service/SysSettingsService.java
-
2src/main/java/com/qyft/ms/system/common/device/command/CyclicNumberGenerator.java
-
6src/main/resources/application.yml
-
41src/main/resources/factory-reset.yml
-
24src/main/resources/sql/init.sql
@ -1,15 +0,0 @@ |
|||||
package com.qyft.ms.app.controller; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
|
||||
import lombok.RequiredArgsConstructor; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
@Tag(name = "系统配置") |
|
||||
@RestController |
|
||||
@RequestMapping("/api/sys") |
|
||||
@RequiredArgsConstructor |
|
||||
@Slf4j |
|
||||
public class SysSettingsController { |
|
||||
} |
|
@ -0,0 +1,35 @@ |
|||||
|
package com.qyft.ms.app.controller; |
||||
|
|
||||
|
import com.qyft.ms.app.service.PositionService; |
||||
|
import com.qyft.ms.app.service.SysSettingsService; |
||||
|
import com.qyft.ms.system.common.result.Result; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
@Tag(name = "系统接口") |
||||
|
@RestController |
||||
|
@RequestMapping("/api/sys") |
||||
|
@RequiredArgsConstructor |
||||
|
@Slf4j |
||||
|
public class SystemController { |
||||
|
private final PositionService positionService; |
||||
|
private final SysSettingsService sysSettingsService; |
||||
|
|
||||
|
@Operation(summary = "还原出厂配置") |
||||
|
@PostMapping("/reset") |
||||
|
public Result<?> resetFactorySettings() { |
||||
|
try { |
||||
|
positionService.resetToFactorySettings(); |
||||
|
sysSettingsService.resetToFactorySettings(); |
||||
|
return Result.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error("还原出厂配置失败", e); |
||||
|
return Result.failed(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.qyft.ms.app.core.properties; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@ConfigurationProperties(prefix = "factory") |
||||
|
@Component |
||||
|
@Data |
||||
|
public class FactoryResetProperties { |
||||
|
|
||||
|
private List<SysSettingConfig> settings; |
||||
|
private List<PositionConfig> positions; |
||||
|
|
||||
|
@Data |
||||
|
public static class SysSettingConfig { |
||||
|
private Long id; |
||||
|
private Long parentId; |
||||
|
private String name; |
||||
|
private String code; |
||||
|
private String value; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
public static class PositionConfig { |
||||
|
private Long id; |
||||
|
private String pointName; |
||||
|
private String pointCode; |
||||
|
private Double x; |
||||
|
private Double y; |
||||
|
private Double z; |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
factory: |
||||
|
settings: |
||||
|
- id: 1 |
||||
|
name: "玻片高度" |
||||
|
code: "slide_height" |
||||
|
value: 101.2 |
||||
|
- id: 2 |
||||
|
name: "z轴安全高度" |
||||
|
code: "safe_z_height" |
||||
|
value: 80 |
||||
|
positions: |
||||
|
- id: 1 |
||||
|
pointName: "玻片1位置" |
||||
|
pointCode: "slide_position1" |
||||
|
x: 18.08 |
||||
|
y: 0 |
||||
|
z: 101.2 |
||||
|
- id: 2 |
||||
|
pointName: "玻片2位置" |
||||
|
pointCode: "slide_position2" |
||||
|
x: 45.08 |
||||
|
y: 0 |
||||
|
z: 101.2 |
||||
|
- id: 3 |
||||
|
pointName: "玻片3位置" |
||||
|
pointCode: "slide_position3" |
||||
|
x: 72.08 |
||||
|
y: 0 |
||||
|
z: 101.2 |
||||
|
- id: 4 |
||||
|
pointName: "玻片4位置" |
||||
|
pointCode: "slide_position4" |
||||
|
x: 99.08 |
||||
|
y: 0 |
||||
|
z: 101.2 |
||||
|
- id: 5 |
||||
|
pointName: "废液桶位置" |
||||
|
pointCode: "waste_liquor" |
||||
|
x: 173.08 |
||||
|
y: 75 |
||||
|
z: 70 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue