use of com.paascloud.provider.model.domain.MdcDict in project paascloud-master by paascloud.
the class MdcDictServiceImpl method getAllParentDictFolderByMenuId.
private List<MdcDict> getAllParentDictFolderByMenuId(Long dictId) {
MdcDict mdcDictQuery = new MdcDict();
mdcDictQuery.setId(dictId);
mdcDictQuery = mapper.selectOne(mdcDictQuery);
List<MdcDict> mdcDictList = Lists.newArrayList();
mdcDictList = buildParentNote(mdcDictList, mdcDictQuery);
return mdcDictList;
}
use of com.paascloud.provider.model.domain.MdcDict in project paascloud-master by paascloud.
the class MdcDictServiceImpl method checkDictHasChildDict.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public boolean checkDictHasChildDict(Long dictId) {
logger.info("检查数据字典id={}是否存在生效节点", dictId);
MdcDict uacMenu = new MdcDict();
uacMenu.setStatus(MdcDictStatusEnum.ENABLE.getType());
uacMenu.setPid(dictId);
return mapper.selectCount(uacMenu) > 0;
}
use of com.paascloud.provider.model.domain.MdcDict in project paascloud-master by paascloud.
the class MdcDictServiceImpl method buildNode.
/**
* 递归获取菜单的子节点
*/
private List<MdcDict> buildNode(List<MdcDict> mdcDictList, MdcDict uacMenu, int dictStatus) {
List<MdcDict> uacMenuQueryList = mapper.select(uacMenu);
MdcDict uacMenuQuery;
for (MdcDict dict : uacMenuQueryList) {
if (dictStatus == dict.getStatus()) {
mdcDictList.add(dict);
}
uacMenuQuery = new MdcDict();
uacMenuQuery.setPid(dict.getId());
buildNode(mdcDictList, uacMenuQuery, dictStatus);
}
return mdcDictList;
}
use of com.paascloud.provider.model.domain.MdcDict in project paascloud-master by paascloud.
the class MdcDictServiceImpl method saveMdcDict.
@Override
public void saveMdcDict(MdcDict mdcDict, LoginAuthDto loginAuthDto) {
Long pid = mdcDict.getPid();
mdcDict.setUpdateInfo(loginAuthDto);
MdcDict parentMenu = mapper.selectByPrimaryKey(pid);
if (PublicUtil.isEmpty(parentMenu)) {
throw new MdcBizException(ErrorCodeEnum.MDC10021020, pid);
}
if (mdcDict.isNew()) {
MdcDict updateMenu = new MdcDict();
updateMenu.setId(pid);
Long dictId = super.generateId();
mdcDict.setId(dictId);
mapper.insertSelective(mdcDict);
} else {
mapper.updateByPrimaryKeySelective(mdcDict);
}
}
use of com.paascloud.provider.model.domain.MdcDict in project paascloud-master by paascloud.
the class MdcDictMainController method saveDict.
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "编辑字典")
public Wrapper saveDict(@ApiParam(name = "saveDict", value = "编辑字典") @RequestBody MdcEditDictDto mdcDictAddDto) {
MdcDict mdcDict = new MdcDict();
LoginAuthDto loginAuthDto = getLoginAuthDto();
BeanUtils.copyProperties(mdcDictAddDto, mdcDict);
mdcDictService.saveMdcDict(mdcDict, loginAuthDto);
return WrapMapper.ok();
}
Aggregations