|
|
@@ -2967,7 +2967,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
public R importTree(MultipartFile file, Long pkeyId) throws IOException {
|
|
|
//最高节点
|
|
|
WbsTreeContract wbsTreeContractRoot = baseMapper.selectOne(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
@@ -3159,7 +3158,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
unit.setDateIsComplete(null);
|
|
|
unit.setPId(wbsTreeContractRoot.getPKeyId());
|
|
|
unit.setAncestorsPId(wbsTreeContractRoot.getAncestorsPId() + "," + wbsTreeContractRoot.getPKeyId());
|
|
|
- //baseMapper.insert(unit);
|
|
|
+ baseMapper.insert(unit);
|
|
|
insertList.add(unit);
|
|
|
WbsTreeContractList.add(unit);
|
|
|
}
|
|
|
@@ -3187,7 +3186,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
subUnit.setDateIsComplete(null);
|
|
|
subUnit.setPId(fatherNode.getPKeyId());
|
|
|
subUnit.setAncestorsPId(fatherNode.getAncestorsPId() + "," + fatherNode.getPKeyId());
|
|
|
- //baseMapper.insert(subUnit);
|
|
|
+ baseMapper.insert(subUnit);
|
|
|
insertList.add(subUnit);
|
|
|
WbsTreeContractList.add(subUnit);
|
|
|
}
|
|
|
@@ -3235,7 +3234,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
division.setDateIsComplete(null);
|
|
|
division.setPId(contract.getPKeyId());
|
|
|
division.setAncestorsPId(contract.getAncestorsPId() + "," + contract.getPKeyId());
|
|
|
- //baseMapper.insert(division);
|
|
|
+ baseMapper.insert(division);
|
|
|
insertList.add(division);
|
|
|
WbsTreeContractList.add(division);
|
|
|
break;
|
|
|
@@ -3290,7 +3289,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
subDivision.setDateIsComplete(null);
|
|
|
subDivision.setPId(contract.getPKeyId());
|
|
|
subDivision.setAncestorsPId(contract.getAncestorsPId() + "," + contract.getPKeyId());
|
|
|
- //baseMapper.insert(subDivision);
|
|
|
+ baseMapper.insert(subDivision);
|
|
|
insertList.add(subDivision);
|
|
|
WbsTreeContractList.add(subDivision);
|
|
|
break;
|
|
|
@@ -3348,7 +3347,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
item.setDateIsComplete(null);
|
|
|
item.setPId(contract.getPKeyId());
|
|
|
item.setAncestorsPId(contract.getAncestorsPId() + "," + contract.getPKeyId());
|
|
|
- //baseMapper.insert(item);
|
|
|
+ baseMapper.insert(item);
|
|
|
insertList.add(item);
|
|
|
WbsTreeContractList.add(item);
|
|
|
break;
|
|
|
@@ -3409,7 +3408,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
subItem.setDateIsComplete(null);
|
|
|
subItem.setPId(contract.getPKeyId());
|
|
|
subItem.setAncestorsPId(contract.getAncestorsPId() + "," + contract.getPKeyId());
|
|
|
- //baseMapper.insert(subItem);
|
|
|
+ baseMapper.insert(subItem);
|
|
|
insertList.add(subItem);
|
|
|
WbsTreeContractList.add(subItem);
|
|
|
break;
|
|
|
@@ -3432,14 +3431,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- boolean b = this.saveBatch(insertList);
|
|
|
- if(b){
|
|
|
- bladeRedis.setEx("import:projectId:"+wbsTreeContractRoot.getProjectId()+"contractId:"+wbsTreeContractRoot.getContractId(), "100",7L);
|
|
|
- return R.success("新增了" + insertList.size() + "个节点" + "," + String.join(",", updateList) + "节点编号已被修改");
|
|
|
- }else {
|
|
|
- bladeRedis.del("import:projectId:"+wbsTreeContractRoot.getProjectId()+"contractId:"+wbsTreeContractRoot.getContractId());
|
|
|
- return R.fail("新增失败");
|
|
|
- }
|
|
|
+ bladeRedis.setEx("import:projectId:"+wbsTreeContractRoot.getProjectId()+"contractId:"+wbsTreeContractRoot.getContractId(), "100",7L);
|
|
|
+ return R.success("新增了" + insertList.size() + "个节点" + "," + String.join(",", updateList) + "节点编号已被修改");
|
|
|
} catch (IOException e) {
|
|
|
bladeRedis.del("import:projectId:"+wbsTreeContractRoot.getProjectId()+"contractId:"+wbsTreeContractRoot.getContractId());
|
|
|
return R.fail("文件处理失败: " + e.getMessage());
|