refactor(autocode): 优化文档类型属性设置逻辑

- 新增 docTypeValue 变量用于存储文档类型值
- 修改文档类型属性设置逻辑,使用 docTypeValue 替代 leftMostCodeRuleNameString
- 优化文档创建后数据集模板带出逻辑
main
熊朝柱 2 months ago
parent d3657c7e8b
commit 3415d4587c

@ -135,6 +135,7 @@ public class NewCodeItemDialog extends Dialog {
//是否为文档 //是否为文档
private boolean isDoc = false; private boolean isDoc = false;
private String leftMostCodeRuleNameString = ""; private String leftMostCodeRuleNameString = "";
private String docTypeValue = "";
// 表单类型中英文对照 // 表单类型中英文对照
private SashForm sashFormCodeView; private SashForm sashFormCodeView;
private CTabItem codeTreeCTab; private CTabItem codeTreeCTab;
@ -660,8 +661,8 @@ public class NewCodeItemDialog extends Dialog {
//20250425新增 将最左侧选中的编码规则名称写入到最右侧的文档类别中 //20250425新增 将最左侧选中的编码规则名称写入到最右侧的文档类别中
String currentPropName = cnProp.getDisplayName();//当前遍历的对象or分类属性名称 String currentPropName = cnProp.getDisplayName();//当前遍历的对象or分类属性名称
System.out.println("当前创建的UI组件Label名称="+currentPropName); System.out.println("当前创建的UI组件Label名称="+currentPropName);
if(currentPropName != null && currentPropName.equals("文档类别") && leftMostCodeRuleNameString != null && !leftMostCodeRuleNameString.equals("")){ if(currentPropName != null && currentPropName.equals("文档类型") && docTypeValue != null && !docTypeValue.equals("")){
System.out.println("“文档类别”匹配成功!属性值设置为最左侧选中编码名称="+leftMostCodeRuleNameString); System.out.println("“文档类别”匹配成功!属性值设置为最左侧选中编码名称="+docTypeValue);
isDocType = true; isDocType = true;
} }
@ -674,7 +675,7 @@ public class NewCodeItemDialog extends Dialog {
final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue());
// text.setText(cnProp.getDefaultValue()); // text.setText(cnProp.getDefaultValue());
if (isDocType){ if (isDocType){
text.setText(leftMostCodeRuleNameString); text.setText(docTypeValue);
}else { }else {
text.setText(cnProp.getDefaultValue()); text.setText(cnProp.getDefaultValue());
} }
@ -683,7 +684,7 @@ public class NewCodeItemDialog extends Dialog {
final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue());
// text.setText("0"); // text.setText("0");
if (isDocType){ if (isDocType){
text.setText(leftMostCodeRuleNameString); text.setText(docTypeValue);
}else { }else {
text.setText("0"); text.setText("0");
} }
@ -699,7 +700,7 @@ public class NewCodeItemDialog extends Dialog {
final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue());
// text.setText("0"); // text.setText("0");
if (isDocType){ if (isDocType){
text.setText(leftMostCodeRuleNameString); text.setText(docTypeValue);
}else { }else {
text.setText("0"); text.setText("0");
} }
@ -722,7 +723,7 @@ public class NewCodeItemDialog extends Dialog {
new String[] { "true", "false" }); // new new String[] { "true", "false" }); // new
// comb.setText(cnProp.getDefaultValue()); // Combo(propTable, // comb.setText(cnProp.getDefaultValue()); // Combo(propTable,
if (isDocType){ if (isDocType){
comb.setText(leftMostCodeRuleNameString); comb.setText(docTypeValue);
}else { }else {
comb.setText(cnProp.getDefaultValue()); comb.setText(cnProp.getDefaultValue());
} }
@ -1692,9 +1693,7 @@ public class NewCodeItemDialog extends Dialog {
System.out.println("第二部分: " + secondPart); System.out.println("第二部分: " + secondPart);
if (firstPart.equals(leftMostCodeRuleNameString)) { if (firstPart.equals(leftMostCodeRuleNameString)) {
//将此secondPart填入最右侧区域中的属性“文档类别”下 //将此secondPart填入最右侧区域中的属性“文档类别”下
docTypeValue = secondPart;
break; break;
}else { }else {
continue; continue;
@ -1703,12 +1702,6 @@ public class NewCodeItemDialog extends Dialog {
} else { } else {
System.out.println("字符串中未找到 = 符号。"); System.out.println("字符串中未找到 = 符号。");
} }
} }
} }
} }
@ -3227,8 +3220,15 @@ public class NewCodeItemDialog extends Dialog {
// } // }
//20250425 新增:文档创建后,根据 ID=编码规则名称 带出数据集模板 //20250425 新增:文档创建后,根据 ID=编码规则名称 带出数据集模板
if (newComp != null){ if (newComp != null && isDoc){
if (leftMostCodeRuleNameString != null && !leftMostCodeRuleNameString.isEmpty()){
//1.调用查询,获取版本对象,下载数据集到本地
//2.将本地数据集上传到新建版本对象中
}
} }
if (targetObject != null) { if (targetObject != null) {

Loading…
Cancel
Save