Commit 20bdfd90 by WeiCong

1.兼容新版本得bd底层eibs.hibernatesupport.jar

2.兼容NoUiVersion和非版本支持
3.去掉dn的校验
parent 8ce08718
......@@ -2,7 +2,7 @@ package org.sss.presentation.noui.api.response;
public class NoUiVersion {
private String version;
private String version = "1.0.0";
public String getVersion() {
return version;
......
......@@ -3,7 +3,7 @@ package org.sss.presentation.noui.api.response;
import java.util.Map;
public class ResultUtil {
final static String DEFAULT_VERSION="DEFAULT_VERSION";
public static Result result(String retcod, String retmsg, Object data,String version) {
return new Result(retcod, retmsg, data,version);
}
......@@ -11,4 +11,12 @@ public class ResultUtil {
public static Result result(String retcod, String retmsg, Map<String, Object> data, Map<String, Object> error, Map<String, Object> codetable,String version) {
return new Result(retcod, retmsg, error, codetable, data,version);
}
public static Result result(String retcod, String retmsg, Object data) {
return new Result(retcod, retmsg, data,DEFAULT_VERSION);
}
public static Result result(String retcod, String retmsg, Map<String, Object> data, Map<String, Object> error, Map<String, Object> codetable) {
return new Result(retcod, retmsg, error, codetable, data,DEFAULT_VERSION);
}
}
package org.sss.presentation.noui.context;
import java.util.UUID;
import java.util.ArrayList;
import java.util.List;
import cn.com.brilliance.eibs.auth.EmptyLoginContext;
import log.Log;
import log.LogFactory;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.reflect.ConstructorUtils;
import org.sss.common.model.ILoginContext;
import org.sss.common.model.IModuleSession;
import org.sss.presentation.noui.api.exception.NoUiException;
import org.sss.presentation.noui.api.request.NoUiRequest;
import org.sss.presentation.noui.util.NoUiUtils;
import cn.com.brilliance.eibs.auth.EmptyLoginContext;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class NoUiContextManager {
private static final Log log = LogFactory.getLog(NoUiContextManager.class);
......@@ -46,7 +46,7 @@ public class NoUiContextManager {
IModuleSession session = null;
try {
Class<?> clazz = Class.forName("org.sss.module." + dbType + ".ModuleSessionImpl");
session = (IModuleSession) ConstructorUtils.invokeConstructor(clazz, new Object[] { noUiContext });
session = (IModuleSession) ConstructorUtils.invokeConstructor(clazz, new Object[] { noUiContext, NoUiUtils.connectKeeped});
} catch (Exception e) {
log.error("Constructs NoUiContext error",e);
throw new NoUiException("Constructs NoUiContext error",e);
......
......@@ -50,10 +50,10 @@ public class LoginController {
Map<String, Object> map = new HashMap<>();//此map会存储返回错误码
String userId = noUiRequest.getDataMap().get(Constants.USERNAME).toString();
String password = noUiRequest.getDataMap().get(Constants.PASSWORD).toString();
// String dncode = noUiRequest.getDataMap().get(Constants.DNCODE).toString();
String dncode = noUiRequest.getDataMap().get(Constants.DNCODE).toString();
map.put("j_username", userId);
map.put("j_password", password);
// map.put("j_dncode", dncode);
map.put("j_dncode", dncode);
NoUiContext context = NoUiContextManager.createNoUiContext(noUiRequest);
try {
if (context.getSession().login(map)) {
......
package org.sss.presentation.noui.util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import log.Log;
import log.LogFactory;
import org.sss.common.impl.DefaultLoginContext;
import org.sss.common.impl.ServiceThread;
import org.sss.common.model.ICodetable;
import org.sss.common.model.IFactory;
import org.sss.common.model.IFilter;
import org.sss.common.model.II18n;
import org.sss.common.model.IModuleSession;
import org.sss.common.model.*;
import org.sss.presentation.noui.api.request.NoUiRequest;
import org.sss.presentation.noui.common.Constants;
import org.sss.presentation.noui.context.NoUiContext;
import org.sss.presentation.noui.context.NoUiPresentation;
import org.sss.util.ContainerUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
public class NoUiUtils {
private static final Log log = LogFactory.getLog(NoUiUtils.class);
......@@ -40,6 +35,7 @@ public class NoUiUtils {
public static ICodetable tbl;
public static II18n i18n;
public static IFilter passwordFilter;
public static boolean connectKeeped;
private static final ThreadGroup threadGroup = new ThreadGroup("eIBS");
......
......@@ -44,6 +44,7 @@
</service> -->
<service class="org.sss.presentation.noui.util.NoUiUtils"
initMethodName="init" deinitMethodName="deinit">
<property name="connectKeeped" value="true" class="boolean" />
<property name="debugMode" value="false" class="boolean" />
<!-- WAR包本身的目录为变量$ROOT,WAR/WEB-INF/classes目录为变量$HOME -->
<property name="rootPath" value="$ROOT" />
......
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