From 94619d90359419a070f80f65c2f0163382b67fc1 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 24 八月 2023 15:07:37 +0800
Subject: [PATCH] 接口配置页面
---
Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyPanelFor410.java | 84 ++++++++++++++++++++++++++++++++----------
1 files changed, 64 insertions(+), 20 deletions(-)
diff --git a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyPanelFor410.java b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyPanelFor410.java
index 1ec0baa..ef66b57 100644
--- a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyPanelFor410.java
+++ b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeApplyPanelFor410.java
@@ -12,9 +12,10 @@
import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO;
import com.vci.ubcs.codeapply.object.CodeClassify;
import com.vci.ubcs.codeapply.object.R;
+import com.vci.ubcs.codeapply.object.TokenUserObject;
import com.vci.ubcs.codeapply.utils.ConfigUtils;
+import com.vci.ubcs.codeapply.utils.HttpUtil;
import com.vci.ubcs.system.user.entity.User;
-import lombok.SneakyThrows;
import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
@@ -45,7 +46,7 @@
private VCIJLabel applylbl = new VCIJLabel("鐢宠鐮佸�硷細");
public VCIJTextField applyTxt = new VCIJTextField(40);
private JComboBox codeItemCombo = new JComboBox();
- private User userObj = null;;
+ private TokenUserObject tokenUserObject = null;;
private CodeClassifyTemplateVO currentCodeClassifyTemplateVO;
private boolean isIntegrate = false; //闆嗘垚鏃朵笉鏄剧ず鎵归噺鐢宠鎸夐挳
@@ -66,18 +67,22 @@
//宸︿晶鏍�
private CodeApplyFor410TreePanel typeTreePanel = null;
private TransmitTreeObject transmitTreeObject = new TransmitTreeObject();
+
+
+ private String url=ConfigUtils.getConfigValue("410.code.url","http://127.0.0.1:36014/codeApplySwingController");
+
/***
*
- * @param userObj
+ * @param tokenUserObject
* @param isIntegrate
* @param clsfName
* @param deptName
* @param libName
*/
- public CodeApplyPanelFor410(CodeApplyFor410Dialog owner , User userObj, boolean isIntegrate, String clsfName, String deptName, String[] libName){
- this.userObj = userObj;
+ public CodeApplyPanelFor410(CodeApplyFor410Dialog owner , TokenUserObject tokenUserObject, boolean isIntegrate, String clsfName, String deptName, String[] libName){
+ this.tokenUserObject = tokenUserObject;
this.owner =owner;
- rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,userObj,getCurrentCodeClassifyTemplateVO());
+ rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,getCurrentCodeClassifyTemplateVO());
this.isIntegrate = isIntegrate;
this.clsfName = clsfName;
this.deptName = deptName;
@@ -160,13 +165,14 @@
CodeClassifyVO [] codeClassifyVOS = new CodeClassifyVO[0];
Map<String,String> condtionMap=new HashMap<>();
//condtionMap.put("parentOid",);
-
- String url=ConfigUtils.getConfigValue("410.PDM.item.url","http://127.0.0.1:36014/codeApplySwingController/getRMLibByName");
+ //String url=ConfigUtils.getConfigValue("410.code.url","http://127.0.0.1:36014/codeApplySwingController");
/**绯荤粺鍙姞杞戒唬鐮侀」 濡傛灉libName涓嶄负绌猴紝鐩存帴鑾峰彇瀵瑰簲鐨勪唬鐮侀」**/
if(libName.length>0) {
condtionMap.put("libName", StringUtils.join(libName,",") );
}
- R r=HttpUtil.sendGet(url,condtionMap,new HashMap<>());
+ Map<String,String> headerMap=new HashMap<>();
+ headerMap.put("Blade-Auth",this.tokenUserObject.getAccess_token());
+ R r= HttpUtil.sendGet(url+"/getRMLibByName",condtionMap,headerMap);
List<CodeClassify> codeClassifyList = new ArrayList<>();
if(r.isSuccess()){
Object object= r.getData();
@@ -230,7 +236,7 @@
String libName=currentCodeClassify.getName();
String classOid=currentCodeClassify.getOid();
final CodeApplyPanelFor410 self = this;
- typeTreePanel = new CodeApplyFor410TreePanel(currentCodeClassify,userObj,clsfName, libName) {
+ typeTreePanel = new CodeApplyFor410TreePanel(currentCodeClassify,tokenUserObject,clsfName, libName) {
private static final long serialVersionUID = 8121108576137012228L;
@Override
public void tree_valueChanged(TreeSelectionEvent e) {
@@ -257,11 +263,14 @@
CodeClassify codeClassify=(CodeClassify)node;
classOid = codeClassify.getOid();
- String url = ConfigUtils.getConfigValue("410.PDM.clsfTemplate.url", "http://127.0.0.1:36014/codeApplySwingController/getUsedTemplateByClassifyOid");
+ //String url = ConfigUtils.getConfigValue("410.PDM.clsfTemplate.url", "http://127.0.0.1:36014/codeApplySwingController/getUsedTemplateByClassifyOid");
/**绯荤粺鍙姞杞戒唬鐮侀」 濡傛灉libName涓嶄负绌猴紝鐩存帴鑾峰彇瀵瑰簲鐨勪唬鐮侀」**/
Map<String, String> condtionMap = new HashMap<>();
condtionMap.put("codeClassifyOid", classOid);
- R r = HttpUtil.sendGet(url, condtionMap, new HashMap<>());
+ Map<String,String> headerMap=new HashMap<>();
+ headerMap.put("Blade-Auth",this.tokenUserObject.getAccess_token());
+
+ R r = HttpUtil.sendGet(url+"/getUsedTemplateByClassifyOid", condtionMap, headerMap);
boolean res = false;
if (r.isSuccess()) {
//List<CodeClassifyTemplateVO> codeClassifyTemplateVOList=new ArrayList<>();
@@ -279,13 +288,13 @@
e.printStackTrace();
}
}
- }else{
+ }/*else{
VCIOptionPane.showMessage(this,r.getMsg());
- }
+ }*/
initBtnStatus(res);
}
}
- rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,userObj,deptName,getCurrentCodeClassifyTemplateVO());
+ rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO());
scrollPane.setViewportView(rightMainPanel);
rightMainPanel.buildMainPanel(1);
int location = jspLeftToRight.getDividerLocation();
@@ -302,11 +311,14 @@
boolean res=false;
if(obj instanceof CodeClassify) {
CodeClassify curentCodeClassify=(CodeClassify)obj;
- String url=ConfigUtils.getConfigValue("410.PDM.clsfTemplate.url","http://127.0.0.1:36014/codeApplySwingController/getUsedTemplateByClassifyOid");
+ //String url=ConfigUtils.getConfigValue("410.PDM.clsfTemplate.url","http://127.0.0.1:36014/codeApplySwingController/getUsedTemplateByClassifyOid");
/**绯荤粺鍙姞杞戒唬鐮侀」 濡傛灉libName涓嶄负绌猴紝鐩存帴鑾峰彇瀵瑰簲鐨勪唬鐮侀」**/
Map<String,String> condtionMap=new HashMap<>();
condtionMap.put("codeClassifyOid",curentCodeClassify.getOid());
- R r=HttpUtil.sendGet(url,condtionMap,new HashMap<>() );
+ Map<String,String> headerMap=new HashMap<>();
+ headerMap.put("Blade-Auth",this.tokenUserObject.getAccess_token());
+
+ R r=HttpUtil.sendGet(url+"/getUsedTemplateByClassifyOid",condtionMap,headerMap);
if(r.isSuccess()) {
CodeClassifyTemplateVO codeClassifyTemplateVO=new CodeClassifyTemplateVO();
Object object= r.getData();
@@ -322,9 +334,9 @@
e1.printStackTrace();
}
}
- }else{
+ }/*else{
VCIOptionPane.showMessage(this.owner,r.getMsg());
- }
+ }*/
}
initBtnStatus(res);
@@ -347,7 +359,7 @@
transmitTreeObject.setCurrentTreeNode(selectedTreeNode);
if(selectedTreeNode.isRoot() && selectedTreeNode.getObj() instanceof String) return;
scrollPane = new JScrollPane();
- rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,userObj,deptName,getCurrentCodeClassifyTemplateVO());
+ rightMainPanel = new CodeApplyFor410MainPanel(transmitTreeObject,tokenUserObject,deptName,getCurrentCodeClassifyTemplateVO());
scrollPane.setViewportView(rightMainPanel);
rightMainPanel.buildMainPanel(1);
VCIJPanel rightPanel = new VCIJPanel();
@@ -378,6 +390,14 @@
this.applyTxt.setText(codeVal);
}
+ public VCIJTextField getApplyTxt() {
+ return applyTxt;
+ }
+
+ public void setApplyTxt(VCIJTextField applyTxt) {
+ this.applyTxt = applyTxt;
+ }
+
public CodeClassifyTemplateVO getCurrentCodeClassifyTemplateVO() {
return currentCodeClassifyTemplateVO;
}
@@ -385,4 +405,28 @@
public void setCurrentCodeClassifyTemplateVO(CodeClassifyTemplateVO currentCodeClassifyTemplateVO) {
this.currentCodeClassifyTemplateVO = currentCodeClassifyTemplateVO;
}
+
+ public CodeApplyFor410MainPanel getRightMainPanel() {
+ return rightMainPanel;
+ }
+
+ public void setRightMainPanel(CodeApplyFor410MainPanel rightMainPanel) {
+ this.rightMainPanel = rightMainPanel;
+ }
+
+ public TransmitTreeObject getTransmitTreeObject() {
+ return transmitTreeObject;
+ }
+
+ public void setTransmitTreeObject(TransmitTreeObject transmitTreeObject) {
+ this.transmitTreeObject = transmitTreeObject;
+ }
+
+ public TokenUserObject getTokenUserObject() {
+ return tokenUserObject;
+ }
+
+ public void setTokenUserObject(TokenUserObject tokenUserObject) {
+ this.tokenUserObject = tokenUserObject;
+ }
}
--
Gitblit v1.9.3