From fb4cb0e61775b2df5e493ad4ca19402d76f8bc6f Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 18 九月 2023 16:17:39 +0800
Subject: [PATCH] 集成系统-查询修复
---
Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyFor410MainPanel.java | 114 +++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 87 insertions(+), 27 deletions(-)
diff --git a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyFor410MainPanel.java b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyFor410MainPanel.java
index c648cc4..69e582e 100644
--- a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyFor410MainPanel.java
+++ b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyFor410MainPanel.java
@@ -32,7 +32,6 @@
import java.util.*;
import java.util.List;
import java.util.regex.Pattern;
-import java.util.stream.Collectors;
public class CodeApplyFor410MainPanel extends VCIJPanel {
@@ -84,8 +83,12 @@
private StringBuffer tempStr= new StringBuffer();//鍙彉鐮佹鐨勫��;
private String levelRes="";
private String[] specialSecVals = new String[0];
- private RMDataTransmitObject transmitForRMData = null;
+ private RMDataTransmitObject transmitForRMData = new RMDataTransmitObject();
private CodeRuleVO codeRuleVO=null;
+ /**
+ * 瀛樺偍灞炴�у拰鍊肩殑Map,key,鐢ㄤ簬榛樿鍊肩殑鏄剧ず
+ */
+ private Map<String,String> displayValues = new HashMap<>();
/**
* 灞炴�D涓庡睘鎬у搴旂殑鎺т欢涔嬮棿鐨勬槧灏凪AP
*/
@@ -117,11 +120,12 @@
this.currentCodeClassifyTemplateVO=currentCodeClassifyTemplateVO;
}
- public CodeApplyFor410MainPanel(TransmitTreeObject transTreeObject,TokenUserObject tokenUserObject,String deptName,CodeClassifyTemplateVO currentCodeClassifyTemplateVO) {
+ public CodeApplyFor410MainPanel(TransmitTreeObject transTreeObject,TokenUserObject tokenUserObject,String deptName,CodeClassifyTemplateVO currentCodeClassifyTemplateVO,Map displayValues) {
this.transTreeObject = transTreeObject;
this.tokenUserObject = tokenUserObject;
this.deptName = deptName;
this.currentCodeClassifyTemplateVO=currentCodeClassifyTemplateVO;
+ this.displayValues = displayValues;
}
/**
@@ -163,8 +167,10 @@
}
}
}else{
- VCIOptionPane.showMessage(this,r.getMsg());
- }
+ if(!r.getMsg().equals("褰撳墠涓婚搴撳垎绫伙紝浠ュ強瀹冪殑鎵�鏈夌殑涓婄骇鍒嗙被閮芥病鏈夎缃紪鐮佽鍒�")){
+ VCIOptionPane.showMessage(this,r.getMsg());
+ }
+ }
/**鍔犺浇瑙勫垯瀵瑰簲鐨勭爜娈典俊鎭�**/
if(codeRuleVO!=null){
List<CodeBasicSecVO> codeBasicSecVOList=codeRuleVO.getSecVOList();
@@ -590,10 +596,10 @@
if(codeClassifyValueList.size()>1) {
secCombo.addItem(new CodeClassifyValue());
}
- codeClassifyValueList.stream().forEach(codeClassifyValue -> {
+ for (CodeClassifyValue codeClassifyValue : codeClassifyValueList) {
secCombo.addItem(codeClassifyValue);
valueOidList.add(codeClassifyValue.getOid());
- });
+ }
}
secIdTOListValueOidMap.put(secObj.getOid(),valueOidList);
/**浠g爜椤逛笅鎷変簨浠�**/
@@ -632,11 +638,11 @@
if(fixedValueVOList.size() >1) {
secCombo.addItem(new CodeFixedValue());
}
- fixedValueVOList.stream().forEach(codeFixedValueVO -> {
+ for (CodeFixedValueVO codeFixedValueVO : fixedValueVOList) {
CodeFixedValue codeFixedValue=new CodeFixedValue();
BeanUtilForVCI.copyPropertiesIgnoreCase(codeFixedValueVO,codeFixedValue);
secCombo.addItem(codeFixedValue);
- });
+ }
/**褰撶郴缁熼�夋嫨鐨勬槸鎸囧畾鐮佹鍊兼椂锛岀粍鍒唬鍙风殑鐮佹绯荤粺涓嶆樉绀� Begin**/
/*FixCodeValObject selObj = (FixCodeValObject) secCombo.getSelectedItem();
if(isSpecialRuleFlag && (secObj.getName().equals(specialControlSecName) && secValMap.containsKey(selObj.getValue())) || secValMap.containsKey(getControlSecSelectValue())) {
@@ -742,10 +748,16 @@
transmit.setRmTypeObject(codeClassify);
if(currentCodeClassifyTemplateVO!=null) {
transmit.setTemplateId(templateId);
- Map<String, CodeClassifyTemplateAttrVO> tempPropObjMapsByInnerName = currentCodeClassifyTemplateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+ Map<String, CodeClassifyTemplateAttrVO> tempPropObjMapsByInnerName = new HashMap<>();
+ for (CodeClassifyTemplateAttrVO attribute : currentCodeClassifyTemplateVO.getAttributes()) {
+ tempPropObjMapsByInnerName.put(attribute.getId().toLowerCase(Locale.ROOT),attribute);
+ }
transmit.setClassifyCode(codeClassify.getId());
transmit.setTempPropObjMapsByInnerName(tempPropObjMapsByInnerName);
- Map<String, CodeClassifyTemplateAttrVO> tempPropObjsMap = currentCodeClassifyTemplateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getOid().toLowerCase(Locale.ROOT), t -> t));
+ Map<String, CodeClassifyTemplateAttrVO> tempPropObjsMap = new HashMap<>();
+ for (CodeClassifyTemplateAttrVO attribute : currentCodeClassifyTemplateVO.getAttributes()) {
+ tempPropObjsMap.put(attribute.getOid().toLowerCase(Locale.ROOT),attribute);
+ }
transmit.setTempPropObjsMap(tempPropObjsMap);
transmit.setTemplateObject(currentCodeClassifyTemplateVO);
transmit.setTempPropObjsList(this.currentCodeClassifyTemplateVO.getAttributes());
@@ -785,7 +797,7 @@
if (index >= realAttrs.length) {
break;
}
- CodeClassifyTemplateAttrVO attrObj = realAttrs[index];
+ final CodeClassifyTemplateAttrVO attrObj = realAttrs[index];
/***濡傛灉妯℃澘閰嶇疆浜嗗紩鐢ㄦā鏉匡紝灞炴�у悕绉板垪琛ㄦ坊鍔犻摼鎺ヨ繘琛屽鐞� BEGIN**/
//ADD BY liujw
@@ -951,10 +963,19 @@
for (int i = 0; i < objs.length; i++) {
objs[i] = new AttrRangObjectWarper(keyValues[i]);
model.addElement(objs[i]);
-
specMap.put(objs[i].toString(), comboBoxIndex++);
}
cbx.setModel(model);
+ if(displayValues.containsKey(attrObj.getId())){
+// cbx.setSelectedItem(displayValues.get(attrObj.getId()));
+// cbx.setSelectedIndex(3);
+ for (int i = 0; i < objs.length; i++) {
+ if(objs[i].getKeyValue().getKey().equals(displayValues.get(attrObj.getId()))){
+ cbx.setSelectedIndex(i);
+ }
+ }
+ cbx.setEnabled(false);
+ }
compt = cbx;
}
} else if(StringUtils.isNotBlank(attrObj.getReferConfig())){//鍙傜収鐨勯渶瑕佽缃垚涓嬫媺妗嗭紝骞朵笖鍙
@@ -968,34 +989,69 @@
cbx.setModel(model);
compt = cbx;
} else { // 涓嶅瓨鍦ㄥ彇鍊艰寖鍥村垯鎸夌被鍨嬬敓鎴愪笉鍚岀殑鎺т欢
- if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTBoolean)) { // Boolean绫诲瀷
+ if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTBoolean.toString())) { // Boolean绫诲瀷
VCIJComboBox cbx = new VCIJComboBox();
DefaultComboBoxModel model = new DefaultComboBoxModel();
model.addElement("0");
model.addElement("1");
cbx.setModel(model);
+ if(displayValues.containsKey(attrObj.getId())){
+ cbx.setSelectedIndex(Integer.parseInt(displayValues.get(attrObj.getId())));
+ cbx.setEnabled(false);
+ return cbx;
+ }
compt = cbx;
- } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDate)) { // 鏃ユ湡绫诲瀷
- compt = new VCIJCalendarPanel("yyyy-MM-dd",
- attrObj.getRequireFlag().equals("true"), true, false);
- } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDateTime)) { // 鏃ユ湡绫诲瀷
- compt = new VCIJCalendarPanel("yyyy-MM-dd HH:mm:ss",
+ } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDate.toString())) { // 鏃ユ湡绫诲瀷
+ VCIJCalendarPanel aTrue = new VCIJCalendarPanel("yyyy-MM-dd",
attrObj.getRequireFlag().equals("true"), true, false);
- }else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTTime)) { // 鏃ユ湡绫诲瀷
- compt = new VCIJCalendarPanel("HH:mm:ss",
+ if(displayValues.containsKey(attrObj.getId())){
+ aTrue.setDateString(displayValues.get(attrObj.getId()));
+ aTrue.setEnabled(false);
+ return aTrue;
+ }
+ compt = aTrue;
+ } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDateTime.toString())) { // 鏃ユ湡绫诲瀷
+ VCIJCalendarPanel aTrue = new VCIJCalendarPanel("yyyy-MM-dd HH:mm:ss",
attrObj.getRequireFlag().equals("true"), true, false);
+ if(displayValues.containsKey(attrObj.getId())){
+ aTrue.setDateString(displayValues.get(attrObj.getId()));
+ aTrue.setEnabled(false);
+ return aTrue;
+ }
+ compt = aTrue;
+ }else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTTime.toString())) { // 鏃ユ湡绫诲瀷
+ VCIJCalendarPanel aTrue = new VCIJCalendarPanel("HH:mm:ss",
+ attrObj.getRequireFlag().equals("true"), true, false);
+ if(displayValues.containsKey(attrObj.getId())){
+ aTrue.setDateString(displayValues.get(attrObj.getId()));
+ aTrue.setEnabled(false);
+ return aTrue;
+ }
+ compt = aTrue;
}
- else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDouble)||attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTLong)) { // Real绫诲瀷
+ else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTDouble.toString())||attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTLong.toString())) { // Real绫诲瀷
RealTextField txt = new RealTextField("");
txt.setRequired(attrObj.getRequireFlag().equals("true"));
+ if(displayValues.containsKey(attrObj.getId())){
+ txt.setText(displayValues.get(attrObj.getId()));
+ txt.setEditable(false);
+ }
compt = txt;
- } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTInteger)) { // Integer绫诲瀷
+ } else if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTInteger.toString())) { // Integer绫诲瀷
IntegerTextField txt = new IntegerTextField("");
txt.setRequired(attrObj.getRequireFlag().equals("true"));
+ if(displayValues.containsKey(attrObj.getId())){
+ txt.setText(displayValues.get(attrObj.getId()));
+ txt.setEditable(false);
+ }
compt = txt;
}
else{
VCIJTextField txt = new VCIJTextField(this,attrObj.getRequireFlag().equals("true"));
+ if(displayValues.containsKey(attrObj.getId())){
+ txt.setText(displayValues.get(attrObj.getId()));
+ txt.setEditable(false);
+ }
compt = txt;
textCompts.add(txt);
}
@@ -1153,7 +1209,8 @@
private void getComptAttrValue( CodeClassifyTemplateAttrVO tempPropObj, LinkedHashMap<String, JComponent> attrIdToCtrlMaps) {
Map<String,String> dataMap=new HashMap<>();
Map<String,String> condtionMap=new HashMap<>();
- attrIdToCtrlMaps.forEach((key,compt)->{
+ for(String key: attrIdToCtrlMaps.keySet()){
+ JComponent compt = attrIdToCtrlMaps.get(key);
String value = "";
if (compt instanceof JTextComponent) {
value = ((JTextComponent) compt).getText();
@@ -1170,7 +1227,7 @@
}
dataMap.put(key,value);
condtionMap.put("dataMap["+key+"]",value);
- });
+ }
condtionMap.put("componentRuleValue",tempPropObj.getComponentRule());
Map<String,String> headerMap=new HashMap<>();
headerMap.put("Blade-Auth",this.tokenUserObject.getAccess_token());
@@ -1263,7 +1320,7 @@
dialog.setVisible(true);
}
- private void doSearch(VCIJComboxBox comboxBox,CodeBasicSecVO secObj){
+ private void doSearch(final VCIJComboxBox comboxBox, CodeBasicSecVO secObj){
if(StringUtils.isBlank(secObj.getReferConfig())){
VCIOptionPane.showMessage(this,"鍙傜収閰嶇疆淇℃伅涓嶆纭�,璇锋牳瀵癸紒");
return;
@@ -1552,7 +1609,10 @@
LinkedList<String> listValues = new LinkedList<String>();
// 鍚勫睘鎬х殑绫诲瀷
LinkedList<String> listDataTypes = new LinkedList<String>();
- Map<String,CodeClassifyTemplateAttrVO> codeClassifyTemplateAttrVOMap=transmitForRMData.getTempPropObjsList().stream().collect(Collectors.toMap(s -> s.getId(), t -> t));
+ Map<String,CodeClassifyTemplateAttrVO> codeClassifyTemplateAttrVOMap = new HashMap<>();
+ for (CodeClassifyTemplateAttrVO codeClassifyTemplateAttrVO : transmitForRMData.getTempPropObjsList()) {
+ codeClassifyTemplateAttrVOMap.put(codeClassifyTemplateAttrVO.getId(),codeClassifyTemplateAttrVO);
+ }
Iterator<String> keys = attrIdToCtrlMaps.keySet().iterator();
JComponent compt = null;
JComponent firstCompt = null;
--
Gitblit v1.9.3