|
@@ -1,9 +1,11 @@
|
|
|
package org.springblade.manager.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import org.redisson.api.RedissonClient;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.secure.BladeUser;
|
|
@@ -92,17 +94,16 @@ public class WbsTreeSynchronousRecordServiceImpl extends ServiceImpl<WbsTreeSync
|
|
|
ProjectInfo tempProject = projectInfoMapper.selectOne(Wrappers.<ProjectInfo>lambdaQuery()
|
|
|
.eq(ProjectInfo::getId, mWbsTreeSynchronousRecord.getTemplateId()));
|
|
|
//当前项目绑定的是公有模板还是私有项目
|
|
|
- if(mWbsTreeSynchronousRecord.getRange() == 1 && tempProject == null && (
|
|
|
- mWbsTreeSynchronousRecord.getType().contains("2")||
|
|
|
- mWbsTreeSynchronousRecord.getType().contains("3")||
|
|
|
- mWbsTreeSynchronousRecord.getType().contains("4")||
|
|
|
- mWbsTreeSynchronousRecord.getType().contains("5")||
|
|
|
- mWbsTreeSynchronousRecord.getType().contains("6"))){
|
|
|
+ if (mWbsTreeSynchronousRecord.getRange() == 1 && tempProject == null && (
|
|
|
+ mWbsTreeSynchronousRecord.getType().contains("2") ||
|
|
|
+ mWbsTreeSynchronousRecord.getType().contains("3") ||
|
|
|
+ mWbsTreeSynchronousRecord.getType().contains("4") ||
|
|
|
+ mWbsTreeSynchronousRecord.getType().contains("5") ||
|
|
|
+ mWbsTreeSynchronousRecord.getType().contains("6"))) {
|
|
|
throw new ServiceException("模板为公共模板,无法选择");
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
//获取项目名称
|
|
|
ProjectInfo projectInfo = projectInfoMapper.selectById(mWbsTreeSynchronousRecord.getProjectId());
|
|
|
if (projectInfo == null) {
|
|
@@ -213,21 +214,56 @@ public class WbsTreeSynchronousRecordServiceImpl extends ServiceImpl<WbsTreeSync
|
|
|
if (isPublic) {
|
|
|
//公共项目
|
|
|
WbsInfo wbsInfo = wbsInfoMapper.selectById(wbsTreePrivate.getWbsId());
|
|
|
- WbsTreeSynchronousRecordVo wbsTreeSynchronousRecordVo = new WbsTreeSynchronousRecordVo();
|
|
|
- wbsTreeSynchronousRecordVo.setId(Long.valueOf(nodeId));
|
|
|
- wbsTreeSynchronousRecordVo.setName(wbsInfo.getWbsName());
|
|
|
- wbsTreeSynchronousRecordVo.setType(1);
|
|
|
- list.add(wbsTreeSynchronousRecordVo);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<ProjectInfo> wrapper = Wrappers.<ProjectInfo>lambdaQuery();
|
|
|
+ wrapper.eq(ProjectInfo::getIsDeleted, 0);
|
|
|
+ //查询所有公共项目下的项目
|
|
|
+ if ("1".equals(wbsTreePrivate.getWbsType())) {
|
|
|
+ //质检
|
|
|
+ wrapper.eq(ProjectInfo::getReferenceWbsTemplateId, wbsInfo.getId());
|
|
|
+ } else if ("2".equals(wbsTreePrivate.getWbsType())) {
|
|
|
+ //试验
|
|
|
+ wrapper.eq(ProjectInfo::getReferenceWbsTemplateIdTrial, wbsInfo.getId());
|
|
|
+ } else if ("3".equals(wbsTreePrivate.getWbsType())) {
|
|
|
+ //计量
|
|
|
+ wrapper.eq(ProjectInfo::getReferenceWbsTemplateIdMeter, wbsInfo.getId());
|
|
|
+ } else if ("4".equals(wbsTreePrivate.getWbsType())) {
|
|
|
+ //日志
|
|
|
+ wrapper.eq(ProjectInfo::getReferenceLogWbsTemplateId, wbsInfo.getId());
|
|
|
+ } else if ("5".equals(wbsTreePrivate.getWbsType())) {
|
|
|
+ //征拆
|
|
|
+ wrapper.eq(ProjectInfo::getReferenceWbsTemplateIdLar, wbsInfo.getId());
|
|
|
+ }
|
|
|
+ List<ProjectInfo> projectInfos = projectInfoMapper.selectList(wrapper);
|
|
|
+ for (ProjectInfo info : projectInfos) {
|
|
|
+ WbsTreeSynchronousRecordVo wbsTreeSynchronousRecordVo = new WbsTreeSynchronousRecordVo();
|
|
|
+ wbsTreeSynchronousRecordVo.setId(info.getId());
|
|
|
+ wbsTreeSynchronousRecordVo.setName(info.getProjectName());
|
|
|
+ wbsTreeSynchronousRecordVo.setType(2);
|
|
|
+ wbsTreeSynchronousRecordVo.setWbsId(String.valueOf(wbsInfo.getId()));
|
|
|
+ list.add(wbsTreeSynchronousRecordVo);
|
|
|
+
|
|
|
+ }
|
|
|
return list;
|
|
|
} else {
|
|
|
WbsTreePrivate wbsTreePrivate1 = wbsTreePrivateMapper.selectById(wbsTreePrivate.getWbsId());
|
|
|
- ProjectInfo projectInfo1 = projectInfoMapper.selectById(wbsTreePrivate1.getProjectId());
|
|
|
- WbsTreeSynchronousRecordVo wbsTreeSynchronousRecordVo = new WbsTreeSynchronousRecordVo();
|
|
|
- wbsTreeSynchronousRecordVo.setId(projectInfo1.getId());
|
|
|
- wbsTreeSynchronousRecordVo.setName(projectInfo1.getProjectName());
|
|
|
- wbsTreeSynchronousRecordVo.setType(2);
|
|
|
- wbsTreeSynchronousRecordVo.setWbsId(wbsTreePrivate1.getWbsId());
|
|
|
- list.add(wbsTreeSynchronousRecordVo);
|
|
|
+
|
|
|
+ //查询私有下的项目
|
|
|
+ List<WbsTreePrivate> list1 = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
+ .select(WbsTreePrivate::getProjectId)
|
|
|
+ .eq(WbsTreePrivate::getWbsId, wbsTreePrivate.getWbsId())
|
|
|
+ .isNotNull(WbsTreePrivate::getProjectId)
|
|
|
+ .eq(WbsTreePrivate::getParentId, 0));
|
|
|
+ for (WbsTreePrivate treePrivate : list1) {
|
|
|
+ ProjectInfo projectInfo2 = projectInfoMapper.selectById(treePrivate.getProjectId());
|
|
|
+ WbsTreeSynchronousRecordVo wbsTreeSynchronousRecordVo = new WbsTreeSynchronousRecordVo();
|
|
|
+ wbsTreeSynchronousRecordVo.setId(projectInfo2.getId());
|
|
|
+ wbsTreeSynchronousRecordVo.setName(projectInfo2.getProjectName());
|
|
|
+ wbsTreeSynchronousRecordVo.setType(2);
|
|
|
+ wbsTreeSynchronousRecordVo.setWbsId(wbsTreePrivate.getWbsId());
|
|
|
+ list.add(wbsTreeSynchronousRecordVo);
|
|
|
+ }
|
|
|
+
|
|
|
return getTempProject(nodeId, wbsTreePrivate1, list);
|
|
|
}
|
|
|
}
|