| | |
| | | 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.*; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | * 存储属性和值的Map,key:属性名称,value:属性值 |
| | | */ |
| | | private String deptName = null; |
| | | /** |
| | | * 存储属性和值的Map,key,用于默认值的显示 |
| | | */ |
| | | private Map displayValues = new HashMap<String,String>(); |
| | | |
| | | private String[] libName = new String[]{};//代码项名称 |
| | | private VCIBaseTree leftTree = null; |
| | |
| | | * @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()); |
| | |
| | | this.clsfName = clsfName; |
| | | this.deptName = deptName; |
| | | this.libName = libName; |
| | | this.displayValues = displayValues; |
| | | init(); |
| | | initActionListener(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | VCIOptionPane.showMessage(this,r.getMsg()); |
| | | } |
| | | if(!CollectionUtils.isEmpty(codeClassifyList)){ |
| | | codeClassifyList.stream().forEach(codeClassify -> { |
| | | for (CodeClassify codeClassify : codeClassifyList) { |
| | | codeItemCombo.addItem(codeClassify); |
| | | }); |
| | | } |
| | | codeItemCombo.setSelectedIndex(0); |
| | | } |
| | | initLeftPanel(); |
| | |
| | | setCurrentCodeClassifyTemplateVO(codeClassifyTemplateVO); |
| | | res = true; |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e1) { |
| | | // TODO Auto-generated catch block |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | }/*else{ |
| | |
| | | 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(); |
| | |
| | | setCurrentCodeClassifyTemplateVO(codeClassifyTemplateVO); |
| | | res=true; |
| | | } |
| | | } catch (JsonProcessingException e1) { |
| | | } catch (IOException e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | 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(); |