ZhuDeKang 6 месяцев назад
Родитель
Сommit
e601ed4827

+ 16 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdModelParamsController.java

@@ -3,6 +3,7 @@ package com.ruoyi.interfaces.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.interfaces.domain.MdModelParams;
 import com.ruoyi.interfaces.service.IMdModelParamsService;
 import io.swagger.annotations.ApiOperation;
@@ -94,6 +95,21 @@ public class MdModelParamsController extends BaseController
         return toAjax(mdModelParamsService.insertMdModelParams(mdModelParams));
     }
 
+    /**
+     * 批量新增模型参数信息
+     */
+    @ApiOperation("新增模型参数信息")
+    @Log(title = "模型参数信息", businessType = BusinessType.INSERT)
+    @PostMapping("/addList")
+    public AjaxResult addList(@RequestBody List<MdModelParams> mdModelParams)
+    {
+        if (StringUtils.isEmpty(mdModelParams)) return AjaxResult.error("数据为空");
+        mdModelParamsService.deleteMdModelParamsByMdid(mdModelParams.get(0).getMdid());
+        mdModelParams.forEach(mdModelParamsService::insertMdModelParams);
+        return success("插入成功");
+    }
+
+
     /**
      * 修改模型参数信息
      */

+ 11 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdModelPargroupController.java

@@ -45,6 +45,17 @@ public class MdModelPargroupController extends BaseController
         return getDataTable(list);
     }
 
+
+    /**
+     * 查询模型参数分组列表
+     */
+    @GetMapping("/allList")
+    public AjaxResult allList(MdModelPargroup mdModelPargroup)
+    {
+        List<MdModelPargroup> list = mdModelPargroupService.selectMdModelPargroupList(mdModelPargroup);
+        return AjaxResult.success(list);
+    }
+
     /**
      * 导出模型参数分组列表
      */

+ 2 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/MdModelParamsMapper.java

@@ -65,4 +65,6 @@ public interface MdModelParamsMapper
      * @return 结果
      */
     public int deleteMdModelParamsByParids(String[] parIds);
+
+    int deleteMdModelParamsByMdid(String mdid);
 }

+ 3 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IMdModelParamsService.java

@@ -59,4 +59,7 @@ public interface IMdModelParamsService
      * @return 结果
      */
     public int deleteMdModelParamsByParId(String parId);
+
+    int deleteMdModelParamsByMdid(String mdid);
+
 }

+ 6 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdModelParamsServiceImpl.java

@@ -96,4 +96,10 @@ public class MdModelParamsServiceImpl implements IMdModelParamsService
     {
         return mdModelParamsMapper.deleteMdModelParamsByParid(parId);
     }
+
+    @Override
+    public int deleteMdModelParamsByMdid(String mdid) {
+
+        return mdModelParamsMapper.deleteMdModelParamsByMdid(mdid);
+    }
 }

+ 3 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/MdModelParamsMapper.xml

@@ -139,4 +139,7 @@
             #{parid}
         </foreach>
     </delete>
+    <delete id="deleteMdModelParamsByMdid">
+        delete from md_model_params where MDID = #{mdid}
+    </delete>
 </mapper>