From 757bfdc997691450a68514c879fcb08cfbd5451f Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期二, 26 十一月 2024 17:00:14 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyRateService.java | 17 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateRespVO.java | 57 +++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyHisService.java | 15 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisPageReqVO.java | 27 ++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyRateDao.java | 9 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisRespVO.java | 33 +++ iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java | 4 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictAlarmConfigController.java | 6 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateSaveReqVO.java | 56 +++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java | 11 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisSaveReqVO.java | 32 +++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmConfigRespVO.java | 4 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictAlarmConfigDao.java | 13 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyHisServiceImpl.java | 43 ++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRatePageReqVO.java | 22 ++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyRateController.java | 74 +++++++ iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml | 1 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyHisController.java | 74 +++++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyHisDao.java | 14 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictAlarmConfigService.java | 4 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyRateServiceImpl.java | 44 ++++ iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemOutputDao.xml | 8 22 files changed, 551 insertions(+), 17 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java index 546062b..2a544a1 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java @@ -9,8 +9,8 @@ public static final String JsonSavePath = "D:/hk-project/json";//海康威视抓取图片上传路径 // public static final String JsonSavePath = "D:/DLUT/json";//海康威视抓取图片上传路径 -// public static final String HIK_WIN_PATH = "hikvision/win64/HCNetSDK.dll"; - public static final String HIK_WIN_PATH = "D:\\DLUT\\lib\\HCNetSDK.dll"; + public static final String HIK_WIN_PATH = "hikvision/win64/HCNetSDK.dll"; +// public static final String HIK_WIN_PATH = "D:\\DLUT\\lib\\HCNetSDK.dll"; public static final String ModelCode = "Image_feature";//模型代码 diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyHisController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyHisController.java new file mode 100644 index 0000000..7197455 --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyHisController.java @@ -0,0 +1,74 @@ +package com.iailab.module.model.mcs.pre.controller.admin; + +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.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; +import com.iailab.module.model.mcs.pre.service.MmItemAccuracyHisService; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisRespVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisSaveReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * @author lirm + * @Description + * @createTime 2024年11月25日 + */ +@RestController +@RequestMapping("/model/item/accuracy-his") +public class MmItemAccuracyHisController { + + @Autowired + private MmItemAccuracyHisService mmItemAccuracyHisService; + + @PostMapping("/create") + @Operation(summary = "创建预测精准度历史配置") + @PreAuthorize("@ss.hasPermission('item:accuracy-his:create')") + public CommonResult<Boolean> create(@Valid @RequestBody MmItemAccuracyHisSaveReqVO createReqVO) { + mmItemAccuracyHisService.create(createReqVO); + return success(true); + } + + @PutMapping("/update") + @Operation(summary = "更新预测精准度历史配置") + @PreAuthorize("@ss.hasPermission('item:accuracy-his:update')") + public CommonResult<Boolean> update(@Valid @RequestBody MmItemAccuracyHisSaveReqVO updateReqVO) { + mmItemAccuracyHisService.update(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除预测精准度历史配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('item:accuracy-his:delete')") + public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { + mmItemAccuracyHisService.delete(id); + return success(true); + } + + @GetMapping("/get/{id}") + @Operation(summary = "获得预测精准度历史配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('item:accuracy-his:query')") + public CommonResult<MmItemAccuracyHisRespVO> getInfo(@PathVariable("id") String id) { + MmItemAccuracyHisEntity entity = mmItemAccuracyHisService.getInfo(id); + return success(BeanUtils.toBean(entity, MmItemAccuracyHisRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得预测精准度历史配置分页") + @PreAuthorize("@ss.hasPermission('item:accuracy-his:query')") + public CommonResult<PageResult<MmItemAccuracyHisRespVO>> getTenantPage(@Valid MmItemAccuracyHisPageReqVO pageVO) { + PageResult<MmItemAccuracyHisEntity> pageResult = mmItemAccuracyHisService.page(pageVO); + return success(BeanUtils.toBean(pageResult, MmItemAccuracyHisRespVO.class)); + } +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyRateController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyRateController.java new file mode 100644 index 0000000..c3b3fb9 --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemAccuracyRateController.java @@ -0,0 +1,74 @@ +package com.iailab.module.model.mcs.pre.controller.admin; + +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.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; +import com.iailab.module.model.mcs.pre.service.MmItemAccuracyRateService; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateRespVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateSaveReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * @author lirm + * @Description + * @createTime 2024年11月25日 + */ +@RestController +@RequestMapping("/model/item/accuracy-rate") +public class MmItemAccuracyRateController { + + @Autowired + private MmItemAccuracyRateService mmItemAccuracyRateService; + + @PostMapping("/create") + @Operation(summary = "创建预测精准度配置") + @PreAuthorize("@ss.hasPermission('item:accuracy-rate:create')") + public CommonResult<Boolean> create(@Valid @RequestBody MmItemAccuracyRateSaveReqVO createReqVO) { + mmItemAccuracyRateService.create(createReqVO); + return success(true); + } + + @PutMapping("/update") + @Operation(summary = "更新预测精准度配置") + @PreAuthorize("@ss.hasPermission('item:accuracy-rate:update')") + public CommonResult<Boolean> update(@Valid @RequestBody MmItemAccuracyRateSaveReqVO updateReqVO) { + mmItemAccuracyRateService.update(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除预测精准度配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('item:accuracy-rate:delete')") + public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { + mmItemAccuracyRateService.delete(id); + return success(true); + } + + @GetMapping("/get/{id}") + @Operation(summary = "获得预测精准度配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('item:accuracy-rate:query')") + public CommonResult<MmItemAccuracyRateRespVO> getInfo(@PathVariable("id") String id) { + MmItemAccuracyRateEntity entity = mmItemAccuracyRateService.getInfo(id); + return success(BeanUtils.toBean(entity, MmItemAccuracyRateRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得预测精准度配置分页") + @PreAuthorize("@ss.hasPermission('item:accuracy-rate:query')") + public CommonResult<PageResult<MmItemAccuracyRateRespVO>> getTenantPage(@Valid MmItemAccuracyRatePageReqVO pageVO) { + PageResult<MmItemAccuracyRateEntity> pageResult = mmItemAccuracyRateService.page(pageVO); + return success(BeanUtils.toBean(pageResult, MmItemAccuracyRateRespVO.class)); + } +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictAlarmConfigController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictAlarmConfigController.java index 26c1675..9a8ddd0 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictAlarmConfigController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictAlarmConfigController.java @@ -55,11 +55,11 @@ return success(true); } - @GetMapping("/get") + @GetMapping("/get/{id}") @Operation(summary = "获得预警配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pre:alarm-config:query')") - public CommonResult<MmPredictAlarmConfigRespVO> getInfo(@RequestParam("id") String id) { + public CommonResult<MmPredictAlarmConfigRespVO> getInfo(@PathVariable("id") String id) { MmPredictAlarmConfigEntity entity = mmPredictAlarmConfigService.getInfo(id); return success(BeanUtils.toBean(entity, MmPredictAlarmConfigRespVO.class)); } @@ -68,7 +68,7 @@ @Operation(summary = "获得预警配置分页") @PreAuthorize("@ss.hasPermission('pre:alarm-config:query')") public CommonResult<PageResult<MmPredictAlarmConfigRespVO>> getTenantPage(@Valid MmPredictAlarmConfigPageReqVO pageVO) { - PageResult<MmPredictAlarmConfigEntity> pageResult = mmPredictAlarmConfigService.page(pageVO); + PageResult<MmPredictAlarmConfigRespVO> pageResult = mmPredictAlarmConfigService.page(pageVO); return success(BeanUtils.toBean(pageResult, MmPredictAlarmConfigRespVO.class)); } } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyHisDao.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyHisDao.java index a64d56d..e5175d2 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyHisDao.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyHisDao.java @@ -1,8 +1,13 @@ package com.iailab.module.model.mcs.pre.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.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; +import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; +import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; import org.apache.ibatis.annotations.Mapper; /** @@ -13,4 +18,11 @@ @TenantDS @Mapper public interface MmItemAccuracyHisDao extends BaseMapperX<MmItemAccuracyHisEntity> { -} + + default PageResult<MmItemAccuracyHisEntity> selectPage(MmItemAccuracyHisPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX<MmItemAccuracyHisEntity>() + .likeIfPresent(MmItemAccuracyHisEntity::getRateId, reqVO.getRateId()) + .likeIfPresent(MmItemAccuracyHisEntity::getInDeviation, reqVO.getInDeviation()) + .orderByDesc(MmItemAccuracyHisEntity::getCreateTime)); + } +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyRateDao.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyRateDao.java index ed4228d..a63a7c3 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyRateDao.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmItemAccuracyRateDao.java @@ -1,8 +1,12 @@ package com.iailab.module.model.mcs.pre.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.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; +import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; import org.apache.ibatis.annotations.Mapper; /** @@ -13,4 +17,9 @@ @TenantDS @Mapper public interface MmItemAccuracyRateDao extends BaseMapperX<MmItemAccuracyRateEntity> { + + default PageResult<MmItemAccuracyRateEntity> selectPage(MmItemAccuracyRatePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX<MmItemAccuracyRateEntity>() + .orderByDesc(MmItemAccuracyRateEntity::getCreateTime)); + } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictAlarmConfigDao.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictAlarmConfigDao.java index 47fe438..1fa68e5 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictAlarmConfigDao.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictAlarmConfigDao.java @@ -1,12 +1,14 @@ package com.iailab.module.model.mcs.pre.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.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * @author PanZhibao @@ -17,10 +19,9 @@ @Mapper public interface MmPredictAlarmConfigDao extends BaseMapperX<MmPredictAlarmConfigEntity> { - default PageResult<MmPredictAlarmConfigEntity> selectPage(MmPredictAlarmConfigPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX<MmPredictAlarmConfigEntity>() - .likeIfPresent(MmPredictAlarmConfigEntity::getTitle, reqVO.getTitle()) - .likeIfPresent(MmPredictAlarmConfigEntity::getAlarmObj, reqVO.getAlarmObj()) - .orderByDesc(MmPredictAlarmConfigEntity::getCreateTime)); + IPage<MmPredictAlarmConfigRespVO> getPageList(IPage<MmPredictAlarmConfigEntity> page, @Param("params") MmPredictAlarmConfigPageReqVO reqVO); + + default IPage<MmPredictAlarmConfigRespVO> selectPage(MmPredictAlarmConfigPageReqVO reqVO) { + return getPageList(getPage(reqVO), reqVO); } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyHisService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyHisService.java index 3243536..a08bee5 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyHisService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyHisService.java @@ -1,9 +1,24 @@ package com.iailab.module.model.mcs.pre.service; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisSaveReqVO; + /** * @author PanZhibao * @Description * @createTime 2024年11月19日 */ public interface MmItemAccuracyHisService { + + PageResult<MmItemAccuracyHisEntity> page(MmItemAccuracyHisPageReqVO pageVO); + + MmItemAccuracyHisEntity getInfo(String id); + + void create(MmItemAccuracyHisSaveReqVO createReqVO); + + void update(MmItemAccuracyHisSaveReqVO updateReqVO); + + void delete(String id); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyRateService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyRateService.java index 09a3036..42ee025 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyRateService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemAccuracyRateService.java @@ -1,9 +1,26 @@ package com.iailab.module.model.mcs.pre.service; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateSaveReqVO; + +import javax.validation.Valid; + /** * @author PanZhibao * @Description * @createTime 2024年11月19日 */ public interface MmItemAccuracyRateService { + + PageResult<MmItemAccuracyRateEntity> page(MmItemAccuracyRatePageReqVO pageVO); + + MmItemAccuracyRateEntity getInfo(String id); + + void create(MmItemAccuracyRateSaveReqVO createReqVO); + + void update(MmItemAccuracyRateSaveReqVO updateReqVO); + + void delete(String id); } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictAlarmConfigService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictAlarmConfigService.java index 9bc8319..9009260 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictAlarmConfigService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictAlarmConfigService.java @@ -1,9 +1,11 @@ package com.iailab.module.model.mcs.pre.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; /** @@ -13,7 +15,7 @@ */ public interface MmPredictAlarmConfigService extends BaseService<MmPredictAlarmConfigEntity> { - PageResult<MmPredictAlarmConfigEntity> page(MmPredictAlarmConfigPageReqVO reqVO); + PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO); MmPredictAlarmConfigEntity getInfo(String id); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyHisServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyHisServiceImpl.java index 241c579..e17491d 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyHisServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyHisServiceImpl.java @@ -1,7 +1,19 @@ package com.iailab.module.model.mcs.pre.service.impl; +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.framework.security.core.util.SecurityFrameworkUtils; +import com.iailab.module.model.mcs.pre.dao.MmItemAccuracyHisDao; +import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; import com.iailab.module.model.mcs.pre.service.MmItemAccuracyHisService; +import com.iailab.module.model.mcs.pre.service.MmItemAccuracyHisService; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisSaveReqVO; import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.UUID; /** * @author PanZhibao @@ -9,5 +21,34 @@ * @createTime 2024年11月19日 */ @Service -public class MmItemAccuracyHisServiceImpl implements MmItemAccuracyHisService { +public class MmItemAccuracyHisServiceImpl extends BaseServiceImpl<MmItemAccuracyHisDao, MmItemAccuracyHisEntity> + implements MmItemAccuracyHisService { + @Override + public PageResult<MmItemAccuracyHisEntity> page(MmItemAccuracyHisPageReqVO reqVO) { + return baseDao.selectPage(reqVO); + } + + @Override + public MmItemAccuracyHisEntity getInfo(String id) { + return baseDao.selectById(id); + } + + @Override + public void create(MmItemAccuracyHisSaveReqVO reqVO) { + MmItemAccuracyHisEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyHisEntity.class); + entity.setId(UUID.randomUUID().toString()); + entity.setCreateTime(new Date()); + baseDao.insert(entity); + } + + @Override + public void update(MmItemAccuracyHisSaveReqVO reqVO) { + MmItemAccuracyHisEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyHisEntity.class); + baseDao.updateById(entity); + } + + @Override + public void delete(String id) { + baseDao.deleteById(id); + } } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyRateServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyRateServiceImpl.java index abaade9..79951cb 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyRateServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemAccuracyRateServiceImpl.java @@ -1,7 +1,19 @@ package com.iailab.module.model.mcs.pre.service.impl; +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.framework.security.core.util.SecurityFrameworkUtils; +import com.iailab.module.model.mcs.pre.dao.MmItemAccuracyRateDao; +import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; import com.iailab.module.model.mcs.pre.service.MmItemAccuracyRateService; +import com.iailab.module.model.mcs.pre.service.MmItemAccuracyRateService; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateSaveReqVO; import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.UUID; /** * @author PanZhibao @@ -9,5 +21,35 @@ * @createTime 2024年11月19日 */ @Service -public class MmItemAccuracyRateServiceImpl implements MmItemAccuracyRateService { +public class MmItemAccuracyRateServiceImpl extends BaseServiceImpl<MmItemAccuracyRateDao, MmItemAccuracyRateEntity> + implements MmItemAccuracyRateService { + @Override + public PageResult<MmItemAccuracyRateEntity> page(MmItemAccuracyRatePageReqVO reqVO) { + return baseDao.selectPage(reqVO); + } + + @Override + public MmItemAccuracyRateEntity getInfo(String id) { + return baseDao.selectById(id); + } + + @Override + public void create(MmItemAccuracyRateSaveReqVO reqVO) { + MmItemAccuracyRateEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyRateEntity.class); + entity.setId(UUID.randomUUID().toString()); + entity.setCreateTime(new Date()); + baseDao.insert(entity); + } + + @Override + public void update(MmItemAccuracyRateSaveReqVO reqVO) { + MmItemAccuracyRateEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyRateEntity.class); + entity.setUpdateTime(new Date()); + baseDao.updateById(entity); + } + + @Override + public void delete(String id) { + baseDao.deleteById(id); + } } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java index 6536a6c..a7d76f5 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java @@ -1,12 +1,15 @@ package com.iailab.module.model.mcs.pre.service.impl; +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.framework.security.core.util.SecurityFrameworkUtils; import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao; import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; import com.iailab.module.model.mcs.pre.service.MmPredictAlarmConfigService; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; import org.springframework.stereotype.Service; @@ -23,8 +26,9 @@ implements MmPredictAlarmConfigService { @Override - public PageResult<MmPredictAlarmConfigEntity> page(MmPredictAlarmConfigPageReqVO reqVO) { - return baseDao.selectPage(reqVO); + public PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO) { + IPage<MmPredictAlarmConfigRespVO> page = baseDao.selectPage(reqVO); + return new PageResult<>(page.getRecords(), page.getTotal()); } @Override @@ -36,6 +40,7 @@ public void create(MmPredictAlarmConfigSaveReqVO reqVO) { MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); entity.setId(UUID.randomUUID().toString()); + entity.setCreator(SecurityFrameworkUtils.getLoginUserNickname()); entity.setCreateTime(new Date()); baseDao.insert(entity); } @@ -43,6 +48,8 @@ @Override public void update(MmPredictAlarmConfigSaveReqVO reqVO) { MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); + entity.setUpdater(SecurityFrameworkUtils.getLoginUserNickname()); + entity.setUpdateTime(new Date()); baseDao.updateById(entity); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisPageReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisPageReqVO.java new file mode 100644 index 0000000..6b0c166 --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisPageReqVO.java @@ -0,0 +1,27 @@ +package com.iailab.module.model.mcs.pre.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.math.BigDecimal; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年11月20日 + */ +@Schema(description = "模型平台 - Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MmItemAccuracyHisPageReqVO extends PageParam { + + @Schema(description = "预测精准度ID") + private String rateId; + + @Schema(description = "精准误差") + private String inDeviation; +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisRespVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisRespVO.java new file mode 100644 index 0000000..6343ee8 --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisRespVO.java @@ -0,0 +1,33 @@ +package com.iailab.module.model.mcs.pre.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年11月20日 + */ +@Schema(description = "模型服务 - 预警配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MmItemAccuracyHisRespVO { + @Schema(description = "ID") + private String id; + + private String rateId; + + private BigDecimal inDeviation; + + private BigDecimal inAccuracyRate; + + private BigDecimal outDeviation; + + private BigDecimal outAccuracyRate; + + private Date createTime; +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisSaveReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisSaveReqVO.java new file mode 100644 index 0000000..21f90e0 --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyHisSaveReqVO.java @@ -0,0 +1,32 @@ +package com.iailab.module.model.mcs.pre.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年11月20日 + */ +@Schema(description = "模型服务 - 预警信息创建/修改 Request VO") +@Data +public class MmItemAccuracyHisSaveReqVO { + + @Schema(description = "ID") + private String id; + + private String rateId; + + private BigDecimal inDeviation; + + private BigDecimal inAccuracyRate; + + private BigDecimal outDeviation; + + private BigDecimal outAccuracyRate; + + private Date createTime; +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRatePageReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRatePageReqVO.java new file mode 100644 index 0000000..0b3e20e --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRatePageReqVO.java @@ -0,0 +1,22 @@ +package com.iailab.module.model.mcs.pre.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; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年11月20日 + */ +@Schema(description = "模型平台 - Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MmItemAccuracyRatePageReqVO extends PageParam { + + @Schema(description = "预测项ID") + private String itemId; +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateRespVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateRespVO.java new file mode 100644 index 0000000..75cc8a2 --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateRespVO.java @@ -0,0 +1,57 @@ +package com.iailab.module.model.mcs.pre.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年11月20日 + */ +@Schema(description = "模型服务 - 预警配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MmItemAccuracyRateRespVO { + @Schema(description = "ID") + private String id; + + + private String itemId; + + + private String outId; + + + private Integer sampleLength; + + + private Integer valueType; + + + private Date beginTime; + + + private BigDecimal inDeviation; + + + private BigDecimal inAccuracyRate; + + + private BigDecimal outDeviation; + + + private BigDecimal outAccuracyRate; + + + private Integer isEnable; + + + private Date createTime; + + + private Date updateTime; +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateSaveReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateSaveReqVO.java new file mode 100644 index 0000000..9fc685c --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemAccuracyRateSaveReqVO.java @@ -0,0 +1,56 @@ +package com.iailab.module.model.mcs.pre.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年11月20日 + */ +@Schema(description = "模型服务 - 预警信息创建/修改 Request VO") +@Data +public class MmItemAccuracyRateSaveReqVO { + + @Schema(description = "ID") + private String id; + + + private String itemId; + + + private String outId; + + + private Integer sampleLength; + + + private Integer valueType; + + + private Date beginTime; + + + private BigDecimal inDeviation; + + + private BigDecimal inAccuracyRate; + + + private BigDecimal outDeviation; + + + private BigDecimal outAccuracyRate; + + + private Integer isEnable; + + + private Date createTime; + + + private Date updateTime; +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmConfigRespVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmConfigRespVO.java index 5807ec9..9b06aec 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmConfigRespVO.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmConfigRespVO.java @@ -28,8 +28,12 @@ @Schema(description = "预测项ID") private String itemId; + private String itemName; + @Schema(description = "输出ID") private String outId; + + private String outName; @Schema(description = "比较长度") private Integer compLength; diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml b/iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml index 61cdbda..9883f9f 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml +++ b/iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml @@ -193,6 +193,7 @@ - t_mm_item_result_json - t_mm_item_result_last_point - t_mm_item_accuracy_rate + - t_mm_item_accuracy_his - t_mm_predict_alarm_config - t_mm_predict_alarm_message - t_mm_sequence_num diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemOutputDao.xml b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemOutputDao.xml index 7579f95..be28aad 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemOutputDao.xml +++ b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmItemOutputDao.xml @@ -3,4 +3,12 @@ <mapper namespace="com.iailab.module.model.mcs.pre.dao.MmItemOutputDao"> + <select id="queryList" resultType="com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO"> + select * from t_mm_item_output t + <where> + <if test="params.itemid != null and params.itemid != ''"> + AND t.itemid LIKE CONCAT('%', #{params.itemid},'%') + </if> + </where> + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3