标签内容修改
This commit is contained in:
+41
-41
@@ -38,7 +38,7 @@ import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 分类字典
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-29
|
||||
@@ -190,21 +190,21 @@ public class SysCategoryController {
|
||||
* @return
|
||||
*/
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
@DeleteMapping(value = "/logicDelete")
|
||||
public Result<SysCategory> logicDelete(@RequestParam(name="id",required=true) String id) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
SysCategory sysCategory = sysCategoryService.getById(id);
|
||||
if(sysCategory==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
sysCategory.setDelFlag(CommonConstant.DEL_FLAG_1);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@DeleteMapping(value = "/logicDelete")
|
||||
public Result<SysCategory> logicDelete(@RequestParam(name="id",required=true) String id) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
SysCategory sysCategory = sysCategoryService.getById(id);
|
||||
if(sysCategory==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
sysCategoryService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,sysCategory.getId());
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@@ -221,33 +221,33 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量逻辑删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
// @RequiresPermissions("sys:category:del")未改
|
||||
@DeleteMapping(value = "/logicDeleteBatch")
|
||||
public Result<SysCategory> logicDBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList){
|
||||
SysCategory joinSystem=sysCategoryService.getById(list);
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(joinSystem.getIsReadOnly())) {
|
||||
result.error500("包含固定字段,不可删除");
|
||||
} else {
|
||||
joinSystem.setDelFlag(CommonConstant.DEL_FLAG_1);
|
||||
result.success("批量删除成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 批量逻辑删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
// @RequiresPermissions("category:logicDeleteBatch")
|
||||
@DeleteMapping(value = "/logicDeleteBatch")
|
||||
public Result<SysCategory> logicDBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList){
|
||||
SysCategory joinSystem=sysCategoryService.getById(list);
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(joinSystem.getIsReadOnly())) {
|
||||
result.error500("包含固定字段,不可删除");
|
||||
} else {
|
||||
sysCategoryService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,joinSystem.getId());
|
||||
result.success("批量删除成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
|
||||
+12
-10
@@ -501,11 +501,13 @@ public class SysDictController {
|
||||
if(oConvertUtils.isEmpty(ids)) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly())) {
|
||||
result.error500("包含固定字段,不可删除");
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for (String list : idList) {
|
||||
SysDict midDict = sysDictService.getById(list);
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(midDict.getIsReadOnly())) {
|
||||
return result.error500("包含固定字段,不可删除");
|
||||
} else {
|
||||
sysDictService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
sysDictService.removeByIds(idList);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
@@ -523,12 +525,12 @@ public class SysDictController {
|
||||
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDict> logicdeleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
if(oConvertUtils.isEmpty(ids)) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList){
|
||||
SysDict joinSystem=sysDictService.getById(list);
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList){
|
||||
SysDict joinSystem=sysDictService.getById(list);
|
||||
if(oConvertUtils.isEmpty(ids)) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(joinSystem.getIsReadOnly())) {
|
||||
result.error500("包含固定字段,不可删除");
|
||||
|
||||
+20
-18
@@ -185,17 +185,19 @@ public class SysDictItemController {
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDictItem> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysDictItem> result = new Result<SysDictItem>();
|
||||
SysDictItem sysDictItem = sysDictItemService.getById(ids);
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}
|
||||
else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(sysDictItem.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDictItem.getIsReadOnly())) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("批量删除成功!");
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList) {
|
||||
SysDictItem joinSystem = sysDictItemService.getById(list);
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
} else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(joinSystem.getIsReadOnly())) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("批量删除成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,13 +215,13 @@ public class SysDictItemController {
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDictItem> logicDeleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysDictItem> result = new Result<SysDictItem>();
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}
|
||||
else {
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList){
|
||||
SysDictItem joinSystem=sysDictItemService.getById(list);
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList){
|
||||
SysDictItem joinSystem=sysDictItemService.getById(list);
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}
|
||||
else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(joinSystem.getIsReadOnly())) {
|
||||
result.error500("包含固定字段,不可删除");
|
||||
|
||||
+14
-8
@@ -1,15 +1,15 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.model.TreeSelectModel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.model.TreeSelectModel;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 分类字典
|
||||
* @Author: jero-boot
|
||||
@@ -27,6 +27,12 @@ public interface SysCategoryMapper extends BaseMapper<SysCategory> {
|
||||
|
||||
@Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
|
||||
public String queryIdByCode(@Param("code") String code);
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态值
|
||||
* @param delFlag
|
||||
* @param id
|
||||
*/
|
||||
@Update("update sys_dict set del_flag = #{flag,jdbcType=INTEGER} where id = #{id,jdbcType=VARCHAR}")
|
||||
public void updateDictDelFlag(@Param("flag") int delFlag, @Param("id") String id);
|
||||
}
|
||||
|
||||
+3
-2
@@ -160,6 +160,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
"i.item_text as attribute_type_name,i.en_name as attribute_type_en_name\n" +
|
||||
"from sys_dict as d\n" +
|
||||
"left join sys_dict_item as i on d.attribute_type=i.item_value\n" +
|
||||
"where i.dict_id=\"1494570247913512962\" and d.del_flag=0")
|
||||
IPage queryPageList(IPage page,@Param("params") Map<String,Object> params);
|
||||
"where i.dict_id=\"1494570247913512962\" and d.del_flag=0\n" +
|
||||
"order by d.create_time desc")
|
||||
IPage<SysDict> queryPageList(IPage page,@Param("params") Map<String,Object> params);
|
||||
}
|
||||
|
||||
+7
@@ -73,4 +73,11 @@ public interface ISysCategoryService extends IService<SysCategory> {
|
||||
List<SysCategoryTreeVO> getSysCategoryTree();
|
||||
|
||||
List<SysCategory> queryBySysName(String sysDictId);
|
||||
|
||||
/**
|
||||
* 修改delFlag
|
||||
* @param delFlag
|
||||
* @param id
|
||||
*/
|
||||
public void updateDictDelFlag(int delFlag,String id);
|
||||
}
|
||||
|
||||
+4
-1
@@ -242,5 +242,8 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateDictDelFlag(int delFlag, String id) {
|
||||
baseMapper.updateDictDelFlag(delFlag,id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user