From 80b00fc662651e4ee20507904364bfcebce2e4ac Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期三, 02 八月 2023 18:23:43 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyFor410MainPanel.java | 212 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 144 insertions(+), 68 deletions(-)
diff --git a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyFor410MainPanel.java b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyFor410MainPanel.java
index 8854c9f..fbcbe95 100644
--- a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyFor410MainPanel.java
+++ b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyFor410MainPanel.java
@@ -5,19 +5,18 @@
import com.vci.base.ui.swing.VCIOptionPane;
import com.vci.base.ui.swing.components.*;
import com.vci.base.ui.tree.VCIBaseTreeNode;
-import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO;
-import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateAttrVO;
-import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateVO;
-import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO;
+import com.vci.ubcs.code.vo.pagemodel.*;
import com.vci.ubcs.codeapply.object.*;
import com.vci.ubcs.codeapply.swing.IntegerTextField;
import com.vci.ubcs.codeapply.swing.RealTextField;
import com.vci.ubcs.codeapply.swing.VCIJComboxBox;
import com.vci.ubcs.codeapply.utils.ConfigUtils;
+import com.vci.ubcs.codeapply.utils.HttpUtil;
import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum;
import com.vci.ubcs.starter.web.pagemodel.KeyValue;
+import com.vci.ubcs.starter.web.util.BeanUtilForVCI;
+import com.vci.ubcs.starter.web.util.VciBaseUtil;
import com.vci.ubcs.system.user.entity.User;
-import net.bytebuddy.implementation.bytecode.Throw;
import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
@@ -25,8 +24,11 @@
import javax.swing.text.JTextComponent;
import javax.swing.tree.TreeNode;
import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;
import java.util.regex.Pattern;
@@ -34,7 +36,7 @@
public class CodeApplyFor410MainPanel extends VCIJPanel {
-
+ private String url=ConfigUtils.getConfigValue("410.code.url","http://127.0.0.1:36014/codeApplySwingController");
//410鏂伴渶姹�
private final String SPECIAL_RULE_NAME="Special.rule.name";
private final String SPECIAL_SECTION_NAME = "Special.section.name";
@@ -141,11 +143,11 @@
this.loadTextAreaEnableEnv(); //add by liujw
//this.loadSpecialRuleConfig();
CodeClassify rmType = (CodeClassify) this.transTreeObject.getCurrentTreeNode().getObj();
- String url= ConfigUtils.getConfigValue("410.PDM.rule.url","http://127.0.0.1:36014/codeApplySwingController/getCodeRuleByClassifyFullInfo");
+ //String url= ConfigUtils.getConfigValue("410.PDM.rule.url","http://127.0.0.1:36014/codeApplySwingController/getCodeRuleByClassifyFullInfo");
/**绯荤粺鍙姞杞戒唬鐮侀」 濡傛灉libName涓嶄负绌猴紝鐩存帴鑾峰彇瀵瑰簲鐨勪唬鐮侀」**/
Map<String,String> condtionMap=new HashMap<>();
condtionMap.put("codeClassId", rmType.getOid());
- R r=HttpUtil.sendGet(url,condtionMap,new HashMap<>());
+ R r= HttpUtil.sendGet(url+"/getCodeRuleByClassifyFullInfo",condtionMap,new HashMap<>());
CodeRuleVO codeRuleVO=new CodeRuleVO();
if(r.isSuccess()){
Object object= r.getData();
@@ -545,6 +547,7 @@
VCIJComboxBox hisCombo = null;
try {
final Map<String, String> secValMap = getSpecialValMap(specialSecVals);
+ Map<String,List<String>> secIdTOListValueOidMap=new HashMap<>();
for(int k = 0;k < secObjs.length; k++) {
final CodeBasicSecVO secObj = secObjs[k];
final VCIJComboxBox secCombo = secCombos[k];
@@ -552,27 +555,56 @@
return;
}
if (secObj.getSecType().equals("codeclassifysec")) {// 鏄垎绫荤爜
- continue;
- } else
- // 鏄浐瀹氱爜
- if (secObj.getSecType() .equals("codefixedsec")) {
- /* SectionValueClientDelegate codeValDel = new SectionValueClientDelegate(userObj);
- FixCodeValObject[] codeValObjs = codeValDel.fetchFixCodeValBySecId(secObj.getId());// 鑾峰彇璇ョ爜娈典笅鐨勬墍鏈夌爜娈电爜鍊煎璞�
- //濡傛灉鍙湁涓�涓�硷紝鍒欑郴缁熼粯璁ら�夋嫨锛屼笉鍔犵┖鍊�
- if(codeValObjs.length > 1 ) {
- secCombo.addItem(new FixCodeValObject());
+ String secOid=secObj.getOid();
+ String parentClassifySecOid= secObj.getParentClassifySecOid();
+ String parentClassifyValueOid="";
+ if(secIdTOListValueOidMap.containsKey(parentClassifySecOid)){
+ List<String> parentClassifyValueList= secIdTOListValueOidMap.get(parentClassifySecOid);
+ parentClassifyValueOid= VciBaseUtil.array2String(parentClassifyValueList.toArray(new String[]{}));
}
- for (int i = 0; i < codeValObjs.length; i++) {
- secCombo.addItem(codeValObjs[i]);
+ Map<String,String> condtionMap=new HashMap<>();
+ condtionMap.put("secOid", secOid);
+ condtionMap.put("parentClassifyValueOid", parentClassifyValueOid);
+ R r=HttpUtil.sendGet(url+"/listCodeClassifyValueBySecOid",condtionMap,new HashMap<>());
+ List<CodeClassifyValue> codeClassifyValueList=new ArrayList<>();
+ if(r.isSuccess()){
+ Object object= r.getData();
+ if(object!=null) {
+ ObjectMapper objectMapper = new ObjectMapper();
+ try {
+ codeClassifyValueList = objectMapper.readValue(object.toString(), new com.fasterxml.jackson.core.type.TypeReference<List<CodeClassifyValue>>() {});
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ }
+ }
+ }else{
+ VCIOptionPane.showMessage(this,r.getMsg());
}
- *//**褰撶郴缁熼�夋嫨鐨勬槸鎸囧畾鐮佹鍊兼椂锛岀粍鍒唬鍙风殑鐮佹绯荤粺涓嶆樉绀� Begin**//*
- FixCodeValObject selObj = (FixCodeValObject) secCombo.getSelectedItem();
- if(isSpecialRuleFlag && (secObj.getName().equals(specialControlSecName) && secValMap.containsKey(selObj.getValue())) || secValMap.containsKey(getControlSecSelectValue())) {
- setComponentStatus(false);
- }else {
- setComponentStatus(true);
+ List<String>valueOidList=new ArrayList<>();
+ if(!CollectionUtils.isEmpty(codeClassifyValueList)) {
+ if(codeClassifyValueList.size()>1) {
+ secCombo.addItem(new CodeClassifyValue());
+ }
+ codeClassifyValueList.stream().forEach(codeClassifyValue -> {
+ secCombo.addItem(codeClassifyValue);
+ valueOidList.add(codeClassifyValue.getOid());
+ });
}
- if (secCombo.getItemCount() > 10){
+ secIdTOListValueOidMap.put(secObj.getOid(),valueOidList);
+ /**浠g爜椤逛笅鎷変簨浠�**/
+ secCombo.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if(secCombo.getSelectedIndex() == -1) {
+ return;
+ }
+ if(secIdToClsfIdMap.containsKey(secObj.getId())){
+ VCIJTextField secDescVcijTextField=(VCIJTextField)secIdToClsfIdMap.get(secObj.getId());
+ CodeClassifyValue codeClassifyValue= (CodeClassifyValue) secCombo.getSelectedItem();
+ secDescVcijTextField.setText(codeClassifyValue.getName());
+ }
+ }
+ });
+ /*if (secCombo.getItemCount() > 10){
if (!secCombo.isFlag()){
secCombo.setFlag(true);
secCombo.getSearchBtn().setVisible(true);
@@ -587,19 +619,51 @@
secCombo.setFlag(false);
secCombo.getSearchBtn().setVisible(false);
}*/
-
+ } else
+ // 鏄浐瀹氱爜
+ if (secObj.getSecType() .equals("codefixedsec")) {
+ List<CodeFixedValueVO> fixedValueVOList=secObj.getFixedValueVOList();
+ //濡傛灉鍙湁涓�涓�硷紝鍒欑郴缁熼粯璁ら�夋嫨锛屼笉鍔犵┖鍊�
+ if(fixedValueVOList.size() >1) {
+ secCombo.addItem(new CodeFixedValue());
+ }
+ fixedValueVOList.stream().forEach(codeFixedValueVO -> {
+ 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())) {
+ setComponentStatus(false);
+ }else {
+ setComponentStatus(true);
+ }*/
+ /*if (secCombo.getItemCount() > 10){
+ if (!secCombo.isFlag()){
+ secCombo.setFlag(true);
+ secCombo.getSearchBtn().setVisible(true);
+ secCombo.getSearchBtn().addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ doSearch(secCombo);
+ }
+ });
+ }
+ }else {
+ secCombo.setFlag(false);
+ secCombo.getSearchBtn().setVisible(false);
+ }*/
} else
// 鏄棩鏈熺爜娈�
if (secObj.getSecType().equals("codedatesec")) {
- /*SectionClientDelegate secDel = new SectionClientDelegate(userObj);
- DateSecObject dateObj = secDel.fetchDateSecById(secObj.getId());
- String df = dateObj.getFormat();
- SimpleDateFormat dateFormate = new SimpleDateFormat(df);
- String curDate = dateFormate.format(Calendar.getInstance().getTime());
- secCombo.addItem(curDate);
- if(dateObj.getIsModify().equals("Y")){//鍙互淇敼
- secCombo.setEditable(true);
- }*/
+ String df =secObj.getCodeDateFormatStr();
+ SimpleDateFormat dateFormate = new SimpleDateFormat(df);
+ String curDate = dateFormate.format(Calendar.getInstance().getTime());
+ secCombo.addItem(curDate);
+ /*if(dateObj.getIsModify().equals("Y")){//鍙互淇敼
+ secCombo.setEditable(true);
+ }*/
} else
//鏄紩鐢ㄧ爜娈�
if (secObj.getSecType().equals("coderefersec")) {
@@ -630,13 +694,13 @@
}
*/} else
- //灞傜骇鐮佹鐮佸�兼樉绀虹殑鏄�夋嫨鐨勪唬鐮侀」鐨勫悕绉�
+ //灞傜骇鐮佹鐮佸�兼樉绀虹殑鏄�夋嫨鐨勪唬鐮侀」鐨勫悕绉�
if(secObj.getSecType().equals("coderefersec")) {
- /*RMTypeObject rmObj = (RMTypeObject) this.transTreeObject.getCurrentTreeNode().getObj();
- secCombo.addItem(rmObj);*/
- } else {
- secCombo.setEditable(true);
- }
+ CodeClassify rmObj = (CodeClassify) this.transTreeObject.getCurrentTreeNode().getObj();
+ secCombo.addItem(rmObj);
+ } else {
+ secCombo.setEditable(true);
+ }
}
}catch (Exception e) {
e.printStackTrace();
@@ -948,6 +1012,16 @@
cbx.setModel(model);
compt = cbx;
}
+ } else if(StringUtils.isNotBlank(attrObj.getReferConfig())){//鍙傜収鐨勯渶瑕佽缃垚涓嬫媺妗嗭紝骞朵笖鍙
+ VCIJComboBox cbx = new VCIJComboBox();
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ KeyValue keyValue = new KeyValue();
+ keyValue.setValue("");
+ keyValue.setKey("");
+ AttrRangObjectWarper wrapper = new AttrRangObjectWarper(keyValue);
+ model.addElement(wrapper);
+ cbx.setModel(model);
+ compt = cbx;
} else { // 涓嶅瓨鍦ㄥ彇鍊艰寖鍥村垯鎸夌被鍨嬬敓鎴愪笉鍚岀殑鎺т欢
if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTBoolean)) { // Boolean绫诲瀷
VCIJComboBox cbx = new VCIJComboBox();
@@ -1003,11 +1077,11 @@
*/
private KeyValue[] getAttrRangeObjects(String attrId){
KeyValue[] res = new KeyValue[0];
- String url= ConfigUtils.getConfigValue("410.PDM.attrKeyValue.url","http://127.0.0.1:36014/codeApplySwingController/listComboboxItems");
+ //String url= ConfigUtils.getConfigValue("410.PDM.attrKeyValue.url","http://127.0.0.1:36014/codeApplySwingController/listComboboxItems");
/**绯荤粺鍙姞杞戒唬鐮侀」 濡傛灉libName涓嶄负绌猴紝鐩存帴鑾峰彇瀵瑰簲鐨勪唬鐮侀」**/
Map<String,String> condtionMap=new HashMap<>();
condtionMap.put("oid", attrId);
- R r=HttpUtil.sendGet(url,condtionMap,new HashMap<>());
+ R r=HttpUtil.sendGet(url+"/listComboboxItems",condtionMap,new HashMap<>());
List<KeyValue> keyValueList=new ArrayList<>();
if(r.isSuccess()){
Object object= r.getData();
@@ -1143,51 +1217,53 @@
// 娴佺▼浠诲姟寮曠敤
// 涓�鑸殑鏁版嵁褰曞叆銆佷慨鏀�
// 涓嶅悓鐨勬潵婧愶紝闇�瑕佺淮鎶ゅソOwner鐖�
- VCIJDialog ownerDialog = realDialogInstance;
+ /*VCIJDialog ownerDialog = realDialogInstance;
if(ownerDialog == null){
ownerDialog = new VCIJDialog();
ownerDialog.setSize(880, 500);
- }
- final String referTempId = tempPropObj.getReferBtmId();
- final RMDataReferTempDialog dialog = new RMDataReferTempDialog(ownerDialog, referTempId);
+ }*/
+ //final String referTempId = tempPropObj.getReferBtmId();
+ final RMDataReferTempDialog dialog = new RMDataReferTempDialog(this,tempPropObj);
dialog.setDialogCallback(new Runnable() {
@Override
public void run() {
- /*LinkedList<RMDataObject> list = dialog.getRMDataMainPanel().getTablePanel().getSelectedRowObjects();
- if(dialog.isFromTableDoubleClick()){
+ KeyValue keyValue=new KeyValue();
+ /*if(dialog.isFromTableDoubleClick()){
int index = dialog.getRMDataMainPanel().getTablePanel().getTable().getSelectedRow();
list.clear();
list.add(dialog.getRMDataMainPanel().getTablePanel().getTableModel().getList().get(index).getObject());
- }
-
- RMDataObject rmDataObj = list.get(0);//閫夋嫨鐨勫紩鐢ㄦā鏉挎暟鎹�
- LinkedHashMap<String, Integer> innnerNamesMaps = rmDataObj.getInnerNameIndexMap();
- String[] datas = rmDataObj.getDatas();
- for(CodeClassifyTemplateAttrVO obj : tempPropList) {
- if(obj.getReferTempId().equals(referTempId)) {
- AttributeObject attrObj = getAttrObjById(obj.getReferAttrId());
- JComponent comp = attrIdToCtrlMaps.get(obj.getId());
- if(comp instanceof VCIJTextField) {
- int index = innnerNamesMaps.get(attrObj.getInternalname());
+ }*/
+ keyValue= dialog.getKeyValue();
+ //for(CodeClassifyTemplateAttrVO obj : tempPropList) {
+ if(attrIdToCtrlMaps.containsKey(tempPropObj.getId())) {
+ JComponent comp = attrIdToCtrlMaps.get(tempPropObj.getId());
+ /*if(comp instanceof VCIJTextField) {
+ int index = innnerNamesMaps.get(tempPropObj.getInternalname());
((VCIJTextField) comp).setText(datas[index]);
}else if (comp instanceof VCIJCalendarPanel) {
- int index = innnerNamesMaps.get(attrObj.getInternalname());
+ int index = innnerNamesMaps.get(tempPropObj.getInternalname());
((VCIJCalendarPanel) comp).setDateString(datas[index]);
- } else if (comp instanceof VCIJComboBox) {
- int index = innnerNamesMaps.get(attrObj.getId());
- ((VCIJComboBox) comp).setSelectedIndex(index);
+ } else */
+ if (comp instanceof VCIJComboBox) {
+ //DefaultComboBoxModel model = new DefaultComboBoxModel();
+ if(keyValue!=null) {
+ AttrRangObjectWarper wrapper = new AttrRangObjectWarper(keyValue);
+ ((VCIJComboBox) comp).getModel().setSelectedItem(wrapper);
+ }
+ //model.addElement(wrapper);
+ //((VCIJComboBox) comp).setModel(model);
}
}
- }*/
+ //}
}
});
//dialog.initDialogSize(ownerDialog.getWidth(), ownerDialog.getHeight());
Dimension dime = Toolkit.getDefaultToolkit().getScreenSize();
int x = dime.width/2 - 400;
- int y = dime.height/2 -400;
+ int y = dime.height/2 -300;
dialog.setLocation(x, y);
- dialog.setSize(new Dimension(900, 800));
+ dialog.setSize(new Dimension(900, 600));
dialog.setModal(true);
dialog.setVisible(true);
}
--
Gitblit v1.9.3