From 476fa242b2994ac480dedc79cde301bf14aa2026 Mon Sep 17 00:00:00 2001 From: xiejun <xiejun@vci-tech.com> Date: 星期五, 05 一月 2024 18:40:54 +0800 Subject: [PATCH] 获取集团分类根节点前端传null传入后端直接改为空字符串bug修复 --- Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyPanelFor410.java | 43 +++++++++++++++++++++++++++---------------- 1 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyPanelFor410.java b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyPanelFor410.java index 5e0fa87..e3096f1 100644 --- a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyPanelFor410.java +++ b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyPanelFor410.java @@ -1,7 +1,5 @@ package com.vci.rmip.code.client.codeapply.Apply410; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import com.vci.base.ui.swing.VCIOptionPane; import com.vci.base.ui.swing.VCISwingUtil; import com.vci.base.ui.swing.components.*; @@ -9,14 +7,17 @@ import com.vci.base.ui.tree.VCIBaseTreeModel; import com.vci.base.ui.tree.VCIBaseTreeNode; import com.vci.rmip.code.client.codeapply.Apply410.object.CodeClassify; +import com.vci.rmip.code.client.codeapply.Apply410.object.CodeClassifyTemplateVO; import com.vci.rmip.code.client.codeapply.Apply410.object.R; import com.vci.rmip.code.client.codeapply.Apply410.object.TokenUserObject; +import com.vci.rmip.code.client.codeapply.Apply410.object.ubcscode.vo.CodeClassifyVO; import com.vci.rmip.code.client.codeapply.Apply410.utils.ConfigUtils; import com.vci.rmip.code.client.codeapply.Apply410.utils.HttpUtil; -import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateVO; -import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; -import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.codehaus.jackson.JsonProcessingException; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.type.TypeReference; import javax.swing.*; import javax.swing.event.TreeSelectionEvent; @@ -24,6 +25,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.HashMap; @@ -59,6 +61,10 @@ * 瀛樺偍灞炴�у拰鍊肩殑Map,key:灞炴�у悕绉帮紝value锛氬睘鎬у�� */ private String deptName = null; + /** + * 瀛樺偍灞炴�у拰鍊肩殑Map,key,鐢ㄤ簬榛樿鍊肩殑鏄剧ず + */ + private Map displayValues = new HashMap<String,String>(); private String[] libName = new String[]{};//浠g爜椤瑰悕绉� private VCIBaseTree leftTree = null; @@ -78,7 +84,7 @@ * @param deptName * @param libName */ - public CodeApplyPanelFor410(CodeApplyFor410Dialog owner , TokenUserObject tokenUserObject, boolean isIntegrate, String clsfName, String deptName, String[] libName){ + public CodeApplyPanelFor410(CodeApplyFor410Dialog owner , TokenUserObject tokenUserObject, boolean isIntegrate, String clsfName, String deptName, String[] libName,Map displayValues){ this.tokenUserObject = tokenUserObject; this.owner =owner; rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,getCurrentCodeClassifyTemplateVO()); @@ -86,6 +92,7 @@ this.clsfName = clsfName; this.deptName = deptName; this.libName = libName; + this.displayValues = displayValues; init(); initActionListener(); } @@ -178,9 +185,12 @@ if(object!=null) { ObjectMapper objectMapper = new ObjectMapper(); try { - codeClassifyList = objectMapper.readValue(object.toString(), new com.fasterxml.jackson.core.type.TypeReference<List<CodeClassify>>() { - }); - } catch (JsonProcessingException e) { + // codeClassifyList = objectMapper.readValue(object.toString(), new TypeReference<List<CodeClassify>(); + + codeClassifyList = objectMapper.readValue(object.toString(), new TypeReference<List<CodeClassify>>(){}); + + }catch (IOException e) { + // TODO Auto-generated catch block e.printStackTrace(); } } @@ -188,9 +198,9 @@ VCIOptionPane.showMessage(this,r.getMsg()); } if(!CollectionUtils.isEmpty(codeClassifyList)){ - codeClassifyList.stream().forEach(codeClassify -> { + for (CodeClassify codeClassify : codeClassifyList) { codeItemCombo.addItem(codeClassify); - }); + } codeItemCombo.setSelectedIndex(0); } initLeftPanel(); @@ -283,8 +293,9 @@ setCurrentCodeClassifyTemplateVO(codeClassifyTemplateVO); res = true; } - } catch (JsonProcessingException e) { - e.printStackTrace(); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); } } }/*else{ @@ -293,7 +304,7 @@ initBtnStatus(res); } } - rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO()); + rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO(),displayValues); scrollPane.setViewportView(rightMainPanel); rightMainPanel.buildMainPanel(1); int location = jspLeftToRight.getDividerLocation(); @@ -329,7 +340,7 @@ setCurrentCodeClassifyTemplateVO(codeClassifyTemplateVO); res=true; } - } catch (JsonProcessingException e1) { + } catch (IOException e1) { e1.printStackTrace(); } } @@ -358,7 +369,7 @@ transmitTreeObject.setCurrentTreeNode(selectedTreeNode); if(selectedTreeNode.isRoot() && selectedTreeNode.getObj() instanceof String) return; scrollPane = new JScrollPane(); - rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO()); + rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO(),displayValues); scrollPane.setViewportView(rightMainPanel); rightMainPanel.buildMainPanel(1); VCIJPanel rightPanel = new VCIJPanel(); -- Gitblit v1.9.3