|
@@ -480,11 +480,25 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
wbsTreeZi.setId(SnowFlakeUtil.getId());
|
|
wbsTreeZi.setId(SnowFlakeUtil.getId());
|
|
wbsTreeZi.setTenantId(AuthUtil.getTenantId());
|
|
wbsTreeZi.setTenantId(AuthUtil.getTenantId());
|
|
wbsTreeZi.setDeptName(maps.getValue());
|
|
wbsTreeZi.setDeptName(maps.getValue());
|
|
|
|
+ wbsTreeZi.setFullName(maps.getValue());
|
|
wbsTreeZi.setDeptCategory(Integer.valueOf(maps.getKey()));
|
|
wbsTreeZi.setDeptCategory(Integer.valueOf(maps.getKey()));
|
|
wbsTreeZi.setWbsId(wbsTreeFu.getWbsId());
|
|
wbsTreeZi.setWbsId(wbsTreeFu.getWbsId());
|
|
wbsTreeZi.setParentId(wbsTreeFu.getParentId());
|
|
wbsTreeZi.setParentId(wbsTreeFu.getParentId());
|
|
wbsTreeZi.setAncestors(wbsTreeFu.getAncestors());
|
|
wbsTreeZi.setAncestors(wbsTreeFu.getAncestors());
|
|
wbsTreeZi.setProjectNodeId(wbsTree1.getProjectNodeId());
|
|
wbsTreeZi.setProjectNodeId(wbsTree1.getProjectNodeId());
|
|
|
|
+ wbsTreeZi.setMajorDataType(0);
|
|
|
|
+ //内页资料
|
|
|
|
+ if (wbsTreeZi.getDeptCategory() == 6 && !(("中间交工证书").equals(wbsTreeZi.getDeptName()) || ("分项工程质量检验评定表").equals(wbsTreeZi.getDeptName()) || ("分项工程开工报告").equals(wbsTreeZi.getDeptName()))) {
|
|
|
|
+ wbsTreeZi.setMajorDataType(4);
|
|
|
|
+ }else if (wbsTreeZi.getDeptCategory() == 5 || wbsTreeZi.getDeptCategory() == 4 || wbsTreeZi.getDeptCategory() == 3 || wbsTreeZi.getDeptCategory() == 2) {
|
|
|
|
+ if (getContains(wbsTreeZi.getDeptName(),"开工报告")) {
|
|
|
|
+ wbsTreeZi.setMajorDataType(1);
|
|
|
|
+ } else if (getContains(wbsTreeZi.getDeptName(),"质量评定")) {
|
|
|
|
+ wbsTreeZi.setMajorDataType(2);
|
|
|
|
+ } else if (getContains(wbsTreeZi.getDeptName(),"中间交工")) {
|
|
|
|
+ wbsTreeZi.setMajorDataType(3);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
//构建参数
|
|
//构建参数
|
|
WbsTree wbsTree = buildTreeNode(wbsTreeZi, allNodeData);
|
|
WbsTree wbsTree = buildTreeNode(wbsTreeZi, allNodeData);
|
|
@@ -530,7 +544,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
&& tree.getDeptCategory().equals(wbsTreeZi.getDeptCategory())
|
|
&& tree.getDeptCategory().equals(wbsTreeZi.getDeptCategory())
|
|
&& tree.getProjectNodeId().equals(wbsTreeZi.getProjectNodeId())) {
|
|
&& tree.getProjectNodeId().equals(wbsTreeZi.getProjectNodeId())) {
|
|
//判断上级节点不同,当前节点名相同的tree选择问题
|
|
//判断上级节点不同,当前节点名相同的tree选择问题
|
|
- //例如:第X跨的上级有上部构造现场浇筑、上部构造预制和安装,导致下方新增重复节点判断时找到的是前一个
|
|
|
|
|
|
+ //例如:第X跨的上级有上部构造现场浇筑、上部构造预制和安装,导致下方新增重复节点判断时找到的是前一个 TODO
|
|
if (!tree.getAncestors().equals(wbsTreeZi.getAncestors())) {
|
|
if (!tree.getAncestors().equals(wbsTreeZi.getAncestors())) {
|
|
wbsTrees.add(tree);
|
|
wbsTrees.add(tree);
|
|
break;
|
|
break;
|
|
@@ -543,7 +557,6 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
if (wbsTrees.size() <= 0) {
|
|
if (wbsTrees.size() <= 0) {
|
|
wbsTreeZi.setStatus(1);
|
|
wbsTreeZi.setStatus(1);
|
|
wbsTreeZi.setType(1);
|
|
wbsTreeZi.setType(1);
|
|
- wbsTreeZi.setMajorDataType(0);
|
|
|
|
if (wbsTreeZi.getDeptCategory() == 6) {
|
|
if (wbsTreeZi.getDeptCategory() == 6) {
|
|
wbsTreeZi.setIsConcrete(0);
|
|
wbsTreeZi.setIsConcrete(0);
|
|
wbsTreeZi.setIsExpernode(0);
|
|
wbsTreeZi.setIsExpernode(0);
|
|
@@ -556,7 +569,6 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
if (!wbsTreeZi.getParentId().equals(tree.getParentId()) && wbsTreeZi.getDeptName().equals(tree.getDeptName())) {
|
|
if (!wbsTreeZi.getParentId().equals(tree.getParentId()) && wbsTreeZi.getDeptName().equals(tree.getDeptName())) {
|
|
wbsTreeZi.setStatus(1);
|
|
wbsTreeZi.setStatus(1);
|
|
wbsTreeZi.setType(1);
|
|
wbsTreeZi.setType(1);
|
|
- wbsTreeZi.setMajorDataType(0);
|
|
|
|
if (wbsTreeZi.getDeptCategory() == 6) {
|
|
if (wbsTreeZi.getDeptCategory() == 6) {
|
|
wbsTreeZi.setIsConcrete(0);
|
|
wbsTreeZi.setIsConcrete(0);
|
|
wbsTreeZi.setIsExpernode(0);
|
|
wbsTreeZi.setIsExpernode(0);
|
|
@@ -570,6 +582,24 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
return wbsTree;
|
|
return wbsTree;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private boolean getContains(String A,String B){
|
|
|
|
+ boolean result = false;
|
|
|
|
+ char[] arrayA = A.toCharArray();
|
|
|
|
+ char[] arrayB = B.toCharArray();
|
|
|
|
+ int intLen = 0;
|
|
|
|
+ for(int i = 0;i < arrayB.length;i++){
|
|
|
|
+ for(int j = 0;j < arrayA.length;j++){
|
|
|
|
+ if(arrayB[i] == arrayA[j]){
|
|
|
|
+ intLen++;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(intLen == arrayB.length)
|
|
|
|
+ result = true;
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public int deleteBatchByProjectNodeId(Long projectNodeId) {
|
|
public int deleteBatchByProjectNodeId(Long projectNodeId) {
|
|
return baseMapper.deleteBatchProjectNodeId(projectNodeId);
|
|
return baseMapper.deleteBatchProjectNodeId(projectNodeId);
|
|
@@ -985,7 +1015,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
|
|
|
//2.新增
|
|
//2.新增
|
|
if (saveIds.size() > 0) {
|
|
if (saveIds.size() > 0) {
|
|
- if (saveIds.size() >= 1000){ //新增1000个以上节点时,防止响应过慢重复提交
|
|
|
|
|
|
+ if (saveIds.size() >= 1000) { //新增1000个以上节点时,防止响应过慢重复提交
|
|
//获取Redis的Value
|
|
//获取Redis的Value
|
|
String redisValue = bladeRedis.get("submit-wbs-project:" + pawDTO.getProjectId());
|
|
String redisValue = bladeRedis.get("submit-wbs-project:" + pawDTO.getProjectId());
|
|
if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|