41 changed files with 4 additions and 1209 deletions
-
52src/main/java/com/qyft/ms/app/model/bo/CraftsStepMethod.java
-
35src/main/java/com/qyft/ms/app/model/bo/CraftsStepStatus.java
-
23src/main/java/com/qyft/ms/app/model/bo/TubeSol.java
-
14src/main/java/com/qyft/ms/app/model/dto/BaseDataDTO.java
-
13src/main/java/com/qyft/ms/app/model/dto/CmdInjectFluidDTO.java
-
14src/main/java/com/qyft/ms/app/model/dto/ContainerDTO.java
-
14src/main/java/com/qyft/ms/app/model/dto/InjectFluid.java
-
10src/main/java/com/qyft/ms/app/model/dto/LogDTO.java
-
11src/main/java/com/qyft/ms/app/model/dto/PauseCraftsDto.java
-
11src/main/java/com/qyft/ms/app/model/dto/ResumeCraftsDto.java
-
13src/main/java/com/qyft/ms/app/model/dto/StartCraftsDTO.java
-
13src/main/java/com/qyft/ms/app/model/dto/StartHeatDTO.java
-
11src/main/java/com/qyft/ms/app/model/dto/StopCraftsDto.java
-
10src/main/java/com/qyft/ms/app/model/dto/StopTaskDTO.java
-
10src/main/java/com/qyft/ms/app/model/dto/TaskDTO.java
-
35src/main/java/com/qyft/ms/app/model/entity/Container.java
-
25src/main/java/com/qyft/ms/app/model/entity/Crafts.java
-
20src/main/java/com/qyft/ms/app/model/entity/Ores.java
-
20src/main/java/com/qyft/ms/app/model/entity/Solutions.java
-
30src/main/java/com/qyft/ms/app/model/entity/TaskSteps.java
-
35src/main/java/com/qyft/ms/app/model/entity/Tasks.java
-
27src/main/java/com/qyft/ms/app/model/vo/BaseDataVO.java
-
13src/main/java/com/qyft/ms/app/model/vo/ContainerListVO.java
-
23src/main/java/com/qyft/ms/app/model/vo/CraftsStepResult.java
-
30src/main/java/com/qyft/ms/app/model/vo/OresCraftsListVO.java
-
35src/main/java/com/qyft/ms/app/model/vo/TaskListVO.java
-
13src/main/java/com/qyft/ms/app/service/CMDService.java
-
93src/main/java/com/qyft/ms/device/controller/DeviceCtrlController.java
-
14src/main/java/com/qyft/ms/device/controller/TestController.java
-
11src/main/java/com/qyft/ms/device/mapper/CtrlFuncMapper.java
-
11src/main/java/com/qyft/ms/device/mapper/CtrlFuncStepMapper.java
-
28src/main/java/com/qyft/ms/device/model/bo/DeviceOperationalStatus.java
-
127src/main/java/com/qyft/ms/device/model/bo/DeviceStatus.java
-
1src/main/java/com/qyft/ms/device/service/DeviceStatusService.java
-
166src/main/java/com/qyft/ms/device/service/DeviceStepService.java
-
28src/main/java/com/qyft/ms/device/service/ICtrlFuncService.java
-
12src/main/java/com/qyft/ms/device/service/ICtrlFuncStepService.java
-
132src/main/java/com/qyft/ms/device/service/impl/CtrlFuncServiceImpl.java
-
20src/main/java/com/qyft/ms/device/service/impl/CtrlFuncStepServiceImpl.java
-
5src/main/resources/mapper/device/CtrlFuncMapper.xml
-
5src/main/resources/mapper/device/CtrlFuncStepMapper.xml
@ -1,52 +0,0 @@ |
|||||
package com.qyft.ms.app.model.bo; |
|
||||
|
|
||||
import lombok.Data; |
|
||||
|
|
||||
/** |
|
||||
* 工艺步骤执行方法 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class CraftsStepMethod { |
|
||||
/** |
|
||||
* 上升托盘 |
|
||||
*/ |
|
||||
public static final String UP_TRAY = "upTray"; |
|
||||
/** |
|
||||
* 降下托盘 |
|
||||
*/ |
|
||||
public static final String DOWN_TRAY = "downTray"; |
|
||||
/** |
|
||||
* 加液 |
|
||||
*/ |
|
||||
public static final String ADD_LIQUID = "addLiquid"; |
|
||||
/** |
|
||||
* 移动到溶液位置 |
|
||||
*/ |
|
||||
public static final String MOVE_TO_SOL = "moveToSol"; |
|
||||
/** |
|
||||
* 移动到加热器位置 |
|
||||
*/ |
|
||||
public static final String MOVE_TO_HEAT = "moveToHeat"; |
|
||||
/** |
|
||||
* 摇晃 |
|
||||
*/ |
|
||||
public static final String SHAKING = "shaking"; |
|
||||
/** |
|
||||
* 开始加热 |
|
||||
*/ |
|
||||
public static final String START_HEATING = "startHeating"; |
|
||||
/** |
|
||||
* 停止加热 |
|
||||
*/ |
|
||||
public static final String STOP_HEATING = "stopHeating"; |
|
||||
/** |
|
||||
* 拍照 |
|
||||
*/ |
|
||||
public static final String TAKE_PHOTO = "takePhoto"; |
|
||||
/** |
|
||||
* 等待 |
|
||||
*/ |
|
||||
public static final String DELAY = "delay"; |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,35 +0,0 @@ |
|||||
package com.qyft.ms.app.model.bo; |
|
||||
|
|
||||
import lombok.Data; |
|
||||
|
|
||||
/** |
|
||||
* 工艺步骤执行状态 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class CraftsStepStatus { |
|
||||
|
|
||||
/** |
|
||||
* 未执行 |
|
||||
*/ |
|
||||
public static final int NOT_EXECUTED = 0; |
|
||||
/** |
|
||||
* 正在执行 |
|
||||
*/ |
|
||||
public static final int IN_PROGRESS = 1; |
|
||||
/** |
|
||||
* 暂停执行 |
|
||||
*/ |
|
||||
public static final int PAUSED = 2; |
|
||||
/** |
|
||||
* 停止执行 |
|
||||
*/ |
|
||||
public static final int STOPPED = 3; |
|
||||
/** |
|
||||
* 执行错误 |
|
||||
*/ |
|
||||
public static final int ERROR = 4; |
|
||||
/** |
|
||||
* 执行完成 |
|
||||
*/ |
|
||||
public static final int FINISH = 6; |
|
||||
} |
|
@ -1,23 +0,0 @@ |
|||||
package com.qyft.ms.app.model.bo; |
|
||||
|
|
||||
import lombok.Data; |
|
||||
|
|
||||
/** |
|
||||
* 试管添加溶液 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class TubeSol { |
|
||||
/** |
|
||||
* 需要添加溶液的试管编号 |
|
||||
*/ |
|
||||
private Integer tubeNum; |
|
||||
/** |
|
||||
* 溶液id |
|
||||
*/ |
|
||||
private Long solId; |
|
||||
/** |
|
||||
* 加液量 |
|
||||
*/ |
|
||||
private Integer volume; |
|
||||
|
|
||||
} |
|
@ -1,14 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class BaseDataDTO { |
|
||||
@Schema(description = "加热区id") |
|
||||
private Long id; |
|
||||
@Schema(description = "温度") |
|
||||
private Long temperature; |
|
||||
@Schema(description = "工艺id") |
|
||||
private Long craftId; |
|
||||
} |
|
@ -1,13 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class CmdInjectFluidDTO { |
|
||||
@Schema(description = "指令id") |
|
||||
private String commandId; |
|
||||
|
|
||||
@Schema(description = "加液数据list") |
|
||||
private InjectFluid[] injectFluids; |
|
||||
} |
|
@ -1,14 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class ContainerDTO { |
|
||||
@Schema(description = "容器id") |
|
||||
private Long id; |
|
||||
@Schema(description = "溶液id") |
|
||||
private Long solutionId; |
|
||||
@Schema(description = "已使用容量") |
|
||||
private Integer capacityUsed; |
|
||||
} |
|
@ -1,14 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class InjectFluid { |
|
||||
@Schema(description = "试管编号") |
|
||||
private Integer tubeNum; |
|
||||
@Schema(description = "溶液id") |
|
||||
private Integer solutionId; |
|
||||
@Schema(description = "容量") |
|
||||
private Integer volume; |
|
||||
} |
|
@ -1,10 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class LogDTO { |
|
||||
@Schema(description = "日志信息") |
|
||||
private String text; |
|
||||
} |
|
@ -1,11 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Schema(description = "暂停执行工艺") |
|
||||
@Data |
|
||||
public class PauseCraftsDto { |
|
||||
@Schema(description = "加热区id") |
|
||||
private String heatId; |
|
||||
} |
|
@ -1,11 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Schema(description = "恢复执行工艺") |
|
||||
@Data |
|
||||
public class ResumeCraftsDto { |
|
||||
@Schema(description = "加热区id") |
|
||||
private String heatId; |
|
||||
} |
|
@ -1,13 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Schema(description = "开始工艺") |
|
||||
@Data |
|
||||
public class StartCraftsDTO { |
|
||||
@Schema(description = "工艺id") |
|
||||
private Long craftId; |
|
||||
@Schema(description = "加热区id") |
|
||||
private String heatId; |
|
||||
} |
|
@ -1,13 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class StartHeatDTO { |
|
||||
@Schema(description = "指令id") |
|
||||
private String commandId; |
|
||||
|
|
||||
@Schema(description = "加液数据list") |
|
||||
private Integer[] heatIds; |
|
||||
} |
|
@ -1,11 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Schema(description = "恢复执行工艺") |
|
||||
@Data |
|
||||
public class StopCraftsDto { |
|
||||
@Schema(description = "加热区id") |
|
||||
private String heatId; |
|
||||
} |
|
@ -1,10 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class StopTaskDTO { |
|
||||
@Schema(description = "实验id") |
|
||||
private Long taskId; |
|
||||
} |
|
@ -1,10 +0,0 @@ |
|||||
package com.qyft.ms.app.model.dto; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
@Data |
|
||||
public class TaskDTO { |
|
||||
@Schema(description = "实验名称") |
|
||||
private String name; |
|
||||
} |
|
@ -1,35 +0,0 @@ |
|||||
package com.qyft.ms.app.model.entity; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import jakarta.validation.constraints.NotBlank; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = false) |
|
||||
@Schema(description = "容器表") |
|
||||
@TableName("container") |
|
||||
@Data |
|
||||
public class Container { |
|
||||
@NotBlank |
|
||||
@Schema(description = "容器id") |
|
||||
private Long id; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "类型 0 溶液 1 废液") |
|
||||
private Long type; |
|
||||
|
|
||||
@Schema(description = "溶液id") |
|
||||
private Long solutionId; |
|
||||
|
|
||||
@Schema(description = "机器id") |
|
||||
private String pumpId; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "总容量") |
|
||||
private Integer capacityTotal; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "使用容量") |
|
||||
private Integer capacityUsed; |
|
||||
} |
|
@ -1,25 +0,0 @@ |
|||||
package com.qyft.ms.app.model.entity; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||
import com.qyft.ms.system.common.base.BaseEntity; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import jakarta.validation.constraints.NotBlank; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@Schema(description = "工艺") |
|
||||
@TableName("crafts") |
|
||||
@Data |
|
||||
public class Crafts extends BaseEntity { |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "工艺名称") |
|
||||
private String name; |
|
||||
|
|
||||
@Schema(description = "工艺步骤") |
|
||||
private String steps; |
|
||||
|
|
||||
@Schema(description = "矿石ID") |
|
||||
private Long oresId; |
|
||||
} |
|
@ -1,20 +0,0 @@ |
|||||
package com.qyft.ms.app.model.entity; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||
import com.qyft.ms.system.common.base.BaseEntity; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import jakarta.validation.constraints.NotBlank; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@Schema(description = "矿石") |
|
||||
@TableName("ores") |
|
||||
@Data |
|
||||
public class Ores extends BaseEntity { |
|
||||
|
|
||||
@NotBlank() |
|
||||
@Schema(description = "矿石名称") |
|
||||
private String name; |
|
||||
|
|
||||
} |
|
@ -1,20 +0,0 @@ |
|||||
package com.qyft.ms.app.model.entity; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||
import com.qyft.ms.system.common.base.BaseEntity; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import jakarta.validation.constraints.NotBlank; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@Schema(description = "溶液") |
|
||||
@TableName("solutions") |
|
||||
@Data |
|
||||
public class Solutions extends BaseEntity { |
|
||||
|
|
||||
@NotBlank() |
|
||||
@Schema(description = "溶液名称") |
|
||||
private String name; |
|
||||
|
|
||||
} |
|
@ -1,30 +0,0 @@ |
|||||
package com.qyft.ms.app.model.entity; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import jakarta.validation.constraints.NotBlank; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = false) |
|
||||
@Schema(description = "实验步骤") |
|
||||
@TableName("task_steps") |
|
||||
@Data |
|
||||
public class TaskSteps { |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "id") |
|
||||
private Long id; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "实验id") |
|
||||
private Long taskId; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "步骤描述") |
|
||||
private String stepDescription; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "创建时间") |
|
||||
private String createTime; |
|
||||
} |
|
@ -1,35 +0,0 @@ |
|||||
package com.qyft.ms.app.model.entity; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||
import com.qyft.ms.system.common.base.BaseEntity; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import jakarta.validation.constraints.NotBlank; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@Schema(description = "实验") |
|
||||
@TableName("tasks") |
|
||||
@Data |
|
||||
public class Tasks extends BaseEntity { |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "实验名称") |
|
||||
private String name; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "开始时间") |
|
||||
private String startTime; |
|
||||
|
|
||||
@Schema(description = "创建人") |
|
||||
private Long createUser; |
|
||||
|
|
||||
@Schema(description = "结束时间") |
|
||||
private String endTime; |
|
||||
|
|
||||
@Schema(description = "状态 1 执行中 2 执行完毕") |
|
||||
private Integer status; |
|
||||
|
|
||||
@Schema(description = "是否删除 0 未删除 1 已删除") |
|
||||
private Integer isDeleted; |
|
||||
} |
|
@ -1,27 +0,0 @@ |
|||||
package com.qyft.ms.app.model.vo; |
|
||||
|
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = false) |
|
||||
@Schema(description = "容器") |
|
||||
@Data |
|
||||
public class BaseDataVO { |
|
||||
@Schema(description = "加热区") |
|
||||
List<SysSettingVO> heat_area; |
|
||||
|
|
||||
@Schema(description = "加液区") |
|
||||
List<SysSettingVO> solution_area; |
|
||||
|
|
||||
@Schema(description = "拍子区域") |
|
||||
List<SysSettingVO> lid_area; |
|
||||
|
|
||||
@Schema(description = "系统配置") |
|
||||
List<SysSettingVO> sys_setting; |
|
||||
|
|
||||
@Schema(description = "容器数据") |
|
||||
List<ContainerListVO> containers; |
|
||||
} |
|
@ -1,13 +0,0 @@ |
|||||
package com.qyft.ms.app.model.vo; |
|
||||
|
|
||||
import com.qyft.ms.app.model.entity.Container; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@Schema(description = "容器") |
|
||||
@Data |
|
||||
public class ContainerListVO extends Container { |
|
||||
|
|
||||
} |
|
@ -1,23 +0,0 @@ |
|||||
package com.qyft.ms.app.model.vo; |
|
||||
|
|
||||
import lombok.Data; |
|
||||
|
|
||||
/** |
|
||||
* 工艺步骤执行状态 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class CraftsStepResult { |
|
||||
/** |
|
||||
* 加热区id |
|
||||
*/ |
|
||||
private String heatId; |
|
||||
/** |
|
||||
* 0 (未执行),1 (正在执行),2 (暂停执行),3 (停止执行),4(执行错误),6(执行完成) |
|
||||
*/ |
|
||||
private Integer status; |
|
||||
/** |
|
||||
* 当前工艺执行的方法数组下标 |
|
||||
*/ |
|
||||
private Integer methodIndex; |
|
||||
|
|
||||
} |
|
@ -1,30 +0,0 @@ |
|||||
package com.qyft.ms.app.model.vo; |
|
||||
|
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||
import com.qyft.ms.app.model.entity.Crafts; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
import java.time.LocalDateTime; |
|
||||
import java.util.List; |
|
||||
|
|
||||
@Schema(description = "矿石工艺视图") |
|
||||
@Data |
|
||||
public class OresCraftsListVO { |
|
||||
|
|
||||
@Schema(description = "矿石id") |
|
||||
private Long id; |
|
||||
|
|
||||
@Schema(description = "矿石名称") |
|
||||
private String oresName; |
|
||||
|
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||
private LocalDateTime createTime; |
|
||||
|
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||
private LocalDateTime updateTime; |
|
||||
|
|
||||
@Schema(description = "该矿石下工艺列表") |
|
||||
private List<Crafts> craftsList; |
|
||||
|
|
||||
} |
|
@ -1,35 +0,0 @@ |
|||||
package com.qyft.ms.app.model.vo; |
|
||||
|
|
||||
import com.qyft.ms.app.model.entity.TaskSteps; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import jakarta.validation.constraints.NotBlank; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
@EqualsAndHashCode(callSuper = false) |
|
||||
@Data |
|
||||
public class TaskListVO { |
|
||||
@Schema(description = "实验id") |
|
||||
private Long id; |
|
||||
|
|
||||
@Schema(description = "实验名称") |
|
||||
private String name; |
|
||||
|
|
||||
@NotBlank |
|
||||
@Schema(description = "开始时间") |
|
||||
private String startTime; |
|
||||
|
|
||||
@Schema(description = "创建人") |
|
||||
private Long createUser; |
|
||||
|
|
||||
@Schema(description = "结束时间") |
|
||||
private String endTime; |
|
||||
|
|
||||
@Schema(description = "状态 1 执行中 2 执行完毕") |
|
||||
private Integer status; |
|
||||
|
|
||||
@Schema(description = "实验步骤") |
|
||||
private List<TaskSteps> steps; |
|
||||
} |
|
@ -1,93 +0,0 @@ |
|||||
package com.qyft.ms.device.controller; |
|
||||
|
|
||||
import com.qyft.ms.device.model.bo.DeviceCtrlFuncCMD; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFunc; |
|
||||
import com.qyft.ms.device.model.form.CtrlFuncForm; |
|
||||
import com.qyft.ms.device.model.vo.DeviceCtrlFuncVO; |
|
||||
import com.qyft.ms.device.service.ICtrlFuncService; |
|
||||
import com.qyft.ms.system.common.result.Result; |
|
||||
import com.qyft.ms.system.common.result.ResultCode; |
|
||||
import io.swagger.v3.oas.annotations.Operation; |
|
||||
import io.swagger.v3.oas.annotations.Parameter; |
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
|
||||
import lombok.RequiredArgsConstructor; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.web.bind.annotation.*; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
@Tag(name = "设备控制") |
|
||||
@RestController |
|
||||
@RequestMapping("/api/device") |
|
||||
@RequiredArgsConstructor |
|
||||
@Slf4j |
|
||||
public class DeviceCtrlController { |
|
||||
private final ICtrlFuncService ctrlFuncService; |
|
||||
|
|
||||
@Operation(summary = "获取所有设备控制方法步骤") |
|
||||
@GetMapping("/ctrl/step") |
|
||||
public Result<List<DeviceCtrlFuncCMD>> getAllCtrlFuncStep() { |
|
||||
List<DeviceCtrlFuncCMD> ctrlFuncList = ctrlFuncService.findAllStepCMD(); |
|
||||
return Result.success(ctrlFuncList); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "获取所有设备控制方法") |
|
||||
@GetMapping("/ctrl") |
|
||||
public Result<List<CtrlFunc>> getAllCtrlFunc() { |
|
||||
List<CtrlFunc> ctrlFuncList = ctrlFuncService.findAll(); |
|
||||
return Result.success(ctrlFuncList); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "根据id获取设备控制方法与步骤") |
|
||||
@GetMapping("/ctrl/{id}") |
|
||||
public Result<DeviceCtrlFuncVO> getById(@PathVariable Long id) { |
|
||||
DeviceCtrlFuncVO ctrlFuncVO = ctrlFuncService.findVOById(id); |
|
||||
return Result.success(ctrlFuncVO); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "添加设备控制方法与步骤") |
|
||||
@PostMapping("/ctrl") |
|
||||
public Result<String> addCtrlFunc(@RequestBody CtrlFuncForm ctrlFuncForm) { |
|
||||
long count = ctrlFuncService.countFuncCmdByFuncCmd(ctrlFuncForm.getFuncCmd()); |
|
||||
if (count > 0) { |
|
||||
return Result.failed(ResultCode.DATA_ALREADY_EXISTS); |
|
||||
|
|
||||
} |
|
||||
boolean isSuccess = ctrlFuncService.addCtrlFunc(ctrlFuncForm); |
|
||||
if (isSuccess) { |
|
||||
return Result.success(); |
|
||||
} |
|
||||
return Result.failed(); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "更新设备控制方法与步骤") |
|
||||
@PutMapping("/ctrl/{id}") |
|
||||
public Result<String> updateCtrlFunc(@PathVariable Long id, @RequestBody CtrlFuncForm ctrlFuncForm) { |
|
||||
CtrlFunc currentCtrlFunc = ctrlFuncService.getById(id); |
|
||||
if (currentCtrlFunc != null && !currentCtrlFunc.getFuncCmd().equals(ctrlFuncForm.getFuncCmd())) { |
|
||||
//改了指令需要判断指令是否重复 |
|
||||
long count = ctrlFuncService.countFuncCmdByFuncCmd(ctrlFuncForm.getFuncCmd()); |
|
||||
if (count > 0) { |
|
||||
return Result.failed(ResultCode.DATA_ALREADY_EXISTS); |
|
||||
} |
|
||||
} |
|
||||
boolean isSuccess = ctrlFuncService.updateCtrlFunc(id, ctrlFuncForm); |
|
||||
if (isSuccess) { |
|
||||
return Result.success(); |
|
||||
} |
|
||||
|
|
||||
return Result.failed(); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "删除设备控制方法") |
|
||||
@DeleteMapping("/ctrl/{ids}") |
|
||||
public Result<String> deleteCtrlFunc(@Parameter(description = "设备控制方法ID,多个以英文逗号(,)分割") @PathVariable String ids) { |
|
||||
boolean isSuccess = ctrlFuncService.deleteCtrlFunc(ids); |
|
||||
if (isSuccess) { |
|
||||
return Result.success(); |
|
||||
} |
|
||||
return Result.failed(); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,11 +0,0 @@ |
|||||
package com.qyft.ms.device.mapper; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFunc; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
|
||||
|
|
||||
@Mapper |
|
||||
public interface CtrlFuncMapper extends BaseMapper<CtrlFunc> { |
|
||||
|
|
||||
} |
|
||||
|
|
@ -1,11 +0,0 @@ |
|||||
package com.qyft.ms.device.mapper; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFuncStep; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
|
||||
|
|
||||
@Mapper |
|
||||
public interface CtrlFuncStepMapper extends BaseMapper<CtrlFuncStep> { |
|
||||
|
|
||||
} |
|
||||
|
|
@ -1,166 +0,0 @@ |
|||||
package com.qyft.ms.device.service; |
|
||||
|
|
||||
import com.qyft.ms.app.model.bo.TubeSol; |
|
||||
import com.qyft.ms.app.service.CMDService; |
|
||||
import lombok.RequiredArgsConstructor; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 设备步骤操作 |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
@Service |
|
||||
@RequiredArgsConstructor |
|
||||
public class DeviceStepService { |
|
||||
|
|
||||
CMDService cmdService; |
|
||||
|
|
||||
/** |
|
||||
* 抬起托盘 |
|
||||
* |
|
||||
* @param heatId 加热区id |
|
||||
*/ |
|
||||
public boolean upTray(String heatId) { |
|
||||
// Map<String, Object> params = Map.of("heatId", heatId); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.upTray(params); |
|
||||
// return cmdList.stream().allMatch(Supplier::get); |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 降下托盘 |
|
||||
* |
|
||||
* @param heatId 加热区id |
|
||||
*/ |
|
||||
public boolean downTray(String heatId) { |
|
||||
// Map<String, Object> params = Map.of("heatId", heatId); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.downTray(params); |
|
||||
// return cmdList.stream().allMatch(Supplier::get); |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 添加溶液 |
|
||||
* |
|
||||
* @param tubeSolList 需要添加溶液的试管与溶液 |
|
||||
*/ |
|
||||
public boolean addLiquid(List<TubeSol> tubeSolList) { |
|
||||
// for (TubeSol tubeSol : tubeSolList) { |
|
||||
// Map<String, Object> params = Map.of("tubeNum", tubeSol.getTubeNum(), "solutionId", tubeSol.getSolId(), "volume", tubeSol.getVolume()); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.downTray(params); |
|
||||
// boolean result = cmdList.stream().allMatch(Supplier::get); |
|
||||
// if (!result) { |
|
||||
// return false; |
|
||||
// } |
|
||||
// } |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 将指定加热区的托盘移至加液区 |
|
||||
* |
|
||||
* @param heatId 加热区id |
|
||||
*/ |
|
||||
public boolean moveToSol(String heatId) { |
|
||||
// Map<String, Object> params = Map.of("heatId", heatId); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.moveToActionArea(params); |
|
||||
// return cmdList.stream().allMatch(Supplier::get); |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 移至加热 |
|
||||
* |
|
||||
* @param heatId 加热区id |
|
||||
*/ |
|
||||
public boolean moveToHeat(String heatId) { |
|
||||
// Map<String, Object> params = Map.of("heatId", heatId); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.moveToHeatArea(params); |
|
||||
// return cmdList.stream().allMatch(Supplier::get); |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 摇匀 |
|
||||
* |
|
||||
* @param second 摇匀时间 |
|
||||
*/ |
|
||||
public boolean shaking(int second) { |
|
||||
// Map<String, Object> params = Map.of(); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.startShakeUp(params); |
|
||||
// boolean result = cmdList.stream().allMatch(Supplier::get); |
|
||||
// if (result) { |
|
||||
// this.delay(second); |
|
||||
// cmdList = cmdService.stopShakeUp(params); |
|
||||
// result = cmdList.stream().allMatch(Supplier::get); |
|
||||
// return result; |
|
||||
// } |
|
||||
// return false; |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 开始加热 |
|
||||
* |
|
||||
* @param heatId 加热区id |
|
||||
* @param temperature 目标温度 |
|
||||
*/ |
|
||||
public boolean startHeating(String heatId, double temperature) { |
|
||||
// Map<String, Object> params = Map.of("heatId", heatId, "temperature", temperature); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.startHeat(params); |
|
||||
// return cmdList.stream().allMatch(Supplier::get); |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 停止加热 |
|
||||
* |
|
||||
* @param heatId 加热区id |
|
||||
*/ |
|
||||
public boolean stopHeating(String heatId) { |
|
||||
// Map<String, Object> params = Map.of("heatId", heatId); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.stopHeat(params); |
|
||||
// return cmdList.stream().allMatch(Supplier::get); |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 停止加热 |
|
||||
*/ |
|
||||
public boolean takePhoto() { |
|
||||
// Map<String, Object> params = Map.of(); |
|
||||
// List<Supplier<Boolean>> cmdList = cmdService.takePhoto(params); |
|
||||
// return cmdList.stream().allMatch(Supplier::get); |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
//移至异常 |
|
||||
public boolean moveToExc() { |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
//移除异常 |
|
||||
public boolean moveOutToExc() { |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 等待 |
|
||||
* |
|
||||
* @param second 秒 |
|
||||
*/ |
|
||||
public boolean delay(int second) { |
|
||||
try { |
|
||||
Thread.sleep(second * 1000L); |
|
||||
return true; |
|
||||
} catch (InterruptedException e) { |
|
||||
Thread.currentThread().interrupt(); |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,28 +0,0 @@ |
|||||
package com.qyft.ms.device.service; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
|
||||
import com.qyft.ms.device.model.bo.DeviceCtrlFuncCMD; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFunc; |
|
||||
import com.qyft.ms.device.model.form.CtrlFuncForm; |
|
||||
import com.qyft.ms.device.model.vo.DeviceCtrlFuncVO; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
|
|
||||
public interface ICtrlFuncService extends IService<CtrlFunc> { |
|
||||
|
|
||||
List<DeviceCtrlFuncCMD> findAllStepCMD(); |
|
||||
|
|
||||
List<CtrlFunc> findAll(); |
|
||||
|
|
||||
DeviceCtrlFuncVO findVOById(Long id); |
|
||||
|
|
||||
long countFuncCmdByFuncCmd(String funcCmd); |
|
||||
|
|
||||
boolean addCtrlFunc(CtrlFuncForm ctrlFuncForm); |
|
||||
|
|
||||
boolean updateCtrlFunc(Long id, CtrlFuncForm ctrlFuncForm); |
|
||||
|
|
||||
boolean deleteCtrlFunc(String idsStr); |
|
||||
|
|
||||
} |
|
@ -1,12 +0,0 @@ |
|||||
package com.qyft.ms.device.service; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFuncStep; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
public interface ICtrlFuncStepService extends IService<CtrlFuncStep> { |
|
||||
List<CtrlFuncStep> selectListByFuncCmd(String funcCmd); |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,132 +0,0 @@ |
|||||
package com.qyft.ms.device.service.impl; |
|
||||
|
|
||||
import cn.hutool.json.JSONUtil; |
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
||||
import com.qyft.ms.device.mapper.CtrlFuncMapper; |
|
||||
import com.qyft.ms.device.model.bo.DeviceCtrlFuncCMD; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFunc; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFuncStep; |
|
||||
import com.qyft.ms.device.model.form.CtrlFuncForm; |
|
||||
import com.qyft.ms.device.model.vo.DeviceCtrlFuncVO; |
|
||||
import com.qyft.ms.device.service.ICtrlFuncService; |
|
||||
import com.qyft.ms.device.service.ICtrlFuncStepService; |
|
||||
import lombok.RequiredArgsConstructor; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.Arrays; |
|
||||
import java.util.List; |
|
||||
import java.util.stream.Collectors; |
|
||||
|
|
||||
@RequiredArgsConstructor |
|
||||
@Service |
|
||||
public class CtrlFuncServiceImpl extends ServiceImpl<CtrlFuncMapper, CtrlFunc> implements ICtrlFuncService { |
|
||||
|
|
||||
private final ICtrlFuncStepService ctrlFuncStepService; |
|
||||
|
|
||||
private static final List<DeviceCtrlFuncCMD> ctrlFuncDeviceCMDList = new ArrayList<>(); |
|
||||
|
|
||||
static { |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("开门", "openDoor", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("关门", "closeDoor", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("导轨机械臂运动到指定点位", "moveRailArmToPoint", "{\"x\":0,\"y\":0,\"z\":0}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("导轨机械臂相对运动", "moveRailArmRelative", "{\"x\":0,\"y\":0,\"z\":0}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("导轨机械臂移至指定加热区上方", "moveToHeatArea", "{\"heatId\":2}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("导轨机械臂移至加液区上方", "moveToActionArea", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("导轨机械臂移至拍子存放区上方", "moveToCapArea", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("打开导轨机械臂夹爪", "openClaw", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("收合导轨机械臂夹爪", "closeClaw", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("指定加热区密封拍子", "sealLidOn", "{\"heatId\":2}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("指定加热区解除密封拍子", "sealLidOff", "{\"heatId\":2}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("拍子存放区高度向上一个级别", "capHeightUp", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("拍子存放区高度向下移动一个级别", "capHeightDown", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("指定加热区开始加热", "startHeating", "{\"heatId\":2}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("指定加热区停止加热", "stopHeating", "{\"heatId\":2}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("指定加热区抬起托盘", "raiseTray", "{\"heatId\":2}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("指定加热区放下托盘", "lowerTray", "{\"heatId\":2}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("依次添加溶液", "addLiquid", "{\"tubeSolList\":[{\"tubeNum\":1,\"solId\":15,\"volume\":20}]}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("开始摇匀", "startShaking", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("停止摇匀", "stopShaking", "{}")); |
|
||||
ctrlFuncDeviceCMDList.add(new DeviceCtrlFuncCMD("拍照", "takePhoto", "{}")); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<DeviceCtrlFuncCMD> findAllStepCMD() { |
|
||||
return ctrlFuncDeviceCMDList; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<CtrlFunc> findAll() { |
|
||||
return this.baseMapper.selectList(null); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public DeviceCtrlFuncVO findVOById(Long id) { |
|
||||
CtrlFunc ctrlFunc = this.getById(id); |
|
||||
List<CtrlFuncStep> ctrlFuncStepList = ctrlFuncStepService.selectListByFuncCmd(ctrlFunc.getFuncCmd()); |
|
||||
DeviceCtrlFuncVO ctrlFuncVO = new DeviceCtrlFuncVO(); |
|
||||
ctrlFuncVO.setId(ctrlFunc.getId()); |
|
||||
ctrlFuncVO.setName(ctrlFunc.getName()); |
|
||||
ctrlFuncVO.setFuncCmd(ctrlFunc.getFuncCmd()); |
|
||||
ctrlFuncVO.setFuncCmd(ctrlFunc.getFuncCmd()); |
|
||||
ctrlFuncVO.setCtrlFuncStepList(ctrlFuncStepList); |
|
||||
return ctrlFuncVO; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public long countFuncCmdByFuncCmd(String funcCmd) { |
|
||||
return this.count(new LambdaQueryWrapper<CtrlFunc>().eq(CtrlFunc::getFuncCmd, funcCmd)); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean addCtrlFunc(CtrlFuncForm ctrlFuncForm) { |
|
||||
CtrlFunc ctrlFunc = new CtrlFunc(); |
|
||||
ctrlFunc.setFuncCmd(ctrlFuncForm.getFuncCmd()); |
|
||||
ctrlFunc.setName(ctrlFuncForm.getName()); |
|
||||
if (this.save(ctrlFunc)) { |
|
||||
return reSaveCtrlFunc(ctrlFuncForm, ctrlFunc); |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean updateCtrlFunc(Long id, CtrlFuncForm ctrlFuncForm) { |
|
||||
CtrlFunc ctrlFunc = this.getById(id); |
|
||||
if (ctrlFunc != null) { |
|
||||
ctrlFunc.setFuncCmd(ctrlFuncForm.getFuncCmd()); |
|
||||
ctrlFunc.setName(ctrlFuncForm.getName()); |
|
||||
if (this.updateById(ctrlFunc)) { |
|
||||
return reSaveCtrlFunc(ctrlFuncForm, ctrlFunc); |
|
||||
} |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean deleteCtrlFunc(String idsStr) { |
|
||||
List<Long> ids = Arrays.stream(idsStr.split(",")) |
|
||||
.map(Long::parseLong) |
|
||||
.collect(Collectors.toList()); |
|
||||
for (Long id : ids) { |
|
||||
String funcCmd = this.getById(id).getFuncCmd(); |
|
||||
ctrlFuncStepService.remove(new LambdaQueryWrapper<CtrlFuncStep>().eq(CtrlFuncStep::getFuncCmd, funcCmd)); |
|
||||
} |
|
||||
return this.removeByIds(ids); |
|
||||
} |
|
||||
|
|
||||
private boolean reSaveCtrlFunc(CtrlFuncForm ctrlFuncForm, CtrlFunc ctrlFunc) { |
|
||||
ctrlFuncStepService.remove(new LambdaQueryWrapper<CtrlFuncStep>().eq(CtrlFuncStep::getFuncCmd, ctrlFunc.getFuncCmd())); |
|
||||
List<CtrlFuncForm.CtrlFuncStepForm> ctrlFuncStepFormList = ctrlFuncForm.getCtrlFuncStepList(); |
|
||||
List<CtrlFuncStep> ctrlFuncStepList = ctrlFuncStepFormList.stream() |
|
||||
.map(ctrlFuncStepForm -> { |
|
||||
CtrlFuncStep ctrlFuncStep = new CtrlFuncStep(); |
|
||||
ctrlFuncStep.setFuncCmd(ctrlFunc.getFuncCmd()); |
|
||||
ctrlFuncStep.setDeviceCmd(ctrlFuncStepForm.getDeviceCmd()); |
|
||||
ctrlFuncStep.setRemarks(ctrlFuncStepForm.getRemarks()); |
|
||||
ctrlFuncStep.setParams(JSONUtil.toJsonStr(ctrlFuncStepForm.getParams())); |
|
||||
return ctrlFuncStep; |
|
||||
}).toList(); |
|
||||
return ctrlFuncStepService.saveBatch(ctrlFuncStepList); |
|
||||
} |
|
||||
} |
|
@ -1,20 +0,0 @@ |
|||||
package com.qyft.ms.device.service.impl; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
||||
import com.qyft.ms.device.mapper.CtrlFuncStepMapper; |
|
||||
import com.qyft.ms.device.model.entity.CtrlFuncStep; |
|
||||
import com.qyft.ms.device.service.ICtrlFuncStepService; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
@Service |
|
||||
public class CtrlFuncStepServiceImpl extends ServiceImpl<CtrlFuncStepMapper, CtrlFuncStep> implements ICtrlFuncStepService { |
|
||||
|
|
||||
@Override |
|
||||
public List<CtrlFuncStep> selectListByFuncCmd(String funcCmd) { |
|
||||
return this.list(new LambdaQueryWrapper<CtrlFuncStep>().eq(CtrlFuncStep::getFuncCmd, funcCmd)); |
|
||||
} |
|
||||
|
|
||||
} |
|
@ -1,5 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
||||
<mapper namespace="com.qyft.ms.device.mapper.CtrlFuncMapper"> |
|
||||
|
|
||||
</mapper> |
|
@ -1,5 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
||||
<mapper namespace="com.qyft.ms.device.mapper.CtrlFuncStepMapper"> |
|
||||
|
|
||||
</mapper> |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue