Commit 49da27e1 by WeiCong

第三版完成

1.支持restoreData模型
2.支持渠道类型判断方式
3.支持sysmod下的spt模型加载
4.支持精确控制lst返回列
5.支持分页查询
parent edc9a29a
......@@ -52,9 +52,9 @@
</orderEntry>
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.18.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.18.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.18.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.7" level="project" />
......
......@@ -27,7 +27,7 @@
<spring.version>5.1.3.RELEASE</spring.version>
<slf4j-api_version>1.7.25</slf4j-api_version>
<jul-to-slf4j_version>1.7.30</jul-to-slf4j_version>
<log4j2.version>2.12.1</log4j2.version>
<log4j2.version>2.18.0</log4j2.version>
<ehcache.version>2.10.4</ehcache.version>
<jackson.version>2.9.7</jackson.version>
<hibernate.version>5.6.9.Final</hibernate.version>
......
......@@ -10,12 +10,13 @@ import org.hibernate.transform.Transformers;
import org.sss.common.model.Argument;
import org.sss.common.model.IModule;
import org.sss.common.model.IModuleRoot;
import org.sss.common.model.IParent;
import org.sss.module.hibernate.HibernateUtils;
import org.sss.presentation.noui.context.NoUiContext;
import org.sss.presentation.noui.util.PropertyUtil;
import org.sss.presentation.noui.util.StringUtil;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -55,12 +56,21 @@ public class PreHandle {
}
public static boolean needPreHandle(String mappingUrl) {
return config.containsKey(mappingUrl);
public static boolean needPreHandle(String trnName, Map<String, ?> paramsMap) {
return config.containsKey(trnName) || paramsMap.containsKey("__sptinr");
}
public static void preHandle(String trnName, Map<String, ?> paramsMap, NoUiContext context) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
public static void preHandle(String trnName, Map<String, ?> paramsMap, NoUiContext context) throws Exception {
//区别app还是zk版本
String terminalType = StringUtil.isEmpty(context.getNoUiRequest().getTerminalType()) ? "APP" : context.getNoUiRequest().getTerminalType();
context.getSession().storeData("__terminalType", terminalType);
if (paramsMap.containsKey("__sptinr")) {
loadSpt(context, paramsMap);
}
String[] handles = config.get(trnName);
if (handles == null) {
return;
}
for (String handle : handles) {
if (StringUtil.isEmpty(handle)) {
continue;
......@@ -77,16 +87,17 @@ public class PreHandle {
}
MethodUtils.invokeStaticMethod(PreHandle.class, method, new Object[]{context, paramsMap, args});
}
}
public static void sureBtn(NoUiContext ctx, Map<String, ?> paramsMap, Object... otherParams) throws Exception {
if (otherParams.length != 2) {
log.warn("执行sureBtn预处理方法,需要两个参数:'Module名称'和'待跳转的交易名称'");
return;
log.error("执行sureBtn预处理方法,需要两个参数:'Module名称'和'待跳转的交易名称'");
throw new RuntimeException("执行sureBtn预处理方法,需要两个参数:'Module名称'和'待跳转的交易名称'");
}
if (paramsMap.get("__inr") == null) {
log.warn("执行sureBtn预处理方法,params中需要__inr关键字对应的模型inr");
return;
if (paramsMap.get("__modelinr") == null) {
log.error("执行sureBtn预处理方法,params中需要'__modelinr'关键字对应的模型inr");
throw new RuntimeException("执行sureBtn预处理方法,params参数中需要'__modelinr'映射的模型inr");
}
String grpNam = (String) otherParams[0];
String toTrs = (String) otherParams[1];
......@@ -97,11 +108,24 @@ public class PreHandle {
new Object[]{toTrs, (IModule) ConstructorUtils.invokeConstructor(clazz, new Object[0])}
, new Class[]{String.class, IModule.class});
IModule grp = (IModule) ctx.getSession().getBaseObject(root, grpNam + "\\rec");
ctx.getSupport().get(grp, new Argument[]{new Argument("inr", paramsMap.get("__inr"))});
ctx.getSupport().get(grp, new Argument[]{new Argument("inr", paramsMap.get("__modelinr"))});
ctx.getError();
ctx.getSession().storeData("com.brilliance." + toTrs + ".ref", grp);
}
public static void loadSpt(NoUiContext ctx, Map<String, ?> paramsMap) throws Exception {
if (paramsMap.get("__sptinr") == null) {
log.error("执行loadSpt预处理方法,params中需要'__sptinr'关键字对应的模型inr");
throw new RuntimeException("执行sureBtn预处理方法,params参数中需要'__sptinr'映射的模型inr");
}
Field sysmodClaz = AbstractPOJOModuleSession.class.getDeclaredField("sysmod");
sysmodClaz.setAccessible(true);
IParent sysmod = (IParent) sysmodClaz.get(ctx.getSession());
IModule spt = (IModule) ctx.getSession().getBaseObject(sysmod, "spt");
ctx.getSupport().get(spt, new Argument[]{new Argument("inr", paramsMap.get("__sptinr"))});
ctx.getError();
}
public static boolean initUserInr(String cid, String oid) {
Session session = HibernateUtils.openSession(null);
String ptySql = "select inr,ptytyp from pty where (ptytyp='2' or PTYTYP='1') and cid=?";
......
......@@ -42,7 +42,7 @@
</service>
<service class="org.sss.util.ContainerUtils">
<!-- <property name="cacheClassName" value="org.sss.presentation.noui.cache.Ehcache.EhcacheCache" class="java.lang.String" /> -->
<property name="cacheClassName" value="org.sss.presentation.noui.cache.Ehcache.EhcacheCache" class="java.lang.String" />
<!-- 交易DAT文件是否采用压缩 -->
<property name="isCompressed" value="false" class="boolean"/>
</service>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment