Commit 623677ac by cjh

更新接入路由配置

parent 04b50ee3
No preview for this file type
No preview for this file type
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<dependency> <dependency>
<groupId>org.hibernate.common</groupId> <groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId> <artifactId>hibernate-commons-annotations</artifactId>
<version>5.1.0.Final</version> <version>4.0.5.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
...@@ -96,16 +96,22 @@ ...@@ -96,16 +96,22 @@
<artifactId>javassist</artifactId> <artifactId>javassist</artifactId>
<version>3.21.0-GA</version> <version>3.21.0-GA</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>org.junit.jupiter</groupId> <!-- <groupId>org.junit.jupiter</groupId>-->
<artifactId>junit-jupiter-engine</artifactId> <!-- <artifactId>junit-jupiter-engine</artifactId>-->
<version>5.4.0</version> <!-- <version>5.4.0</version>-->
<scope>test</scope> <!-- <scope>test</scope>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>org.junit.jupiter</groupId> <!-- <groupId>org.junit.jupiter</groupId>-->
<artifactId>junit-jupiter-params</artifactId> <!-- <artifactId>junit-jupiter-params</artifactId>-->
<version>5.4.0</version> <!-- <version>5.4.0</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
...@@ -117,8 +123,8 @@ ...@@ -117,8 +123,8 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.8</source> <source>1.6</source>
<target>1.8</target> <target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
......
package cn.com.brilliance.eibs.channel;
import com.dc.eai.data.CompositeData;
public interface Router {
CompositeData run(CompositeData reqData);
}
package cn.com.brilliance.eibs.channel.impl;
import cn.com.brilliance.eibs.channel.Router;
import com.dc.eai.data.CompositeData;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.sss.common.model.*;
import org.sss.presentation.noui.api.exception.NoUiException;
import org.sss.presentation.noui.api.model.Alias;
import org.sss.presentation.noui.api.model.FileIn;
import org.sss.presentation.noui.api.model.FileOut;
import org.sss.presentation.noui.api.model.LoginInfo;
import org.sss.presentation.noui.api.request.NoUiRequest;
import org.sss.presentation.noui.api.response.ErrorCodes;
import org.sss.presentation.noui.api.response.Result;
import org.sss.presentation.noui.api.response.ResultUtil;
import org.sss.presentation.noui.common.Constants;
import org.sss.presentation.noui.context.NoUiContext;
import org.sss.presentation.noui.context.NoUiContextManager;
import org.sss.presentation.noui.context.NoUiPresentation;
import org.sss.presentation.noui.util.CacheUtil;
import org.sss.presentation.noui.util.ESBUtil;
import org.sss.presentation.noui.util.NoUiPresentationUtil;
import org.sss.presentation.noui.util.StringUtil;
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BdRouterImpl implements Router {
private static Log log = LogFactory.getLog(BdRouterImpl.class);
protected static String ON_CLICK = "ON_CLICK";
protected static String INIT = "INIT";
protected static String ON_CHANGE = "ON_CHANGE";
protected static String ON_CHECK = "ON_CHECK";
protected static String ON_STREAM_UPLOAD = "ON_STREAM_UPLOAD";
protected static String ON_STREAM_DOWNLOAD = "ON_STREAM_DOWNLOAD";
@Override
public CompositeData run(CompositeData reqData) {
CompositeData respData = new CompositeData();
CompositeData sys_head = new CompositeData();
CompositeData BODY= new CompositeData();
Result result;
try {
String mappingUrl = ESBUtil.getMappingUrl(reqData);
Map body_map = ESBUtil.bodyToMap(reqData.getStruct(Constants.BODY));
String userId = (String) body_map.get(Constants.USER_ID);
Map request_data = new HashMap();
request_data.put(Constants.DATA,body_map);
result = event(mappingUrl, ON_CLICK, request_data, null, userId, null);
ESBUtil.mapToBody(BODY,(Map<String, Object>)result.getData());
}catch (Exception e){
log.error(e);
result = new Result(ErrorCodes.ERROR,e.getMessage(),null);
}
respData.addStruct(Constants.BODY, BODY);
ESBUtil.buildSysHead(sys_head,result);
respData.addStruct(Constants.SYS_HEAD,sys_head);
return respData;
}
public String getMainPanel(){
return "";
}
@SuppressWarnings("unchecked")
public Result event(String mappingUrl, String eventType, Map<String, Object> dataMap, FileIn file, String userId, FileOut fileOut) {
NoUiContext context = null;
Result ret = null;
try {
NoUiRequest noUiRequest = new NoUiRequest(userId, mappingUrl, dataMap);
context = NoUiContextManager.createNoUiContext(noUiRequest);
Alias alias = new Alias(mappingUrl,Constants.REQ);
Alias alias_resp = new Alias(mappingUrl,Constants.RESP);
String trnName = alias.getTrnName();
// 交易参数赋值
Map<String, ?> paramsMap = noUiRequest.getParamsMap();
for (String key : paramsMap.keySet()) {
context.getSession().storeData(key, paramsMap.get(key));
}
// 设置old sysmod
LoginInfo loginInfo = null;
if( !StringUtils.isEmpty(noUiRequest.getUserId()) ) //开放模式下
loginInfo = (LoginInfo) CacheUtil.get(StringUtil.userUniqueId(noUiRequest));
if(loginInfo != null)
{
NoUiPresentationUtil.setSysmod(context, (byte[]) loginInfo.getSysmod());
context.setLoginInfo(loginInfo);
}
// 交易跳转
context.getSession().chain(true, trnName);
//执行可能存在的主面板的初始化
if(this.getMainPanel().length() > 0)
{
IPanel mainPanel = (IPanel)context.getSession().getBaseObject(null, this.getMainPanel());
mainPanel.invokeDefaultRules(context);
}
// 模型赋值
NoUiPresentationUtil.hanleInput(context, noUiRequest, alias);
if (eventType.equals(ON_CLICK)) {
IBaseObject dataField = baseObject(context, noUiRequest, alias);
((IDatafield<?>) dataField).invokeEventRules(context, EventType.ON_CLICK, null);
} else if (eventType.equals(ON_CHANGE)) {
IBaseObject dataField = baseObject(context, noUiRequest, alias);
((IDatafield<?>) dataField).invokeEventRules(context, EventType.ON_CHANGE, null);
} else if (eventType.equals(ON_CHECK)) {
for (String aliasKey : noUiRequest.getDataMap().keySet()) {
if (aliasKey.startsWith(Constants.MAPPING_PRE)) {
continue;
}
String realPath = alias.getRelPath(aliasKey);
IBaseObject currentDataField = (IDatafield<?>) context.getSession().getBaseObject(context.getRoot(), realPath);
if (currentDataField instanceof IDatafield<?>) {
((IDatafield<?>) currentDataField).invokeCheckRules(context);
}
}
} else if (eventType.equals(ON_STREAM_UPLOAD) && file != null) {
@SuppressWarnings("rawtypes")
IDatafield dataField = (IDatafield) baseObject(context, noUiRequest, alias);
IStream stream = (IStream) dataField.getValue();
stream.setName(file.getOriginalFilename());
stream.setType(file.getContentType());
log.info("文件表单 key:" + file.getOriginalFilename() + ",size:" + file.getSize());
IOUtils.copy(new ByteArrayInputStream(file.getBytes()), stream.getOutputStream(), 1024);
dataField.invokeEventRules(context, EventType.ON_STREAM_UPLOAD, null);
} else if (eventType.equals(ON_STREAM_DOWNLOAD)) {
@SuppressWarnings("rawtypes")
IDatafield dataField = (IDatafield) baseObject(context, noUiRequest, alias);
IStream stream = (IStream) dataField.getValue();
byte[] data = IOUtils.readFully(stream.getInputStream(), (int) stream.size());
dataField.invokeEventRules(context, EventType.ON_STREAM_DOWNLOAD, null);
// IOUtils.write(data, response.getOutputStream());
fileOut.setBytes(data);
}
// 保存新的LoginInfo
if(loginInfo!=null) //当为开放模式下,LoginInfo 为空
{
byte[] sysmodBytes = NoUiPresentationUtil.sysmodToBytes(context);
loginInfo.setSysmod(sysmodBytes);
CacheUtil.set(StringUtil.userUniqueId(noUiRequest), loginInfo);
}
Map<String, Object> afterReturnData = handleReturnData(eventType, context, noUiRequest, alias_resp);
ret = ResultUtil.result(NoUiPresentationUtil.retCode(context), NoUiPresentationUtil.retMsg(context), afterReturnData,
NoUiPresentationUtil.handleErrorReturnData(context, alias_resp), NoUiPresentationUtil.handleCodeTableReturnData(context, alias));
} catch (Exception e) {
log.error("OnClick command error", e);
ret = ResultUtil.result(ErrorCodes.ERROR, "hander error", e.getMessage());
} finally {
if (context != null)
{
//context.getSupport().disconnect();
context.dispose();
}
}
return ret;
}
private IBaseObject baseObject(NoUiContext context, NoUiRequest noUiRequest, Alias alias) {
String aliasActionUrl = alias.getAliasActionUrl();
String actionUrl = alias.getRel().get(aliasActionUrl);
IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), actionUrl);
if (null == baseObject)
throw new NoUiException("onClickUrl :" + actionUrl + " is not exsit");
return baseObject;
}
private Map<String, Object> handleReturnData(String eventType, NoUiContext context, NoUiRequest noUiRequest, Alias alias) {
Map<String, Object> data = new HashMap<String, Object>();
// 初始化事件
if (eventType.equals(INIT)) {
for (String aliasKey : alias.getRel().keySet()) {
if (aliasKey.startsWith(Constants.MAPPING_PRE)) {
continue;
}
String realPath = alias.getRelPath(aliasKey);
IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), realPath);
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, baseObject, realPath,alias));
}
return data;
}
NoUiPresentation gui = (NoUiPresentation) context.getGui();
Map<String, Object> modifyMap = gui.getModifyMap();
List<String> containsKeys = new ArrayList<String>();
for (Map.Entry<String, Object> modifyEntry : modifyMap.entrySet()) {
for (Map.Entry<String, String> aliasEntry : alias.getRel().entrySet()) {
String aliasKey = aliasEntry.getKey();
String aliasPath = aliasEntry.getValue();
if(aliasPath == null)
{
log.error("错误的mapping:"+noUiRequest.getMappingUrl()+"--"+aliasKey+"--"+aliasPath);
continue;
}
if(modifyEntry.getKey() == null)
{
log.error("错误的modifymap:"+noUiRequest.getMappingUrl()+"--"+modifyMap);
continue;
}
int modKeyLen = modifyEntry.getKey().length();
if(aliasPath.equals(modifyEntry.getKey()) || (aliasPath.startsWith(modifyEntry.getKey())) && aliasPath.charAt(modKeyLen)=='\\'){
Object val = modifyEntry.getValue();
if(aliasKey == null)
continue;
if(aliasPath.length() > modKeyLen && val instanceof IModule){
IBaseObject obj = context.getSession().getBaseObject((IModule)val,aliasPath);
if(!(obj instanceof IModule))
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, obj, aliasEntry.getValue(),alias));
}else
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, val, aliasEntry.getValue(),alias));
containsKeys.add(modifyEntry.getKey());
}
}
}
// 不能修改
// for (String key : modifyMap.keySet()) {
// if (!containsKeys.contains(key)) {
// System.out.println("modify test:" + modifyMap.get(key).getClass());
// System.out.println("modify datafield:" + (modifyMap.get(key) instanceof IDatafield));
// System.out.println("modify module:" + (modifyMap.get(key) instanceof IModule));
// System.out.println("modify moduleList:" + (modifyMap.get(key) instanceof IModuleList));
// if(key == null)
// continue;
// if(!(modifyMap.get(key) instanceof IModule))
// data.put(key, NoUiPresentationUtil.handIBaseObject(context, modifyMap.get(key), key,alias));
// }
// }
return data;
}
}
package cn.com.brilliance.eibs.channel.impl;
import cn.com.brilliance.eibs.channel.Router;
import com.brilliance.eibs.main.Client;
import com.dc.eai.data.CompositeData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class GdRouterImpl implements Router {
private static Log log = LogFactory.getLog(GdRouterImpl.class);
@Override
public CompositeData run(CompositeData data) {
if(log.isDebugEnabled()){
log.debug("[开始接口业务逻辑处理]");
}
data = (CompositeData) new Client().call("deal","deal",new Object[]{data}).getContent();
return data;
}
}
package cn.com.brilliance.eibs.service; package cn.com.brilliance.eibs.service;
import cn.com.brilliance.eibs.channel.Router;
import cn.com.brilliance.eibs.channel.impl.BdRouterImpl;
import cn.com.brilliance.eibs.channel.impl.GdRouterImpl;
import com.dc.eai.data.CompositeData; import com.dc.eai.data.CompositeData;
import com.dc.eai.data.Field;
import com.dc.eai.data.FieldAttr;
import com.dc.eai.data.FieldType;
import com.dcfs.esb.server.service.Service; import com.dcfs.esb.server.service.Service;
import com.google.gson.Gson;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.sss.common.model.*;
import org.sss.module.hibernate.HibernateUtils;
import org.sss.presentation.noui.api.exception.NoUiException;
import org.sss.presentation.noui.api.model.Alias;
import org.sss.presentation.noui.api.model.FileIn;
import org.sss.presentation.noui.api.model.FileOut;
import org.sss.presentation.noui.api.model.LoginInfo;
import org.sss.presentation.noui.api.request.NoUiRequest;
import org.sss.presentation.noui.api.response.ErrorCodes; import org.sss.presentation.noui.api.response.ErrorCodes;
import org.sss.presentation.noui.api.response.Result; import org.sss.presentation.noui.api.response.Result;
import org.sss.presentation.noui.api.response.ResultUtil;
import org.sss.presentation.noui.common.Constants; import org.sss.presentation.noui.common.Constants;
import org.sss.presentation.noui.context.NoUiContext;
import org.sss.presentation.noui.context.NoUiContextManager;
import org.sss.presentation.noui.context.NoUiPresentation;
import org.sss.presentation.noui.util.CacheUtil;
import org.sss.presentation.noui.util.ESBUtil; import org.sss.presentation.noui.util.ESBUtil;
import org.sss.presentation.noui.util.NoUiPresentationUtil;
import org.sss.presentation.noui.util.StringUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ServiceImpl implements Service { public class ServiceImpl implements Service {
private static Log log = LogFactory.getLog(ServiceImpl.class); private static Log log = LogFactory.getLog(ServiceImpl.class);
protected static String ON_CLICK = "ON_CLICK";
protected static String INIT = "INIT";
protected static String ON_CHANGE = "ON_CHANGE";
protected static String ON_CHECK = "ON_CHECK";
protected static String ON_STREAM_UPLOAD = "ON_STREAM_UPLOAD";
protected static String ON_STREAM_DOWNLOAD = "ON_STREAM_DOWNLOAD";
public String getMainPanel(){
return "";
}
@SuppressWarnings("unchecked")
public Result event(String mappingUrl, String eventType, Map<String, Object> dataMap, FileIn file, String userId, FileOut fileOut) {
NoUiContext context = null;
Result ret = null;
try {
NoUiRequest noUiRequest = new NoUiRequest(userId, mappingUrl, dataMap);
context = NoUiContextManager.createNoUiContext(noUiRequest);
Alias alias = new Alias(mappingUrl,Constants.REQ);
Alias alias_resp = new Alias(mappingUrl,Constants.RESP);
String trnName = alias.getTrnName();
// 交易参数赋值
Map<String, ?> paramsMap = noUiRequest.getParamsMap();
for (String key : paramsMap.keySet()) {
context.getSession().storeData(key, paramsMap.get(key));
}
// 设置old sysmod
LoginInfo loginInfo = null;
if( !StringUtils.isEmpty(noUiRequest.getUserId()) ) //开放模式下
loginInfo = (LoginInfo) CacheUtil.get(StringUtil.userUniqueId(noUiRequest));
if(loginInfo != null)
{
NoUiPresentationUtil.setSysmod(context, (byte[]) loginInfo.getSysmod());
context.setLoginInfo(loginInfo);
}
// 交易跳转
context.getSession().chain(true, trnName);
//执行可能存在的主面板的初始化
if(this.getMainPanel().length() > 0)
{
IPanel mainPanel = (IPanel)context.getSession().getBaseObject(null, this.getMainPanel());
mainPanel.invokeDefaultRules(context);
}
// 模型赋值
NoUiPresentationUtil.hanleInput(context, noUiRequest, alias);
if (eventType.equals(ON_CLICK)) {
IBaseObject dataField = baseObject(context, noUiRequest, alias);
((IDatafield<?>) dataField).invokeEventRules(context, EventType.ON_CLICK, null);
} else if (eventType.equals(ON_CHANGE)) {
IBaseObject dataField = baseObject(context, noUiRequest, alias);
((IDatafield<?>) dataField).invokeEventRules(context, EventType.ON_CHANGE, null);
} else if (eventType.equals(ON_CHECK)) {
for (String aliasKey : noUiRequest.getDataMap().keySet()) {
if (aliasKey.startsWith(Constants.MAPPING_PRE)) {
continue;
}
String realPath = alias.getRelPath(aliasKey);
IBaseObject currentDataField = (IDatafield<?>) context.getSession().getBaseObject(context.getRoot(), realPath);
if (currentDataField instanceof IDatafield<?>) {
((IDatafield<?>) currentDataField).invokeCheckRules(context);
}
}
} else if (eventType.equals(ON_STREAM_UPLOAD) && file != null) {
@SuppressWarnings("rawtypes")
IDatafield dataField = (IDatafield) baseObject(context, noUiRequest, alias);
IStream stream = (IStream) dataField.getValue();
stream.setName(file.getOriginalFilename());
stream.setType(file.getContentType());
log.info("文件表单 key:" + file.getOriginalFilename() + ",size:" + file.getSize());
IOUtils.copy(new ByteArrayInputStream(file.getBytes()), stream.getOutputStream(), 1024);
dataField.invokeEventRules(context, EventType.ON_STREAM_UPLOAD, null);
} else if (eventType.equals(ON_STREAM_DOWNLOAD)) {
@SuppressWarnings("rawtypes")
IDatafield dataField = (IDatafield) baseObject(context, noUiRequest, alias);
IStream stream = (IStream) dataField.getValue();
byte[] data = IOUtils.readFully(stream.getInputStream(), (int) stream.size());
dataField.invokeEventRules(context, EventType.ON_STREAM_DOWNLOAD, null);
// IOUtils.write(data, response.getOutputStream());
fileOut.setBytes(data);
}
// 保存新的LoginInfo
if(loginInfo!=null) //当为开放模式下,LoginInfo 为空
{
byte[] sysmodBytes = NoUiPresentationUtil.sysmodToBytes(context);
loginInfo.setSysmod(sysmodBytes);
CacheUtil.set(StringUtil.userUniqueId(noUiRequest), loginInfo);
}
Map<String, Object> afterReturnData = handleReturnData(eventType, context, noUiRequest, alias_resp);
ret = ResultUtil.result(NoUiPresentationUtil.retCode(context), NoUiPresentationUtil.retMsg(context), afterReturnData,
NoUiPresentationUtil.handleErrorReturnData(context, alias_resp), NoUiPresentationUtil.handleCodeTableReturnData(context, alias));
} catch (Exception e) {
log.error("OnClick command error", e);
ret = ResultUtil.result(ErrorCodes.ERROR, "hander error", e.getMessage());
} finally {
if (context != null)
{
//context.getSupport().disconnect();
context.dispose();
}
}
return ret;
}
private IBaseObject baseObject(NoUiContext context, NoUiRequest noUiRequest, Alias alias) {
String aliasActionUrl = alias.getAliasActionUrl();
String actionUrl = alias.getRel().get(aliasActionUrl);
IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), actionUrl);
if (null == baseObject)
throw new NoUiException("onClickUrl :" + actionUrl + " is not exsit");
return baseObject;
}
private Map<String, Object> handleReturnData(String eventType, NoUiContext context, NoUiRequest noUiRequest, Alias alias) {
Map<String, Object> data = new HashMap<String, Object>();
// 初始化事件
if (eventType.equals(INIT)) {
for (String aliasKey : alias.getRel().keySet()) {
if (aliasKey.startsWith(Constants.MAPPING_PRE)) {
continue;
}
String realPath = alias.getRelPath(aliasKey);
IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), realPath);
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, baseObject, realPath,alias));
}
return data;
}
NoUiPresentation gui = (NoUiPresentation) context.getGui();
Map<String, Object> modifyMap = gui.getModifyMap();
List<String> containsKeys = new ArrayList<String>();
for (Map.Entry<String, Object> modifyEntry : modifyMap.entrySet()) {
for (Map.Entry<String, String> aliasEntry : alias.getRel().entrySet()) {
String aliasKey = aliasEntry.getKey();
String aliasPath = aliasEntry.getValue();
if(aliasPath == null)
{
log.error("错误的mapping:"+noUiRequest.getMappingUrl()+"--"+aliasKey+"--"+aliasPath);
continue;
}
if(modifyEntry.getKey() == null)
{
log.error("错误的modifymap:"+noUiRequest.getMappingUrl()+"--"+modifyMap);
continue;
}
int modKeyLen = modifyEntry.getKey().length();
if(aliasPath.equals(modifyEntry.getKey()) || (aliasPath.startsWith(modifyEntry.getKey())) && aliasPath.charAt(modKeyLen)=='\\'){
Object val = modifyEntry.getValue();
if(aliasKey == null)
continue;
if(aliasPath.length() > modKeyLen && val instanceof IModule){
IBaseObject obj = context.getSession().getBaseObject((IModule)val,aliasPath);
if(!(obj instanceof IModule))
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, obj, aliasEntry.getValue(),alias));
}else
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, val, aliasEntry.getValue(),alias));
containsKeys.add(modifyEntry.getKey());
}
}
}
// 不能修改
// for (String key : modifyMap.keySet()) {
// if (!containsKeys.contains(key)) {
// System.out.println("modify test:" + modifyMap.get(key).getClass());
// System.out.println("modify datafield:" + (modifyMap.get(key) instanceof IDatafield));
// System.out.println("modify module:" + (modifyMap.get(key) instanceof IModule));
// System.out.println("modify moduleList:" + (modifyMap.get(key) instanceof IModuleList));
// if(key == null)
// continue;
// if(!(modifyMap.get(key) instanceof IModule))
// data.put(key, NoUiPresentationUtil.handIBaseObject(context, modifyMap.get(key), key,alias));
// }
// }
return data;
}
public CompositeData exec(CompositeData reqData) { public CompositeData exec(CompositeData reqData) {
Router router;
CompositeData respData = new CompositeData(); String mappingUrl = ESBUtil.getMappingUrl(reqData);
try { if(mappingUrl == null){
String userId = ESBUtil.getUserId(reqData); CompositeData respData = new CompositeData();
String mappingUrl = ESBUtil.getMappingUrl(reqData); CompositeData sys_head = new CompositeData();
Map body_map = ESBUtil.bodyToMap(reqData.getStruct(Constants.BODY));
Map request_data = new HashMap();
request_data.put(Constants.DATA,body_map);
Result result = event(mappingUrl, ON_CLICK, request_data, null, userId, null);
CompositeData BODY= new CompositeData(); CompositeData BODY= new CompositeData();
ESBUtil.mapToBody(BODY,(Map<String, Object>)result.getData());
respData.addStruct(Constants.BODY, BODY); respData.addStruct(Constants.BODY, BODY);
}catch (Exception e){ ESBUtil.buildSysHead(sys_head,new Result(ErrorCodes.ERROR,"服务码不存在,请检查映射配置文件",null));
log.error(e); respData.addStruct(Constants.SYS_HEAD,sys_head);
return respData;
}
if(mappingUrl.equals(Constants.ROUTE_FLAG)){
router = new GdRouterImpl();
}else{
router = new BdRouterImpl();
} }
return respData; return router.run(reqData);
} }
} }
...@@ -21,10 +21,10 @@ public class Alias { ...@@ -21,10 +21,10 @@ public class Alias {
} }
private Map<String, String> rel; private Map<String, String> rel;
private Map<String, String> revertRel = new HashMap<>(); private Map<String, String> revertRel = new HashMap<String, String>();
private Map<String, String> lstRel; private Map<String, String> lstRel;
private Map<String, String> revertLstRel = new HashMap<>(); private Map<String, String> revertLstRel = new HashMap<String, String>();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public Alias(String mappingUrl,String flag) { public Alias(String mappingUrl,String flag) {
......
...@@ -13,7 +13,7 @@ public class Menu implements Serializable { ...@@ -13,7 +13,7 @@ public class Menu implements Serializable {
private String id; private String id;
private String label; private String label;
private String value; private String value;
public List<Menu> subMenu = new ArrayList<>(); public List<Menu> subMenu = new ArrayList<Menu>();
public String getId() { public String getId() {
return id; return id;
......
...@@ -16,9 +16,15 @@ public class Constants { ...@@ -16,9 +16,15 @@ public class Constants {
public final static String BODY = "BODY"; public final static String BODY = "BODY";
public final static String SYS_HEAD = "SYS_HEAD"; public final static String SYS_HEAD = "SYS_HEAD";
public final static String APP_HEAD = "APP_HEAD"; public final static String APP_HEAD = "APP_HEAD";
public final static String USER_ID = "USER_ID"; public final static String USER_ID = "OPERATOR_NO";
public final static String SERVICE_SCENE = "SERVICE_SCENE"; public final static String SERVICE_SCENE = "SERVICE_SCENE";
public final static String SERVICE_CODE = "SERVICE_CODE"; public final static String SERVICE_CODE = "SERVICE_CODE";
public final static String REQ = "req"; public final static String REQ = "req";
public final static String RESP = "resp"; public final static String RESP = "resp";
public final static String ROUTE_FLAG = "tzbets";
public final static String RET = "RET";
public final static String RET_MSG = "RET_MSG";
public final static String RET_CODE = "RET_CODE";
public final static String RET_STATUS = "RET_STATUS";
} }
...@@ -59,11 +59,11 @@ public class NoUiPresentation extends AbstractNullPresentation { ...@@ -59,11 +59,11 @@ public class NoUiPresentation extends AbstractNullPresentation {
// public final List<IAttribute<?>> codeValuesList = new // public final List<IAttribute<?>> codeValuesList = new
// ArrayList<IAttribute<?>>(); // ArrayList<IAttribute<?>>();
private Map<String, Object> codetable = new HashMap<>(); private Map<String, Object> codetable = new HashMap<String, Object>();
private NoUiRequest noUiRequest; private NoUiRequest noUiRequest;
private Map<String, Object> error = new HashMap<>(); private Map<String, Object> error = new HashMap<String, Object>();
private Map<String, Object> modifyMap = new HashMap<>(); private Map<String, Object> modifyMap = new HashMap<String, Object>();
// public final List<IAttribute<?>> enableList = new // public final List<IAttribute<?>> enableList = new
// ArrayList<IAttribute<?>>(); // ArrayList<IAttribute<?>>();
......
...@@ -5,7 +5,7 @@ import java.util.Map; ...@@ -5,7 +5,7 @@ import java.util.Map;
public class CacheUtil { public class CacheUtil {
private static Map map = new HashMap<>(); private static Map map = new HashMap<String,Object>();
synchronized public static Object get(String key){ synchronized public static Object get(String key){
return map.get(key); return map.get(key);
......
package org.sss.presentation.noui.util; package org.sss.presentation.noui.util;
import com.dc.eai.data.*; import com.dc.eai.data.*;
import org.sss.presentation.noui.api.response.ErrorCodes;
import org.sss.presentation.noui.api.response.Result;
import org.sss.presentation.noui.common.Constants; import org.sss.presentation.noui.common.Constants;
import java.io.IOException; import java.io.IOException;
...@@ -19,11 +21,6 @@ public class ESBUtil { ...@@ -19,11 +21,6 @@ public class ESBUtil {
} }
} }
public static String getUserId(CompositeData reqData){
CompositeData sys_head = reqData.getStruct(Constants.SYS_HEAD);
return (String) sys_head.getField(Constants.USER_ID).getValue();
}
public static String getMappingUrl(CompositeData reqData){ public static String getMappingUrl(CompositeData reqData){
CompositeData sys_head = reqData.getStruct(Constants.SYS_HEAD); CompositeData sys_head = reqData.getStruct(Constants.SYS_HEAD);
String code = (String) sys_head.getField(Constants.SERVICE_CODE).getValue(); String code = (String) sys_head.getField(Constants.SERVICE_CODE).getValue();
...@@ -31,9 +28,38 @@ public class ESBUtil { ...@@ -31,9 +28,38 @@ public class ESBUtil {
return (String) serviceMap.get(code+"."+scene); return (String) serviceMap.get(code+"."+scene);
} }
public static void buildSysHead(CompositeData data, Result result){
FieldType type = FieldType.getEnum("string");
FieldAttr fieldAttr = new FieldAttr(type,20);
Field ret_msg = new Field(fieldAttr);
Field ret_status = new Field(fieldAttr);
Field ret_code = new Field(fieldAttr);
if(result.getRetcod().equals(ErrorCodes.SUCCESS)){
ret_status.setValue("S");
ret_msg.setValue("success");
ret_code.setValue("000000");
}else{
ret_status.setValue("F");
ret_msg.setValue(result.getRetmsg());
ret_code.setValue("999999");
}
CompositeData struct= new CompositeData();
struct.addField(Constants.RET_MSG,ret_msg);
struct.addField(Constants.RET_CODE,ret_code);
Array array = new Array();
array.addStruct(struct);
data.addArray(Constants.RET, array);
data.addField(Constants.RET_STATUS,ret_status);
}
public static Map bodyToMap(CompositeData body){ public static Map bodyToMap(CompositeData body){
Iterator<String> iterator = body.iterator(); Iterator<String> iterator = body.iterator();
Map map = new HashMap<>(); Map map = new HashMap<String,Object>();
while(iterator.hasNext()){ while(iterator.hasNext()){
String child = iterator.next(); String child = iterator.next();
AtomData atomData = body.getObject(child); AtomData atomData = body.getObject(child);
...@@ -41,7 +67,7 @@ public class ESBUtil { ...@@ -41,7 +67,7 @@ public class ESBUtil {
Object value = ((Field)atomData).getValue(); Object value = ((Field)atomData).getValue();
map.put(child,value); map.put(child,value);
}else if(atomData.isArray()){ }else if(atomData.isArray()){
List list = new ArrayList<>(); List list = new ArrayList<Object>();
Array lst = (Array)atomData; Array lst = (Array)atomData;
for(int i=0;i<lst.size();i++){ for(int i=0;i<lst.size();i++){
AtomData atomData1 = lst.getObject(i); AtomData atomData1 = lst.getObject(i);
...@@ -50,11 +76,11 @@ public class ESBUtil { ...@@ -50,11 +76,11 @@ public class ESBUtil {
}else if(atomData1.isStruct()){ }else if(atomData1.isStruct()){
CompositeData lst_bd = ((CompositeData)atomData1); CompositeData lst_bd = ((CompositeData)atomData1);
Iterator<String> lst_iterator = lst_bd.iterator(); Iterator<String> lst_iterator = lst_bd.iterator();
Map lst_map = new HashMap<>(); Map lst_map = new HashMap<String,Object>();
while(lst_iterator.hasNext()){ while(lst_iterator.hasNext()){
String lst_child = lst_iterator.next(); String lst_child = lst_iterator.next();
Object lst_value = lst_bd.getField(lst_child); Object lst_value = lst_bd.getField(lst_child);
lst_map.put(lst_child,lst_value); lst_map.put(lst_child,((Field)lst_value).getValue());
} }
list.add(lst_map); list.add(lst_map);
} }
......
...@@ -60,10 +60,10 @@ public class NoUiPresentationUtil { ...@@ -60,10 +60,10 @@ public class NoUiPresentationUtil {
List<Map<String, Object>> valueList = (List<Map<String, Object>>) value; List<Map<String, Object>> valueList = (List<Map<String, Object>>) value;
for (Map<String, Object> m : valueList) { for (Map<String, Object> m : valueList) {
IModule module = moduleList.add(); IModule module = moduleList.add();
for (Map.Entry<String, Object> entry : m.entrySet()){ for (Map.Entry<String, Object> entry : m.entrySet()) {
if(alias.getLstRelPath(entry.getKey())==null){ if (alias.getLstRelPath(entry.getKey()) == null) {
handleDatafield(context, (IDatafield<Object>) module.get(entry.getKey()), entry.getValue()); handleDatafield(context, (IDatafield<Object>) module.get(entry.getKey()), entry.getValue());
}else{ } else {
handleDatafield(context, (IDatafield<Object>) module.get(alias.getLstRelPath(entry.getKey())), entry.getValue()); handleDatafield(context, (IDatafield<Object>) module.get(alias.getLstRelPath(entry.getKey())), entry.getValue());
} }
} }
...@@ -84,46 +84,52 @@ public class NoUiPresentationUtil { ...@@ -84,46 +84,52 @@ public class NoUiPresentationUtil {
private static void handleDatafield(IContext context, IDatafield<Object> dataField, Object value) { private static void handleDatafield(IContext context, IDatafield<Object> dataField, Object value) {
if (null == value || dataField == null) if (null == value || dataField == null)
return; return;
Class<?> dataType = dataField.getDataType(); try {
if (dataType.equals(String.class)) { Class<?> dataType = dataField.getDataType();
String valStr = value.toString(); if (dataType.equals(String.class)) {
String valStr = value.toString();
// if ("true".equalsIgnoreCase(valStr.trim())) // if ("true".equalsIgnoreCase(valStr.trim()))
// dataField.setValue("X"); // dataField.setValue("X");
// else if ("false".equalsIgnoreCase(valStr.trim())) // else if ("false".equalsIgnoreCase(valStr.trim()))
// dataField.setValue(""); // dataField.setValue("");
// else // else
dataField.setValue(valStr); dataField.setValue(valStr);
return; return;
} }
if (dataType.equals(Integer.TYPE) || dataType.equals(Integer.class)) { if (dataType.equals(Integer.TYPE) || dataType.equals(Integer.class)) {
String data = value.toString().trim(); String data = value.toString().trim();
if (StringUtils.isEmpty(data)) if (StringUtils.isEmpty(data))
dataField.setValue(0); dataField.setValue(0);
else else
dataField.setValue(Double.valueOf(data.replaceAll(",", "")).intValue()); dataField.setValue(Double.valueOf(data.replaceAll(",", "")).intValue());
return; return;
} }
if (dataType.equals(BigDecimal.class)) { if (dataType.equals(BigDecimal.class)) {
String data = value.toString().trim(); String data = value.toString().trim();
if (StringUtils.isEmpty(data)) if (StringUtils.isEmpty(data))
dataField.setValue(new BigDecimal(0)); dataField.setValue(new BigDecimal(0));
else else
dataField.setValue(new BigDecimal(data.replaceAll(",", ""))); dataField.setValue(new BigDecimal(data.replaceAll(",", "")));
return; return;
} }
if (dataType.equals(Date.class)) { if (dataType.equals(Date.class)) {
String data = value.toString().trim(); String data = value.toString().trim();
dataField.setValue(dealDateFormat(data)); dataField.setValue(dealDateFormat(data));
return; return;
} }
if (dataType.equals(Long.TYPE) || dataType.equals(Long.class)) { if (dataType.equals(Long.TYPE) || dataType.equals(Long.class)) {
String data = value.toString().trim(); String data = value.toString().trim();
if (StringUtils.isEmpty(data)) if (StringUtils.isEmpty(data))
dataField.setValue(0L); dataField.setValue(0L);
else else
dataField.setValue(Double.valueOf(data.replaceAll(",", "")).longValue()); dataField.setValue(Double.valueOf(data.replaceAll(",", "")).longValue());
return; return;
}
} catch (Exception e) {
log.error("object["+value+"] data type error",e);
throw new NoUiException("Unsupported data type", ErrorCodes.UNSUPPORTED_DATA_TYPE);
} }
throw new NoUiException("Unsupported data type", ErrorCodes.UNSUPPORTED_DATA_TYPE); throw new NoUiException("Unsupported data type", ErrorCodes.UNSUPPORTED_DATA_TYPE);
} }
...@@ -180,7 +186,7 @@ public class NoUiPresentationUtil { ...@@ -180,7 +186,7 @@ public class NoUiPresentationUtil {
} }
String realPath = alias.getRelPath(aliasKey); String realPath = alias.getRelPath(aliasKey);
IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), realPath); IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), realPath);
data.put(aliasKey, handIBaseObject(context, baseObject, realPath,alias)); data.put(aliasKey, handIBaseObject(context, baseObject, realPath, alias));
} }
return data; return data;
} }
...@@ -193,7 +199,7 @@ public class NoUiPresentationUtil { ...@@ -193,7 +199,7 @@ public class NoUiPresentationUtil {
String aliasPath = aliasEntry.getValue(); String aliasPath = aliasEntry.getValue();
if (aliasPath.startsWith(modifyEntry.getKey())) { if (aliasPath.startsWith(modifyEntry.getKey())) {
Object val = modifyEntry.getValue(); Object val = modifyEntry.getValue();
data.put(aliasKey, handIBaseObject(context, val, aliasEntry.getValue(),alias)); data.put(aliasKey, handIBaseObject(context, val, aliasEntry.getValue(), alias));
} }
} }
...@@ -239,20 +245,20 @@ public class NoUiPresentationUtil { ...@@ -239,20 +245,20 @@ public class NoUiPresentationUtil {
return null; return null;
} }
public static Object handIBaseObject(IContext context, Object val, String path,Alias alias) { public static Object handIBaseObject(IContext context, Object val, String path, Alias alias) {
if (val == null) if (val == null)
return null; return null;
if (val instanceof IModuleList<?>) { if (val instanceof IModuleList<?>) {
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
IModuleList<?> moduleList = (IModuleList<?>) val; IModuleList<?> moduleList = (IModuleList<?>) val;
for (int index = 0; index < moduleList.size(); index++) { for (int index = 0; index < moduleList.size(); index++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<String, Object>();
IModule module = moduleList.get(index); IModule module = moduleList.get(index);
Collection<IDatafield> datafields = module.getDatafields(); Collection<IDatafield> datafields = module.getDatafields();
for (IDatafield<Object> datafield : datafields) { for (IDatafield<Object> datafield : datafields) {
if(alias.getRevertLstRelPath(datafield.getName())==null){ if (alias.getRevertLstRelPath(datafield.getName()) == null) {
map.put(datafield.getName(), handle(datafield.getValue(), datafield)); map.put(datafield.getName(), handle(datafield.getValue(), datafield));
}else{ } else {
map.put(alias.getRevertLstRelPath(datafield.getName()), handle(datafield.getValue(), datafield)); map.put(alias.getRevertLstRelPath(datafield.getName()), handle(datafield.getValue(), datafield));
} }
} }
...@@ -261,33 +267,32 @@ public class NoUiPresentationUtil { ...@@ -261,33 +267,32 @@ public class NoUiPresentationUtil {
return list; return list;
} else if (val instanceof IModule) { } else if (val instanceof IModule) {
val = context.getSession().getBaseObject(context.getRoot(), path); val = context.getSession().getBaseObject(context.getRoot(), path);
return handIBaseObject(context, val, path,alias); return handIBaseObject(context, val, path, alias);
} else if (val instanceof IDatafield) { } else if (val instanceof IDatafield) {
IDatafield datafield = (IDatafield) val; IDatafield datafield = (IDatafield) val;
return handle(datafield.getValue(), datafield); return handle(datafield.getValue(), datafield);
} }
return null; return null;
} }
public static Map<String, Object> getWholeAliasData(IContext context, String mappingUrl) public static Map<String, Object> getWholeAliasData(IContext context, String mappingUrl) {
{
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
Alias alias = new Alias(mappingUrl,Constants.RESP); Alias alias = new Alias(mappingUrl, Constants.RESP);
for (String aliasKey : alias.getRel().keySet()) { for (String aliasKey : alias.getRel().keySet()) {
if (aliasKey.startsWith(Constants.MAPPING_PRE)) { if (aliasKey.startsWith(Constants.MAPPING_PRE)) {
continue; continue;
} }
String realPath = alias.getRelPath(aliasKey); String realPath = alias.getRelPath(aliasKey);
IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), realPath); IBaseObject baseObject = context.getSession().getBaseObject(context.getRoot(), realPath);
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, baseObject, realPath,alias)); data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, baseObject, realPath, alias));
} }
return data; return data;
} }
public static Map<String, Object> handleErrorReturnData(NoUiContext context, Alias alias) { public static Map<String, Object> handleErrorReturnData(NoUiContext context, Alias alias) {
NoUiPresentation gui = (NoUiPresentation) context.getGui(); NoUiPresentation gui = (NoUiPresentation) context.getGui();
Map<String, Object> errorMap = gui.getError(); Map<String, Object> errorMap = gui.getError();
Map<String, Object> n_errorMap = new HashMap<String,Object>(); Map<String, Object> n_errorMap = new HashMap<String, Object>();
for (Map.Entry<String, Object> errorEntity : errorMap.entrySet()) { for (Map.Entry<String, Object> errorEntity : errorMap.entrySet()) {
String key = errorEntity.getKey(); String key = errorEntity.getKey();
String realKey = alias.getRevertRel().get(key); String realKey = alias.getRevertRel().get(key);
...@@ -302,7 +307,7 @@ public class NoUiPresentationUtil { ...@@ -302,7 +307,7 @@ public class NoUiPresentationUtil {
public static Map<String, Object> handleCodeTableReturnData(NoUiContext context, Alias alias) { public static Map<String, Object> handleCodeTableReturnData(NoUiContext context, Alias alias) {
NoUiPresentation gui = (NoUiPresentation) context.getGui(); NoUiPresentation gui = (NoUiPresentation) context.getGui();
Map<String, Object> codeTableMap = gui.getCodetable(); Map<String, Object> codeTableMap = gui.getCodetable();
Map<String, Object> retCodeTableMap = new HashMap<>(); Map<String, Object> retCodeTableMap = new HashMap<String, Object>();
for (Map.Entry<String, Object> codeTableEntity : codeTableMap.entrySet()) { for (Map.Entry<String, Object> codeTableEntity : codeTableMap.entrySet()) {
String key = codeTableEntity.getKey(); String key = codeTableEntity.getKey();
String realKey = alias.getRevertRel().get(key); String realKey = alias.getRevertRel().get(key);
......
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.brilliance.com.cn/interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.brilliance.com.cn/interface ../etc/schema/interface.xsd">
<interface id="deal" type="server" version="2.0" defaultScope="transaction">
<transaction id="deal" detail="" >
<step id="1">
<filter type="in" ref="publicFilter" >
<field tag="filenam" value="${this[0]}" scope="transaction"/>
<field tag="localfile" type="${new file(filenam)}" scope="transaction" />
<field tag="isfile" value="${localfile.isFile()}" scope="transaction" />
</filter>
<if condition="${isfile}">
<connection ref="fileConnection" type="in">
<property name="path" value="${filenam}" />
<property name="type" value="list" /><!-- 按行读取为List<String>,如果不配则整个文件读到一个String -->
</connection>
<!-- 分多线程处理,每个线程产生一个结果,所有结果存放在一个list里面 -->
<filter ref="batchFilter1" type="in" encoding="GBK">
</filter>
<filter ref="publicFilter" type="in">
<!-- 获取所有结果List -->
<field tag="results" value="${this}" scope="step" />
<!-- 获取结果个数 -->
<field tag="len" value="${__this.getArrayLen(results)}" scope="transaction"> </field>
<field tag="impflg" value="" scope="transaction"/>
</filter>
<filter ref="publicFilter" type="in">
<foreach tag="l" begin="0" end="${len}" step="1">
<!-- 获取所有结果,这个过程是阻塞的,确保所有线程执行完后返回 -->
<!-- 获取子线程call返回的ResultMsg对象 -->
<field tag="result[${l}]" value="${__this.getFutureValue(results[l])}" scope="step">
</field>
<if condition="${result[l].success}">
<log value="************ 子线程${l}执行成功 ************" />
</if>
<else>
<log value="************ 子线程${l}执行失败 ************" />
<!--通过报文的形式判断程序是否走到最后-->
<field tag="content" value="${result[l].content}" type="String" scope="transaction"/>
<field tag="content" value="${trim(content)}"/>
<if condition="${content != 'true'}">
<field tag="impflg" value="false" scope="transaction"/>
</if>
</else>
</foreach>
<if condition="${impflg != 'false'}">
<log value="bicimpor success!" />
</if>
<else>
<log value="bicimpor fail!" />
</else>
</filter>
</if>
<else>
<filter type="in" ref="publicFilter" >
<log value="bicimpor fail: not find file!"/>
</filter>
</else>
</step>
<step id="exception">
<filter type="in" ref="publicFilter" >
<log value="bicimpor fail:find error!" />
</filter>
</step>
</transaction>
<transaction id="import" detail="">
<process>
<step id="ready" />
<step id="handle" />
<exception id="exception" />
</process>
<step id="ready" level="debug">
<filter ref="publicFilter" type="in">
<!-- 当前行 -->
<field tag="curLine" value="${this[1]}" scope="transaction" />
<!-- 子线程需要处理的文件内容 -->
<field tag="arr" value="${this[0]}" type="Object[]" scope="transaction" />
</filter>
</step>
<step id="handle" level="debug">
<connection ref="jdbcConnection" />
<filter ref="publicFilter" type="in" encoding="GBK">
<field tag="len" value="${__this.getArrayLen(arr)}" scope="step">
</field>
</filter>
<foreach tag="i" begin="0" end="${len}" step="1" >
<filter via="${arr[i]}" ref="splitFilter3" type="in">
<!--<field tag="seq[${i}]" etag="0" type="String" scope="transaction"/>-->
<field tag="ncid[${i}]" etag="0" type="String" scope="transaction"/>
<field tag="nam[${i}]" etag="1" type="String" scope="transaction"/>
<field tag="engnam[${i}]" etag="2" type="String" scope="transaction"/>
<field tag="adr[${i}]" etag="3" type="String" scope="transaction"/>
</filter>
</foreach>
<filter ref="sqlFilter" type="in" encoding="GBK">
<field tag="selectSeq" etag="select inr from pty where cid =?" scope="this" >
<argument value="08101"/>
</field>
</filter>
<filter ref="resultSetFilter" type="in">
<!-- 获取resultSet的大小 -->
<field tag="size" type="int" value="${__this.getSize()}" scope="transaction" />
<foreach tag="i" begin="0" end="1" step="1" condition="${__this.next()}">
<field tag="nxtptyinr" etag="inr" type="String" scope="transaction"/>
</foreach>
</filter>
<filter type="in" ref="publicFilter" >
<field tag="begindate" value="${formatNow('yyyy-MM-dd HH:mm:ss')}" scope="transaction"/>
</filter>
<foreach tag="i" begin="0" end="${len}" step="1" ignoreException="true" >
<filter type="in" ref="publicFilter" >
<log value="************===import rownum : ${curLine+i}===************" />
</filter>
<!--判断是否已存在bic-->
<filter ref="sqlFilter" type="in" encoding="GBK">
<field tag="insert" etag="select * from PTY where extkey =?" scope="this">
<argument value="${ncid[i]}"/>
</field>
</filter>
<filter ref="resultSetFilter" type="in">
<!-- 获取resultSet的大小 -->
<field tag="resultSize" type="int" value="${__this.getSize()}" scope="transaction" />
</filter>
<if condition="${resultSize==0}">
<filter ref="sqlFilter" type="in" encoding="GBK">
<field tag="ptyinr" value="${__this.getCNTinr('PTY')}"/>
<field tag="insert" etag="insert into PTY (INR, BEGDAT, ENGNAM, ETYINR, EXTKEY, NAM, NCID, PTYTYP, STATUS) values (?,to_timestamp(?,'yyyy-MM-dd HH24:mi:ss'), ?,?,?,?,?,?,?)">
<argument value="${ptyinr}"/>
<argument value="${begindate}"/>
<argument value="${engnam[i]}"/>
<argument value="00000000"/>
<argument value="${ncid[i]}"/>
<argument value="${nam[i]}"/>
<argument value="${ncid[i]}"/>
<argument value="5"/>
<argument value="0"/>
</field>
<field tag="adrinr" value="${__this.getCNTinr('ADR')}"/>
<field tag="insert" etag="insert into adr (INR, ADR,EXTKEY) values (?,?,?)">
<argument value="${adrinr}"/>
<argument value="${adr[i]}"/>
<argument value="${ncid[i]}"/>
</field>
<field tag="ptainr" value="${__this.getCNTinr('PTA')}"/>
<field tag="insert" etag="insert into pta (INR,NAM,OBJINR,OBJKEY,PTYINR, PTYTYP) values (?,?,?,?,?,?)">
<argument value="${ptainr}"/>
<argument value="${engnam[i]}"/>
<argument value="${adrinr}"/>
<argument value="${ncid[i]}"/>
<argument value="${ptyinr}"/>
<argument value="4"/>
</field>
<field tag="ptrinr" value="${__this.getCNTinr('PTR')}"/>
<field tag="insert" etag="insert into ptr (INR,NXTPTYINR,PREPTYINR,PTRTYP) values (?,?,?,?)">
<argument value="${ptrinr}"/>
<argument value="${nxtptyinr}"/>
<argument value="${ptyinr}"/>
<argument value="4"/>
</field>
<field etag="commit" />
</filter>
</if>
</foreach>
<!--通过报文的形式判断程序是否走到最后-->
<filter tag="msg" type="out" ref="fixedFilter" encoding="GBK">
<field value="true" type="String" size="4"></field>
</filter>
</step>
<step id="exception">
<filter type="in" ref="publicFilter">
<log value="************=======import failed!!!======************"></log>
</filter>
</step>
</transaction>
</interface>
<filters>
<filter id="batchFilter1" class="BatchFilter">
<parameter name="lines" value="1000" /><!-- 每个线程读取的行数 -->
<parameter name="threadnum" value="10" /><!-- 线程池大小 -->
<parameter name="call_interface" value="bicimpor" /><!-- 处理业务的接口 -->
<parameter name="call_transaction" value="import" /><!-- 处理业务的交易 -->
</filter>
<filter id="splitFilter3" class="SplitFilter">
<parameter name="split_strategy" value="||" />
<parameter name="keep_split" value="false" />
<parameter name="split_pos" value="pre" />
</filter>
</filters>
</root>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender"> <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="Threshold" value="ERROR" /> <param name="Threshold" value="DEBUG" />
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8" />
<param name="File" value="../logs/eibs.log" /> <param name="File" value="../logs/eps.log" />
<param name="Append" value="true" /> <param name="Append" value="true" />
<param name="DatePattern" value="'.'yyyy-MM-dd" /> <param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" /> <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
</layout> </layout>
<filter class="log.PatternFilter" > <!--
<param name="Pattern" value="org.sss.*" /> <filter class="log.PatternFilter" >
<param name="AcceptOnMatch" value="true" /> <param name="Pattern" value="org.sss.*" />
</filter> <param name="AcceptOnMatch" value="true" />
</appender> </filter>
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> -->
<param name="Threshold" value="TRACE" /> </appender>
<layout class="org.apache.log4j.PatternLayout"> <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%-10t][%c{1}] %m%n" /> <param name="Threshold" value="TRACE" />
</layout> <layout class="org.apache.log4j.PatternLayout">
<filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%-10t][%c{1}] %m%n" />
<param name="LevelMax" value="ERROR" /> </layout>
<param name="LevelMin" value="TRACE" /> <filter class="org.apache.log4j.varia.LevelRangeFilter">
</filter> <param name="LevelMax" value="ERROR" />
</appender> <param name="LevelMin" value="TRACE" />
<category name="org.sss"> </filter>
<priority value="INFO" /> </appender>
</category> <category name="org.sss">
<category name="org.hibernate"> <priority value="INFO" />
<priority value="ERROR" /> </category>
</category> <category name="org.hibernate">
<category name="org.apache"> <priority value="ERROR" />
<priority value="ERROR" /> </category>
</category> <category name="org.apache">
<category name="com.opensymphony"> <priority value="ERROR" />
<priority value="ERROR" /> </category>
</category> <category name="com.opensymphony">
<root> <priority value="ERROR" />
<level value="WARN" /> </category>
<appender-ref ref="CONSOLE" /> <root>
<appender-ref ref="FILE" /> <level value="DEBUG" />
</root> <appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
</log4j:configuration> </log4j:configuration>
\ No newline at end of file
_sav=mtabut\\sav
bchcod=fcdgrp\\rec\\bchcod
credat=fcdgrp\\rec\\credat
ownref=fcdgrp\\rec\\ownref
acccur=fcdgrp\\rec\\acccur
accamt=fcdgrp\\rec\\accamt
foract=fcdgrp\\rec\\foract
rmbact=fcdgrp\\rec\\rmbact
doclst=fcdgrp\\rec\\doclst
doctxt=fcdgrp\\rec\\doctxt
111.01=dbcact/_select 111.01=dbcact/_select
111.02=fxisll/_sav
#111.01=tzbets
package com.brilliance.test; package com.brilliance.test;
import org.junit.jupiter.api.Test; import org.junit.Test;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
...@@ -9,13 +9,17 @@ import java.net.URLConnection; ...@@ -9,13 +9,17 @@ import java.net.URLConnection;
public class ESBClientTest { public class ESBClientTest {
public static final String addr = "http://localhost:8080/nouiWithESB/ESBServer"; public static final String addr = "http://localhost:8080/nouiWithESB/ESBServer";
// public static final String addr = "http://localhost:8080/eps/ESBServer";
public static final String userId = "test3"; public static final String userId = "test3";
public static final String eventType = "ON_CLICK"; public static final String eventType = "ON_CLICK";
public static final String mappingUrl = "dbcact/_select"; public static final String mappingUrl = "dbcact/_select";
// public static final String mappingUrl = "tskqur/_tsktp_tohistory";
// public static final String mappingUrl = "esyqur/_esytp_select";
// public static final String mappingUrl = "cptimp/_sav1"; // public static final String mappingUrl = "cptimp/_sav1";
public static final String requestData = "{\"data\":{\"cur\":\"CNY\"}}"; public static final String requestData = "{\"data\":{\"cur\":\"CNY\"}}";
// public static final String requestData = "{\"data\":{\"CLIENT_NO\":\"aa\"}}";
// public static final String requestData = "{\"data\":{\"accamt\":\"200.00\",\"credat\":\"2020/05/20\",\"foract\":\"EFS2005200006\",\"ownref\":\"EFS2005200006\",\"doctxt\":\"bbbbbbbbbb\",\"acccur\":\"USD\",\"doclst\":\"aaaaaaaaaaa\",\"rmbact\":\"EFS2005200006\",\"bchcod\":\"4144620185\",\"jwhtyp\":\"1\",\"outacttyp\":\"1\"}}"; // public static final String requestData = "{\"data\":{\"accamt\":\"200.00\",\"credat\":\"2020/05/20\",\"foract\":\"EFS2005200006\",\"ownref\":\"EFS2005200006\",\"doctxt\":\"bbbbbbbbbb\",\"acccur\":\"USD\",\"doclst\":\"aaaaaaaaaaa\",\"rmbact\":\"EFS2005200006\",\"bchcod\":\"4144620185\",\"jwhtyp\":\"1\",\"outacttyp\":\"1\"}}";
// public static final String requestData = "{\"data\":{\"implst\":[{\"fxact\":\"11111112\",\"puract\":\"\",\"othact\":\"\",\"remcur\":\"USD\",\"remamt\":\"300\",\"cuscod\":\"4144620185\",\"pyenam\":\"LDA\",\"acwnam\":\"CITI\",\"swtcod\":\"CITIUS33XXX\",\"pyeact\":\"6226000\",\"rcpnam\":\"\",\"rcpswtcod\":\"\",\"rcpact\":\"\",\"detchgcod\":\"BEN\",\"pyecry\":\"USA\",\"inoutflg\":\"out\",\"paytyp\":\"A\",\"paytyptxt\":\"2\",\"reminf\":\"2\",\"cavpayflg\":\"\",\"invno\":\"\",\"conno\":\"\",\"supno\":\"\",\"fmdno\":\"\",\"bopcod1\":\"\",\"bopamt1\":\"0.00\",\"bopcur1\":\"\",\"bopinf1\":\"1\",\"remark\":\"1\",\"ownref\":\"EOR2005250009\",\"acttyp\":\"NRA\"},{\"fxact\":\"11111112\",\"puract\":\"\",\"othact\":\"\",\"remcur\":\"USD\",\"remamt\":\"200\",\"cuscod\":\"4144620185\",\"pyenam\":\"LDA\",\"acwnam\":\"CITI\",\"swtcod\":\"CITIUS33XXX\",\"pyeact\":\"6226000\",\"rcpnam\":\"\",\"rcpswtcod\":\"\",\"rcpact\":\"\",\"detchgcod\":\"BEN\",\"pyecry\":\"USA\",\"inoutflg\":\"out\",\"paytyp\":\"A\",\"paytyptxt\":\"2\",\"reminf\":\"2\",\"cavpayflg\":\"\",\"invno\":\"\",\"conno\":\"\",\"supno\":\"\",\"fmdno\":\"\",\"bopcod1\":\"\",\"bopamt1\":\"0.00\",\"bopcur1\":\"\",\"bopinf1\":\"1\",\"remark\":\"1\",\"ownref\":\"EOR2005250010\",\"acttyp\":\"NRA\"}]}}"; // public static final String requestData = "{\"data\":{\"implst\":[{\"fxact\":\"11111112\",\"puract\":\"\",\"othact\":\"\",\"rem_cur\":\"USD\",\"remamt\":\"300\",\"cuscod\":\"4144620185\",\"pyenam\":\"LDA\",\"acwnam\":\"CITI\",\"swtcod\":\"CITIUS33XXX\",\"pyeact\":\"6226000\",\"rcpnam\":\"\",\"rcpswtcod\":\"\",\"rcpact\":\"\",\"detchgcod\":\"BEN\",\"pyecry\":\"USA\",\"inoutflg\":\"out\",\"paytyp\":\"A\",\"paytyptxt\":\"2\",\"reminf\":\"2\",\"cavpayflg\":\"\",\"invno\":\"\",\"conno\":\"\",\"supno\":\"\",\"fmdno\":\"\",\"bopcod1\":\"\",\"bopamt1\":\"0.00\",\"bopcur1\":\"\",\"bopinf1\":\"1\",\"remark\":\"1\",\"own_ref\":\"EOR2006020009\",\"acttyp\":\"NRA\"},{\"fxact\":\"11111112\",\"puract\":\"\",\"othact\":\"\",\"rem_cur\":\"USD\",\"remamt\":\"200\",\"cuscod\":\"4144620185\",\"pyenam\":\"LDA\",\"acwnam\":\"CITI\",\"swtcod\":\"CITIUS33XXX\",\"pyeact\":\"6226000\",\"rcpnam\":\"\",\"rcpswtcod\":\"\",\"rcpact\":\"\",\"detchgcod\":\"BEN\",\"pyecry\":\"USA\",\"inoutflg\":\"out\",\"paytyp\":\"A\",\"paytyptxt\":\"2\",\"reminf\":\"2\",\"cavpayflg\":\"\",\"invno\":\"\",\"conno\":\"\",\"supno\":\"\",\"fmdno\":\"\",\"bopcod1\":\"\",\"bopamt1\":\"0.00\",\"bopcur1\":\"\",\"bopinf1\":\"1\",\"remark\":\"1\",\"own_ref\":\"EOR2006020010\",\"acttyp\":\"NRA\"}]}}";
//ESB接入相关参数,当前测试已将验签流程屏蔽,后续到行内测试环境,根据实际情况修改下列参数 //ESB接入相关参数,当前测试已将验签流程屏蔽,后续到行内测试环境,根据实际情况修改下列参数
public static final String flag = "noL"; public static final String flag = "noL";
......
package com.brilliance.test;
import org.junit.Test;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
public class ESBClientTest1 {
public static final String addr = "http://localhost:8889/nouiWithESB/ESBServer";
// public static final String addr = "http://localhost:8080/eps/ESBServer";
public static final String userId = "test3";
public static final String SERVICE_CODE = "111";
public static final String SERVICE_SCENE = "02";
// public static final String requestData = "{\"data\":{\"cur\":\"CNY\"}}";
//ESB接入相关参数,当前测试已将验签流程屏蔽,后续到行内测试环境,根据实际情况修改下列参数
public static final String flag = "noL";
public static final String uid = "123";
public static final String series = "se";
public static final String workDay = "20200511";
@Test
public void call() {
post();
}
public static void post() {
DataOutputStream out = null;
DataInputStream in = null;
try {
URL realUrl = new URL(addr);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("accept", "application/json");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("Content-Type", "application/json;charset=utf-8");
conn.setRequestProperty("flag", flag);
conn.setRequestProperty("uid", uid);
conn.setRequestProperty("series", series);
conn.setRequestProperty("workDay", workDay);
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new DataOutputStream(conn.getOutputStream());
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
"<service>\n" +
" <sys-header>\n" +
" <data name=\"SYS_HEAD\">\n" +
" <struct>\n" +
" <data name=\"SERVICE_SCENE\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">"+SERVICE_SCENE+"</field>\n" +
" </data>\n" +
" <data name=\"SERVICE_CODE\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">"+SERVICE_CODE+"</field>\n" +
" </data>\n" +
" <data name=\"CONSUMER_SEQ_NO\">\n" +
" <field type=\"string\" length=\"42\" scale=\"0\">200811131504570045655</field>\n" +
" </data>\n" +
" <data name=\"TRAN_TIMESTAMP\">\n" +
" <field type=\"string\" length=\"12\" scale=\"0\">153821</field>\n" +
" </data>\n" +
" <data name=\"TRAN_DATE\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">20090220</field>\n" +
" </data>\n" +
" <data name=\"USER_ID\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">xxx</field>\n" +
" </data>\n" +
" <data name=\"CONSUMER_ID\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">896789</field>\n" +
" </data>\n" +
" <data name=\"WS_ID\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">019</field>\n" +
" </data>\n" +
" </struct>\n" +
" </data>\n" +
" </sys-header>\n" +
" <app-header>\n" +
" <data name=\"APP_HEAD\">\n" +
" <struct>\n" +
" <data name=\"BRANCH_ID\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">001</field>\n" +
" </data>\n" +
" </struct>\n" +
" </data>\n" +
" </app-header>\n" +
" <local-header>\n" +
" <data name=\"LOCAL_HEAD\">\n" +
" <struct></struct>\n" +
" </data>\n" +
" </local-header>\n" +
" <body>\n" +
" <data name=\"BODY\">\n" +
" <struct>\n" +
" <data name=\"doctxt\">\n" +
" <field type=\"string\" length=\"20\" scale=\"0\">bbbbb</field>\n" +
" </data>\n" +
" <data name=\"OPERATOR_NO\">\n" +
" <field type=\"string\" length=\"30\" scale=\"0\">"+userId+"</field>\n" +
" </data>\n" +
" </struct>\n" +
" </data>\n" +
" </body>\n" +
"</service>";
out.writeInt(xml.getBytes("utf-8").length);
out.write(xml.getBytes("utf-8"));
in = new DataInputStream(new BufferedInputStream(conn.getInputStream()));
int length = in.readInt();
byte[] b_result = new byte[length];
in.read(b_result,0,length);
System.out.println("result=" + new String(b_result));
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
if(in != null)
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
package com.brilliance.test; package com.brilliance.test;
import com.dc.eai.data.CompositeData; import com.dc.eai.data.*;
import com.dc.eai.data.Field;
import com.dc.eai.data.FieldAttr;
import com.dc.eai.data.FieldType;
import com.dcfs.esb.pack.standardxml.PackUtil; import com.dcfs.esb.pack.standardxml.PackUtil;
import java.util.*;
public class ESBPackTest { public class ESBPackTest {
public static void main(String[] args) public static void main(String[] args)
...@@ -59,16 +58,35 @@ public class ESBPackTest { ...@@ -59,16 +58,35 @@ public class ESBPackTest {
APP_HEAD.addField("BRANCH_ID", field); APP_HEAD.addField("BRANCH_ID", field);
//报文体 //报文体
fieldAttr = new FieldAttr(type,20,0); FieldType type1 = FieldType.getEnum("double");
fieldAttr = new FieldAttr(type1,20);
field = new Field(fieldAttr); field = new Field(fieldAttr);
field.setValue("9"); field.setValue(1.12345678);
BODY.addField("GLOBAL_TYPE", field); BODY.addField("GLOBAL_TYPE", field);
fieldAttr = new FieldAttr(type,20,0); fieldAttr = new FieldAttr(type,5,0);
field = new Field(fieldAttr); field = new Field(fieldAttr);
field.setValue("430921198302213835"); field.setValue("123456789");
BODY.addField("GLOBAL_ID", field); BODY.addField("GLOBAL_ID", field);
fieldAttr = new FieldAttr(type,20,0);
Field field1 = new Field(fieldAttr);
field1.setValue("11");
CompositeData struct1= new CompositeData();
struct1.addField("test1",field1);
struct1.addField("test2",field);
CompositeData struct2= new CompositeData();
struct2.addField("test1",field1);
struct2.addField("test2",field);
Array array = new Array();
array.addStruct(struct1);
array.addStruct(struct2);
BODY.addArray("myLst", array);
req_data.addStruct("SYS_HEAD", SYS_HEAD); req_data.addStruct("SYS_HEAD", SYS_HEAD);
req_data.addStruct("APP_HEAD", APP_HEAD); req_data.addStruct("APP_HEAD", APP_HEAD);
req_data.addStruct("BODY", BODY); req_data.addStruct("BODY", BODY);
...@@ -76,5 +94,43 @@ public class ESBPackTest { ...@@ -76,5 +94,43 @@ public class ESBPackTest {
System.out.println(new String(PackUtil.pack(req_data))); System.out.println(new String(PackUtil.pack(req_data)));
CompositeData bd = req_data.getStruct("BODY");
System.out.println(bd.size());
Iterator<String> iterator = bd.iterator();
Map map = new HashMap<String,Object>();
while(iterator.hasNext()){
String child = iterator.next();
System.out.println(child);
AtomData atomData = bd.getObject(child);
if(atomData.isField()){
Object value = ((Field)atomData).getValue();
map.put(child,value);
}else if(atomData.isArray()){
List list = new ArrayList<Object>();
Array lst = (Array)atomData;
for(int i=0;i<lst.size();i++){
AtomData atomData1 = lst.getObject(i);
if(atomData1.isField()){
list.add(((Field)atomData1).getValue());
}else if(atomData1.isStruct()){
CompositeData lst_bd = ((CompositeData)atomData1);
Iterator<String> lst_iterator = lst_bd.iterator();
Map lst_map = new HashMap<String,Object>();
while(lst_iterator.hasNext()){
String lst_child = lst_iterator.next();
Object lst_value = lst_bd.getField(lst_child);
lst_map.put(lst_child,((Field)lst_value).getValue());
}
list.add(lst_map);
}
}
map.put(child,list);
}
}
System.out.println(map);
} }
} }
...@@ -2,27 +2,99 @@ package com.brilliance.test; ...@@ -2,27 +2,99 @@ package com.brilliance.test;
import com.google.gson.Gson; import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
public class Test1 { public class Test1 {
public static void main(String[] args) { public static void main(String[] args) {
Map datamap = new HashMap<>(); Map datamap = new HashMap<String,Object>();
Map dm = new HashMap(); Map dm = new HashMap();
dm.put("bchcod","4144620185"); // dm.put("bchcod","4144620185");
dm.put("credat","2020/05/20"); // dm.put("credat","2020/05/20");
dm.put("ownref","EFS2005200006"); // dm.put("ownref","EFS2005200006");
dm.put("jwhtyp","1"); // dm.put("jwhtyp","1");
dm.put("acccur","USD"); // dm.put("acccur","USD");
dm.put("accamt","200.00"); // dm.put("accamt","200.00");
dm.put("outacttyp","1"); // dm.put("outacttyp","1");
dm.put("foract","EFS2005200006"); // dm.put("foract","EFS2005200006");
dm.put("rmbact","EFS2005200006"); // dm.put("rmbact","EFS2005200006");
dm.put("doclst","aaaaaaaaaaa"); // dm.put("doclst","aaaaaaaaaaa");
dm.put("doctxt","bbbbbbbbbb"); // dm.put("doctxt","bbbbbbbbbb");
Implst implst = new Implst();
implst.setOwnref("EOR2005250009");
implst.setActtyp("NRA");
implst.setFxact("11111112");
implst.setPuract("");
implst.setOthact("");
implst.setRemcur("USD");
implst.setRemamt("300");
implst.setCuscod("4144620185");
implst.setPyenam("LDA");
implst.setAcwnam("CITI");
implst.setSwtcod("CITIUS33XXX");
implst.setPyeact("6226000");
implst.setDetchgcod("BEN");
implst.setPyecry("USA");
implst.setRcpnam("");
implst.setRcpswtcod("");
implst.setRcpact("");
implst.setInoutflg("out");
implst.setPaytyp("A");
implst.setPaytyptxt("2");
implst.setReminf("2");
implst.setCavpayflg("");
implst.setInvno("");
implst.setConno("");
implst.setSupno("");
implst.setFmdno("");
implst.setBopcod1("");
implst.setBopamt1("0.00");
implst.setBopcur1("");
implst.setBopinf1("1");
implst.setRemark("1");
Implst implst1 = new Implst();
implst1.setOwnref("EOR2005250010");
implst1.setActtyp("NRA");
implst1.setFxact("11111112");
implst1.setPuract("");
implst1.setOthact("");
implst1.setRemcur("USD");
implst1.setRemamt("200");
implst1.setCuscod("4144620185");
implst1.setPyenam("LDA");
implst1.setAcwnam("CITI");
implst1.setSwtcod("CITIUS33XXX");
implst1.setPyeact("6226000");
implst1.setDetchgcod("BEN");
implst1.setPyecry("USA");
implst1.setRcpnam("");
implst1.setRcpswtcod("");
implst1.setRcpact("");
implst1.setInoutflg("out");
implst1.setPaytyp("A");
implst1.setPaytyptxt("2");
implst1.setReminf("2");
implst1.setCavpayflg("");
implst1.setInvno("");
implst1.setConno("");
implst1.setSupno("");
implst1.setFmdno("");
implst1.setBopcod1("");
implst1.setBopamt1("0.00");
implst1.setBopcur1("");
implst1.setBopinf1("1");
implst1.setRemark("1");
List list = new ArrayList<Object>();
list.add(implst);
list.add(implst1);
dm.put("implst",list);
datamap.put("data",dm); datamap.put("data",dm);
......
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