From 751617419b362158b8b3558fb1a44f01cc91b9b8 Mon Sep 17 00:00:00 2001
From: lau572 <1010031226@qq.com>
Date: Wed, 7 Aug 2024 17:39:55 +0800
Subject: [PATCH] =?UTF-8?q?=E6=83=85=E6=8A=A5=E6=9D=BF=E6=A8=A1=E6=9D=BF?=
=?UTF-8?q?=E5=88=86=E7=B1=BB=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/DcInfoBoardTemplateController.java | 9 +++++++++
.../mapper/DcInfoBoardTemplateMapper.java | 1 +
.../service/IDcInfoBoardTemplateService.java | 9 +++++++++
.../impl/DcInfoBoardTemplateServiceImpl.java | 15 +++++++++++++++
.../mapper/business/DcInfoBoardTemplateMapper.xml | 3 +++
5 files changed, 37 insertions(+)
diff --git a/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java b/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java
index 38ca85a7..509dadca 100644
--- a/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java
+++ b/zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java
@@ -71,4 +71,13 @@ public class DcInfoBoardTemplateController extends BaseController
}
+ @ApiOperation("模板分类排序")
+ @Log(title = "情报板模板", businessType = BusinessType.INSERT)
+ @PostMapping("/updateCategorySort")
+ public AjaxResult updateCategorySort(@RequestBody @ApiParam(value="ids", name="ids", required=true) Long[] ids)
+ {
+ dcInfoBoardTemplateService.updateCategorySort(ids);
+ return AjaxResult.success();
+ }
+
}
diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcInfoBoardTemplateMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcInfoBoardTemplateMapper.java
index 25045191..f21987ff 100644
--- a/zc-business/src/main/java/com/zc/business/mapper/DcInfoBoardTemplateMapper.java
+++ b/zc-business/src/main/java/com/zc/business/mapper/DcInfoBoardTemplateMapper.java
@@ -49,4 +49,5 @@ public interface DcInfoBoardTemplateMapper
public Long selectSdVmsTemplateId();
+ void updateCategorySort(@Param("dictCode") Long dictCode, @Param("dictSort") int dictSort);
}
diff --git a/zc-business/src/main/java/com/zc/business/service/IDcInfoBoardTemplateService.java b/zc-business/src/main/java/com/zc/business/service/IDcInfoBoardTemplateService.java
index 5162c826..dd6a612a 100644
--- a/zc-business/src/main/java/com/zc/business/service/IDcInfoBoardTemplateService.java
+++ b/zc-business/src/main/java/com/zc/business/service/IDcInfoBoardTemplateService.java
@@ -1,6 +1,7 @@
package com.zc.business.service;
import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcInfoBoardTemplate;
import java.util.List;
@@ -39,4 +40,12 @@ public interface IDcInfoBoardTemplateService {
* @return 结果
*/
int deleteSdVmsTemplateById(Long ids);
+
+ /**
+ * 模板分类排序
+ *
+ * @param ids
+ * @return 结果
+ */
+ AjaxResult updateCategorySort(Long[] ids);
}
diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcInfoBoardTemplateServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcInfoBoardTemplateServiceImpl.java
index 917fad80..1b0d60eb 100644
--- a/zc-business/src/main/java/com/zc/business/service/impl/DcInfoBoardTemplateServiceImpl.java
+++ b/zc-business/src/main/java/com/zc/business/service/impl/DcInfoBoardTemplateServiceImpl.java
@@ -1,5 +1,6 @@
package com.zc.business.service.impl;
+import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.utils.DictUtils;
import com.zc.business.domain.DcInfoBoardTemplate;
@@ -85,4 +86,18 @@ public class DcInfoBoardTemplateServiceImpl implements IDcInfoBoardTemplateServi
return dcInfoBoardTemplateMapper.deleteSdVmsTemplateByIds(id);
}
+ /**
+ * 模板分类排序
+ *
+ * @param ids
+ * @return 结果
+ */
+ @Override
+ public AjaxResult updateCategorySort(Long[] ids){
+ for (int i = 0; i < ids.length; i++) {
+ dcInfoBoardTemplateMapper.updateCategorySort(ids[i],i);
+ }
+ return AjaxResult.success("修改排序成功");
+ }
+
}
diff --git a/zc-business/src/main/resources/mapper/business/DcInfoBoardTemplateMapper.xml b/zc-business/src/main/resources/mapper/business/DcInfoBoardTemplateMapper.xml
index 6c2b66e7..8468ce74 100644
--- a/zc-business/src/main/resources/mapper/business/DcInfoBoardTemplateMapper.xml
+++ b/zc-business/src/main/resources/mapper/business/DcInfoBoardTemplateMapper.xml
@@ -105,6 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
+
+ update sys_dict_data set dict_sort = #{dictSort} where dict_code = #{dictCode}
+
delete from dc_info_board_template where id = #{id}