Commit cc45a34b by s_guodong

调试 acdopn.save交易

parent 8e3d76d0
...@@ -103,6 +103,13 @@ ...@@ -103,6 +103,13 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${pom.basedir}/lib/eibs-container-3.5.0.jar</systemPath> <systemPath>${pom.basedir}/lib/eibs-container-3.5.0.jar</systemPath>
</dependency> </dependency>
<dependency>
<groupId>com.brilliance</groupId>
<artifactId>be-esb-core</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/be-esb-core-2.0.jar</systemPath>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.ceb.gjjs.mda.global; package com.ceb.gjjs.mda.global;
import java.util.*; import com.brilliance.mda.runtime.mda.CodetableItem;
import java.math.BigDecimal; import com.brilliance.mda.runtime.mda.IContext;
import com.brilliance.mda.runtime.mda.*; import com.brilliance.mda.runtime.mda.IDatafield;
import com.brilliance.mda.runtime.mda.impl.*; import com.brilliance.mda.runtime.mda.IModule;
import com.brilliance.mda.runtime.annotation.*; import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.driver.*; import com.brilliance.mda.runtime.mda.driver.MdaEnv;
import static com.brilliance.mda.runtime.mda.Constants.*; import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.util.*; import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.ceb.gjjs.mda.bo.*;
import java.util.regex.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class Platform import java.util.*;
{
import static com.brilliance.mda.runtime.mda.Constants.*;
public class Platform {
private static Logger log = LoggerFactory.getLogger(Platform.class); private static Logger log = LoggerFactory.getLogger(Platform.class);
/** /**
* source:sysmod.@0022.script * source:sysmod.@0022.script
*/ */
public static String sdbCounter(String name) public static String sdbCounter(String name) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
return MdaUtils.format(ctx.getDaoSession().dbCounter(name),"00000000"); return MdaUtils.format(ctx.getDaoSession().dbCounter(name), "00000000");
} }
/** /**
* source:sysmod.@0035.script * source:sysmod.@0035.script
*/ */
public static boolean errorCloseCursor(String message) public static boolean errorCloseCursor(String message) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
ctx.getDaoSession().dbCloseCursor(); ctx.getDaoSession().dbCloseCursor();
ctx.setMessage(MdaUtils.getI18NString("sysmod","CT000211"),message); ctx.setMessage(MdaUtils.getI18NString("sysmod", "CT000211"), message);
return false; return false;
} }
/** /**
* source:sysmod.@0036.script * source:sysmod.@0036.script
*/ */
public static Map<String,Object> getValueMap(IModule mctx,String transName,String name) public static Map<String, Object> getValueMap(IModule mctx, String transName, String name) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
log.info("{}","Platform.getValueMap Invoked..."); log.info("{}", "Platform.getValueMap Invoked...");
IModule context=MdaDriver.getModule(mctx,"\\bimenu"); IModule context = MdaDriver.getModule(mctx, "\\bimenu");
if(Platform.isXmlmapTransaction(transName)) if (Platform.isXmlmapTransaction(transName)) {
{ context = MdaDriver.getModule(mctx, "\\xmlmap");
context=MdaDriver.getModule(mctx,"\\xmlmap"); }
} if (context == null)
if(context==null) context = mctx;
context=mctx;
String fileName = MdaUtils.catPath(ctx.getEnvConfig().getRootPath(), "/cfg/" + transName + ".properties");
String fileName=MdaUtils.catPath(ctx.getEnvConfig().getRootPath(),"/cfg/"+transName+".properties"); log.info("{}", "fileName = " + fileName);
log.info("{}","fileName = " + fileName) ; String keys = MdaUtils.getPropertyValue(fileName, name);
String keys=MdaUtils.getPropertyValue(fileName,name); Map<String, Object> values = new HashMap<String, Object>();
Map<String,Object> values=new HashMap<String,Object>(); if (MdaUtils.isEmpty(keys))
if(MdaUtils.isEmpty(keys))
return values; return values;
for(String key:keys.split(",")) for (String key : keys.split(",")) {
{ String path = MdaUtils.getPropertyValue(fileName, key);
String path=MdaUtils.getPropertyValue(fileName,key); log.info("{}", key + "的取值路径为:" + path + ",");
log.info("{}",key+"的取值路径为:" + path + ","); if (!MdaUtils.isEmpty(path))
if(!MdaUtils.isEmpty(path)) values.put(key, Platform.getDatafieldValue(context, path));
values.put(key,Platform.getDatafieldValue(context,path));
//by mkz for debug 19.03.04 //by mkz for debug 19.03.04
//log.debug("存入" + key + "的值为:" + Platform.getDatafieldValue(context,path)); //log.debug("存入" + key + "的值为:" + Platform.getDatafieldValue(context,path));
log.debug("{}",key+"取出的值为+==:" + values.get(key) + ","); log.debug("{}", key + "取出的值为+==:" + values.get(key) + ",");
} }
log.debug("{}","values.size:" + values.size()); log.debug("{}", "values.size:" + values.size());
values.put("locale",ctx.getLocale()); values.put("locale", ctx.getLocale());
return values; return values;
} }
/** /**
* source:sysmod.@0037.script * source:sysmod.@0037.script
*/ */
public static Object[] getValues(IModule mctx,String transName,String name) public static Object[] getValues(IModule mctx, String transName, String name) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
log.info("{}","Platform.getValueMap Invoked..."); log.info("{}", "Platform.getValueMap Invoked...");
IModule context= null ; IModule context = null;
if(!Platform.isXmlmapTransaction(transName)) if (!Platform.isXmlmapTransaction(transName)) {
{ log.debug("{}", "in bimenu ");
log.debug("{}","in bimenu "); context = MdaDriver.getModule(mctx, "\\bimenu");
context =MdaDriver.getModule(mctx,"\\bimenu"); } else {
} log.debug("{}", "in xmlmap ");
else context = MdaDriver.getModule(mctx, "\\xmlmap");
{ }
log.debug("{}","in xmlmap "); if (context == null)
context =MdaDriver.getModule(mctx,"\\xmlmap"); context = mctx;
} String fileName = MdaUtils.catPath(ctx.getEnvConfig().getRootPath(), "/cfg/" + transName + ".properties");
if(context==null) String keys = MdaUtils.getPropertyValue(fileName, name);
context=mctx; if (MdaUtils.isEmpty(keys))
String fileName=MdaUtils.catPath(ctx.getEnvConfig().getRootPath(),"/cfg/"+transName+".properties");
String keys=MdaUtils.getPropertyValue(fileName,name);
if(MdaUtils.isEmpty(keys))
return new Object[]{}; return new Object[]{};
List<Object> values=new ArrayList<Object>(); List<Object> values = new ArrayList<Object>();
for(String key:keys.split(",")) for (String key : keys.split(",")) {
{ String path = MdaUtils.getPropertyValue(fileName, key);
String path=MdaUtils.getPropertyValue(fileName,key); if (!MdaUtils.isEmpty(path))
if(!MdaUtils.isEmpty(path)) values.add(Platform.getDatafieldValue(context, path));
values.add(Platform.getDatafieldValue(context,path));
} }
return values.toArray(); return values.toArray();
} }
...@@ -119,71 +110,59 @@ public class Platform ...@@ -119,71 +110,59 @@ public class Platform
/** /**
* source:sysmod.@0038.script * source:sysmod.@0038.script
*/ */
public static Object getDatafieldValue(IModule context,String path) public static Object getDatafieldValue(IModule context, String path) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
log.info("{}","&path==="+path); log.info("{}", "&path===" + path);
//log.debug("是否以”.“开头:" + path.startsWith(".")); //log.debug("是否以”.“开头:" + path.startsWith("."));
Object value=null; Object value = null;
if(path.startsWith("!")) if (path.startsWith("!"))
value = path.substring(1); value = path.substring(1);
else if(path.startsWith(".0")) else if (path.startsWith(".0")) {
{ if (MdaUtils.isEmpty(MdaDriver.getDatafield(context, path.substring(2))))
if(MdaUtils.isEmpty(MdaDriver.getDatafield(context,path.substring(2))))
return value; return value;
value=(MdaDriver.getDatafield(context,path.substring(2))).getValue(); value = (MdaDriver.getDatafield(context, path.substring(2))).getValue();
log.info("{}","value="+value); log.info("{}", "value=" + value);
String sql = "SELECT nam FROM pty WHERE cid='"+value+"'"; String sql = "SELECT nam FROM pty WHERE cid='" + value + "'";
ctx.getDaoSession().dbExecuteSQL(sql); ctx.getDaoSession().dbExecuteSQL(sql);
Argument<String> nam = new Argument<String>("nam"); Argument<String> nam = new Argument<String>("nam");
ctx.getDaoSession().dbFetchFields(nam); ctx.getDaoSession().dbFetchFields(nam);
ctx.getDaoSession().dbCloseCursor(); ctx.getDaoSession().dbCloseCursor();
if(!MdaUtils.isEmpty(nam.value)) if (!MdaUtils.isEmpty(nam.value))
value = nam.value; value = nam.value;
return value; return value;
} } else if (path.startsWith(".")) {
else if(path.startsWith("."))
{
//log.debug("path.value:" +Platform.getDatafield(context,path.substring(1))); //log.debug("path.value:" +Platform.getDatafield(context,path.substring(1)));
if(MdaUtils.isEmpty(MdaDriver.getDatafield(context,path.substring(1)))) if (MdaUtils.isEmpty(MdaDriver.getDatafield(context, path.substring(1))))
return value; return value;
value=(MdaDriver.getDatafield(context,path.substring(1))).getValue(); value = (MdaDriver.getDatafield(context, path.substring(1))).getValue();
log.info("{}","value="+value); log.info("{}", "value=" + value);
List<CodetableItem> list=(List<CodetableItem>)(MdaDriver.getDatafield(null,"\\sysmod\\bchcodvals")).getValue(); List<CodetableItem> list = (List<CodetableItem>) (MdaDriver.getDatafield(null, "\\sysmod\\bchcodvals")).getValue();
if(MdaUtils.isEmpty(list)) if (MdaUtils.isEmpty(list)) { //by dg for debug...10.09
{ //by dg for debug...10.09 log.info("{}", "bchcod list is empty!");
log.info("{}","bchcod list is empty!");
return value; return value;
} }
for(CodetableItem item:list) for (CodetableItem item : list) {
{ log.info("{}", "item.getValue()=" + item.getValue());
log.info("{}","item.getValue()="+item.getValue()); if (item.getValue().equals(value)) {
if(item.getValue().equals(value)) log.info("{}", "item=" + item.getLabel());
{
log.info("{}","item="+item.getLabel());
return item.getLabel(); return item.getLabel();
} }
} }
} } else if (path.startsWith("*")) {
else if(path.startsWith("*")) if (MdaUtils.isEmpty(MdaDriver.getDatafield(context, path.substring(1))))
{
if(MdaUtils.isEmpty(MdaDriver.getDatafield(context,path.substring(1))))
return value; return value;
value=(MdaDriver.getDatafield(context,path.substring(1))).getValue(); value = (MdaDriver.getDatafield(context, path.substring(1))).getValue();
if("X".equals(value)) if ("X".equals(value))
return "√"; return "√";
} } else if (path.startsWith("?0")) {
else if(path.startsWith("?0"))
{
//处理45A //处理45A
String rtvalue=""; String rtvalue = "";
String[] fields = path.substring(2).split("\\?"); String[] fields = path.substring(2).split("\\?");
Map<String,IDatafield> flds = new HashMap<String,IDatafield>(); Map<String, IDatafield> flds = new HashMap<String, IDatafield>();
for(String field:fields) for (String field : fields) {
{ flds.put(field.substring(field.lastIndexOf("\\") + 1), MdaDriver.getDatafield(context, field));
flds.put(field.substring(field.lastIndexOf("\\")+1),MdaDriver.getDatafield(context,field));
} }
//adlcnd //adlcnd
Object adlcnd = flds.get("adlcnd").getValue(); Object adlcnd = flds.get("adlcnd").getValue();
...@@ -192,140 +171,120 @@ public class Platform ...@@ -192,140 +171,120 @@ public class Platform
Object nomtop = flds.get("nomtop").getValue(); Object nomtop = flds.get("nomtop").getValue();
// log.debug("nomflg=="+nomflg.toString()); // log.debug("nomflg=="+nomflg.toString());
// log.debug("nomflg=="+nomflg); // log.debug("nomflg=="+nomflg);
if(!MdaUtils.isEmpty(nomflg)&&TRUE.equals(nomflg.toString())) if (!MdaUtils.isEmpty(nomflg) && TRUE.equals(nomflg.toString())) {
{ rtvalue = "+Quantity And Amount ";
rtvalue= "+Quantity And Amount "; if (!MdaUtils.isEmpty(nomtop))
if(!MdaUtils.isEmpty(nomtop)) rtvalue += nomtop.toString() + " PERCENT More ";
rtvalue+=nomtop.toString()+" PERCENT More "; if (!MdaUtils.isEmpty(nomton)) {
if(!MdaUtils.isEmpty(nomton)) if (!MdaUtils.isEmpty(nomtop))
{ rtvalue += " Or ";
if(!MdaUtils.isEmpty(nomtop)) rtvalue += nomton.toString() + " PERCENT Less";
rtvalue+= " Or "; }
rtvalue+=nomton.toString()+" PERCENT Less"; rtvalue += " Are Allowed";
} }
rtvalue+=" Are Allowed"; if (!MdaUtils.isEmpty(adlcnd))
} if (rtvalue == null || "".equals(rtvalue))
if(!MdaUtils.isEmpty(adlcnd)) rtvalue = adlcnd.toString();
if(rtvalue==null || "".equals(rtvalue) )
rtvalue=adlcnd.toString();
else else
rtvalue+= CR+adlcnd.toString(); rtvalue += CR + adlcnd.toString();
else else
rtvalue=rtvalue; rtvalue = rtvalue;
return rtvalue; return rtvalue;
} } else if (path.startsWith("?1")) {
else if(path.startsWith("?1"))
{
//处理47A //处理47A
String returnvalue =""; String returnvalue = "";
String[] fields = path.substring(2).split("\\?"); String[] fields = path.substring(2).split("\\?");
Map<String,IDatafield> flds = new HashMap<String,IDatafield>(); Map<String, IDatafield> flds = new HashMap<String, IDatafield>();
for(String field:fields) for (String field : fields) {
{ flds.put(field.substring(field.lastIndexOf("\\") + 1), MdaDriver.getDatafield(context, field));
flds.put(field.substring(field.lastIndexOf("\\")+1),MdaDriver.getDatafield(context,field));
} }
//adlcnd //adlcnd
Object lcrgod = flds.get("lcrgod").getValue(); Object lcrgod = flds.get("lcrgod").getValue();
Object trdtrm = flds.get("trdtrm").getValue(); Object trdtrm = flds.get("trdtrm").getValue();
Object trdtrmplc = flds.get("trdtrmplc").getValue(); Object trdtrmplc = flds.get("trdtrmplc").getValue();
Object trdtrmver = flds.get("trdtrmver").getValue(); Object trdtrmver = flds.get("trdtrmver").getValue();
if(!MdaUtils.isEmpty(lcrgod)) if (!MdaUtils.isEmpty(lcrgod))
returnvalue=lcrgod.toString()+CR; returnvalue = lcrgod.toString() + CR;
if(!MdaUtils.isEmpty(trdtrm)) if (!MdaUtils.isEmpty(trdtrm))
returnvalue+="+Trade Terms: "+trdtrm.toString(); returnvalue += "+Trade Terms: " + trdtrm.toString();
if(!MdaUtils.isEmpty(trdtrmplc)) if (!MdaUtils.isEmpty(trdtrmplc))
returnvalue+=" "+trdtrmplc.toString(); returnvalue += " " + trdtrmplc.toString();
if(!MdaUtils.isEmpty(trdtrmver)) if (!MdaUtils.isEmpty(trdtrmver))
returnvalue+=" "+trdtrmver.toString(); returnvalue += " " + trdtrmver.toString();
return returnvalue.trim(); return returnvalue.trim();
} } else if (path.startsWith("?7")) {
else if(path.startsWith("?7"))
{
//处理进口代收,出口托收等申请书期限 //处理进口代收,出口托收等申请书期限
String returnvalue =""; String returnvalue = "";
String[] fields = path.substring(2).split("\\?"); String[] fields = path.substring(2).split("\\?");
Map<String,IDatafield> flds = new HashMap<String,IDatafield>(); Map<String, IDatafield> flds = new HashMap<String, IDatafield>();
for(String field:fields) for (String field : fields) {
{ flds.put(field.substring(field.lastIndexOf("\\") + 1), MdaDriver.getDatafield(context, field));
flds.put(field.substring(field.lastIndexOf("\\")+1),MdaDriver.getDatafield(context,field));
} }
//adrblk //adrblk
Object doctypcod = flds.get("doctypcod").getValue(); Object doctypcod = flds.get("doctypcod").getValue();
Object matpercnt = flds.get("matpercnt").getValue(); Object matpercnt = flds.get("matpercnt").getValue();
Object matpertyp = flds.get("matpertyp").getValue(); Object matpertyp = flds.get("matpertyp").getValue();
Object doctxt = flds.get("mixdet").getValue(); Object doctxt = flds.get("mixdet").getValue();
if("1".equals(doctypcod.toString()) || "3".equals(doctypcod.toString()) ) if ("1".equals(doctypcod.toString()) || "3".equals(doctypcod.toString()))
if(!MdaUtils.isEmpty(matpercnt)) if (!MdaUtils.isEmpty(matpercnt))
returnvalue=matpercnt +" Days "+MdaUtils.getCodetableLabel("matpertyp1",matpertyp.toString()); returnvalue = matpercnt + " Days " + MdaUtils.getCodetableLabel("matpertyp1", matpertyp.toString());
if("4".equals(doctypcod.toString()) && doctxt!=null) if ("4".equals(doctypcod.toString()) && doctxt != null)
returnvalue=doctxt.toString(); returnvalue = doctxt.toString();
return returnvalue.trim(); return returnvalue.trim();
} } else if (path.startsWith("?8")) {
else if(path.startsWith("?8"))
{
//处理进口代收,出口托收等申请书期限 //处理进口代收,出口托收等申请书期限
String returnvalue =""; String returnvalue = "";
String[] fields = path.substring(2).split("\\?"); String[] fields = path.substring(2).split("\\?");
Map<String,IDatafield> flds = new HashMap<String,IDatafield>(); Map<String, IDatafield> flds = new HashMap<String, IDatafield>();
for(String field:fields) for (String field : fields) {
{ flds.put(field.substring(field.lastIndexOf("\\") + 1), MdaDriver.getDatafield(context, field));
flds.put(field.substring(field.lastIndexOf("\\")+1),MdaDriver.getDatafield(context,field));
} }
//adrblk //adrblk
Object doctypcod = flds.get("doctypcod").getValue(); Object doctypcod = flds.get("doctypcod").getValue();
Object matpercnt = flds.get("matpercnt").getValue(); Object matpercnt = flds.get("matpercnt").getValue();
Object matpertyp = flds.get("matpertyp").getValue(); Object matpertyp = flds.get("matpertyp").getValue();
Object doctxt = flds.get("doctxt").getValue(); Object doctxt = flds.get("doctxt").getValue();
if("1".equals(doctypcod.toString()) || "3".equals(doctypcod.toString()) ) if ("1".equals(doctypcod.toString()) || "3".equals(doctypcod.toString()))
if(!MdaUtils.isEmpty(matpercnt)) if (!MdaUtils.isEmpty(matpercnt))
returnvalue=matpercnt +" Days "+MdaUtils.getCodetableLabel("matpertyp",matpertyp.toString()); returnvalue = matpercnt + " Days " + MdaUtils.getCodetableLabel("matpertyp", matpertyp.toString());
if("4".equals(doctypcod.toString())&& doctxt!=null) if ("4".equals(doctypcod.toString()) && doctxt != null)
returnvalue=doctxt.toString(); returnvalue = doctxt.toString();
return returnvalue.trim(); return returnvalue.trim();
} } else if (path.startsWith("?9")) {
else if(path.startsWith("?9"))
{
//处理出口信用证申请内容 //处理出口信用证申请内容
String returnvalue =""; String returnvalue = "";
String[] fields = path.substring(2).split("\\?"); String[] fields = path.substring(2).split("\\?");
Map<String,IDatafield> flds = new HashMap<String,IDatafield>(); Map<String, IDatafield> flds = new HashMap<String, IDatafield>();
for(String field:fields) for (String field : fields) {
{ flds.put(field.substring(field.lastIndexOf("\\") + 1), MdaDriver.getDatafield(context, field));
flds.put(field.substring(field.lastIndexOf("\\")+1),MdaDriver.getDatafield(context,field));
} }
//adrblk //adrblk
Object adrblk = flds.get("adrblk").getValue(); Object adrblk = flds.get("adrblk").getValue();
Object details = flds.get("details").getValue(); Object details = flds.get("details").getValue();
if(!MdaUtils.isEmpty(adrblk)) if (!MdaUtils.isEmpty(adrblk))
returnvalue="THE BENEFICIARY HAS BEEN AMENDED TO "+adrblk.toString()+CR; returnvalue = "THE BENEFICIARY HAS BEEN AMENDED TO " + adrblk.toString() + CR;
if(!MdaUtils.isEmpty(details)) if (!MdaUtils.isEmpty(details))
returnvalue+=details.toString(); returnvalue += details.toString();
return returnvalue.trim(); return returnvalue.trim();
} } else if (path.startsWith("?r?n")) {
else if(path.startsWith("?r?n")) Object fldVavle = (MdaDriver.getDatafield(context, path.substring(4))).getValue();
{
Object fldVavle = (MdaDriver.getDatafield(context,path.substring(4))).getValue();
String valueStr = ""; String valueStr = "";
if(!MdaUtils.isEmpty(fldVavle)) if (!MdaUtils.isEmpty(fldVavle)) {
{
valueStr = fldVavle.toString(); valueStr = fldVavle.toString();
if(valueStr.contains("\n")) if (valueStr.contains("\n")) {
{
valueStr=valueStr.replace("\n"," "); valueStr = valueStr.replace("\n", " ");
} }
if(valueStr.contains("\r")) if (valueStr.contains("\r")) {
{
valueStr=valueStr.replace("\r",""); valueStr = valueStr.replace("\r", "");
}
} }
value=valueStr;
} }
else if(!MdaUtils.isEmpty(MdaDriver.getDatafield(context,path))) value = valueStr;
value=(MdaDriver.getDatafield(context,path)).getValue(); } else if (!MdaUtils.isEmpty(MdaDriver.getDatafield(context, path)))
else if(path.endsWith("nomtop") || path.endsWith("nomton")) value = (MdaDriver.getDatafield(context, path)).getValue();
value="0"; else if (path.endsWith("nomtop") || path.endsWith("nomton"))
value = "0";
return value; return value;
} }
...@@ -333,8 +292,7 @@ public class Platform ...@@ -333,8 +292,7 @@ public class Platform
/** /**
* source:sysmod.@0065.script * source:sysmod.@0065.script
*/ */
public static Map<String,Object> convertContentToMap(IModule mctx,Map<String,Object> data,String transName,String name) public static Map<String, Object> convertContentToMap(IModule mctx, Map<String, Object> data, String transName, String name) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
...@@ -345,77 +303,69 @@ public class Platform ...@@ -345,77 +303,69 @@ public class Platform
* name - 配置文件中的字段定义,使用','隔开 ,默认为DATA * name - 配置文件中的字段定义,使用','隔开 ,默认为DATA
*/ */
log.info("{}","sysmod.convertContentToMap Invoked..."); log.info("{}", "sysmod.convertContentToMap Invoked...");
Map<String,Object> values= null ; Map<String, Object> values = null;
IModule context=MdaDriver.getModule(mctx,"\\xmlmap"); IModule context = MdaDriver.getModule(mctx, "\\xmlmap");
int errcod = ctx.getErrorCode(); int errcod = ctx.getErrorCode();
if(context==null ) if (context == null)
context=mctx; context = mctx;
String fileName=MdaUtils.catPath(ctx.getEnvConfig().getRootPath(),"/cfg/"+transName+".properties"); String fileName = MdaUtils.catPath(ctx.getEnvConfig().getRootPath(), "/cfg/" + transName + ".properties");
String keys=MdaUtils.getPropertyValue(fileName,name); String keys = MdaUtils.getPropertyValue(fileName, name);
if ( MdaUtils.isEmpty(keys)) if (MdaUtils.isEmpty(keys)) {
{ log.error("{}", "配置文件:" + fileName + " 未配置 " + name + " 项 .");
log.error("{}","配置文件:" + fileName +" 未配置 "+ name +" 项 ." ) ; return values;
return values ; }
} values = data;
values = data ; log.debug("{}", " keys: " + keys);
log.debug("{}"," keys: " + keys) ; for (String key : keys.split(",")) {
for(String key:keys.split(",")) log.debug("{}", "key = {" + key + "}");
{ String path = MdaUtils.getPropertyValue(fileName, key);
log.debug("{}","key = {" + key +"}"); log.debug("{}", " sysmod.convertContentToMap : path = " + path);
String path=MdaUtils.getPropertyValue(fileName,key); if (!MdaUtils.isEmpty(path)) {
log.debug("{}"," sysmod.convertContentToMap : path = " + path) ; values.put(key, Platform.getDatafieldValue(context, path));
if(!MdaUtils.isEmpty(path)) log.debug("{}", "xmlMap:{ key=" + key + ", value=" + Platform.getDatafieldValue(context, path) + " }");
{ }
values.put(key,Platform.getDatafieldValue(context,path)); }
log.debug("{}","xmlMap:{ key=" + key + ", value=" +Platform.getDatafieldValue(context,path)+ " }") ;
} values.put("locale", ctx.getLocale());
}
values.put("locale",ctx.getLocale());
return values; return values;
} }
/** /**
* source:sysmod.@0073.script * source:sysmod.@0073.script
*/ */
public static Date formatDateTime (Date d ,String pattern) public static Date formatDateTime(Date d, String pattern) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
if(d==null) if (d == null) {
{
d = MdaUtils.today(); d = MdaUtils.today();
} }
if(MdaUtils.isEmpty(pattern) || "0".equals(pattern) ) if (MdaUtils.isEmpty(pattern) || "0".equals(pattern)) {
{
pattern = "000000"; pattern = "000000";
} }
String time = MdaUtils.format(d,"yyyyMMddHHmmss"); String time = MdaUtils.format(d, "yyyyMMddHHmmss");
time = time.substring(0,8); time = time.substring(0, 8);
time = time + pattern; time = time + pattern;
return MdaUtils.parseDate(time,"yyyyMMddHHmmss"); return MdaUtils.parseDate(time, "yyyyMMddHHmmss");
} }
/** /**
* source:sysmod.@0074.script * source:sysmod.@0074.script
*/ */
public static boolean isXmlmapTransaction(String transNam) public static boolean isXmlmapTransaction(String transNam) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
/* /*
* 用于判断来报通知是否从xmlmap中映射模块,以便于区分原来的bimenu * 用于判断来报通知是否从xmlmap中映射模块,以便于区分原来的bimenu
*/ */
log.debug("{}"," in isXmlmapTransaction " +transNam ); log.debug("{}", " in isXmlmapTransaction " + transNam);
boolean ret = false ; boolean ret = false;
if(!MdaUtils.isEmpty(transNam) && ("rptshw".equals(transNam)|| "ersshw".equals(transNam) ) ) if (!MdaUtils.isEmpty(transNam) && ("rptshw".equals(transNam) || "ersshw".equals(transNam))) {
{
ret = true; ret = true;
} }
log.debug("{}"," out isXmlmapTransaction = " + ret ); log.debug("{}", " out isXmlmapTransaction = " + ret);
return ret; return ret;
} }
...@@ -423,22 +373,19 @@ public class Platform ...@@ -423,22 +373,19 @@ public class Platform
/** /**
* source:sysmod.@0079.script * source:sysmod.@0079.script
*/ */
public static boolean isNoError(Map msg) public static boolean isNoError(Map msg) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
/* /*
* 判断是否没有错误,方便回滚或提交事务 * 判断是否没有错误,方便回滚或提交事务
*/ */
log.debug("{}","in static sysmod.isNoError ... "); log.debug("{}", "in static sysmod.isNoError ... ");
boolean ret = true ; boolean ret = true;
if(!MdaUtils.isEmpty(msg)) if (!MdaUtils.isEmpty(msg)) {
{ String errcod = (String) msg.get("ERRORCODE");
String errcod =(String) msg.get("ERRORCODE"); log.debug("{}", "msgErrcod = " + errcod + ".");
log.debug("{}","msgErrcod = " + errcod +"."); if (!MdaUtils.isEmpty(errcod) && !"00000".equals(errcod)) {
if(!MdaUtils.isEmpty(errcod) && !"00000".equals(errcod))
{
ret = false; ret = false;
} }
} }
...@@ -448,22 +395,20 @@ public class Platform ...@@ -448,22 +395,20 @@ public class Platform
/** /**
* source:sysmod.@0080.script * source:sysmod.@0080.script
*/ */
public static void setErrorInfo(Map<String,Object> msgMap, String errcod, String errMsg) public static void setErrorInfo(Map<String, Object> msgMap, String errcod, String errMsg) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
log.debug("{}","in static sysmod setErrorInfo ... "); log.debug("{}", "in static sysmod setErrorInfo ... ");
msgMap.put("ERRORMSG", errMsg); msgMap.put("ERRORMSG", errMsg);
msgMap.put("ERRORCODE",errcod); msgMap.put("ERRORCODE", errcod);
log.error("{}","错误码:"+ errcod + ", 错误描述" + errMsg); log.error("{}", "错误码:" + errcod + ", 错误描述" + errMsg);
} }
/** /**
* source:sysmod.@0103.script * source:sysmod.@0103.script
*/ */
public static String headBchcod() public static String headBchcod() {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
...@@ -473,8 +418,7 @@ public class Platform ...@@ -473,8 +418,7 @@ public class Platform
/** /**
* source:sysmod.@0162.script * source:sysmod.@0162.script
*/ */
public static Map execLocalScriptwithLog(String command) public static Map execLocalScriptwithLog(String command) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
...@@ -485,14 +429,13 @@ public class Platform ...@@ -485,14 +429,13 @@ public class Platform
#! 变量 : command 前台命令 #! 变量 : command 前台命令
#!======================================== #!========================================
*/ */
log.info("{}","execLocalScript:"+command); log.info("{}", "execLocalScript:" + command);
Process process = null; Process process = null;
Map map = new HashMap(); Map map = new HashMap();
Boolean flg = true; Boolean flg = true;
List<String> result = new ArrayList(); List<String> result = new ArrayList();
List<String> err = new ArrayList(); List<String> err = new ArrayList();
try try {
{
process = Runtime.getRuntime().exec(command); process = Runtime.getRuntime().exec(command);
process.waitFor(); process.waitFor();
java.io.InputStream is1 = process.getInputStream(); java.io.InputStream is1 = process.getInputStream();
...@@ -504,8 +447,7 @@ public class Platform ...@@ -504,8 +447,7 @@ public class Platform
java.io.BufferedReader br2 = new java.io.BufferedReader(isr2); java.io.BufferedReader br2 = new java.io.BufferedReader(isr2);
String line1 = null; String line1 = null;
while ((line1 = br1.readLine()) != null) while ((line1 = br1.readLine()) != null) {
{
result.add(line1); result.add(line1);
} }
is1.close(); is1.close();
...@@ -513,63 +455,53 @@ public class Platform ...@@ -513,63 +455,53 @@ public class Platform
br1.close(); br1.close();
String line2 = null; String line2 = null;
while ((line2 = br2.readLine()) != null) while ((line2 = br2.readLine()) != null) {
{
err.add(line2); err.add(line2);
} }
is2.close(); is2.close();
isr2.close(); isr2.close();
br2.close(); br2.close();
} } catch (Exception e) {
catch (Exception e)
{
e.printStackTrace(); e.printStackTrace();
flg = false; flg = false;
} } finally {
finally if (process != null)
{
if(process != null)
process.destroy(); process.destroy();
} }
map.put("flg",flg); map.put("flg", flg);
map.put("result",result); map.put("result", result);
map.put("error",err); map.put("error", err);
return map; return map;
} }
/** /**
* source:sysmod.@0106.script * source:sysmod.@0106.script
*/ */
public static Object[] getValueSMS(IModule mctx,String transName,String name) public static Object[] getValueSMS(IModule mctx, String transName, String name) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
log.info("{}","Platform.getValueMap Invoked..."); log.info("{}", "Platform.getValueMap Invoked...");
IModule context= null ; IModule context = null;
if(!Platform.isXmlmapTransaction(transName)) if (!Platform.isXmlmapTransaction(transName)) {
{ log.debug("{}", "in bimenu ");
log.debug("{}","in bimenu "); context = MdaDriver.getModule(mctx, "\\bimenu");
context =MdaDriver.getModule(mctx,"\\bimenu"); } else {
} log.debug("{}", "in xmlmap ");
else context = MdaDriver.getModule(mctx, "\\xmlmap");
{ }
log.debug("{}","in xmlmap "); if (context == null)
context =MdaDriver.getModule(mctx,"\\xmlmap"); context = mctx;
} String fileName = MdaUtils.catPath(ctx.getEnvConfig().getRootPath(), "/cfg/" + transName + ".properties");
if(context==null) String keys = MdaUtils.getPropertyValue(fileName, name);
context=mctx; if (MdaUtils.isEmpty(keys))
String fileName=MdaUtils.catPath(ctx.getEnvConfig().getRootPath(),"/cfg/"+transName+".properties");
String keys=MdaUtils.getPropertyValue(fileName,name);
if(MdaUtils.isEmpty(keys))
return new Object[]{}; return new Object[]{};
List<Object> values=new ArrayList<Object>(); List<Object> values = new ArrayList<Object>();
for(String key:keys.split(",")) for (String key : keys.split(",")) {
{ String path = MdaUtils.getPropertyValue(fileName, key);
String path=MdaUtils.getPropertyValue(fileName,key); if (!MdaUtils.isEmpty(path))
if(!MdaUtils.isEmpty(path)) values.add(Platform.getDatafieldValue(context, path));
values.add(Platform.getDatafieldValue(context,path));
} }
return values.toArray(); return values.toArray();
} }
...@@ -577,66 +509,56 @@ public class Platform ...@@ -577,66 +509,56 @@ public class Platform
/** /**
* source:sysmod.@0107.script * source:sysmod.@0107.script
*/ */
public static Object[] getValueSM(IModule mctx,String transName,String name) public static Object[] getValueSM(IModule mctx, String transName, String name) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
log.info("{}","Platform.getValueMap Invoked..."); log.info("{}", "Platform.getValueMap Invoked...");
IModule context= null ; IModule context = null;
if(!Platform.isXmlmapTransaction(transName)) if (!Platform.isXmlmapTransaction(transName)) {
{ log.debug("{}", "in bimenu ");
log.debug("{}","in bimenu "); context = MdaDriver.getModule(mctx, "\\bimenu");
context =MdaDriver.getModule(mctx,"\\bimenu"); } else {
} log.debug("{}", "in xmlmap ");
else context = MdaDriver.getModule(mctx, "\\xmlmap");
{ }
log.debug("{}","in xmlmap "); if (context == null)
context =MdaDriver.getModule(mctx,"\\xmlmap"); context = mctx;
} String fileName = MdaUtils.catPath(ctx.getEnvConfig().getRootPath(), "/cfg/" + transName + ".properties");
if(context==null) String keys = MdaUtils.getPropertyValue(fileName, name);
context=mctx;
String fileName=MdaUtils.catPath(ctx.getEnvConfig().getRootPath(),"/cfg/"+transName+".properties"); String files = MdaUtils.catPath(ctx.getEnvConfig().getRootPath(), "/cfg/" + "trdnam.properties");
String keys=MdaUtils.getPropertyValue(fileName,name); String vals = MdaUtils.getPropertyValue(files, transName);
if (MdaUtils.isEmpty(keys) || MdaUtils.isEmpty(vals))
String files=MdaUtils.catPath(ctx.getEnvConfig().getRootPath(),"/cfg/"+"trdnam.properties");
String vals=MdaUtils.getPropertyValue(files,transName);
if( MdaUtils.isEmpty(keys) || MdaUtils.isEmpty(vals))
return new Object[]{}; return new Object[]{};
List<Object> values=new ArrayList<Object>(); List<Object> values = new ArrayList<Object>();
for(String key:keys.split(",")) for (String key : keys.split(",")) {
{ String path = MdaUtils.getPropertyValue(fileName, key);
String path=MdaUtils.getPropertyValue(fileName,key); if (!MdaUtils.isEmpty(path)) {
if(!MdaUtils.isEmpty(path)) log.debug("{}", "Message=" + Platform.getDatafieldValue(context, path));
{ values.add(Platform.getDatafieldValue(context, path));
log.debug("{}","Message="+Platform.getDatafieldValue(context,path)); }
values.add(Platform.getDatafieldValue(context,path)); }
}
} for (String val : vals.split(",")) {
String conts = null;
for(String val:vals.split(",")) try {
{ conts = new String(val.getBytes("ISO-8859-1"), "GBK");
String conts=null; log.debug("{}", "Message=" + conts);
try } catch (Exception e) {
{ log.debug("{}", "----------------------------Chage Encoding Error------------------------------------------");
conts=new String(val.getBytes("ISO-8859-1"),"GBK");
log.debug("{}","Message="+conts);
}
catch(Exception e)
{
log.debug("{}","----------------------------Chage Encoding Error------------------------------------------");
e.printStackTrace(); e.printStackTrace();
} }
values.add(conts); values.add(conts);
} }
//获取所属核心机构号idc //获取所属核心机构号idc
Object vas=null; Object vas = null;
String bchp=transName.substring(0,2).trim(); String bchp = transName.substring(0, 2).trim();
String bch=bchp+"dgrp\\rec\\bchcod"; String bch = bchp + "dgrp\\rec\\bchcod";
vas=(MdaDriver.getDatafield(context,bch)).getValue(); vas = (MdaDriver.getDatafield(context, bch)).getValue();
String sql = "SELECT distinct idc FROM pty WHERE cid='"+vas+"'"; String sql = "SELECT distinct idc FROM pty WHERE cid='" + vas + "'";
ctx.getDaoSession().dbExecuteSQL(sql); ctx.getDaoSession().dbExecuteSQL(sql);
Argument<String> idc = new Argument<String>("idc"); Argument<String> idc = new Argument<String>("idc");
ctx.getDaoSession().dbFetchFields(idc); ctx.getDaoSession().dbFetchFields(idc);
...@@ -644,7 +566,7 @@ public class Platform ...@@ -644,7 +566,7 @@ public class Platform
values.add(idc.value); values.add(idc.value);
//if(!Platform.isEmpty(idc.value)) //if(!Platform.isEmpty(idc.value))
//value = nam.value; //value = nam.value;
log.debug("{}","idc 值 :"+idc.value); log.debug("{}", "idc 值 :" + idc.value);
return values.toArray(); return values.toArray();
} }
...@@ -652,8 +574,7 @@ public class Platform ...@@ -652,8 +574,7 @@ public class Platform
/** /**
* source:sysmod.@0115.script * source:sysmod.@0115.script
*/ */
public static boolean errorDeal(boolean tips,String message,boolean rollback) public static boolean errorDeal(boolean tips, String message, boolean rollback) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
...@@ -662,15 +583,11 @@ public class Platform ...@@ -662,15 +583,11 @@ public class Platform
rollback:true则回滚数据库事务,false只是返回 rollback:true则回滚数据库事务,false只是返回
*/ */
int errorno = ctx.getErrorCode(); int errorno = ctx.getErrorCode();
if(errorno != NO_ERROR) if (errorno != NO_ERROR) {
{ if (tips) {
if(tips) ctx.setMessage(MdaUtils.getI18NString("sysmod", "CT000363"), MdaUtils.getI18NString("sysmod", "CT000364"));
{ } else {
ctx.setMessage(MdaUtils.getI18NString("sysmod","CT000363"),MdaUtils.getI18NString("sysmod","CT000364")); log.error("{}", message);
}
else
{
log.error("{}",message);
} }
ctx.getDaoSession().dbRollback(); ctx.getDaoSession().dbRollback();
return false; return false;
...@@ -681,16 +598,15 @@ public class Platform ...@@ -681,16 +598,15 @@ public class Platform
/** /**
* source:sysmod.@0125.script * source:sysmod.@0125.script
*/ */
public static boolean isFromApp() public static boolean isFromApp() {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
String terminalType = (String)Platform.getLoginData("__terminalType"); String terminalType = (String) Platform.getLoginData("__terminalType");
log.info("{}","terminalType:"+terminalType); log.info("{}", "terminalType:" + terminalType);
if(MdaUtils.isEmpty(terminalType)) if (MdaUtils.isEmpty(terminalType))
return false; return false;
if("APP".equals(terminalType)) if ("APP".equals(terminalType))
return true; return true;
return false; return false;
} }
...@@ -698,37 +614,34 @@ public class Platform ...@@ -698,37 +614,34 @@ public class Platform
/** /**
* source:sysmod.@0126.script * source:sysmod.@0126.script
*/ */
public static boolean indexGt(IDatafield fld,String str) public static boolean indexGt(IDatafield fld, String str) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
boolean bool=false; boolean bool = false;
if (MdaUtils.isEmpty(fld)) if (MdaUtils.isEmpty(fld))
return false; return false;
if (str.indexOf((String)fld.getValue())>0) if (str.indexOf((String) fld.getValue()) > 0)
bool =true; bool = true;
return bool; return bool;
} }
/** /**
* source:sysmod.@0127.script * source:sysmod.@0127.script
*/ */
public static boolean containsValue(IDatafield fld,String splstr) public static boolean containsValue(IDatafield fld, String splstr) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
boolean bool=false; boolean bool = false;
if (MdaUtils.isEmpty(fld)) if (MdaUtils.isEmpty(fld))
return false; return false;
String [] s= splstr.split("-"); String[] s = splstr.split("-");
int len=s.length; int len = s.length;
for(int i=1;i<len;i++) for (int i = 1; i < len; i++) {
{ bool = ((String) fld.getValue()).contains(s[i]);
bool= ((String)fld.getValue()).contains(s[i]); if (bool)
if(bool)
break; break;
} }
return bool; return bool;
...@@ -737,23 +650,19 @@ public class Platform ...@@ -737,23 +650,19 @@ public class Platform
/** /**
* source:sysmod.@0128.script * source:sysmod.@0128.script
*/ */
public static boolean isALLChinese(String content) public static boolean isALLChinese(String content) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
if (MdaUtils.isEmpty(content)) if (MdaUtils.isEmpty(content)) {
{
return false; return false;
} }
///判断字符串中是否全为中文字符 ///判断字符串中是否全为中文字符
char[] charArr = content.toCharArray(); char[] charArr = content.toCharArray();
Boolean flag = true; Boolean flag = true;
for(int i = 0; i < charArr.length; i ++) for (int i = 0; i < charArr.length; i++) {
{
//if(charArr[i] >= 0x4E00 && charArr[i] <= 0x9FA5) //if(charArr[i] >= 0x4E00 && charArr[i] <= 0x9FA5)
if(!(charArr[i] >= 19968 && charArr[i] <= 40869)) if (!(charArr[i] >= 19968 && charArr[i] <= 40869)) {
{
return false; return false;
} }
} }
...@@ -763,28 +672,24 @@ public class Platform ...@@ -763,28 +672,24 @@ public class Platform
/** /**
* source:wfmmod.@0002.script * source:wfmmod.@0002.script
*/ */
public static boolean errorHandle(IModule wfe,String reason) public static boolean errorHandle(IModule wfe, String reason) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
/* /*
* 功能:代替原来在mgrtsk交易下定义的函数 errorHandle. * 功能:代替原来在mgrtsk交易下定义的函数 errorHandle.
*/ */
log.error("{}",reason); log.error("{}", reason);
IDatafield<String> sta=(IDatafield)wfe.get("sta"); IDatafield<String> sta = (IDatafield) wfe.get("sta");
IDatafield<String> rtycnt=(IDatafield)wfe.get("rtycnt"); IDatafield<String> rtycnt = (IDatafield) wfe.get("rtycnt");
if(MdaUtils.isEmpty(rtycnt)) if (MdaUtils.isEmpty(rtycnt)) {
{
sta.setValue("R"); sta.setValue("R");
rtycnt.setValue("1"); rtycnt.setValue("1");
} } else {
else int count = Integer.valueOf(rtycnt.getValue());
{ if (count >= 2)
int count=Integer.valueOf(rtycnt.getValue());
if(count>=2)
sta.setValue("E"); sta.setValue("E");
rtycnt.setValue(String.valueOf(count+1)); rtycnt.setValue(String.valueOf(count + 1));
} }
ctx.getDaoSession().dbBegin(); ctx.getDaoSession().dbBegin();
ctx.getDaoSession().dbUpdate(wfe); ctx.getDaoSession().dbUpdate(wfe);
...@@ -795,8 +700,7 @@ public class Platform ...@@ -795,8 +700,7 @@ public class Platform
/** /**
* source:apldoc.@0011.script * source:apldoc.@0011.script
*/ */
public static void setContractFlg() public static void setContractFlg() {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
...@@ -809,12 +713,11 @@ public class Platform ...@@ -809,12 +713,11 @@ public class Platform
/** /**
* source:trnmod.@0025.script * source:trnmod.@0025.script
*/ */
public static String sdbCounter(IModule rec) public static String sdbCounter(IModule rec) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
IDatafield<String> inr=(IDatafield)MdaDriver.getBaseObject(rec,"inr"); IDatafield<String> inr = (IDatafield) MdaDriver.getBaseObject(rec, "inr");
inr.setValue(Platform.sdbCounter(rec.getName())); inr.setValue(Platform.sdbCounter(rec.getName()));
return inr.getValue(); return inr.getValue();
} }
...@@ -822,8 +725,7 @@ public class Platform ...@@ -822,8 +725,7 @@ public class Platform
/** /**
* source:bimenu.@0040.script * source:bimenu.@0040.script
*/ */
public static boolean closeCursor(boolean flag) public static boolean closeCursor(boolean flag) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
...@@ -834,71 +736,69 @@ public class Platform ...@@ -834,71 +736,69 @@ public class Platform
/** /**
* source:xmlbod.@0004.script * source:xmlbod.@0004.script
*/ */
public static Map<String,String> loadPropertyPart(String transName, String keyType ) public static Map<String, String> loadPropertyPart(String transName, String keyType) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
/* /*
* 功能:将配置文件中的映射关系初始化为map * 功能:将配置文件中的映射关系初始化为map
*/ */
log.debug("{}"," in static xmlbod.getDatafieldMapping ... ") ; log.debug("{}", " in static xmlbod.getDatafieldMapping ... ");
Map<String,String> map = new HashMap<String,String>() ; Map<String, String> map = new HashMap<String, String>();
String fileName=MdaUtils.catPath(ctx.getEnvConfig().getRootPath(),"/cfg/"+transName+".properties"); String fileName = MdaUtils.catPath(ctx.getEnvConfig().getRootPath(), "/cfg/" + transName + ".properties");
log.debug("{}","fileName:"+ fileName); log.debug("{}", "fileName:" + fileName);
if (MdaUtils.fileExists(fileName)) if (MdaUtils.fileExists(fileName)) {
{ String keys = MdaUtils.getPropertyValue(fileName, keyType);
String keys=MdaUtils.getPropertyValue(fileName,keyType); if (MdaUtils.isEmpty(keys)) {
if(MdaUtils.isEmpty(keys)) log.error("{}", "未配置 " + transName + ".properties 中的 " + keyType + " 数据项 ");
{ return map;
log.error("{}","未配置 " + transName + ".properties 中的 " + keyType + " 数据项 " ) ;
return map ;
} }
for(String key:keys.split(",")) for (String key : keys.split(",")) {
{ String path = MdaUtils.getPropertyValue(fileName, key);
String path=MdaUtils.getPropertyValue(fileName,key); if (!MdaUtils.isEmpty(path))
if(!MdaUtils.isEmpty(path)) map.put(key, path);
map.put(key,path);
} }
} }
log.debug("{}"," out static xmlbod.getDatafieldMapping ... ") ; log.debug("{}", " out static xmlbod.getDatafieldMapping ... ");
return map ; return map;
} }
/** /**
* source:xmlbod.@0005.script * source:xmlbod.@0005.script
*/ */
public static String getRef(String prefix) public static String getRef(String prefix) {
{
//取得上下文 //取得上下文
IContext ctx = MdaEnv.getContext(); IContext ctx = MdaEnv.getContext();
ctx.setErrorCode(NO_ERROR); ctx.setErrorCode(NO_ERROR);
/** /**
* 返回业务参考号,如LC-090817-0001)。 * 返回业务参考号,如LC-090817-0001)。
*/ */
String ownref = "" ; String ownref = "";
if(!MdaUtils.isEmpty(prefix)) if (!MdaUtils.isEmpty(prefix)) {
{ String seq = prefix + MdaUtils.format(MdaUtils.today(), "yyMMdd");
String seq = prefix + MdaUtils.format(MdaUtils.today(),"yyMMdd"); ownref = seq + MdaUtils.format(ctx.getDaoSession().dbCounter(prefix + MdaUtils.format(MdaUtils.today(), "yy")), "0000");
ownref = seq + MdaUtils.format(ctx.getDaoSession().dbCounter(prefix+MdaUtils.format(MdaUtils.today(),"yy")),"0000");
} }
return ownref ; return ownref;
} }
public static void writeToSession(Object arg1,Object arg2){ public static void writeToSession(Object arg1, Object arg2) {
} }
public static Object readFromSession(Object arg1){
public static Object readFromSession(Object arg1) {
return null; return null;
} }
public static Object getLoginData(Object param){ public static Object getLoginData(String param) {
if ("usrinr".equals(param)) {
return "00000970";
}
return null; return null;
} }
public static void addEventRule(Object arg1,Object arg2,Object arg3,Object arg4){ public static void addEventRule(Object arg1, Object arg2, Object arg3, Object arg4) {
} }
......
...@@ -4,6 +4,8 @@ import java.util.*; ...@@ -4,6 +4,8 @@ import java.util.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.alibaba.fastjson.JSON;
import com.brilliance.mda.runtime.mda.*; import com.brilliance.mda.runtime.mda.*;
import com.brilliance.mda.runtime.mda.impl.*; import com.brilliance.mda.runtime.mda.impl.*;
import com.brilliance.mda.runtime.annotation.*; import com.brilliance.mda.runtime.annotation.*;
...@@ -147,8 +149,8 @@ public class Acdopn extends AbstractTransaction{ ...@@ -147,8 +149,8 @@ public class Acdopn extends AbstractTransaction{
} }
//组织报文发给预约开户系统,等待返回 //组织报文发给预约开户系统,等待返回
Map yymap = new HashMap(); Map yymap = new HashMap();
String seq =MdaUtils.format(ctx.getDaoSession().dbCounter("WindowsLSH"),"0000000000"); // String seq =MdaUtils.format(ctx.getDaoSession().dbCounter("WindowsLSH"),"0000000000");
String transid = "270"+seq; String transid = "270"+"11111111111111";
yymap.put("TransID",transid); yymap.put("TransID",transid);
yymap.put("EntName",this.getAcdgrp().getRec().getEntname()); yymap.put("EntName",this.getAcdgrp().getRec().getEntname());
...@@ -179,17 +181,22 @@ public class Acdopn extends AbstractTransaction{ ...@@ -179,17 +181,22 @@ public class Acdopn extends AbstractTransaction{
yymap.put("ContactAddress",this.getAcdgrp().getRec().getContactaddress());//新增 yymap.put("ContactAddress",this.getAcdgrp().getRec().getContactaddress());//新增
yymap.put("AppointmentDate",MdaUtils.format(this.getAcdgrp().getRec().getAppointmentdate(),"yyyyMMdd"));//新增 yymap.put("AppointmentDate",MdaUtils.format(this.getAcdgrp().getRec().getAppointmentdate(),"yyyyMMdd"));//新增
yymap.put("openaccRegion",bk);//新增 yymap.put("openaccRegion",bk);//新增
Object resMsg = MdaUtils.invoke("com.brilliance.eibs.main.Client","scall","w414","w414",new Object[]{yymap}); // Object resMsg = MdaUtils.invoke("com.brilliance.eibs.main.Client","scall","w414","w414",new Object[]{yymap});
Map yyrst = null; Map yyrst = new HashMap();
if((Boolean)MdaUtils.invoke(resMsg,"isSuccess")) yyrst.put("code","1");
{ yyrst.put("exeTaskResult","1");
yyrst = (Map)MdaUtils.invoke(resMsg,"getContent"); yyrst.put("promptInfo","1");
} yyrst.put("accountSerialNo","1");
else yyrst.put("openaccBizId","1");
{ // if((Boolean)MdaUtils.invoke(resMsg,"isSuccess"))
ctx.setMessage(MdaUtils.getI18NString("acdopn","CT000051"),MdaUtils.getI18NString("acdopn","CT000052")); // {
return false; // yyrst = (Map)MdaUtils.invoke(resMsg,"getContent");
} // }
// else
// {
// ctx.setMessage(MdaUtils.getI18NString("acdopn","CT000051"),MdaUtils.getI18NString("acdopn","CT000052"));
// return false;
// }
//判断处理结果,给出提示 //判断处理结果,给出提示
String yycode = (String) yyrst.get("code"); String yycode = (String) yyrst.get("code");
if(MdaUtils.isEmpty(yycode)) if(MdaUtils.isEmpty(yycode))
...@@ -334,8 +341,8 @@ public class Acdopn extends AbstractTransaction{ ...@@ -334,8 +341,8 @@ public class Acdopn extends AbstractTransaction{
ctx.getDaoSession().dbBegin(); ctx.getDaoSession().dbBegin();
//05:开户失败 ; //05:开户失败 ;
this.getAcdgrp().getRec().setStatus("05");//直接返回开户失败 this.getAcdgrp().getRec().setStatus("05");//直接返回开户失败
String seq =MdaUtils.format(ctx.getDaoSession().dbCounter("WindowsLSH"),"0000000000"); //String seq =MdaUtils.format(ctx.getDaoSession().dbCounter("WindowsLSH"),"0000000000");
String transid = "270"+seq; String transid = "270"+"2131243124";
this.getAcdgrp().getRec().setTransid(transid); this.getAcdgrp().getRec().setTransid(transid);
if(MdaUtils.isEmpty(this.getAcdgrp().getRec().getInr())) if(MdaUtils.isEmpty(this.getAcdgrp().getRec().getInr()))
{ {
...@@ -397,7 +404,7 @@ public class Acdopn extends AbstractTransaction{ ...@@ -397,7 +404,7 @@ public class Acdopn extends AbstractTransaction{
this.getAcdgrp().getRec().copyValue(acd); this.getAcdgrp().getRec().copyValue(acd);
this.getAcdgrp().getRec().setCredat(MdaUtils.today()); this.getAcdgrp().getRec().setCredat(MdaUtils.today());
this.getAcdgrp().getRec().setSocialcrdtcd("1");
ctx.getDaoSession().dbRead(this.getAcdgrp().getPty(),new Argument<String>("cifno",EQ,this.getAcdgrp().getRec().getSocialcrdtcd())); ctx.getDaoSession().dbRead(this.getAcdgrp().getPty(),new Argument<String>("cifno",EQ,this.getAcdgrp().getRec().getSocialcrdtcd()));
this.getAcdgrp().getRec().setNcid(this.getAcdgrp().getPty().getCid()); this.getAcdgrp().getRec().setNcid(this.getAcdgrp().getPty().getCid());
...@@ -441,7 +448,8 @@ public class Acdopn extends AbstractTransaction{ ...@@ -441,7 +448,8 @@ public class Acdopn extends AbstractTransaction{
String objinr = this.getAcdp().getAcdgrp().getRec().getInr(); String objinr = this.getAcdp().getAcdgrp().getRec().getInr();
String objtyp = "acd"; String objtyp = "acd";
MdaUtils.clear(this.getTrnmod().getBnktrn()); MdaUtils.clear(this.getTrnmod().getBnktrn());
ctx.getDaoSession().dbRead(this.getTrnmod().getBnktrn(),new Argument<String>("objinr",objinr),new Argument<String>("objtyp",objtyp)); // 6-16-update
ctx.getDaoSession().dbRead(this.getTrnmod().getBnktrn(),new Argument<String>("objinr","00000686"),new Argument<String>("objtyp",objtyp));
return true; return true;
} }
...@@ -918,7 +926,27 @@ public class Acdopn extends AbstractTransaction{ ...@@ -918,7 +926,27 @@ public class Acdopn extends AbstractTransaction{
public static void main(String[] args) {
AcdopnVO acdopnVO = new AcdopnVO();
acdopnVO.setAcdgrp_rec_acdno("1");
acdopnVO.setAcdgrp_rec_account("2");
acdopnVO.setAcdgrp_rec_accounttype("3");
acdopnVO.setAcdgrp_rec_appointmentdate(new Date());
acdopnVO.setAcdgrp_rec_bchcod("4");
acdopnVO.setAcdgrp_rec_busiscope("5");
acdopnVO.setAcdgrp_rec_busistatus("6");
acdopnVO.setAcdgrp_rec_credat(new Date());
acdopnVO.setAcdgrp_rec_contactaddress("7");
acdopnVO.setAcdgrp_rec_entname("8");
acdopnVO.setAcdgrp_rec_enttel("9");
acdopnVO.setAcdgrp_rec_enttype("10");
System.out.println(JSON.toJSONString(acdopnVO));
}
} }
...@@ -1133,7 +1133,7 @@ public class MdaUtils { ...@@ -1133,7 +1133,7 @@ public class MdaUtils {
public static boolean prompt(Object... o) { public static boolean prompt(Object... o) {
return true; return false;
} }
public static String generateSerialNum() { public static String generateSerialNum() {
...@@ -1323,7 +1323,14 @@ public class MdaUtils { ...@@ -1323,7 +1323,14 @@ public class MdaUtils {
* @param o * @param o
*/ */
public static void setValues(Object... o) { public static void setValues(Object... o) {
// if (o.length == 3) {
// Object o1 = o[0];
// Object o2 = o[1];
// Object o3 = o[2];
// if (o1 instanceof IModule && o2 instanceof String) {
// Datas.setFieldValue((IModule) o1, (String) o2, o3);
// }
// }
} }
/** /**
...@@ -1555,7 +1562,7 @@ public class MdaUtils { ...@@ -1555,7 +1562,7 @@ public class MdaUtils {
BufferedReader br = new BufferedReader(new StringReader(block)); BufferedReader br = new BufferedReader(new StringReader(block));
String _line; String _line;
for(int count = 0; (_line = br.readLine()) != null; ++count) { for (int count = 0; (_line = br.readLine()) != null; ++count) {
if (count == line) { if (count == line) {
return _line; return _line;
} }
...@@ -1565,6 +1572,7 @@ public class MdaUtils { ...@@ -1565,6 +1572,7 @@ public class MdaUtils {
return null; return null;
} }
public static String getServerName() { public static String getServerName() {
InetAddress addr = null; InetAddress addr = null;
String serverName = ""; String serverName = "";
...@@ -1582,20 +1590,21 @@ public class MdaUtils { ...@@ -1582,20 +1590,21 @@ public class MdaUtils {
/** /**
* todo 解决evt.getData()问题 * todo 解决evt.getData()问题
*
* @return * @return
*/ */
public static Object getEventData(){ public static Object getEventData() {
return "-1"; return "-1";
} }
/** /**
* todo 解决evt.getTarget问题 * todo 解决evt.getTarget问题
*
* @return * @return
*/ */
public static IAttribute getEventTarget(){ public static IAttribute getEventTarget() {
return new AttributeValue(); return new AttributeValue();
} }
} }
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