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}