|
|
@@ -307,37 +307,18 @@ public class NodeAttachmentController extends BaseController {
|
|
|
NodeAttachment nodeAttachment = null;
|
|
|
TdgyRes tdgyRes = tdgyService.getById(nodeId);
|
|
|
if (Objects.nonNull(tdgyRes)) {
|
|
|
- String dbGdType = tdgyRes.getGdType();
|
|
|
- //如果当前类型与库中一致,则直接取
|
|
|
- if(("出让".equals(dbGdType) && "1".equals(gdType)) || ("划拨".equals(dbGdType) && "2".equals(gdType))){
|
|
|
- // 1.如果出让
|
|
|
- nodeAttachment = nodeAttachmentService.getByNodeId(nodeId);
|
|
|
- //增加一条空目录结构
|
|
|
- if (Objects.isNull(nodeAttachment)) {
|
|
|
- nodeAttachmentService.addDefaultAttachment(projectId, nodeId,gdType);
|
|
|
- }
|
|
|
- //这里重新获取依赖关系
|
|
|
- nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
|
|
|
- }else {
|
|
|
- //1.先删除当前节点
|
|
|
- nodeAttachmentService.deleteByNodeId(nodeId);
|
|
|
- nodeAttachmentService.addDefaultAttachment(projectId,nodeId,gdType);
|
|
|
- //这里重新获取依赖关系
|
|
|
- nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
|
|
|
- }
|
|
|
+ //1.先删除当前节点
|
|
|
+ nodeAttachmentService.deleteByNodeId(nodeId);
|
|
|
+ nodeAttachmentService.addDefaultAttachment(projectId,nodeId,gdType);
|
|
|
+ //这里重新获取依赖关系
|
|
|
+ nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
|
|
|
}
|
|
|
return R.ok(nodeAttachment);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("初始化附件信息异常", e);
|
|
|
return R.fail(502,"初始化附件信息异常:" + e.getMessage());
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|