diff --git a/lib/EmergencyBaseLib/EmergencyCommon/src/main/java/com/zdxt/common/util/http/HttpUtils.java b/lib/EmergencyBaseLib/EmergencyCommon/src/main/java/com/zdxt/common/util/http/HttpUtils.java index c7de22a3..86b6d956 100644 --- a/lib/EmergencyBaseLib/EmergencyCommon/src/main/java/com/zdxt/common/util/http/HttpUtils.java +++ b/lib/EmergencyBaseLib/EmergencyCommon/src/main/java/com/zdxt/common/util/http/HttpUtils.java @@ -5,10 +5,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; -import java.net.ConnectException; -import java.net.SocketTimeoutException; -import java.net.URL; -import java.net.URLConnection; +import java.net.*; import java.security.cert.X509Certificate; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; @@ -16,12 +13,15 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 通用http发送方法 - * + * * @author ruoyi */ public class HttpUtils @@ -245,4 +245,31 @@ public class HttpUtils return true; } } + + public static InputStream postInputStream(String urlStr , JSONObject paramJson) throws Exception { + //获取小程序码,通过该接口生成的小程序码,永久有效,有数量限制 + URL url = new URL(urlStr); + + HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection(); + httpURLConnection.setRequestMethod("POST");// 提交模式 + // 发送POST请求必须设置如下两行 + httpURLConnection.setDoOutput(true); + httpURLConnection.setDoInput(true); + // 获取URLConnection对象对应的输出流 + PrintWriter printWriter = new PrintWriter(httpURLConnection.getOutputStream()); + + printWriter.write(paramJson.toString()); + // flush输出流的缓冲 + printWriter.flush(); + String contentType = httpURLConnection.getContentType(); + if (contentType.contains("json")) { + IoUtil.copy(httpURLConnection.getInputStream(), System.out); + throw new IllegalArgumentException("调用微信小程序生成接口出错"); + } else { + //开始获取数据 + return httpURLConnection.getInputStream(); + } + + } + } \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/drawflow/src/drawflow.js b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/drawflow/src/drawflow.js index 94423795..73fa2fe4 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/drawflow/src/drawflow.js +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/drawflow/src/drawflow.js @@ -1167,7 +1167,8 @@ export default class Drawflow { var moduleName = this.getModuleFromNodeId(id) return JSON.parse(JSON.stringify(this.drawflow.drawflow[moduleName].data[id])); } - getNodesFromName(name) { + + getNodesFromName(name,val) { var nodes = []; const editor = this.drawflow.drawflow Object.keys(editor).map(function(moduleName, index) { @@ -1177,6 +1178,9 @@ export default class Drawflow { } } }); + // let nodeId = nodes.at(0); + // var moduleName = this.getModuleFromNodeId(nodeId) + // this.drawflow.drawflow[moduleName].data[id].data = {option: val+'', value: '', channel: val+''}; return nodes; } @@ -1492,6 +1496,7 @@ export default class Drawflow { } updateNodeDataFromId(id, data) { + debugger var moduleName = this.getModuleFromNodeId(id) this.drawflow.drawflow[moduleName].data[id].data = data; if(this.module === moduleName) { diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/addNew.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/addNew.html index 755a7179..bf5c1027 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/addNew.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/addNew.html @@ -4,6 +4,7 @@ +
@@ -69,6 +70,8 @@