iailab-module-model/iailab-module-model-biz/db/mysql.sql
@@ -256,8 +256,8 @@ create table t_st_schedule_scheme ( `id` varchar(36) not null COMMENT 'ID', `code` varchar(20) COMMENT '编号', `name` varchar(20) COMMENT '名称', `code` varchar(20) not null COMMENT '编号', `name` varchar(20) not null COMMENT '名称', `trigger_method` varchar(20) COMMENT '触发方式', `trigger_condition` varchar(20) COMMENT '触发条件', `schedule_obj` varchar(20) COMMENT '调整对象', @@ -280,8 +280,8 @@ create table t_st_schedule_model ( `id` varchar(36) not null COMMENT 'ID', `model_code` varchar(64) COMMENT '模型编号', `model_name` varchar(64) COMMENT '模型名称', `model_code` varchar(64) not null COMMENT '模型编号', `model_name` varchar(64) not null COMMENT '模型名称', `model_type` varchar(64) COMMENT '模型类型', `class_name` varchar(128) COMMENT '类名', `method_name` varchar(64) COMMENT '方法名', @@ -304,7 +304,7 @@ t_st_schedule_model_param ( id varchar(36) not null, modelid varchar(64), modelid varchar(64) not null, modelparamname varchar(64), modelparamid varchar(64), modelparamorder integer, @@ -320,7 +320,7 @@ t_st_schedule_model_setting ( `id` varchar(36) not null, `modelid` varchar(64), `modelid` varchar(64) not null, `key` varchar(64), `value` varchar(64), `valuetype` varchar(64), iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleModelController.java
@@ -16,6 +16,8 @@ import javax.validation.Valid; import java.util.List; import static com.iailab.framework.common.pojo.CommonResult.error; import static com.iailab.framework.common.pojo.CommonResult.success; @@ -39,6 +41,13 @@ return success(BeanUtils.toBean(page, StScheduleModelRespVO.class)); } @GetMapping("/list") @PreAuthorize("@ss.hasPermission('sche:model:query')") public CommonResult<List<StScheduleModelRespVO>> list() { List<StScheduleModelEntity> list = stScheduleModelService.list(); return success(BeanUtils.toBean(list, StScheduleModelRespVO.class)); } @GetMapping("/get") @Operation(summary = "获得详情") @PreAuthorize("@ss.hasPermission('sche:model:query')") iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleModelSettingEntity.java
@@ -1,6 +1,7 @@ package com.iailab.module.model.mcs.sche.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -31,11 +32,13 @@ /** * 键 */ @TableField(value = "`key`") private String key; /** * 值 */ @TableField(value = "`value`") private String value; /** iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleModelService.java
@@ -6,6 +6,8 @@ import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleModelSaveReqVO; import java.util.List; /** * @author PanZhibao * @date 2021年07月20日 14:13 @@ -14,6 +16,8 @@ PageResult<StScheduleModelEntity> page(StScheduleModelPageReqVO reqVO); List<StScheduleModelEntity> list(); void create(StScheduleModelSaveReqVO reqVO); void update(StScheduleModelSaveReqVO reqVO); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelParamServiceImpl.java
@@ -48,6 +48,7 @@ saveList.forEach(item -> { StScheduleModelParamEntity entity = BeanUtils.toBean(item, StScheduleModelParamEntity.class); entity.setId(UUID.randomUUID().toString()); entity.setModelid(modelId); baseDao.insert(entity); }); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelServiceImpl.java
@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.UUID; /** @@ -37,6 +38,12 @@ } @Override public List<StScheduleModelEntity> list() { return baseDao.selectList(null); } @Override @Transactional(rollbackFor = Exception.class) public void create(StScheduleModelSaveReqVO reqVO) { StScheduleModelEntity entity = BeanUtils.toBean(reqVO, StScheduleModelEntity.class); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelSettingServiceImpl.java
@@ -44,10 +44,13 @@ if (CollectionUtils.isEmpty(saveList)) { return; } saveList.forEach(item -> { for (int i = 0; i < saveList.size(); i++) { StScheduleModelSettingSaveReqVO item = saveList.get(i); StScheduleModelSettingEntity entity = BeanUtils.toBean(item, StScheduleModelSettingEntity.class); entity.setId(UUID.randomUUID().toString()); entity.setModelid(modelId); entity.setSort(i); baseDao.insert(entity); }); } } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeSaveReqVO.java
@@ -20,11 +20,11 @@ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "编号不能为空") private String appCode; private String code; @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "名称不能为空") private String appName; private String name; @Schema(description = "触发方式") private String triggerMethod;