iailab-module-model/iailab-module-model-biz/db/mysql.sql
@@ -271,17 +271,17 @@ `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updater` varchar(64) NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', primary key (id), UNIQUE INDEX `uk_code` (`code` ASC) USING BTREE ) engine = innodb default character set utf8mb4 COMMENT = '调度方案表'; 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) COMMENT '模型编号', `model_name` varchar(64) COMMENT '模型名称', `model_type` varchar(64) COMMENT '模型类型', `class_name` varchar(128) COMMENT '类名', `method_name` varchar(64) COMMENT '方法名', @@ -295,10 +295,10 @@ `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updater` varchar(64) NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', primary key (id), UNIQUE INDEX `uk_model_code` (`model_code` ASC) USING BTREE ) engine = innodb default character set utf8mb4 COMMENT = '调度模型表'; ) engine = innodb default character set utf8mb4 COMMENT = '调度模型表'; create table t_st_schedule_model_param @@ -325,13 +325,14 @@ `value` varchar(64), `valuetype` varchar(64), `name` varchar(64), `sort` integer, primary key (id), key idx_modelid (modelid) ) engine = innodb default character set utf8mb4 COMMENT = '调度模型设置参数表'; create table t_st_schedule_scheme_suggest t_st_schedule_suggest ( id varchar(36) not null, title varchar(50) COMMENT '标题', @@ -372,7 +373,7 @@ `id` varchar(36) not null, `scheme_id` varchar(36) COMMENT '方案ID', `model_id` varchar(36) COMMENT '模型ID', `model_name` varchar(64) COMMENT '名称', `model_name` varchar(64) COMMENT '模型名称', `schedule_time` datetime COMMENT '调度时间', `create_time` datetime default current_timestamp COMMENT '创建时间', primary key (id), iailab-module-model/iailab-module-model-biz/pom.xml
@@ -66,6 +66,10 @@ </dependency> <dependency> <groupId>com.iailab</groupId> <artifactId>iailab-common-biz-tenant</artifactId> </dependency> <dependency> <groupId>com.iailab</groupId> <artifactId>iailab-module-model-api</artifactId> <version>${revision}</version> </dependency> iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/ModelServiceApplication.java
@@ -13,7 +13,7 @@ @SpringBootApplication public class ModelServiceApplication implements CommandLineRunner { static { /*static { //加载动态链接库 try { Properties properties = new Properties(); @@ -27,7 +27,7 @@ System.out.println("动态链接库IAILMDK初始化失败"); } } */ public static void main(String[] args) { SpringApplication.run(ModelServiceApplication.class, args); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/framework/rpc/config/RpcConfiguration.java
对比新文件 @@ -0,0 +1,14 @@ package com.iailab.module.model.framework.rpc.config; import com.iailab.module.data.api.point.DataPointApi; import com.iailab.module.infra.api.config.ConfigApi; import com.iailab.module.infra.api.file.FileApi; import com.iailab.module.system.api.tenant.TenantApi; import com.iailab.module.system.api.user.AdminUserApi; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; @Configuration(proxyBeanMethods = false) @EnableFeignClients(clients = {FileApi.class, AdminUserApi.class, ConfigApi.class, TenantApi.class, DataPointApi.class}) public class RpcConfiguration { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/framework/rpc/package-info.java
对比新文件 @@ -0,0 +1,4 @@ /** * 占位 */ package com.iailab.module.model.framework.rpc; iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/framework/security/config/SecurityConfiguration.java
对比新文件 @@ -0,0 +1,38 @@ package com.iailab.module.model.framework.security.config; import com.iailab.framework.security.config.AuthorizeRequestsCustomizer; import com.iailab.module.system.enums.ApiConstants; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; /** * System 模块的 Security 配置 */ @Configuration(proxyBeanMethods = false, value = "systemSecurityConfiguration") public class SecurityConfiguration { @Bean("systemAuthorizeRequestsCustomizer") public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() { return new AuthorizeRequestsCustomizer() { @Override public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) { // TODO iailab:这个每个项目都需要重复配置,得捉摸有没通用的方案 // Swagger 接口文档 registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据 .antMatchers("/swagger-ui.html").permitAll(); // Swagger UI // Druid 监控 registry.antMatchers("/druid/**").anonymous(); // Spring Boot Actuator 的安全配置 registry.antMatchers("/actuator").anonymous() .antMatchers("/actuator/**").anonymous(); // RPC 服务的安全配置 registry.antMatchers(ApiConstants.PREFIX + "/**").permitAll(); } }; } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/framework/security/core/package-info.java
对比新文件 @@ -0,0 +1,4 @@ /** * 占位 */ package com.iailab.module.model.framework.security.core; iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java
@@ -54,7 +54,7 @@ */ @GetMapping("/get") public CommonResult<DmModuleEntity> info(@RequestParam("id") String id){ DmModuleEntity module = dmModuleService.selectById(id); DmModuleEntity module = dmModuleService.get(id); return success(module); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleService.java
@@ -1,6 +1,5 @@ package com.iailab.module.model.mcs.pre.service; import com.iailab.framework.common.page.PageData; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; @@ -28,4 +27,6 @@ List<DmModuleEntity> list(Map<String, Object> params); List<DmModuleEntity> getModuleByModuleType(String moduletype); DmModuleEntity get(String id); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java
@@ -34,6 +34,11 @@ return baseDao.selectList(wrapper); } @Override public DmModuleEntity get(String id) { return baseDao.selectById(id); } private QueryWrapper<DmModuleEntity> getWrapper(Map<String, Object> params) { String modulename = (String) params.get("modulename"); String moduletype = (String) params.get("moduletype"); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/StScheduleController.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/StScheduleEnergyTypeController.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/StScheduleModelController.java
@@ -3,15 +3,18 @@ import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.module.model.mcs.sche.dto.StScheduleModelDto; import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; import com.iailab.module.model.mcs.sche.service.StScheduleModelService; import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleModelRespVO; import com.iailab.module.model.mcs.sche.vo.StScheduleModelSaveReqVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.Map; import javax.validation.Valid; import static com.iailab.framework.common.pojo.CommonResult.error; import static com.iailab.framework.common.pojo.CommonResult.success; @@ -20,66 +23,59 @@ * @author PanZhibao * @date 2021年07月20日 14:35 */ @Tag(name = "模型服务 - 调度模型管理") @RestController @RequestMapping("/sche/schedule-model") @RequestMapping("/model/sche/model") public class StScheduleModelController { @Autowired private StScheduleModelService stScheduleModelService; /** * 调度模型类型列表 */ @GetMapping("/page") public CommonResult<PageResult<StScheduleModelRespVO>> page(@RequestParam Map<String, Object> params) { PageResult<StScheduleModelRespVO> page = stScheduleModelService.getPageList(params); @Operation(summary = "获得分页") @PreAuthorize("@ss.hasPermission('sche:model:query')") public CommonResult<PageResult<StScheduleModelRespVO>> page(@Valid StScheduleModelPageReqVO reqVO) { PageResult<StScheduleModelEntity> page = stScheduleModelService.page(reqVO); return success(BeanUtils.toBean(page, StScheduleModelRespVO.class)); } /** * 调度模型类型信息 */ @GetMapping("/get") public CommonResult<StScheduleModelDto> info(@RequestParam("id") String id){ StScheduleModelDto scheduleMode = stScheduleModelService.getDetailById(id); return success(scheduleMode); @Operation(summary = "获得详情") @PreAuthorize("@ss.hasPermission('sche:model:query')") public CommonResult<StScheduleModelRespVO> get(@RequestParam("id") String id){ StScheduleModelEntity data = stScheduleModelService.get(id); return success(BeanUtils.toBean(data, StScheduleModelRespVO.class)); } /** * 保存调度模型类型 */ @PostMapping("/create") public CommonResult<Boolean> save(@RequestBody StScheduleModelDto scheduleMode){ StScheduleModelEntity stScheduleModelEntity = ConvertUtils.sourceToTarget(scheduleMode, StScheduleModelEntity.class); int count = stScheduleModelService.check(stScheduleModelEntity); @Operation(summary = "创建模型") @PreAuthorize("@ss.hasPermission('sche:model:create')") public CommonResult<Boolean> save(@Valid @RequestBody StScheduleModelSaveReqVO reqVO){ Long count = stScheduleModelService.check(reqVO); if (count > 0) { return error(999, "名称或编号重复"); } stScheduleModelService.saveStScheduleModel(scheduleMode); stScheduleModelService.create(reqVO); return success(true); } /** * 修改调度模型类型 */ @PutMapping("/update") public CommonResult<Boolean> update(@RequestBody StScheduleModelDto scheduleMode){ StScheduleModelEntity stScheduleModelEntity = ConvertUtils.sourceToTarget(scheduleMode, StScheduleModelEntity.class); int count = stScheduleModelService.check(stScheduleModelEntity); @Operation(summary = "更新模型") @PreAuthorize("@ss.hasPermission('sche:model:update')") public CommonResult<Boolean> update(@Valid @RequestBody StScheduleModelSaveReqVO reqVO){ Long count = stScheduleModelService.check(reqVO); if (count > 0) { return error(999, "名称或编号重复"); } stScheduleModelService.update(scheduleMode); stScheduleModelService.update(reqVO); return success(true); } /** * 删除调度模型类型 */ @DeleteMapping("/delete") @Operation(summary = "删除模型") @PreAuthorize("@ss.hasPermission('sche:model:delete')") public CommonResult<Boolean> delete(@RequestParam("id") String id){ stScheduleModelService.deleteBatch(new String[]{id}); stScheduleModelService.delete(id); return success(true); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/StScheduleObjectController.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/StScheduleSchemeController.java
对比新文件 @@ -0,0 +1,96 @@ package com.iailab.module.model.mcs.sche.controller; import com.iailab.framework.apilog.core.annotation.ApiAccessLog; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageParam; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.framework.excel.core.util.ExcelUtils; import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemePageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeRespVO; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeSaveReqVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.util.List; import static com.iailab.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Tag(name = "模型服务 - 调度方案") @RestController @RequestMapping("/model/sche/scheme") public class StScheduleSchemeController { @Autowired private StScheduleSchemeService stScheduleSchemeService; @PostMapping("/create") @Operation(summary = "创建调度方案") @PreAuthorize("@ss.hasPermission('sche:scheme:create')") public CommonResult<Boolean> create(@Valid @RequestBody StScheduleSchemeSaveReqVO createReqVO) { stScheduleSchemeService.create(createReqVO); return success(true); } @PutMapping("/update") @Operation(summary = "更新调度方案") @PreAuthorize("@ss.hasPermission('sche:scheme:update')") public CommonResult<Boolean> update(@Valid @RequestBody StScheduleSchemeSaveReqVO updateReqVO) { stScheduleSchemeService.update(updateReqVO); return success(true); } @DeleteMapping("/delete") @Operation(summary = "删除调度方案") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('sche:scheme:delete')") public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { stScheduleSchemeService.delete(id); return success(true); } @GetMapping("/get") @Operation(summary = "获得调度方案") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('sche:scheme:query')") public CommonResult<StScheduleSchemeRespVO> getInfo(@RequestParam("id") String id) { StScheduleSchemeEntity entity = stScheduleSchemeService.getInfo(id); return success(BeanUtils.toBean(entity, StScheduleSchemeRespVO.class)); } @GetMapping("/page") @Operation(summary = "获得调度方案分页") @PreAuthorize("@ss.hasPermission('sche:scheme:query')") public CommonResult<PageResult<StScheduleSchemeRespVO>> getTenantPage(@Valid StScheduleSchemePageReqVO pageVO) { PageResult<StScheduleSchemeEntity> pageResult = stScheduleSchemeService.page(pageVO); return success(BeanUtils.toBean(pageResult, StScheduleSchemeRespVO.class)); } @GetMapping("/export-excel") @Operation(summary = "导出调度方案 Excel") @PreAuthorize("@ss.hasPermission('system:tenant:export')") @ApiAccessLog(operateType = EXPORT) public void exportTenantExcel(@Valid StScheduleSchemePageReqVO exportReqVO, HttpServletResponse response) throws IOException { exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List<StScheduleSchemeEntity> list = stScheduleSchemeService.page(exportReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "调度方案.xls", "数据", StScheduleSchemeEntity.class, BeanUtils.toBean(list, StScheduleSchemeEntity.class)); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/StScheduleUserController.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleEnergyTypeDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleModelDao.java
@@ -1,13 +1,11 @@ package com.iailab.module.model.mcs.sche.dao; import com.baomidou.mybatisplus.core.metadata.IPage; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleModelRespVO; import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Map; /** * @author PanZhibao @@ -16,12 +14,10 @@ @Mapper public interface StScheduleModelDao extends BaseMapperX<StScheduleModelEntity> { /** * 查询列表 * * @param page * @param params * @return */ IPage<StScheduleModelRespVO> getPageList(IPage<StScheduleModelEntity> page, @Param("params") Map<String, Object> params); default PageResult<StScheduleModelEntity> selectPage(StScheduleModelPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX<StScheduleModelEntity>() .likeIfPresent(StScheduleModelEntity::getModelCode, reqVO.getModelCode()) .likeIfPresent(StScheduleModelEntity::getModelName, reqVO.getModelName()) .orderByDesc(StScheduleModelEntity::getCreateTime)); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleModelParamDao.java
对比新文件 @@ -0,0 +1,14 @@ package com.iailab.module.model.mcs.sche.dao; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.module.model.mcs.sche.entity.StScheduleModelParamEntity; import org.apache.ibatis.annotations.Mapper; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Mapper public interface StScheduleModelParamDao extends BaseMapperX<StScheduleModelParamEntity> { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleModelSettingDao.java
对比新文件 @@ -0,0 +1,14 @@ package com.iailab.module.model.mcs.sche.dao; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity; import org.apache.ibatis.annotations.Mapper; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Mapper public interface StScheduleModelSettingDao extends BaseMapperX<StScheduleModelSettingEntity> { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleModelUserParamDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleObjectDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleParamDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleParamSettingDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleRecordDao.java
对比新文件 @@ -0,0 +1,25 @@ package com.iailab.module.model.mcs.sche.dao; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO; import org.apache.ibatis.annotations.Mapper; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Mapper public interface StScheduleRecordDao extends BaseMapperX<StScheduleRecordEntity> { default PageResult<StScheduleRecordEntity> selectPage(StScheduleRecordPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX<StScheduleRecordEntity>() .likeIfPresent(StScheduleRecordEntity::getModelName, reqVO.getModelName()) .geIfPresent(StScheduleRecordEntity::getScheduleTime, reqVO.getStartTime()) .leIfPresent(StScheduleRecordEntity::getScheduleTime, reqVO.getEndTime()) .orderByDesc(StScheduleRecordEntity::getCreateTime)); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleRecordDetailDao.java
对比新文件 @@ -0,0 +1,14 @@ package com.iailab.module.model.mcs.sche.dao; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.module.model.mcs.sche.entity.StScheduleRecordDetailEntity; import org.apache.ibatis.annotations.Mapper; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Mapper public interface StScheduleRecordDetailDao extends BaseMapperX<StScheduleRecordDetailEntity> { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleSchemeDao.java
@@ -1,7 +1,10 @@ package com.iailab.module.model.mcs.sche.dao; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemePageReqVO; import org.apache.ibatis.annotations.Mapper; import java.util.Map; @@ -13,10 +16,9 @@ @Mapper public interface StScheduleSchemeDao extends BaseMapperX<StScheduleSchemeEntity> { /** * saveScheduleTime * * @param map */ void saveScheduleTime(Map map); default PageResult<StScheduleSchemeEntity> selectPage(StScheduleSchemePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX<StScheduleSchemeEntity>() .likeIfPresent(StScheduleSchemeEntity::getName, reqVO.getName()) .orderByDesc(StScheduleSchemeEntity::getCreateTime)); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleSchemeDetailesDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleSchemeEvalTypeDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleSchemeEvalValueDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleSuggestDao.java
对比新文件 @@ -0,0 +1,14 @@ package com.iailab.module.model.mcs.sche.dao; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; import org.apache.ibatis.annotations.Mapper; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Mapper public interface StScheduleSuggestDao extends BaseMapperX<StScheduleSuggestEntity> { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dao/StScheduleUserDao.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dto/StScheduleModelDto.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/dto/StSchedulePredictItemDto.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleEnergyTypeEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleModelEntity.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.iailab.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,7 +15,7 @@ */ @Data @TableName("T_ST_SCHEDULE_MODEL") public class StScheduleModelEntity implements Serializable { public class StScheduleModelEntity extends BaseDO { private static final long serialVersionUID = 1L; @@ -24,46 +25,58 @@ @TableId(value = "id",type = IdType.INPUT) private String id; /** * 模型编号 */ private String modelCode; /** * 模型名称 */ @NotBlank(message="模型名称不能为空") private String modelname; private String modelName; /** * 调度ID * 模型类型 */ private String scheduleid; /** * 对象ID */ private String objectid; private String modelType; /** * 类名 */ private String classname; private String className; /** * 方法名 */ private String methodname; private String methodName; /** * 输入数量 */ private Integer portLength; /** * 参数构造 */ private String paramStructure; /** * 模型路径 */ private String modelpath; private String modelPath; /** * 端口长度 * 结果字符串 */ private Integer portlength; private String resultStrId; /** * 模型状态 * 调用方式 */ private Integer modelstatus; private String invocation; /** * 状态 */ private Integer status; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleModelParamEntity.java
文件名从 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleParamEntity.java 修改 @@ -9,12 +9,12 @@ /** * @author PanZhibao * @date 2021年07月19日 16:17 * @Description * @createTime 2024年09月06日 */ @Data @TableName("T_ST_SCHEDULE_PARAM") public class StScheduleParamEntity implements Serializable { @TableName("t_st_schedule_model_param") public class StScheduleModelParamEntity implements Serializable { private static final long serialVersionUID = 1L; /** iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleModelSettingEntity.java
文件名从 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleParamSettingEntity.java 修改 @@ -9,12 +9,12 @@ /** * @author PanZhibao * @date 2021年07月19日 16:35 * @Description * @createTime 2024年09月06日 */ @Data @TableName("T_ST_SCHEDULE_PARAM_SETTING") public class StScheduleParamSettingEntity implements Serializable { @TableName("t_st_schedule_model_setting") public class StScheduleModelSettingEntity implements Serializable { private static final long serialVersionUID = 1L; /** @@ -47,4 +47,9 @@ * 名称 */ private String name; /** * 排序 */ private Integer sort; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleModelUserParamEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleObjectEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StSchedulePredictItemEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleRecordDetailEntity.java
对比新文件 @@ -0,0 +1,56 @@ package com.iailab.module.model.mcs.sche.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Data @TableName("t_st_schedule_record_detail") public class StScheduleRecordDetailEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id",type = IdType.INPUT) private String id; /** * 记录ID */ private String recordId; /** * 方案ID */ private String schemeId; /** * 模型ID */ private String modelId; /** * 结果KEY */ private String resultKey; /** * 结果值 */ private String resultValue; /** * 调度时间 */ private Date scheduleTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleRecordEntity.java
对比新文件 @@ -0,0 +1,52 @@ package com.iailab.module.model.mcs.sche.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Data @TableName("t_st_schedule_record") public class StScheduleRecordEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id",type = IdType.INPUT) private String id; /** * 方案ID */ private String schemeId; /** * 模型ID */ private String modelId; /** * 模型名称 */ private String modelName; /** * 调度时间 */ private Date scheduleTime; /** * 创建时间 */ private Date createTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeDetailesEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEntity.java
@@ -3,10 +3,9 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.iailab.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; /** @@ -14,8 +13,8 @@ * @date 2021年07月19日 16:43 */ @Data @TableName("T_ST_SCHEDULE_SCHEME") public class StScheduleSchemeEntity implements Serializable { @TableName("t_st_schedule_scheme") public class StScheduleSchemeEntity extends BaseDO { private static final long serialVersionUID = 1L; @@ -26,37 +25,57 @@ private String id; /** * 模型ID * 编号 */ private String modelid; private String code; /** * 开始时间 * 名称 */ private Date starttime; private String name; /** * 结束时间 * 触发方式 */ private Date endtime; private String triggerMethod; /** * 触发条件 */ private String triggerCondition; /** * 调整对象 */ private String scheduleObj; /** * 调整类型 */ private String scheduleType; /** * 调整策略 */ private String scheduleStrategy; /** * 调度模型 */ private String modelId; /** * 调度时间 */ private Date scheduletime; private Date scheduleTime; /** * 对象值 * 状态(0正常 1停用) */ private BigDecimal objectvalue; private Integer status; /** * 方案排序 * 备注 */ private Integer schemeorder; /** * 是否调整 */ private Integer isadjust; private String remark; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEvalTypeEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSchemeEvalValueEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleSuggestEntity.java
对比新文件 @@ -0,0 +1,132 @@ package com.iailab.module.model.mcs.sche.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Data @TableName("t_st_schedule_suggest") public class StScheduleSuggestEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id",type = IdType.INPUT) private String id; /** * 标题 */ private String title; /** * 内容 */ private String content; /** * 排序 */ private Integer sort; /** * 方案ID */ private String schemeId; /** * 预警ID */ private String alarmId; /** * 预测项ID */ private String itemId; /** * 模型ID */ private String modelId; /** * 调整对象 */ private String scheduleObj; /** * 调整类型 */ private String scheduleType; /** * 调整策略 */ private String scheduleStrategy; /** * 调整方式 */ private String adjustMode; /** * 调整值 */ private BigDecimal adjustValue; /** * 调整单位 */ private String adjustUnit; /** * 持续时长 */ private BigDecimal adjustTimes; /** * 调整开始时间 */ private Date adjustStart; /** * 调整结束时间 */ private Date adjustEnd; /** * 调度时间 */ private Date scheduleTime; /** * 状态 */ private Integer status; /** * 处理人 */ private String handler; /** * 处理时间 */ private Date handleTime; /** * 创建时间 */ private Date createTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/entity/StScheduleUserEntity.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleEnergyTypeService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleModelParamService.java
对比新文件 @@ -0,0 +1,21 @@ package com.iailab.module.model.mcs.sche.service; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.sche.entity.StScheduleModelParamEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleModelParamSaveReqVO; import java.util.List; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ public interface StScheduleModelParamService extends BaseService<StScheduleModelParamEntity> { List<StScheduleModelParamEntity> getByModelId(String modelId); void deleteByModelId(String modelId); void saveList(String modelId, List<StScheduleModelParamSaveReqVO> saveList); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleModelService.java
@@ -1,13 +1,10 @@ package com.iailab.module.model.mcs.sche.service; import com.iailab.framework.common.page.PageData; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.sche.dto.StScheduleModelDto; import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleModelRespVO; import java.util.Map; import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleModelSaveReqVO; /** * @author PanZhibao @@ -15,17 +12,17 @@ */ public interface StScheduleModelService extends BaseService<StScheduleModelEntity> { void saveStScheduleModel(StScheduleModelDto stScheduleModel); PageResult<StScheduleModelEntity> page(StScheduleModelPageReqVO reqVO); StScheduleModelDto getDetailById(String id); void create(StScheduleModelSaveReqVO reqVO); void update(StScheduleModelDto stScheduleModel); void update(StScheduleModelSaveReqVO reqVO); void deleteBatch(String[] stScheduleModelIds); StScheduleModelEntity get(String id); int check(StScheduleModelEntity stScheduleModel); void delete(String id); PageResult<StScheduleModelRespVO> getPageList(Map<String, Object> params); Long check(StScheduleModelSaveReqVO reqVO); Long count(); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleModelSettingService.java
对比新文件 @@ -0,0 +1,21 @@ package com.iailab.module.model.mcs.sche.service; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleModelSettingSaveReqVO; import java.util.List; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ public interface StScheduleModelSettingService extends BaseService<StScheduleModelSettingEntity> { List<StScheduleModelSettingEntity> getByModelId(String modelId); void deleteByModelId(String modelId); void saveList(String modelId, List<StScheduleModelSettingSaveReqVO> saveList); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleModelUserParamService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleObjectService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleParamService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleParamSettingService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordDetailService.java
对比新文件 @@ -0,0 +1,19 @@ package com.iailab.module.model.mcs.sche.service; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.sche.entity.StScheduleRecordDetailEntity; import com.iailab.module.model.mdk.vo.ScheduleResultVO; import java.util.List; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ public interface StScheduleRecordDetailService extends BaseService<StScheduleRecordDetailEntity> { void create(String recordId, ScheduleResultVO resultVO); List<StScheduleRecordDetailEntity> getByRecordId(String recordId); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordService.java
对比新文件 @@ -0,0 +1,20 @@ package com.iailab.module.model.mcs.sche.service; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleRecordSaveReqVO; import com.iailab.module.model.mdk.vo.ScheduleResultVO; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ public interface StScheduleRecordService extends BaseService<StScheduleRecordEntity> { PageResult<StScheduleRecordEntity> page(StScheduleRecordPageReqVO reqVO); void create(ScheduleResultVO resultVO); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSchemeDetailesService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSchemeService.java
@@ -1,11 +1,30 @@ package com.iailab.module.model.mcs.sche.service; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemePageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeSaveReqVO; import java.util.Date; /** * @author PanZhibao * @date 2021年08月11日 12:06 */ public interface StScheduleSchemeService extends BaseService<StScheduleSchemeEntity> { PageResult<StScheduleSchemeEntity> page(StScheduleSchemePageReqVO reqVO); void create(StScheduleSchemeSaveReqVO createReqVO); void update(StScheduleSchemeSaveReqVO createReqVO); void delete(String id); StScheduleSchemeEntity getInfo(String id); void updateTime(String id, Date scheduleTime); StScheduleSchemeEntity getByCode(String code); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSuggestService.java
对比新文件 @@ -0,0 +1,12 @@ package com.iailab.module.model.mcs.sche.service; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ public interface StScheduleSuggestService extends BaseService<StScheduleSuggestEntity> { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleUserService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleEnergyTypeServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelParamServiceImpl.java
对比新文件 @@ -0,0 +1,54 @@ package com.iailab.module.model.mcs.sche.service.impl; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.model.mcs.sche.dao.StScheduleModelParamDao; import com.iailab.module.model.mcs.sche.entity.StScheduleModelParamEntity; import com.iailab.module.model.mcs.sche.service.StScheduleModelParamService; import com.iailab.module.model.mcs.sche.vo.StScheduleModelParamSaveReqVO; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.List; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Service public class StScheduleModelParamServiceImpl extends BaseServiceImpl<StScheduleModelParamDao, StScheduleModelParamEntity> implements StScheduleModelParamService { @Override public List<StScheduleModelParamEntity> getByModelId(String modelId) { return baseDao.selectList( new LambdaQueryWrapperX<StScheduleModelParamEntity>() .likeIfPresent(StScheduleModelParamEntity::getModelid, modelId) .orderByAsc(StScheduleModelParamEntity::getModelparamportorder) .orderByAsc(StScheduleModelParamEntity::getModelparamorder) ); } @Override public void deleteByModelId(String modelId) { baseDao.delete(new LambdaQueryWrapperX<StScheduleModelParamEntity>() .likeIfPresent(StScheduleModelParamEntity::getModelid, modelId) ); } @Override public void saveList(String modelId, List<StScheduleModelParamSaveReqVO> saveList) { deleteByModelId(modelId); if (CollectionUtils.isEmpty(saveList)) { return; } saveList.forEach(item -> { StScheduleModelParamEntity entity = BeanUtils.toBean(item, StScheduleModelParamEntity.class); entity.setId(UUID.randomUUID().toString()); baseDao.insert(entity); }); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelServiceImpl.java
@@ -1,140 +1,81 @@ package com.iailab.module.model.mcs.sche.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.model.mcs.sche.dao.StScheduleModelDao; import com.iailab.module.model.mcs.sche.dto.StScheduleModelDto; import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleModelUserParamEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleParamEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleParamSettingEntity; import com.iailab.module.model.mcs.sche.service.StScheduleModelParamService; import com.iailab.module.model.mcs.sche.service.StScheduleModelService; import com.iailab.module.model.mcs.sche.vo.StScheduleModelRespVO; import com.iailab.module.model.mcs.sche.service.StScheduleModelSettingService; import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleModelSaveReqVO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.UUID; /** * @author PanZhibao * @date 2021年07月20日 14:23 */ @Service("stScheduleModelService") @Service public class StScheduleModelServiceImpl extends BaseServiceImpl<StScheduleModelDao, StScheduleModelEntity> implements StScheduleModelService { @Autowired private StScheduleParamSettingServiceImpl stScheduleParamSettingServiceImpl; @Autowired private StScheduleParamServiceImpl stScheduleParamServiceImpl; private StScheduleModelParamService stScheduleModelParamService; @Autowired private StScheduleModelUserParamServiceImpl stScheduleModelUserParamServiceImpl; private StScheduleModelSettingService stScheduleModelSettingService; @Override public PageResult<StScheduleModelRespVO> getPageList(Map<String, Object> params) { PageResult<StScheduleModelRespVO> result = new PageResult(); IPage<StScheduleModelRespVO> page = baseDao.getPageList( getPage(params, null, false), params ); result.setTotal(page.getTotal()); result.setList(page.getRecords()); return result; } private QueryWrapper<StScheduleModelEntity> getWrapper(Map<String, Object> params) { QueryWrapper<StScheduleModelEntity> wrapper = new QueryWrapper<>(); return wrapper; public PageResult<StScheduleModelEntity> page(StScheduleModelPageReqVO reqVO) { return baseDao.selectPage(reqVO); } @Override @Transactional(rollbackFor = Exception.class) public void saveStScheduleModel(StScheduleModelDto scheduleModel) { StScheduleModelEntity stScheduleModelEntity = new StScheduleModelEntity(); BeanUtils.copyProperties(scheduleModel, stScheduleModelEntity); stScheduleModelEntity.setId(UUID.randomUUID().toString()); baseDao.insert(stScheduleModelEntity); scheduleModel.getStScheduleParamSettingList().forEach(item -> { item.setModelid(stScheduleModelEntity.getId()); }); stScheduleParamSettingServiceImpl.saveList(scheduleModel.getStScheduleParamSettingList()); scheduleModel.getStScheduleParamList().forEach(item -> { item.setModelid(stScheduleModelEntity.getId()); }); stScheduleParamServiceImpl.saveList(scheduleModel.getStScheduleParamList()); scheduleModel.getStScheduleModelUserParamList().forEach(item -> { item.setModelid(stScheduleModelEntity.getId()); }); stScheduleModelUserParamServiceImpl.saveList(scheduleModel.getStScheduleModelUserParamList()); } @Override public StScheduleModelDto getDetailById(String id) { StScheduleModelDto scheduleMode = new StScheduleModelDto(); StScheduleModelEntity stScheduleModelEntity = baseDao.selectById(id); BeanUtils.copyProperties(stScheduleModelEntity, scheduleMode); List<StScheduleParamSettingEntity> stScheduleParamSettingList = stScheduleParamSettingServiceImpl.getByModelid(stScheduleModelEntity.getId()); scheduleMode.setStScheduleParamSettingList(stScheduleParamSettingList); List<StScheduleParamEntity> stScheduleParamList = stScheduleParamServiceImpl.getByModelid(stScheduleModelEntity.getId()); scheduleMode.setStScheduleParamList(stScheduleParamList); List<StScheduleModelUserParamEntity> stScheduleModelUserParamList = stScheduleModelUserParamServiceImpl.getByModelid(stScheduleModelEntity.getId()); scheduleMode.setStScheduleModelUserParamList(stScheduleModelUserParamList); return scheduleMode; public void create(StScheduleModelSaveReqVO reqVO) { StScheduleModelEntity entity = BeanUtils.toBean(reqVO, StScheduleModelEntity.class); entity.setId(UUID.randomUUID().toString()); baseDao.insert(entity); stScheduleModelParamService.saveList(entity.getId(), reqVO.getParamList()); stScheduleModelSettingService.saveList(entity.getId(), reqVO.getSettingList()); } @Override @Transactional(rollbackFor = Exception.class) public void update(StScheduleModelDto scheduleModel) { StScheduleModelEntity stScheduleModelEntity = new StScheduleModelEntity(); BeanUtils.copyProperties(scheduleModel, stScheduleModelEntity); baseDao.updateById(stScheduleModelEntity); public void update(StScheduleModelSaveReqVO reqVO) { StScheduleModelEntity entity = BeanUtils.toBean(reqVO, StScheduleModelEntity.class); baseDao.updateById(entity); stScheduleModelParamService.saveList(entity.getId(), reqVO.getParamList()); stScheduleModelSettingService.saveList(entity.getId(), reqVO.getSettingList()); } scheduleModel.getStScheduleParamSettingList().forEach(item -> { item.setModelid(stScheduleModelEntity.getId()); }); stScheduleParamSettingServiceImpl.saveList(scheduleModel.getStScheduleParamSettingList()); scheduleModel.getStScheduleParamList().forEach(item -> { item.setModelid(stScheduleModelEntity.getId()); }); stScheduleParamServiceImpl.saveList(scheduleModel.getStScheduleParamList()); scheduleModel.getStScheduleModelUserParamList().forEach(item -> { item.setModelid(stScheduleModelEntity.getId()); }); stScheduleModelUserParamServiceImpl.saveList(scheduleModel.getStScheduleModelUserParamList()); @Override public StScheduleModelEntity get(String id) { return baseDao.selectById(id); } @Override @Transactional(rollbackFor = Exception.class) public void deleteBatch(String[] scheduleModelIds) { baseDao.deleteBatchIds(Arrays.asList(scheduleModelIds)); stScheduleParamSettingServiceImpl.deleteBatch(scheduleModelIds); stScheduleParamServiceImpl.deleteBatch(scheduleModelIds); stScheduleModelUserParamServiceImpl.deleteBatch(scheduleModelIds); public void delete(String id) { baseDao.deleteById(id); stScheduleModelParamService.deleteByModelId(id); stScheduleModelSettingService.deleteByModelId(id); } @Override public int check(StScheduleModelEntity scheduleModel) { String id = scheduleModel.getId(); String modelname = scheduleModel.getModelname(); public Long check(StScheduleModelSaveReqVO reqVO) { String id = reqVO.getId(); String modelname = reqVO.getModelName(); QueryWrapper<StScheduleModelEntity> scheduleModelWrapper = new QueryWrapper<>(); scheduleModelWrapper.ne(StringUtils.isNotBlank(id), "id", id); scheduleModelWrapper.and(wrapper -> wrapper.eq("modelname", modelname)); List<StScheduleModelEntity> list = baseDao.selectList(scheduleModelWrapper); return list.size(); scheduleModelWrapper.and(wrapper -> wrapper.eq("model_name", modelname)); return baseDao.selectCount(scheduleModelWrapper); } @Override iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelSettingServiceImpl.java
对比新文件 @@ -0,0 +1,53 @@ package com.iailab.module.model.mcs.sche.service.impl; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.model.mcs.sche.dao.StScheduleModelSettingDao; import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity; import com.iailab.module.model.mcs.sche.service.StScheduleModelSettingService; import com.iailab.module.model.mcs.sche.vo.StScheduleModelSettingSaveReqVO; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.List; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Service public class StScheduleModelSettingServiceImpl extends BaseServiceImpl<StScheduleModelSettingDao, StScheduleModelSettingEntity> implements StScheduleModelSettingService { @Override public List<StScheduleModelSettingEntity> getByModelId(String modelId) { return baseDao.selectList( new LambdaQueryWrapperX<StScheduleModelSettingEntity>() .likeIfPresent(StScheduleModelSettingEntity::getModelid, modelId) .orderByAsc(StScheduleModelSettingEntity::getSort) ); } @Override public void deleteByModelId(String modelId) { baseDao.delete(new LambdaQueryWrapperX<StScheduleModelSettingEntity>() .likeIfPresent(StScheduleModelSettingEntity::getModelid, modelId) ); } @Override public void saveList(String modelId, List<StScheduleModelSettingSaveReqVO> saveList) { deleteByModelId(modelId); if (CollectionUtils.isEmpty(saveList)) { return; } saveList.forEach(item -> { StScheduleModelSettingEntity entity = BeanUtils.toBean(item, StScheduleModelSettingEntity.class); entity.setId(UUID.randomUUID().toString()); baseDao.insert(entity); }); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelUserParamServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleObjectServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleParamServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleParamSettingServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordDetailServiceImpl.java
对比新文件 @@ -0,0 +1,52 @@ package com.iailab.module.model.mcs.sche.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.module.model.mcs.sche.dao.StScheduleRecordDetailDao; import com.iailab.module.model.mcs.sche.entity.StScheduleRecordDetailEntity; import com.iailab.module.model.mcs.sche.service.StScheduleRecordDetailService; import com.iailab.module.model.mdk.vo.ScheduleResultVO; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.List; import java.util.Map; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Service public class StScheduleRecordDetailServiceImpl extends BaseServiceImpl<StScheduleRecordDetailDao, StScheduleRecordDetailEntity> implements StScheduleRecordDetailService { @Override public void create(String recordId, ScheduleResultVO resultVO) { if (CollectionUtils.isEmpty(resultVO.getResult())) { return; } for (Map.Entry<String, Object > entry: resultVO.getResult().entrySet()) { StScheduleRecordDetailEntity entity = new StScheduleRecordDetailEntity(); entity.setId(UUID.randomUUID().toString()); entity.setId(recordId); entity.setSchemeId(resultVO.getSchemeId()); entity.setModelId(resultVO.getModelId()); entity.setScheduleTime(resultVO.getScheduleTime()); entity.setResultKey(entry.getKey()); entity.setResultValue(JSON.toJSONString(entry.getValue())); baseDao.insert(entity); } } @Override public List<StScheduleRecordDetailEntity> getByRecordId(String recordId) { QueryWrapper<StScheduleRecordDetailEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("record_id", recordId); queryWrapper.orderByAsc("result_key"); return baseDao.selectList(queryWrapper); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordServiceImpl.java
对比新文件 @@ -0,0 +1,47 @@ package com.iailab.module.model.mcs.sche.service.impl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.module.model.mcs.sche.dao.StScheduleRecordDao; import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity; import com.iailab.module.model.mcs.sche.service.StScheduleRecordDetailService; import com.iailab.module.model.mcs.sche.service.StScheduleRecordService; import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO; import com.iailab.module.model.mdk.vo.ScheduleResultVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Service public class StScheduleRecordServiceImpl extends BaseServiceImpl<StScheduleRecordDao, StScheduleRecordEntity> implements StScheduleRecordService { @Autowired private StScheduleRecordDetailService stScheduleRecordDetailService; @Override public PageResult<StScheduleRecordEntity> page(StScheduleRecordPageReqVO reqVO) { return baseDao.selectPage(reqVO); } @Override @Transactional(rollbackFor = Exception.class) public void create(ScheduleResultVO resultVO) { StScheduleRecordEntity entity = new StScheduleRecordEntity(); entity.setId(UUID.randomUUID().toString()); entity.setCreateTime(new Date()); entity.setSchemeId(resultVO.getSchemeId()); entity.setScheduleTime(resultVO.getScheduleTime()); entity.setModelId(resultVO.getModelId()); baseDao.insert(entity); stScheduleRecordDetailService.create(entity.getId(), resultVO); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSchemeDetailesServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSchemeServiceImpl.java
@@ -1,16 +1,67 @@ package com.iailab.module.model.mcs.sche.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.model.mcs.sche.dao.StScheduleSchemeDao; import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemePageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeSaveReqVO; import org.springframework.stereotype.Service; import java.util.Date; import java.util.UUID; /** * @author PanZhibao * @date 2021年08月11日 12:06 */ @Service("stScheduleSchemeService") @Service public class StScheduleSchemeServiceImpl extends BaseServiceImpl<StScheduleSchemeDao, StScheduleSchemeEntity> implements StScheduleSchemeService { @Override public PageResult<StScheduleSchemeEntity> page(StScheduleSchemePageReqVO reqVO) { return baseDao.selectPage(reqVO); } @Override public void create(StScheduleSchemeSaveReqVO createReqVO) { StScheduleSchemeEntity entity = BeanUtils.toBean(createReqVO, StScheduleSchemeEntity.class); entity.setId(UUID.randomUUID().toString()); baseDao.insert(entity); } @Override public void update(StScheduleSchemeSaveReqVO createReqVO) { StScheduleSchemeEntity entity = BeanUtils.toBean(createReqVO, StScheduleSchemeEntity.class); baseDao.updateById(entity); } @Override public void delete(String id) { baseDao.deleteById(id); } @Override public StScheduleSchemeEntity getInfo(String id) { return baseDao.selectById(id); } @Override public StScheduleSchemeEntity getByCode(String code) { QueryWrapper<StScheduleSchemeEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("code", code); return baseDao.selectOne(queryWrapper); } @Override public void updateTime(String id, Date scheduleTime) { StScheduleSchemeEntity entity = new StScheduleSchemeEntity(); entity.setId(id); entity.setScheduleTime(scheduleTime); baseDao.updateById(entity); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
对比新文件 @@ -0,0 +1,17 @@ package com.iailab.module.model.mcs.sche.service.impl; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.module.model.mcs.sche.dao.StScheduleSuggestDao; import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; import org.springframework.stereotype.Service; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Service public class StScheduleSuggestServiceImpl extends BaseServiceImpl<StScheduleSuggestDao, StScheduleSuggestEntity> implements StScheduleSuggestService { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleUserServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/ScheduleModelUserParamVo.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/ScheduleSchemeDetailesVo.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleEnergyTypePageReqVO.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleEnergyTypeRespVO.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleModelPageReqVO.java
@@ -11,9 +11,15 @@ * @Description * @createTime 2024年09月04日 */ @Schema(description = "模型平台 - 管网分页 Request VO") @Schema(description = "模型服务 - 调度模型分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class StScheduleModelPageReqVO extends PageParam { @Schema(description = "模型编号,模糊匹配", example = "") private String modelCode; @Schema(description = "模型名称,模糊匹配", example = "") private String modelName; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleModelParamRespVO.java
对比新文件 @@ -0,0 +1,40 @@ package com.iailab.module.model.mcs.sche.vo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 模型输入参数 Response VO") @Data @ExcelIgnoreUnannotated public class StScheduleModelParamRespVO { @Schema(description = "ID") private String id; @Schema(description = "模型ID") private String modelid; @Schema(description = "模型参数名称") private String modelparamname; @Schema(description = "模型参数ID") private String modelparamid; @Schema(description = "模型参数排序") private Integer modelparamorder; @Schema(description = "模型参数端口排序") private Integer modelparamportorder; @Schema(description = "数据长度") private Integer datalength; @Schema(description = "数据类型") private String modelparamtype; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleModelParamSaveReqVO.java
对比新文件 @@ -0,0 +1,38 @@ package com.iailab.module.model.mcs.sche.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 模型输入参数创建/修改 Request VO") @Data public class StScheduleModelParamSaveReqVO { @Schema(description = "ID") private String id; @Schema(description = "模型ID") private String modelid; @Schema(description = "模型参数名称") private String modelparamname; @Schema(description = "模型参数ID") private String modelparamid; @Schema(description = "模型参数排序") private Integer modelparamorder; @Schema(description = "模型参数端口排序") private Integer modelparamportorder; @Schema(description = "数据长度") private Integer datalength; @Schema(description = "数据类型") private String modelparamtype; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleModelRespVO.java
@@ -5,71 +5,57 @@ import lombok.Data; import java.io.Serializable; import java.util.List; /** * @author PanZhibao * @date 2021年07月21日 14:08 */ @Schema(description = "模型平台 - Response VO") @Schema(description = "模型平台 - 调度模型 Response VO") @Data @ExcelIgnoreUnannotated public class StScheduleModelRespVO implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @Schema(description = "ID", example = "ID") private String id; @Schema(description = "模型编号", example = "模型编号") private String modelCode; /** * 模型名称 */ private String modelname; @Schema(description = "模型名称", example = "模型名称") private String modelName; @Schema(description = "模型类型", example = "模型类型") private String modelType; /** * 调度ID */ private String scheduleid; @Schema(description = "类名", example = "类名") private String className; /** * 调度名称 */ private String schedulename; @Schema(description = "方法名", example = "方法名") private String methodName; /** * 对象ID */ private String objectid; @Schema(description = "参数数量", example = "参数数量") private Integer portLength; /** * 对象名称 */ private String objectname; @Schema(description = "参数构造", example = "参数构造") private String paramStructure; /** * 类名 */ private String classname; @Schema(description = "模型路径", example = "模型路径") private String modelPath; /** * 方法名 */ private String methodname; @Schema(description = "结果字符串", example = "结果字符串") private String resultStrId; /** * 模型路径 */ private String modelpath; @Schema(description = "调用方式", example = "调用方式") private String invocation; /** * 端口长度 */ private Integer portlength; @Schema(description = "状态", example = "状态") private Integer status; /** * 模型状态 */ private Integer modelstatus; @Schema(description = "输入参数列表", example = "输入参数列表") private List<StScheduleModelParamRespVO> paramList; @Schema(description = "设置参数列表", example = "设置参数列表") private List<StScheduleModelSettingRespVO> settingList; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleModelSaveReqVO.java
对比新文件 @@ -0,0 +1,61 @@ package com.iailab.module.model.mcs.sche.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.List; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 调度模型创建/修改 Request VO") @Data public class StScheduleModelSaveReqVO { @Schema(description = "ID") private String id; @Schema(description = "模型编号", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "编号不能为空") private String modelCode; @Schema(description = "模型名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "名称不能为空") private String modelName; @Schema(description = "模型类型") private String modelType; @Schema(description = "类名", example = "类名") private String className; @Schema(description = "方法名", example = "方法名") private String methodName; @Schema(description = "输入数量", example = "输入数量") private Integer portLength; @Schema(description = "参数构造", example = "参数构造") private String paramStructure; @Schema(description = "模型路径", example = "模型路径") private String modelPath; @Schema(description = "结果字符串", example = "结果字符串") private String resultStrId; @Schema(description = "调用方式", requiredMode = Schema.RequiredMode.REQUIRED) private String invocation; @Schema(description = "状态", example = "状态") private Integer status; @Schema(description = "输入参数", example = "输入参数") private List<StScheduleModelParamSaveReqVO> paramList; @Schema(description = "设置参数", example = "设置参数") private List<StScheduleModelSettingSaveReqVO> settingList; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleModelSettingRespVO.java
对比新文件 @@ -0,0 +1,37 @@ package com.iailab.module.model.mcs.sche.vo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 模型设置参数 Response VO") @Data @ExcelIgnoreUnannotated public class StScheduleModelSettingRespVO { @Schema(description = "ID") private String id; @Schema(description = "模型ID") private String modelid; @Schema(description = "键") private String key; @Schema(description = "值") private String value; @Schema(description = "值类型") private String valuetype; @Schema(description = "名称") private String name; @Schema(description = "排序") private Integer sort; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleModelSettingSaveReqVO.java
对比新文件 @@ -0,0 +1,35 @@ package com.iailab.module.model.mcs.sche.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 模型设置参数创建/修改 Request VO") @Data public class StScheduleModelSettingSaveReqVO { @Schema(description = "ID") private String id; @Schema(description = "模型ID") private String modelid; @Schema(description = "键") private String key; @Schema(description = "值") private String value; @Schema(description = "值类型") private String valuetype; @Schema(description = "名称") private String name; @Schema(description = "排序") private Integer sort; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleObjectPageReqVO.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleObjectRespVO.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordDetailRespVO.java
对比新文件 @@ -0,0 +1,39 @@ package com.iailab.module.model.mcs.sche.vo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型平台 - 调度记录详情 Response VO") @Data @ExcelIgnoreUnannotated public class StScheduleRecordDetailRespVO { @Schema(description = "ID") private String id; @Schema(description = "记录ID") private String recordId; @Schema(description = "方案ID") private String schemeId; @Schema(description = "模型ID") private String modelId; @Schema(description = "结果KEY") private String resultKey; @Schema(description = "结果值") private String resultValue; @Schema(description = "调度时间") private Date scheduleTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordDetailSaveReqVO.java
对比新文件 @@ -0,0 +1,37 @@ package com.iailab.module.model.mcs.sche.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 调度记录详情 Request VO") @Data public class StScheduleRecordDetailSaveReqVO { @Schema(description = "ID") private String id; @Schema(description = "记录ID") private String recordId; @Schema(description = "方案ID") private String schemeId; @Schema(description = "模型ID") private String modelId; @Schema(description = "结果KEY") private String resultKey; @Schema(description = "结果值") private String resultValue; @Schema(description = "调度时间") private Date scheduleTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordPageReqVO.java
对比新文件 @@ -0,0 +1,33 @@ package com.iailab.module.model.mcs.sche.vo; import com.iailab.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 调度记录分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class StScheduleRecordPageReqVO extends PageParam { @Schema(description = "方案ID") private String schemeId; @Schema(description = "模型名称,模糊匹配", example = "") private String modelName; @Schema(description = "开始时间") private Date startTime; @Schema(description = "结束时间") private Date endTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordRespVO.java
对比新文件 @@ -0,0 +1,36 @@ package com.iailab.module.model.mcs.sche.vo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 调度记录 Response VO") @Data @ExcelIgnoreUnannotated public class StScheduleRecordRespVO { @Schema(description = "ID") private String id; @Schema(description = "方案ID") private String schemeId; @Schema(description = "模型ID") private String modelId; @Schema(description = "模型名称") private String modelName; @Schema(description = "调度时间") private String scheduleTime; @Schema(description = "创建时间") private Date createTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordSaveReqVO.java
对比新文件 @@ -0,0 +1,34 @@ package com.iailab.module.model.mcs.sche.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 调度记录创建/修改 Request VO") @Data public class StScheduleRecordSaveReqVO { @Schema(description = "ID") private String id; @Schema(description = "方案ID") private String schemeId; @Schema(description = "模型ID") private String modelId; @Schema(description = "模型名称") private String modelName; @Schema(description = "调度时间") private String scheduleTime; @Schema(description = "创建时间") private Date createTime; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRespVO.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemePageReqVO.java
文件名从 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StSchedulePageReqVO.java 修改 @@ -9,13 +9,14 @@ /** * @author PanZhibao * @Description * @createTime 2024年09月04日 * @createTime 2024年09月06日 */ @Schema(description = "模型平台 - 管网分页 Request VO") @Schema(description = "模型服务 - 调度方案分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class StSchedulePageReqVO extends PageParam { public class StScheduleSchemePageReqVO extends PageParam { @Schema(description = "方案名称,模糊匹配", example = "") private String name; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeRespVO.java
对比新文件 @@ -0,0 +1,54 @@ package com.iailab.module.model.mcs.sche.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 调度方案 Response VO") @Data public class StScheduleSchemeRespVO { @Schema(description = "ID", example = "ID") private String id; @Schema(description = "编号", example = "编号") private String code; @Schema(description = "名称", example = "名称") private String name; @Schema(description = "触发方式", example = "事件触发") private String triggerMethod; @Schema(description = "触发条件", example = "mcs.predict.finished") private String triggerCondition; @Schema(description = "调整对象", example = "电厂") private String scheduleObj; @Schema(description = "调整类型", example = "调整类型") private String scheduleType; @Schema(description = "调整策略", example = "调整策略") private String scheduleStrategy; @Schema(description = "调度模型", example = "调度模型") private String modelId; @Schema(description = "调度时间", example = "2024-09-01 00:00:00") private Date scheduleTime; @Schema(description = "备注", example = "备注") private String remark; @Schema(description = "状态(0正常 1停用)", example = "0") private Integer status; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSchemeSaveReqVO.java
对比新文件 @@ -0,0 +1,55 @@ package com.iailab.module.model.mcs.sche.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.Date; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Schema(description = "模型服务 - 调度方案创建/修改 Request VO") @Data public class StScheduleSchemeSaveReqVO { @Schema(description = "ID") private Long id; @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "编号不能为空") private String appCode; @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "名称不能为空") private String appName; @Schema(description = "触发方式") private String triggerMethod; @Schema(description = "触发条件") private String triggerCondition; @Schema(description = "调整对象") private String scheduleObj; @Schema(description = "调整类型") private String scheduleType; @Schema(description = "调整策略") private String scheduleStrategy; @Schema(description = "调度模型") private String modelId; @Schema(description = "调度时间") private Date scheduleTime; @Schema(description = " 状态(0正常 1停用)") private Integer status; @Schema(description = "备注") private String remark; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleUserPageReqVO.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleUserRespVO.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/schedule/ScheduleModelHandler.java
@@ -12,5 +12,5 @@ */ public interface ScheduleModelHandler { ScheduleResultVO doSchedule(String scheduleCode, Date scheduleTime) throws ModelInvokeException; ScheduleResultVO doSchedule(String schemeCode, Date scheduleTime) throws ModelInvokeException; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/schedule/impl/ScheduleModelHandlerImpl.java
@@ -5,10 +5,11 @@ import com.iail.IAILMDK; import com.iail.model.IAILModel; import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleParamSettingEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity; import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; import com.iailab.module.model.mcs.sche.service.StScheduleModelService; import com.iailab.module.model.mcs.sche.service.StScheduleParamSettingService; import com.iailab.module.model.mcs.sche.service.StScheduleService; import com.iailab.module.model.mcs.sche.service.StScheduleModelSettingService; import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; import com.iailab.module.model.mdk.common.enums.TypeA; import com.iailab.module.model.mdk.common.exceptions.ModelInvokeException; import com.iailab.module.model.mdk.sample.SampleConstructor; @@ -33,40 +34,39 @@ public class ScheduleModelHandlerImpl implements ScheduleModelHandler { @Autowired private StScheduleSchemeService stScheduleSchemeService; @Autowired private StScheduleModelService stScheduleModelService; @Autowired private StScheduleService stScheduleService; private StScheduleModelSettingService stScheduleModelSettingService; @Autowired private SampleConstructor sampleConstructor; @Autowired private StScheduleParamSettingService stScheduleParamSettingService; @Override public ScheduleResultVO doSchedule(String scheduleCode, Date scheduleTime) throws ModelInvokeException { public ScheduleResultVO doSchedule(String schemeCode, Date scheduleTime) throws ModelInvokeException { ScheduleResultVO scheduleResult = new ScheduleResultVO(); // todo StScheduleModelEntity schModelEntity = stScheduleModelService.selectById(scheduleCode); if (schModelEntity == null) { StScheduleSchemeEntity scheduleScheme = stScheduleSchemeService.getByCode(schemeCode); StScheduleModelEntity scheduleModel = stScheduleModelService.selectById(scheduleScheme.getModelId()); if (scheduleModel == null) { throw new ModelInvokeException(MessageFormat.format("{0},modelId={1}", ModelInvokeException.errorGetModelEntity, schModelEntity.getId())); ModelInvokeException.errorGetModelEntity, scheduleModel.getId())); } String modelId = schModelEntity.getId(); String modelId = scheduleModel.getId(); try { IAILModel newModelBean = new IAILModel(); //1.根据模型id构造模型输入样本 List<SampleData> sampleDataList = sampleConstructor.constructSample(TypeA.Schedule.name(), modelId, scheduleTime); if (CollectionUtils.isEmpty(sampleDataList)) { log.info("调度模型构造样本失败,scheduleCode=" + scheduleCode); log.info("调度模型构造样本失败,schemeCode=" + schemeCode); return null; } //2.拼接newModelBean的参数结构:a.类名、方法名 b.参数类型 String className = schModelEntity.getClassname().trim(); String methodName = schModelEntity.getMethodname().trim(); String className = scheduleModel.getClassName() .trim(); String methodName = scheduleModel.getMethodName().trim(); newModelBean.setClassName(className); newModelBean.setMethodName(methodName); @@ -108,7 +108,7 @@ //5.返回调度结果 scheduleResult.setResult(result); scheduleResult.setModelId(modelId); scheduleResult.setScheduleId(schModelEntity.getId()); scheduleResult.setSchemeId(scheduleScheme.getId()); scheduleResult.setScheduleTime(scheduleTime); } catch (Exception ex) { log.error("IAILMDK.run()执行失败"); @@ -126,12 +126,12 @@ * @return */ private HashMap<String, Object> getPredictSettingsByModelId(String modelId) { List<StScheduleParamSettingEntity> list = stScheduleParamSettingService.getByModelid(modelId); List<StScheduleModelSettingEntity> list = stScheduleModelSettingService.getByModelId(modelId); if (CollectionUtils.isEmpty(list)) { return null; } HashMap<String, Object> result = new HashMap<>(); for (StScheduleParamSettingEntity entry : list) { for (StScheduleModelSettingEntity entry : list) { String valueType = entry.getValuetype().trim(); String valueStr = entry.getValue().trim(); if ("int".equals(valueType)) { iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/vo/ScheduleResultVO.java
@@ -5,9 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.sql.Timestamp; import java.util.Date; import java.util.HashMap; import java.util.Map; /** @@ -21,12 +19,12 @@ /** * 调度方案ID */ private String scheduleId; private String schemeId; /** * 调度方案CODE */ private String scheduleCode; private String schemeCode; /** * 模型ID iailab-module-model/iailab-module-model-biz/src/main/resources/application-dev.yaml
对比新文件 @@ -0,0 +1,51 @@ spring: # 数据源配置项 autoconfigure: exclude: - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 datasource: druid: # Druid 【监控】相关的全局配置 web-stat-filter: enabled: true stat-view-servlet: enabled: true allow: # 设置白名单,不填则允许所有访问 url-pattern: /druid/* login-username: # 控制台管理用户名和密码 login-password: filter: stat: enabled: true log-slow-sql: true # 慢 SQL 记录 slow-sql-millis: 100 merge-sql: true wall: config: multi-statement-allow: true dynamic: # 多数据源配置 druid: # Druid 【连接池】相关的全局配置 initial-size: 1 # 初始连接数 min-idle: 1 # 最小连接池数量 max-active: 20 # 最大连接池数量 max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒 time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒 max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒 validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效 test-while-idle: true test-on-borrow: false test-on-return: false primary: master datasource: master: url: jdbc:mysql://127.0.0.1:3306/iailab_expert_master?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true username: root password: 123456 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: host: 127.0.0.1 # 地址 port: 6379 # 端口 database: 0 # 数据库索引 # password: 123456 # 密码,建议生产环境开启 iailab-module-model/iailab-module-model-biz/src/main/resources/application-dev.yml
@@ -21,7 +21,7 @@ type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/iailab_ntt_model?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai url: jdbc:mysql://127.0.0.1:3306/iailab_expert_tenant_zjgt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root password: 123456 initial-size: 10 @@ -54,7 +54,7 @@ database: 0 host: 127.0.0.1 port: 6379 password: # 密码(默认为空) #password: # 密码(默认为空) timeout: 6000ms # 连接超时时长(毫秒) jedis: pool: iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml
@@ -3,7 +3,7 @@ name: model-server profiles: active: ${spring.profiles.active} active: @profiles.active@ cloud: nacos: @@ -58,6 +58,12 @@ logging: file: name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 level: org: springframework: boot: autoconfigure: logging: info --- #################### 接口文档配置 #################### @@ -68,7 +74,7 @@ swagger-ui: enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面 path: /swagger-ui.html default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档 default-flat-param-object: true knife4j: enable: true @@ -140,31 +146,59 @@ listener: missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错 --- #################### 定时任务相关配置 #################### xxl: job: executor: appname: ${spring.application.name} # 执行器 AppName logpath: @log.path@/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径 accessToken: default_token # 执行器通讯TOKEN --- #################### 平台相关配置 #################### iailab: info: version: 1.0.0 base-package: com.iailab.module base-package: com.iailab.module.model web: admin-ui: url: # Admin 管理后台 UI 的地址 swagger: title: 模型 description: 模型 title: 数据采集 description: 数据采集 version: ${iailab.info.version} base-package: ${iailab.info.base-package} tenant: # 多租户相关配置项 enable: false enable: true ignore-tables: - qrtz_blob_triggers - qrtz_calendars - qrtz_cron_triggers - qrtz_fired_triggers - qrtz_job_details - qrtz_locks - qrtz_paused_trigger_grps - qrtz_scheduler_state - qrtz_simple_triggers - qrtz_simprop_triggers - qrtz_triggers - schedule_job - schedule_job_log - t_channel_kio_device - t_channel_kio_tag - t_channel_modbus_device - t_channel_modbus_tag - t_channel_opcda_device - t_channel_opcda_tag - t_channel_opcua_device - t_channel_opcua_tag - t_da_math_point - t_da_measure_point - t_da_point - t_da_point_value - t_da_sequence_num - t_http_api - t_http_tag - t_http_token - t_ind_item - t_ind_item_atom app: app-key: data app-secret: 85b0df7edc3df3611913df34ed695011 core-host: 127.0.0.1 debug: true