|
@@ -13,6 +13,7 @@ import cn.cslg.pas.common.vo.customAnalyse.SelectAnalyseVO;
|
|
import cn.cslg.pas.common.vo.customAnalyse.SelectCustomAnalyseVO;
|
|
import cn.cslg.pas.common.vo.customAnalyse.SelectCustomAnalyseVO;
|
|
import cn.cslg.pas.domain.business.CustomAnalysisItem;
|
|
import cn.cslg.pas.domain.business.CustomAnalysisItem;
|
|
import cn.cslg.pas.exception.UnLoginException;
|
|
import cn.cslg.pas.exception.UnLoginException;
|
|
|
|
+import cn.cslg.pas.exception.XiaoShiException;
|
|
import cn.cslg.pas.mapper.CustomAnalysisItemMapper;
|
|
import cn.cslg.pas.mapper.CustomAnalysisItemMapper;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
@@ -65,7 +66,7 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
|
|
try {
|
|
try {
|
|
personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new UnLoginException("未登录");
|
|
|
|
|
|
+ throw new XiaoShiException("未登录");
|
|
}
|
|
}
|
|
|
|
|
|
SelectAnalyseVO analyseVO = new SelectAnalyseVO();
|
|
SelectAnalyseVO analyseVO = new SelectAnalyseVO();
|
|
@@ -116,7 +117,7 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
|
|
.eq(CustomAnalysisItem::getName, vo.getName())
|
|
.eq(CustomAnalysisItem::getName, vo.getName())
|
|
.eq(CustomAnalysisItem::getType, vo.getType()));
|
|
.eq(CustomAnalysisItem::getType, vo.getType()));
|
|
if (items.size() > 1) {
|
|
if (items.size() > 1) {
|
|
- throw new Exception("名称不可重复");
|
|
|
|
|
|
+ throw new XiaoShiException("名称不可重复");
|
|
}
|
|
}
|
|
|
|
|
|
String uid = IdUtil.simpleUUID();
|
|
String uid = IdUtil.simpleUUID();
|
|
@@ -125,7 +126,7 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
|
|
try {
|
|
try {
|
|
personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new UnLoginException("未登录");
|
|
|
|
|
|
+ throw new XiaoShiException("未登录");
|
|
}
|
|
}
|
|
CustomAnalysisItem item = new CustomAnalysisItem();
|
|
CustomAnalysisItem item = new CustomAnalysisItem();
|
|
BeanUtils.copyProperties(vo, item);
|
|
BeanUtils.copyProperties(vo, item);
|
|
@@ -159,14 +160,14 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
|
|
.eq(CustomAnalysisItem::getName, vo.getName())
|
|
.eq(CustomAnalysisItem::getName, vo.getName())
|
|
.eq(CustomAnalysisItem::getType, vo.getType()));
|
|
.eq(CustomAnalysisItem::getType, vo.getType()));
|
|
if (items.size() > 1) {
|
|
if (items.size() > 1) {
|
|
- throw new Exception("名称不可重复");
|
|
|
|
|
|
+ throw new XiaoShiException("名称不可重复");
|
|
}
|
|
}
|
|
//获取登陆人信息 用于设置创建人
|
|
//获取登陆人信息 用于设置创建人
|
|
PersonnelVO personnelVO = new PersonnelVO();
|
|
PersonnelVO personnelVO = new PersonnelVO();
|
|
try {
|
|
try {
|
|
personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new UnLoginException("未登录");
|
|
|
|
|
|
+ throw new XiaoShiException("未登录");
|
|
}
|
|
}
|
|
|
|
|
|
CustomAnalysisItem item = customAnalysisItemMapper.selectById(vo.getId());
|
|
CustomAnalysisItem item = customAnalysisItemMapper.selectById(vo.getId());
|
|
@@ -191,7 +192,7 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
|
|
long count = this.count(new LambdaQueryWrapper<CustomAnalysisItem>()
|
|
long count = this.count(new LambdaQueryWrapper<CustomAnalysisItem>()
|
|
.eq(CustomAnalysisItem::getParentId, vo.getId()));
|
|
.eq(CustomAnalysisItem::getParentId, vo.getId()));
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
- throw new Exception("删除失败,请先删除子节点");
|
|
|
|
|
|
+ throw new XiaoShiException("删除失败,请先删除子节点");
|
|
}
|
|
}
|
|
this.removeById(vo.getId());
|
|
this.removeById(vo.getId());
|
|
itemSchemaService.deleteByUid(item.getUid());
|
|
itemSchemaService.deleteByUid(item.getUid());
|