Browse Source

情报板模板分类排序

develop
lau572 4 months ago
parent
commit
751617419b
  1. 9
      zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java
  2. 1
      zc-business/src/main/java/com/zc/business/mapper/DcInfoBoardTemplateMapper.java
  3. 9
      zc-business/src/main/java/com/zc/business/service/IDcInfoBoardTemplateService.java
  4. 15
      zc-business/src/main/java/com/zc/business/service/impl/DcInfoBoardTemplateServiceImpl.java
  5. 3
      zc-business/src/main/resources/mapper/business/DcInfoBoardTemplateMapper.xml

9
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();
}
}

1
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);
}

9
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);
}

15
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("修改排序成功");
}
}

3
zc-business/src/main/resources/mapper/business/DcInfoBoardTemplateMapper.xml

@ -105,6 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="updateCategorySort">
update sys_dict_data set dict_sort = #{dictSort} where dict_code = #{dictCode}
</update>
<delete id="deleteSdVmsTemplateById" parameterType="Long">
delete from dc_info_board_template where id = #{id}

Loading…
Cancel
Save