From 9057425fa1472e48d79f7f8608ea80267e224135 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 25 九月 2024 14:14:37 +0800
Subject: [PATCH] pre

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java      |    2 
 /dev/null                                                                                                                               |    9 ----
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemTypeRespVO.java                      |    2 
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java |   10 ++--
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java         |   27 ++++---------
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java    |   12 +++---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java |    2 -
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/package-info.java                  |    1 
 8 files changed, 23 insertions(+), 42 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java
index 8be5627..61826c0 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java
@@ -70,7 +70,7 @@
     @PostMapping("/create")
     @PreAuthorize("@ss.hasPermission('model:pre-module:create')")
     @DSTransactional(rollbackFor= Exception.class)
-    public CommonResult<Boolean> save(@RequestBody DmModuleEntity module){
+    public CommonResult<Boolean> create(@RequestBody DmModuleEntity module){
         int count = dmModuleService.check(module);
         if (count > 0) {
             ErrorCode errorCode = new ErrorCode(999, "名称重复");
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java
index b2674ae..ddd89b3 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java
@@ -35,7 +35,7 @@
      * 预测项类型列表
      */
     @GetMapping("/page")
-    @PreAuthorize("@ss.hasPermission('model:pre-item:query')")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:query')")
     public CommonResult<PageResult<MmItemTypeRespVO>> page(@Validated MmItemTypePageReqVO reqVO) {
         PageResult<MmItemTypeEntity> page = mmItemTypeService.page(reqVO);
 
@@ -43,7 +43,7 @@
     }
 
     @GetMapping("/list")
-    @PreAuthorize("@ss.hasPermission('model:pre-item:query')")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:query')")
     public CommonResult<List<MmItemTypeEntity>> list(@RequestParam Map<String, Object> params) {
         List<MmItemTypeEntity> list = mmItemTypeService.list(params);
 
@@ -54,7 +54,7 @@
      * 预测项类型信息
      */
     @GetMapping("/get/{id}")
-    @PreAuthorize("@ss.hasPermission('model:pre-item:query')")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:query')")
     public CommonResult<MmItemTypeEntity> info(@PathVariable("id") String id) {
         MmItemTypeEntity itemType = mmItemTypeService.info(id);
 
@@ -65,7 +65,7 @@
      * 保存预测项类型
      */
     @PostMapping("/create")
-    @PreAuthorize("@ss.hasPermission('model:pre-item:create')")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:create')")
     @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> save(@RequestBody MmItemTypeEntity itemType) {
         int count = mmItemTypeService.check(itemType);
@@ -80,7 +80,7 @@
      * 修改预测项类型
      */
     @PutMapping("/update")
-    @PreAuthorize("@ss.hasPermission('model:pre-item:update')")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:update')")
     @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> update(@RequestBody MmItemTypeEntity itemType) {
         int count = mmItemTypeService.check(itemType);
@@ -95,7 +95,7 @@
      * 删除预测项类型
      */
     @DeleteMapping("/delete")
-    @PreAuthorize("@ss.hasPermission('model:pre-item:delete')")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:delete')")
     @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> delete(@RequestParam("id") String id) {
         mmItemTypeService.deleteBatch(new String[]{id});
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java
index 06590e6..267f2c0 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java
@@ -51,7 +51,7 @@
      * 预测项列表
      */
     @GetMapping("/page")
-    @PreAuthorize("@ss.hasPermission('model:pre-predict:query')")
+    @PreAuthorize("@ss.hasPermission('model:pre-item:query')")
     public CommonResult<PageResult<MmPredictItemRespVO>> page(@Validated MmPredictItemPageReqVO reqVO) {
         PageResult<MmPredictItemEntity> page = mmPredictItemService.queryPage(reqVO);
         PageResult<MmPredictItemRespVO> result = BeanUtils.toBean(page, MmPredictItemRespVO.class);
@@ -79,7 +79,7 @@
      * 预测项信息
      */
     @GetMapping("/get/{id}")
-    @PreAuthorize("@ss.hasPermission('model:pre-predict:query')")
+    @PreAuthorize("@ss.hasPermission('model:pre-item:query')")
     public CommonResult<MmPredictItemDTO> info(@PathVariable("id") String id){
         MmPredictItemDTO predictItem = mmPredictItemService.info(id);
         return success(predictItem);
@@ -89,7 +89,7 @@
      * 保存预测项
      */
     @PostMapping("/create")
-    @PreAuthorize("@ss.hasPermission('model:pre-predict:create')")
+    @PreAuthorize("@ss.hasPermission('model:pre-item:create')")
     @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> save(@RequestBody MmPredictItemDTO mmPredictItemDto){
         mmPredictItemService.add(mmPredictItemDto);
@@ -100,7 +100,7 @@
      * 修改预测项
      */
     @PutMapping("/update")
-    @PreAuthorize("@ss.hasPermission('model:pre-predict:update')")
+    @PreAuthorize("@ss.hasPermission('model:pre-item:update')")
     @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> update(@RequestBody MmPredictItemDTO mmPredictItemDTO){
         mmPredictItemService.update(mmPredictItemDTO);
@@ -111,7 +111,7 @@
      * 删除预测项
      */
     @DeleteMapping("/delete")
-    @PreAuthorize("@ss.hasPermission('model:pre-predict:delete')")
+    @PreAuthorize("@ss.hasPermission('model:pre-item:delete')")
     @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> delete(@RequestParam("id") String id) {
         mmPredictItemService.deleteBatch(new String[]{id});
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
index a8a0efd..55f0017 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
@@ -38,7 +38,6 @@
      * 结果存放列表
      */
     @GetMapping("/page")
-    @PreAuthorize("@ss.hasPermission('model:pre-result:query')")
     public CommonResult<PageResult<MmResultTableRespVO>> page(@Validated MmResultTablePageReqVO reqVO) {
         PageResult<MmResultTableEntity> page = mmResultTableService.page(reqVO);
 
@@ -47,7 +46,6 @@
 
 
     @GetMapping("/list")
-    @PreAuthorize("@ss.hasPermission('model:pre-result:query')")
     public CommonResult<List<MmResultTableEntity>> list(@Valid @RequestParam Map<String, Object> params) {
         List<MmResultTableEntity> list = mmResultTableService.list(params);
         return success(list);
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/app/app.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/app/app.java
deleted file mode 100644
index c3d66ad..0000000
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/app/app.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.iailab.module.model.mcs.pre.controller.app;
-
-/**
- * @author PanZhibao
- * @Description
- * @createTime 2024年09月06日
- */
-public class app {
-}
\ 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/package-info.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/package-info.java
new file mode 100644
index 0000000..9eb4d09
--- /dev/null
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/package-info.java
@@ -0,0 +1 @@
+package com.iailab.module.model.mcs.pre.controller;
\ 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/DmModuleServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java
index 027832f..5b678c8 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java
@@ -1,11 +1,8 @@
 package com.iailab.module.model.mcs.pre.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.iailab.framework.common.page.PageData;
 import com.iailab.framework.common.pojo.PageResult;
-import com.iailab.framework.common.service.impl.BaseServiceImpl;
 import com.iailab.module.model.mcs.pre.dao.DmModuleDao;
 import com.iailab.module.model.mcs.pre.entity.DmModuleEntity;
 import com.iailab.module.model.mcs.pre.service.DmModuleService;
@@ -13,9 +10,7 @@
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
-import javax.annotation.Resource;
 import java.util.*;
 
 /**
@@ -36,7 +31,7 @@
     @Override
     public List<DmModuleEntity> list(Map<String, Object> params) {
         QueryWrapper<DmModuleEntity> wrapper = getWrapper(params);
-        wrapper.orderByDesc("CREATE_TIME");
+        wrapper.orderByDesc("create_time");
         return dmModuleDao.selectList(wrapper);
     }
 
@@ -57,21 +52,17 @@
     }
 
     @Override
-    public void saveModule(DmModuleEntity module) {
-        module.setId(UUID.randomUUID().toString());
-        Calendar calendar = Calendar.getInstance();
-        calendar.set(Calendar.SECOND, 0);
-        calendar.set(Calendar.MILLISECOND, 0);
-        module.setPredicttime(calendar.getTime());
-        module.setCollecttime(calendar.getTime());
-        module.setUpdateTime(new Date());
-        dmModuleDao.insert(module);
+    public void saveModule(DmModuleEntity entity) {
+        entity.setId(UUID.randomUUID().toString());
+        entity.setCreateTime(new Date());
+        entity.setUpdateTime(new Date());
+        dmModuleDao.insert(entity);
     }
 
     @Override
-    public void update(DmModuleEntity module) {
-        module.setUpdateTime(new Date());
-        dmModuleDao.updateById(module);
+    public void update(DmModuleEntity entity) {
+        entity.setUpdateTime(new Date());
+        dmModuleDao.updateById(entity);
     }
 
     @Override
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemTypeRespVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemTypeRespVO.java
index 060f3d9..65fd135 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemTypeRespVO.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmItemTypeRespVO.java
@@ -13,7 +13,7 @@
  * @Description
  * @createTime 2024年09月04日
  */
-@Schema(description = "模型平台 - MmItemType Response VO")
+@Schema(description = "模型平台 - 预测项类型 Response VO")
 @Data
 @ExcelIgnoreUnannotated
 public class MmItemTypeRespVO {

--
Gitblit v1.9.3