xiejun
2023-09-18 8ef555ab552cbf5945be1ccc51e3d5d419587866
Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/CodeApplyFor410Dialog.java
@@ -1,6 +1,5 @@
package com.vci.rmip.code.client.codeapply.Apply410;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.vci.base.ui.swing.VCIOptionPane;
import com.vci.base.ui.swing.VCISwingUtil;
@@ -12,6 +11,9 @@
import com.vci.rmip.code.client.codeapply.Apply410.utils.ConfigUtils;
import com.vci.rmip.code.client.codeapply.Apply410.utils.HttpUtil;
import javax.swing.*;
import org.apache.commons.lang.StringUtils;
import java.awt.*;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -31,7 +33,8 @@
   private Component parentComponet = null;
   private Map<String, String> attrNameAndValMap = new LinkedHashMap();//存储属性名称(包含内部名称和外部名称)和对应的值
   private String tokenUrl= ConfigUtils.getConfigValue("410.code.token.url","http://127.0.0.1:37000/ubcs-auth/oauth/token");
   private String[] fields;
   private String[] values;
   /**
    * 存储分类的Map,key:分类名称,value:分类值
    */
@@ -48,6 +51,23 @@
   }
   public CodeApplyFor410Dialog(JDialog dialog, String clsfName, String deptName) {
      this(dialog, "pdmUser", clsfName, deptName,new String[]{});
   }
   public CodeApplyFor410Dialog(JDialog dialog, String clsfName, String deptName,String[] fields,String[] values) {
      this(dialog, "pdmUser", clsfName, deptName,new String[]{},fields,values);
   }
   public CodeApplyFor410Dialog(Frame frame, String clsfName, String deptName,String[] fields,String[] values){
      super(frame, true);
      VCISwingUtil.setClientMainFrame(frame);
      //this.setModal(true);
      parentComponet = frame;
      this.userName = userName;
      this.clsfName = clsfName;
      this.deptName = deptName;
      this.fields=fields;
      this.values=values;
      //this.libName = libName;
      init();
   }
   public CodeApplyFor410Dialog(Frame frame, String userName, String clsfName, String deptName, String[] libName){
      super(frame, true);
@@ -76,6 +96,23 @@
         this.deptName = deptName;
         //   this.libName = libName;
         init();
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
   public CodeApplyFor410Dialog(JDialog dialog, String userName, String clsfName, String deptName, String[] libName,String[] fields,String[] values) {
      super(dialog, true);
      VCISwingUtil.setClientMainFrame(new Frame());
      try {
         this.setModal(true);
         parentComponet = dialog;
         this.userName = userName;
         this.clsfName = clsfName;
         this.deptName = deptName;
         this.fields     = fields;
         this.values     = values;
         init();
      } catch (Exception e) {
         e.printStackTrace();
@@ -139,7 +176,14 @@
   private void bulidPal() throws Exception {
      this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      this.setTitle("代码申请");
      mainPal = new CodeApplyPanelFor410(this,tokenUserObject, true, clsfName, deptName,libName);
      Map<String , String> displayValues = new HashMap<>();
      if(fields != null && fields.length > 0 && values !=null && values.length > 0){
         for (int i = 0; i < fields.length; i++) {
            displayValues.put(fields[i] , values[i]);
         }
      }
      mainPal = new CodeApplyPanelFor410(this,tokenUserObject, true, clsfName, deptName,libName,displayValues);
      VCIJPanel btnPal = new VCIJPanel();
      btnPal.add(okBtn);