提交 120d9169 authored 作者: yucaiwei's avatar yucaiwei

--no commit message

上级 c6ed7f10
......@@ -233,7 +233,7 @@ public class AuthorLibraryController {
List<ResourceRelation> recordList = new ArrayList<ResourceRelation>();
for (int i = 0; i < entity.getResourceIds().size(); i++) {
List<ResourceRelation> list = resourceRelationService.queryByid(entity.getId(),entity.getResourceIds().get(i));
if(list.size()==0) {
if(list==null || list.size()==0) {
ResourceRelation e = new ResourceRelation();
e.setObjectId(entity.getId());
e.setResourceId(entity.getResourceIds().get(i));
......@@ -245,10 +245,10 @@ public class AuthorLibraryController {
}else{
e.setSort(1);
}
recordList.add(e);
resourceRelationService.insert(e);
}
}
return CallBack.success(resourceRelationService.insertList(recordList));
return CallBack.success(true);
}
@ApiOperation(value = "批量删除关联资源", notes = "批量删除")
......
......@@ -67,6 +67,12 @@ public class DiyTypeController {
/*if(entity.getParentId().equals(0) && AllResourceTypeEnum.getCode(entity.getTypeName()) == null){
throw new BusinessValidateException("分类名称错误");
}*/
if(StringUtils.isNotBlank(entity.getOldCode())){
CallBack<Boolean> result = isExistOldCodeBoolean(null, entity.getOldCode());
if(result.hasEntity() && result.getData()){
throw new BusinessValidateException("旧编码已存在");
}
}
//分页排序查询当前子分类最大code值
example = service.createExample();
example.createCriteria().andEqualTo("parentId", entity.getParentId());
......@@ -108,6 +114,12 @@ public class DiyTypeController {
/*if(entity.getParentId() == 0 && AllResourceTypeEnum.getCode(entity.getTypeName()) == null){
throw new BusinessValidateException("分类名称错误");
}*/
if(StringUtils.isNotBlank(entity.getOldCode())){
CallBack<Boolean> result = isExistOldCodeBoolean(entity.getId(), entity.getOldCode());
if(result.hasEntity() && result.getData()){
throw new BusinessValidateException("旧编码已存在");
}
}
DiyType old = service.selectByPrimaryKey(entity.getId());
entity.setCreateTime(old.getCreateTime());
entity.setCode(old.getCode());
......
......@@ -77,14 +77,15 @@ public class DiyTypeRecommendController {
a.setCreateTime(new Date());
Integer maxOrderNum = service.getMaxOrderNum(arf.getCode());
a.setSortNum(maxOrderNum+1);
service.insert(a);
}, obj -> !hasList.contains(obj.getId()));
if(dtrList.size()==0) {
throw new BaseException("您选择的资源都被关联啦");
}
if (!service.insertUuidList(dtrList)) {
/*if (!service.insertUuidList(dtrList)) {
throw new BaseException("关联失败");
}
}*/
return CallBack.success("关联成功");
}
@ApiOperation(value = "查询自定义分类当前最大排序号" , notes ="查询当前最大排序号")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论