胸科医院代码上传

dev
wangxuanran 2023-07-27 12:44:37 +08:00
parent 0836261a05
commit ee84e559e6
2 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package aiyh.utils;
import aiyh.utils.interfaces.script_util.CusScriptFunInterface;
import aiyh.utils.tool.org.apache.commons.jexl3.*;
import java.util.Map;
@ -13,9 +14,16 @@ import java.util.Map;
*/
public class ScriptUtil {
private static final JexlEngine JEXL = new JexlBuilder().create();
public static Object invokeScript(String script, Map<String, Object> params) {
return invokeScript(script, params, null);
}
public static Object invokeScript(String script, Map<String, Object> params, CusScriptFunInterface scriptFunInterface) {
JexlContext jc = new MapContext();
if(null != scriptFunInterface){
jc.set(scriptFunInterface.getClass().getSimpleName(), scriptFunInterface);
}
for (Map.Entry<String, Object> entry : params.entrySet()) {
jc.set(entry.getKey(), entry.getValue());
}

View File

@ -117,4 +117,12 @@ public class XkHospitalTest extends BaseTest {
Util.null2DefaultStr(null,"");
service.async("4bce0693734d","common", map);
}
@Test
public void testD(){
String json = "{\"data\":[{\"ID\":\"2\",\"GroupID\":\"test_yl_01\",\"Wards\":[]},{\"ID\":\"1\",\"GroupID\":\"test_yl_01\",\"Wards\":[{\"ID\":\"1\",\"WardCode\":\"bq_01\",\"WardName\":\"病区名称01_1\"},{\"ID\":\"2\",\"WardCode\":\"bq_02\",\"WardName\":\"病区名称01_2\"},{\"ID\":\"3\",\"WardCode\":\"bq_03\",\"WardName\":\"病区名称0_2_3\"},{\"ID\":\"4\",\"WardCode\":\"bq_04\",\"WardName\":\"病区名称02_1_3\"}]}]}\n";
System.out.println(json);
Map map = JSONObject.parseObject(json, Map.class);
service.async("testarr","common", map);
}
}