整理代码
This commit is contained in:
@@ -42,21 +42,6 @@ public class SysTestConfigController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, sysTestConfig, methodDescribe);
|
||||
}
|
||||
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
// @PostMapping("/add")
|
||||
// @ApiOperation("新增检测相关配置信息")
|
||||
// @ApiImplicitParam(name = "sysTestConfig", value = "检测相关配置信息", required = true)
|
||||
// public HttpResult<Boolean> add(@RequestBody @Validated SysTestConfigParam param) {
|
||||
// String methodDescribe = getMethodDescribe("add");
|
||||
// LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||
// boolean result = sysTestConfigService.addTestConfig(param);
|
||||
// if (result) {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
// } else {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改检测相关配置信息")
|
||||
@@ -66,9 +51,9 @@ public class SysTestConfigController extends BaseController {
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||
boolean result = sysTestConfigService.updateTestConfig(sysTestConfig);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,14 +63,14 @@ public class DictDataController extends BaseController {
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增字典数据")
|
||||
@ApiImplicitParam(name = "dictDataParam", value = "字典数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated DictDataParam dictDataParam) {
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated DictDataParam dictDataParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, dictDataParam);
|
||||
boolean result = dictDataService.addDictData(dictDataParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,14 +81,14 @@ public class DictDataController extends BaseController {
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改字典数据")
|
||||
@ApiImplicitParam(name = "updateParam", value = "字典数据", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated DictDataParam.UpdateParam updateParam) {
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated DictDataParam.UpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = dictDataService.updateDictData(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,14 +99,14 @@ public class DictDataController extends BaseController {
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除字典数据")
|
||||
@ApiImplicitParam(name = "ids", value = "字典索引", required = true, dataTypeClass = List.class)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},字典ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||
boolean result = dictDataService.deleteDictData(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ public class DictPqController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增电能质量指标字典")
|
||||
public HttpResult<Object> add(@RequestBody @Validated DictPqParam dictPqParam) {
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated DictPqParam dictPqParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, dictPqParam);
|
||||
boolean result = dictPqService.addDictPq(dictPqParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,14 +65,14 @@ public class DictPqController extends BaseController {
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("更新电能质量指标字典")
|
||||
@ApiImplicitParam(name = "updateParam", value = "更新参数", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated DictPqParam.UpdateParam updateParam) {
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated DictPqParam.UpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},更新数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = dictPqService.updateDictPq(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,14 +80,14 @@ public class DictPqController extends BaseController {
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除电能质量指标字典")
|
||||
@ApiImplicitParam(name = "ids", value = "字典索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||
boolean result = dictPqService.deleteDictPq(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ public class DictTreeController extends BaseController {
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增字典树数据")
|
||||
@ApiImplicitParam(name = "dictTreeParam", value = "字典数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated DictTreeParam dictTreeParam) {
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated DictTreeParam dictTreeParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, dictTreeParam);
|
||||
boolean result = dictTreeService.addDictTree(dictTreeParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,55 +118,6 @@ public class DictTreeController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @GetMapping("/getById")
|
||||
// @ApiOperation("根据id查询数据")
|
||||
// public HttpResult<DictTree> getById(@RequestParam("id") String id) {
|
||||
// String methodDescribe = getMethodDescribe("getById");
|
||||
// LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, id);
|
||||
// DictTree result = dictTreeService.queryById(id);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
// }
|
||||
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @GetMapping("/getByPid")
|
||||
// @ApiOperation("根据pid查询字典树")
|
||||
// public HttpResult<List<DictTreeVO>> getByPid(@RequestParam("pid") String pid) {
|
||||
// String methodDescribe = getMethodDescribe("getByPid");
|
||||
// LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, pid);
|
||||
// List<DictTreeVO> result = dictTreeService.queryByPid(pid);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
// }
|
||||
|
||||
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/queryLastLevelById")
|
||||
// @ApiOperation("根据id查询字典树最底层")
|
||||
// public HttpResult<List<DictTreeVO>> queryLastLevelById(@RequestParam("id") String id) {
|
||||
// String methodDescribe = getMethodDescribe("queryLastLevelById");
|
||||
// LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, id);
|
||||
// List<DictTreeVO> result = dictTreeService.queryLastLevelById(id);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
// }
|
||||
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @GetMapping("/queryAll")
|
||||
// @ApiOperation("查询所有树形字典")
|
||||
// public HttpResult<List<DictTree>> queryAll() {
|
||||
// String methodDescribe = getMethodDescribe("queryAll");
|
||||
// List<DictTree> result = dictTreeService.queryAll();
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @GetMapping("/queryAllByType")
|
||||
// @ApiOperation("分类查询所有树形字典")
|
||||
// public HttpResult<List<DictTree>> queryAllByType(@RequestParam("type")Integer type) {
|
||||
// String methodDescribe = getMethodDescribe("queryAll");
|
||||
// List<DictTree> result = dictTreeService.queryAllByType(type);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,14 +65,14 @@ public class DictTypeController extends BaseController {
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增字典类型")
|
||||
@ApiImplicitParam(name = "dictTypeParam", value = "字典类型数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated DictTypeParam dictTypeParam) {
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated DictTypeParam dictTypeParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},字典类型数据为:{}", methodDescribe, dictTypeParam);
|
||||
boolean result = dictTypeService.addDictType(dictTypeParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,14 +80,14 @@ public class DictTypeController extends BaseController {
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改字典类型")
|
||||
@ApiImplicitParam(name = "updateParam", value = "字典类型数据", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated DictTypeParam.UpdateParam updateParam) {
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated DictTypeParam.UpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},字典类型数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = dictTypeService.updateDictType(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,14 +95,14 @@ public class DictTypeController extends BaseController {
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除字典类型")
|
||||
@ApiImplicitParam(name = "ids", value = "字典索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},字典ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||
boolean result = dictTypeService.deleteDictType(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface IDictTreeService extends IService<DictTree> {
|
||||
|
||||
/**
|
||||
* 初始化缓存设备树
|
||||
*/
|
||||
//void refreshDictTreeCache();
|
||||
|
||||
/**
|
||||
* 根据code查询字典树
|
||||
*
|
||||
@@ -49,32 +44,16 @@ public interface IDictTreeService extends IService<DictTree> {
|
||||
*/
|
||||
DictTree queryById(String id);
|
||||
|
||||
//DictTreeVO queryByCode(String code);
|
||||
|
||||
//List<DictTreeVO> queryByPid(String pid);
|
||||
|
||||
//List<DictTreeVO> queryLastLevelById(String id);
|
||||
|
||||
/**
|
||||
* 查询所有字典树
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DictTree> queryTree();
|
||||
|
||||
/**
|
||||
* 查询所有树形字典
|
||||
* 根据字典树id查询字典树
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/12/18
|
||||
*/
|
||||
//List<DictTree> queryAll();
|
||||
|
||||
/**
|
||||
* 分类查询所有树形字典
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/12/18
|
||||
*/
|
||||
//List<DictTree> queryAllByType(Integer type);
|
||||
|
||||
/**
|
||||
* 根据字典树
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -34,15 +34,6 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> implements IDictTreeService {
|
||||
|
||||
//private final RedisUtil redisUtil;
|
||||
|
||||
// @Override
|
||||
// public void refreshDictTreeCache () {
|
||||
// LambdaQueryWrapper<DictTree> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(DictTree::getState, DictConst.ENABLE);
|
||||
// List<DictTree> list = this.list(queryWrapper);
|
||||
// redisUtil.saveByKey(AppRedisKey.DICT_TREE, list);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<DictTree> getTreeByCode(String code) {
|
||||
@@ -52,7 +43,6 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
dictTree = dictTree.stream().filter(item -> item.getCode().equals(code)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//this.filterTreeByName(dictTree, keyword);
|
||||
return dictTree;
|
||||
}
|
||||
|
||||
@@ -83,9 +73,6 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
}
|
||||
dictTree.setState(DictConst.ENABLE);
|
||||
result = this.save(dictTree);
|
||||
// if (result) {
|
||||
// refreshDictTreeCache();
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -99,9 +86,6 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
checkRepeat(param, true);
|
||||
DictTree copyDictTree = new DictTree();
|
||||
BeanUtils.copyProperties(param, copyDictTree);
|
||||
// if (result) {
|
||||
// refreshDictTreeCache();
|
||||
// }
|
||||
return this.updateById(copyDictTree);
|
||||
}
|
||||
|
||||
@@ -117,9 +101,6 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
List<DictTree> childrenList = this.lambdaQuery().eq(DictTree::getState, DictConst.ENABLE).eq(DictTree::getPid, id).list();
|
||||
if (CollectionUtils.isEmpty(childrenList)) {
|
||||
result = this.lambdaUpdate().set(DictTree::getState, DictConst.DELETE).in(DictTree::getId, id).update();
|
||||
// if (result) {
|
||||
// refreshRolesFunctionsCache();
|
||||
// }
|
||||
} else {
|
||||
throw new BusinessException(SystemResponseEnum.EXISTS_CHILDREN_NOT_DELETE);
|
||||
}
|
||||
@@ -131,43 +112,6 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
return this.lambdaQuery().eq(DictTree::getId, id).eq(DictTree::getState, DictConst.ENABLE).one();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public DictTreeVO queryByCode(String code) {
|
||||
// LambdaQueryWrapper<DictTree> query = new LambdaQueryWrapper<>();
|
||||
// query.clear();
|
||||
// query.eq(DictTree::getCode, code).eq(DictTree::getState, DictConst.ENABLE);
|
||||
// DictTree result = this.getOne(query);
|
||||
// if (result != null) {
|
||||
// DictTreeVO resultVO = new DictTreeVO();
|
||||
// BeanUtils.copyProperties(result, resultVO);
|
||||
// return resultVO;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public List<DictTreeVO> queryByPid(String pid) {
|
||||
// List<DictTreeVO> collect = new ArrayList<>();
|
||||
// LambdaQueryWrapper<DictTree> query = new LambdaQueryWrapper<>();
|
||||
// query.eq(DictTree::getPid, pid).eq(DictTree::getState, DictConst.ENABLE).orderByDesc(DictTree::getSort);
|
||||
// List<DictTree> resultList = this.list(query);
|
||||
// DictTree byId = this.getById(pid);
|
||||
// if (CollUtil.isNotEmpty(resultList)) {
|
||||
// collect = resultList.stream().map(temp -> {
|
||||
// DictTreeVO resultVO = new DictTreeVO();
|
||||
// BeanUtils.copyProperties(temp, resultVO);
|
||||
// resultVO.setPname(Objects.nonNull(byId) ? byId.getName() : "最高级");
|
||||
// return resultVO;
|
||||
// }).collect(Collectors.toList());
|
||||
// }
|
||||
// return collect;
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public List<DictTreeVO> queryLastLevelById(String id) {
|
||||
// return this.baseMapper.queryLastLevelById(id);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<DictTree> queryTree() {
|
||||
LambdaQueryWrapper<DictTree> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -193,19 +137,6 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<DictTree> queryAll() {
|
||||
// LambdaQueryWrapper<DictTree> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(DictTree::getState, DictConst.ENABLE);
|
||||
// return this.list(lambdaQueryWrapper);
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public List<DictTree> queryAllByType(Integer type) {
|
||||
// LambdaQueryWrapper<DictTree> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(DictTree::getState, DictConst.ENABLE).eq(DictTree::getType, type);
|
||||
// return this.list(lambdaQueryWrapper);
|
||||
// }
|
||||
private void checkRepeat(DictTreeParam dictTreeParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<DictTree> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(DictTree::getPid, dictTreeParam.getPid()) // 同一父节点下不能有相同的code
|
||||
|
||||
@@ -12,62 +12,15 @@ public enum SystemResponseEnum {
|
||||
|
||||
/**
|
||||
* 系统模块异常响应码的范围:
|
||||
* A00350 ~ A00449
|
||||
* A01000 ~ A01
|
||||
*/
|
||||
SYSTEM_COMMON_ERROR("A00350", "系统模块异常"),
|
||||
DICT_TYPE_REPEAT("A00351", "字典类型名称或编码重复"),
|
||||
DICT_DATA_REPEAT("A00352", "字典数据名称或编码重复"),
|
||||
AREA_CODE_REPEAT("A00353", "行政区域编码重复"),
|
||||
LOAD_TYPE_EMPTY("A00354", "用能负荷数据为空"),
|
||||
LINE_MARK_EMPTY("A00355", "字典监测点评分等级数据为空"),
|
||||
VOLTAGE_EMPTY("A00356", "查询字典电压等级数据为空"),
|
||||
|
||||
INTERFERENCE_EMPTY("A00356", "查询字典干扰源类型数据为空"),
|
||||
BUSINESS_EMPTY("A00356", "查询字典行业类型数据为空"),
|
||||
SYSTEM_TYPE_EMPTY("A00356", "查询字典系统类型数据为空"),
|
||||
DEV_TYPE_EMPTY("A00357", "查询字典设备类型数据为空"),
|
||||
MANUFACTURER("A00358", "查询字典终端厂家数据为空"),
|
||||
DEV_VARIETY("A00359", "查询字典终端类型数据为空"),
|
||||
|
||||
/*pms*/
|
||||
LINE_TYPE_VARIETY_EMPTY("A00360", "查询字典监测点类型数据为空"),
|
||||
LINE_STATE_EMPTY("A00361", "查询字典监测点状态为空"),
|
||||
LINE_TYPE_EMPTY("A00362", "查询字典监测点类型状态为空"),
|
||||
POTENTIAL_TYPE_EMPTY("A00363", "查询字典电压互感器类型为空"),
|
||||
Neutral_Mode_EMPTY("A00364", "查询字典中性点接地方式为空"),
|
||||
MONITOR_TAG_EMPTY("A00365", "查询字典监测点标签类型为空"),
|
||||
MONITORY_TYPE_EMPTY("A00366", "查询字典监测对象类型为空"),
|
||||
TERMINAL_WIRING_EMPTY("A00367", "查询字典监测终端接线方式为空"),
|
||||
MONITOR_TYPE_EMPTY("A00368", "查询字典监测点类别为空"),
|
||||
ACTIVATED_STATE("A00369", "必须存在一个已激活的系统类型"),
|
||||
ADVANCE_REASON("A00370", "查询字典暂降原因为空"),
|
||||
EFFECT_STATUS_EMPTY("A00370", "查询字典实施状态为空"),
|
||||
|
||||
EVENT_REPORT_REPEAT("A00361", "暂态报告模板重复"),
|
||||
NOT_EXISTED("A00361", "您查询的该条记录不存在"),
|
||||
TIMER_NO_CLASS("A00361", "请检查定时任务是否添加"),
|
||||
|
||||
/**
|
||||
* 定时任务执行类不存在
|
||||
*/
|
||||
TIMER_NOT_EXISTED("A00361", "定时任务执行类不存在"),
|
||||
EXE_EMPTY_PARAM("A00361", "请检查定时器的id,定时器cron表达式,定时任务是否为空!"),
|
||||
|
||||
DICT_PQ_NAME_EXIST("A00389", "当前数据模型及相别下已存在相同名称"),
|
||||
EXISTS_CHILDREN_NOT_DELETE("A00390", "当前字典下存在子字典,不能删除"),
|
||||
|
||||
/**
|
||||
* 审计日志模块异常响应
|
||||
*/
|
||||
NOT_FIND_FILE("A0300", "文件未备份或者备份文件为空,请先备份文件"),
|
||||
LOG_EXCEPTION("A0301", "导入旧日志文件异常"),
|
||||
LOG_EXCEPTION_TIME("A0302", "导入旧日志文件异常:缺少时间范围"),
|
||||
DELETE_DATA("A0303", "导入旧日志文件异常:删除数据失败"),
|
||||
MULTIPLE_CLICKS_LOG_FILE_WRITER("A0304", "当前文件备份数据未结束,请勿多次点击"),
|
||||
MULTIPLE_CLICKS_RECOVER_LOG_FILE("A0303", "当前文件恢复数据未结束,请勿多次点击"),
|
||||
CODE_REPEAT("A0305", "该层级下已存在相同的编码"),
|
||||
CAN_NOT_DELETE_USED_DICT("A0306", "该字典在使用中,不能删除"),
|
||||
CAN_NOT_UPDATE_USED_DICT("A0307", "该字典在使用中,不能修改");
|
||||
DICT_TYPE_REPEAT("A01000", "字典类型名称或编码重复"),
|
||||
DICT_DATA_REPEAT("A01002", "字典数据名称或编码重复"),
|
||||
DICT_PQ_NAME_EXIST("A01003", "当前数据模型及相别下已存在相同名称"),
|
||||
EXISTS_CHILDREN_NOT_DELETE("A01004", "当前字典下存在子字典,不能删除"),
|
||||
CODE_REPEAT("A01005", "该层级下已存在相同的编码"),
|
||||
CAN_NOT_DELETE_USED_DICT("A01006", "该字典在使用中,不能删除"),
|
||||
CAN_NOT_UPDATE_USED_DICT("A01007", "该字典在使用中,不能修改");
|
||||
|
||||
private final String code;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user