Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
cc45a34b
Commit
cc45a34b
authored
Jun 16, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试 acdopn.save交易
parent
8e3d76d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
845 additions
and
901 deletions
+845
-901
be-esb-core-2.0.jar
gjjs-bd-business/lib/be-esb-core-2.0.jar
+0
-0
pom.xml
gjjs-bd-business/pom.xml
+7
-0
Platform.java
...iness/src/main/java/com/ceb/gjjs/mda/global/Platform.java
+776
-875
Acdopn.java
...siness/src/main/java/com/ceb/gjjs/mda/manager/Acdopn.java
+47
-20
MdaUtils.java
...in/java/com/brilliance/mda/runtime/mda/util/MdaUtils.java
+15
-6
No files found.
gjjs-bd-business/lib/be-esb-core-2.0.jar
0 → 100644
View file @
cc45a34b
File added
gjjs-bd-business/pom.xml
View file @
cc45a34b
...
@@ -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>
...
...
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/global/Platform.java
View file @
cc45a34b
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.*
;
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
Platform
.
class
);
/**
* source:sysmod.@0022.script
*/
public
static
String
sdbCounter
(
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
return
MdaUtils
.
format
(
ctx
.
getDaoSession
().
dbCounter
(
name
),
"00000000"
);
}
/**
* source:sysmod.@0035.script
*/
public
static
boolean
errorCloseCursor
(
String
message
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
ctx
.
getDaoSession
().
dbCloseCursor
();
ctx
.
setMessage
(
MdaUtils
.
getI18NString
(
"sysmod"
,
"CT000211"
),
message
);
return
false
;
}
/**
* source:sysmod.@0036.script
*/
public
static
Map
<
String
,
Object
>
getValueMap
(
IModule
mctx
,
String
transName
,
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
IModule
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
if
(
Platform
.
isXmlmapTransaction
(
transName
))
{
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
}
if
(
context
==
null
)
context
=
mctx
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
log
.
info
(
"{}"
,
"fileName = "
+
fileName
)
;
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
Map
<
String
,
Object
>
values
=
new
HashMap
<
String
,
Object
>();
if
(
MdaUtils
.
isEmpty
(
keys
))
return
values
;
for
(
String
key:
keys
.
split
(
","
))
{
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
log
.
info
(
"{}"
,
key
+
"的取值路径为:"
+
path
+
","
);
if
(!
MdaUtils
.
isEmpty
(
path
))
values
.
put
(
key
,
Platform
.
getDatafieldValue
(
context
,
path
));
//by mkz for debug 19.03.04
//log.debug("存入" + key + "的值为:" + Platform.getDatafieldValue(context,path));
log
.
debug
(
"{}"
,
key
+
"取出的值为+==:"
+
values
.
get
(
key
)
+
","
);
}
log
.
debug
(
"{}"
,
"values.size:"
+
values
.
size
());
values
.
put
(
"locale"
,
ctx
.
getLocale
());
return
values
;
}
/**
* source:sysmod.@0037.script
*/
public
static
Object
[]
getValues
(
IModule
mctx
,
String
transName
,
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
IModule
context
=
null
;
if
(!
Platform
.
isXmlmapTransaction
(
transName
))
{
log
.
debug
(
"{}"
,
"in bimenu "
);
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
}
else
{
log
.
debug
(
"{}"
,
"in xmlmap "
);
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
}
if
(
context
==
null
)
context
=
mctx
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
if
(
MdaUtils
.
isEmpty
(
keys
))
return
new
Object
[]{};
List
<
Object
>
values
=
new
ArrayList
<
Object
>();
for
(
String
key:
keys
.
split
(
","
))
{
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
if
(!
MdaUtils
.
isEmpty
(
path
))
values
.
add
(
Platform
.
getDatafieldValue
(
context
,
path
));
}
return
values
.
toArray
();
}
/**
* source:sysmod.@0038.script
*/
public
static
Object
getDatafieldValue
(
IModule
context
,
String
path
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
info
(
"{}"
,
"&path==="
+
path
);
//log.debug("是否以”.“开头:" + path.startsWith("."));
Object
value
=
null
;
if
(
path
.
startsWith
(
"!"
))
value
=
path
.
substring
(
1
);
else
if
(
path
.
startsWith
(
".0"
))
{
if
(
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
2
))))
return
value
;
value
=(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
2
))).
getValue
();
log
.
info
(
"{}"
,
"value="
+
value
);
String
sql
=
"SELECT nam FROM pty WHERE cid='"
+
value
+
"'"
;
ctx
.
getDaoSession
().
dbExecuteSQL
(
sql
);
Argument
<
String
>
nam
=
new
Argument
<
String
>(
"nam"
);
ctx
.
getDaoSession
().
dbFetchFields
(
nam
);
ctx
.
getDaoSession
().
dbCloseCursor
();
if
(!
MdaUtils
.
isEmpty
(
nam
.
value
))
value
=
nam
.
value
;
return
value
;
}
else
if
(
path
.
startsWith
(
"."
))
{
//log.debug("path.value:" +Platform.getDatafield(context,path.substring(1)));
if
(
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))))
return
value
;
value
=(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))).
getValue
();
log
.
info
(
"{}"
,
"value="
+
value
);
List
<
CodetableItem
>
list
=(
List
<
CodetableItem
>)(
MdaDriver
.
getDatafield
(
null
,
"\\sysmod\\bchcodvals"
)).
getValue
();
if
(
MdaUtils
.
isEmpty
(
list
))
{
//by dg for debug...10.09
log
.
info
(
"{}"
,
"bchcod list is empty!"
);
return
value
;
}
for
(
CodetableItem
item:
list
)
{
log
.
info
(
"{}"
,
"item.getValue()="
+
item
.
getValue
());
if
(
item
.
getValue
().
equals
(
value
))
{
log
.
info
(
"{}"
,
"item="
+
item
.
getLabel
());
return
item
.
getLabel
();
}
}
}
else
if
(
path
.
startsWith
(
"*"
))
{
if
(
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))))
return
value
;
value
=(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))).
getValue
();
if
(
"X"
.
equals
(
value
))
return
"√"
;
}
else
if
(
path
.
startsWith
(
"?0"
))
{
//处理45A
String
rtvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adlcnd
Object
adlcnd
=
flds
.
get
(
"adlcnd"
).
getValue
();
Object
nomton
=
flds
.
get
(
"nomton"
).
getValue
();
Object
nomflg
=
flds
.
get
(
"nomflg"
).
getValue
();
Object
nomtop
=
flds
.
get
(
"nomtop"
).
getValue
();
// log.debug("nomflg=="+nomflg.toString());
// log.debug("nomflg=="+nomflg);
if
(!
MdaUtils
.
isEmpty
(
nomflg
)&&
TRUE
.
equals
(
nomflg
.
toString
()))
{
rtvalue
=
"+Quantity And Amount "
;
if
(!
MdaUtils
.
isEmpty
(
nomtop
))
rtvalue
+=
nomtop
.
toString
()+
" PERCENT More "
;
if
(!
MdaUtils
.
isEmpty
(
nomton
))
{
if
(!
MdaUtils
.
isEmpty
(
nomtop
))
rtvalue
+=
" Or "
;
rtvalue
+=
nomton
.
toString
()+
" PERCENT Less"
;
}
rtvalue
+=
" Are Allowed"
;
}
if
(!
MdaUtils
.
isEmpty
(
adlcnd
))
if
(
rtvalue
==
null
||
""
.
equals
(
rtvalue
)
)
rtvalue
=
adlcnd
.
toString
();
else
rtvalue
+=
CR
+
adlcnd
.
toString
();
else
rtvalue
=
rtvalue
;
return
rtvalue
;
}
else
if
(
path
.
startsWith
(
"?1"
))
{
//处理47A
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adlcnd
Object
lcrgod
=
flds
.
get
(
"lcrgod"
).
getValue
();
Object
trdtrm
=
flds
.
get
(
"trdtrm"
).
getValue
();
Object
trdtrmplc
=
flds
.
get
(
"trdtrmplc"
).
getValue
();
Object
trdtrmver
=
flds
.
get
(
"trdtrmver"
).
getValue
();
if
(!
MdaUtils
.
isEmpty
(
lcrgod
))
returnvalue
=
lcrgod
.
toString
()+
CR
;
if
(!
MdaUtils
.
isEmpty
(
trdtrm
))
returnvalue
+=
"+Trade Terms: "
+
trdtrm
.
toString
();
if
(!
MdaUtils
.
isEmpty
(
trdtrmplc
))
returnvalue
+=
" "
+
trdtrmplc
.
toString
();
if
(!
MdaUtils
.
isEmpty
(
trdtrmver
))
returnvalue
+=
" "
+
trdtrmver
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?7"
))
{
//处理进口代收,出口托收等申请书期限
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adrblk
Object
doctypcod
=
flds
.
get
(
"doctypcod"
).
getValue
();
Object
matpercnt
=
flds
.
get
(
"matpercnt"
).
getValue
();
Object
matpertyp
=
flds
.
get
(
"matpertyp"
).
getValue
();
Object
doctxt
=
flds
.
get
(
"mixdet"
).
getValue
();
if
(
"1"
.
equals
(
doctypcod
.
toString
())
||
"3"
.
equals
(
doctypcod
.
toString
())
)
if
(!
MdaUtils
.
isEmpty
(
matpercnt
))
returnvalue
=
matpercnt
+
" Days "
+
MdaUtils
.
getCodetableLabel
(
"matpertyp1"
,
matpertyp
.
toString
());
if
(
"4"
.
equals
(
doctypcod
.
toString
())
&&
doctxt
!=
null
)
returnvalue
=
doctxt
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?8"
))
{
//处理进口代收,出口托收等申请书期限
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adrblk
Object
doctypcod
=
flds
.
get
(
"doctypcod"
).
getValue
();
Object
matpercnt
=
flds
.
get
(
"matpercnt"
).
getValue
();
Object
matpertyp
=
flds
.
get
(
"matpertyp"
).
getValue
();
Object
doctxt
=
flds
.
get
(
"doctxt"
).
getValue
();
if
(
"1"
.
equals
(
doctypcod
.
toString
())
||
"3"
.
equals
(
doctypcod
.
toString
())
)
if
(!
MdaUtils
.
isEmpty
(
matpercnt
))
returnvalue
=
matpercnt
+
" Days "
+
MdaUtils
.
getCodetableLabel
(
"matpertyp"
,
matpertyp
.
toString
());
if
(
"4"
.
equals
(
doctypcod
.
toString
())&&
doctxt
!=
null
)
returnvalue
=
doctxt
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?9"
))
{
//处理出口信用证申请内容
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adrblk
Object
adrblk
=
flds
.
get
(
"adrblk"
).
getValue
();
Object
details
=
flds
.
get
(
"details"
).
getValue
();
if
(!
MdaUtils
.
isEmpty
(
adrblk
))
returnvalue
=
"THE BENEFICIARY HAS BEEN AMENDED TO "
+
adrblk
.
toString
()+
CR
;
if
(!
MdaUtils
.
isEmpty
(
details
))
returnvalue
+=
details
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?r?n"
))
{
Object
fldVavle
=
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
4
))).
getValue
();
String
valueStr
=
""
;
if
(!
MdaUtils
.
isEmpty
(
fldVavle
))
{
valueStr
=
fldVavle
.
toString
();
if
(
valueStr
.
contains
(
"\n"
))
{
valueStr
=
valueStr
.
replace
(
"\n"
,
" "
);
}
if
(
valueStr
.
contains
(
"\r"
))
{
valueStr
=
valueStr
.
replace
(
"\r"
,
""
);
}
}
value
=
valueStr
;
}
else
if
(!
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
)))
value
=(
MdaDriver
.
getDatafield
(
context
,
path
)).
getValue
();
else
if
(
path
.
endsWith
(
"nomtop"
)
||
path
.
endsWith
(
"nomton"
))
value
=
"0"
;
return
value
;
}
/**
* source:sysmod.@0065.script
*/
public
static
Map
<
String
,
Object
>
convertContentToMap
(
IModule
mctx
,
Map
<
String
,
Object
>
data
,
String
transName
,
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/**
* 功能:将模型内容转换为指定的Map格式
* 参数: mctx - 配置中Datafield的相对模块
* transName- 转换配置的参数文件名称
* name - 配置文件中的字段定义,使用','隔开 ,默认为DATA
*/
log
.
info
(
"{}"
,
"sysmod.convertContentToMap Invoked..."
);
Map
<
String
,
Object
>
values
=
null
;
IModule
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
int
errcod
=
ctx
.
getErrorCode
();
if
(
context
==
null
)
context
=
mctx
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
if
(
MdaUtils
.
isEmpty
(
keys
))
{
log
.
error
(
"{}"
,
"配置文件:"
+
fileName
+
" 未配置 "
+
name
+
" 项 ."
)
;
return
values
;
}
values
=
data
;
log
.
debug
(
"{}"
,
" keys: "
+
keys
)
;
for
(
String
key:
keys
.
split
(
","
))
{
log
.
debug
(
"{}"
,
"key = {"
+
key
+
"}"
);
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
log
.
debug
(
"{}"
,
" sysmod.convertContentToMap : path = "
+
path
)
;
if
(!
MdaUtils
.
isEmpty
(
path
))
{
values
.
put
(
key
,
Platform
.
getDatafieldValue
(
context
,
path
));
log
.
debug
(
"{}"
,
"xmlMap:{ key="
+
key
+
", value="
+
Platform
.
getDatafieldValue
(
context
,
path
)+
" }"
)
;
}
}
values
.
put
(
"locale"
,
ctx
.
getLocale
());
return
values
;
}
/**
* source:sysmod.@0073.script
*/
public
static
Date
formatDateTime
(
Date
d
,
String
pattern
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
if
(
d
==
null
)
{
d
=
MdaUtils
.
today
();
}
if
(
MdaUtils
.
isEmpty
(
pattern
)
||
"0"
.
equals
(
pattern
)
)
{
pattern
=
"000000"
;
}
String
time
=
MdaUtils
.
format
(
d
,
"yyyyMMddHHmmss"
);
time
=
time
.
substring
(
0
,
8
);
time
=
time
+
pattern
;
return
MdaUtils
.
parseDate
(
time
,
"yyyyMMddHHmmss"
);
}
/**
* source:sysmod.@0074.script
*/
public
static
boolean
isXmlmapTransaction
(
String
transNam
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 用于判断来报通知是否从xmlmap中映射模块,以便于区分原来的bimenu
*/
log
.
debug
(
"{}"
,
" in isXmlmapTransaction "
+
transNam
);
boolean
ret
=
false
;
if
(!
MdaUtils
.
isEmpty
(
transNam
)
&&
(
"rptshw"
.
equals
(
transNam
)||
"ersshw"
.
equals
(
transNam
)
)
)
{
ret
=
true
;
}
log
.
debug
(
"{}"
,
" out isXmlmapTransaction = "
+
ret
);
return
ret
;
}
/**
* source:sysmod.@0079.script
*/
public
static
boolean
isNoError
(
Map
msg
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 判断是否没有错误,方便回滚或提交事务
*/
log
.
debug
(
"{}"
,
"in static sysmod.isNoError ... "
);
boolean
ret
=
true
;
if
(!
MdaUtils
.
isEmpty
(
msg
))
{
String
errcod
=(
String
)
msg
.
get
(
"ERRORCODE"
);
log
.
debug
(
"{}"
,
"msgErrcod = "
+
errcod
+
"."
);
if
(!
MdaUtils
.
isEmpty
(
errcod
)
&&
!
"00000"
.
equals
(
errcod
))
{
ret
=
false
;
}
}
return
ret
;
}
/**
import
static
com
.
brilliance
.
mda
.
runtime
.
mda
.
Constants
.*;
* source:sysmod.@0080.script
*/
public
static
void
setErrorInfo
(
Map
<
String
,
Object
>
msgMap
,
String
errcod
,
String
errMsg
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
debug
(
"{}"
,
"in static sysmod setErrorInfo ... "
);
msgMap
.
put
(
"ERRORMSG"
,
errMsg
);
msgMap
.
put
(
"ERRORCODE"
,
errcod
);
log
.
error
(
"{}"
,
"错误码:"
+
errcod
+
", 错误描述"
+
errMsg
);
}
public
class
Platform
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
Platform
.
class
);
/**
* source:sysmod.@0022.script
*/
public
static
String
sdbCounter
(
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
return
MdaUtils
.
format
(
ctx
.
getDaoSession
().
dbCounter
(
name
),
"00000000"
);
}
/**
* source:sysmod.@0035.script
*/
public
static
boolean
errorCloseCursor
(
String
message
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
ctx
.
getDaoSession
().
dbCloseCursor
();
ctx
.
setMessage
(
MdaUtils
.
getI18NString
(
"sysmod"
,
"CT000211"
),
message
);
return
false
;
}
/**
* source:sysmod.@0036.script
*/
public
static
Map
<
String
,
Object
>
getValueMap
(
IModule
mctx
,
String
transName
,
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
IModule
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
if
(
Platform
.
isXmlmapTransaction
(
transName
))
{
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
}
if
(
context
==
null
)
context
=
mctx
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
log
.
info
(
"{}"
,
"fileName = "
+
fileName
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
Map
<
String
,
Object
>
values
=
new
HashMap
<
String
,
Object
>();
if
(
MdaUtils
.
isEmpty
(
keys
))
return
values
;
for
(
String
key
:
keys
.
split
(
","
))
{
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
log
.
info
(
"{}"
,
key
+
"的取值路径为:"
+
path
+
","
);
if
(!
MdaUtils
.
isEmpty
(
path
))
values
.
put
(
key
,
Platform
.
getDatafieldValue
(
context
,
path
));
//by mkz for debug 19.03.04
//log.debug("存入" + key + "的值为:" + Platform.getDatafieldValue(context,path));
log
.
debug
(
"{}"
,
key
+
"取出的值为+==:"
+
values
.
get
(
key
)
+
","
);
}
log
.
debug
(
"{}"
,
"values.size:"
+
values
.
size
());
values
.
put
(
"locale"
,
ctx
.
getLocale
());
return
values
;
}
/**
* source:sysmod.@0037.script
*/
public
static
Object
[]
getValues
(
IModule
mctx
,
String
transName
,
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
IModule
context
=
null
;
if
(!
Platform
.
isXmlmapTransaction
(
transName
))
{
log
.
debug
(
"{}"
,
"in bimenu "
);
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
}
else
{
log
.
debug
(
"{}"
,
"in xmlmap "
);
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
}
if
(
context
==
null
)
context
=
mctx
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
if
(
MdaUtils
.
isEmpty
(
keys
))
return
new
Object
[]{};
List
<
Object
>
values
=
new
ArrayList
<
Object
>();
for
(
String
key
:
keys
.
split
(
","
))
{
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
if
(!
MdaUtils
.
isEmpty
(
path
))
values
.
add
(
Platform
.
getDatafieldValue
(
context
,
path
));
}
return
values
.
toArray
();
}
/**
* source:sysmod.@0038.script
*/
public
static
Object
getDatafieldValue
(
IModule
context
,
String
path
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
info
(
"{}"
,
"&path==="
+
path
);
//log.debug("是否以”.“开头:" + path.startsWith("."));
Object
value
=
null
;
if
(
path
.
startsWith
(
"!"
))
value
=
path
.
substring
(
1
);
else
if
(
path
.
startsWith
(
".0"
))
{
if
(
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
2
))))
return
value
;
value
=
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
2
))).
getValue
();
log
.
info
(
"{}"
,
"value="
+
value
);
String
sql
=
"SELECT nam FROM pty WHERE cid='"
+
value
+
"'"
;
ctx
.
getDaoSession
().
dbExecuteSQL
(
sql
);
Argument
<
String
>
nam
=
new
Argument
<
String
>(
"nam"
);
ctx
.
getDaoSession
().
dbFetchFields
(
nam
);
ctx
.
getDaoSession
().
dbCloseCursor
();
if
(!
MdaUtils
.
isEmpty
(
nam
.
value
))
value
=
nam
.
value
;
return
value
;
}
else
if
(
path
.
startsWith
(
"."
))
{
//log.debug("path.value:" +Platform.getDatafield(context,path.substring(1)));
if
(
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))))
return
value
;
value
=
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))).
getValue
();
log
.
info
(
"{}"
,
"value="
+
value
);
List
<
CodetableItem
>
list
=
(
List
<
CodetableItem
>)
(
MdaDriver
.
getDatafield
(
null
,
"\\sysmod\\bchcodvals"
)).
getValue
();
if
(
MdaUtils
.
isEmpty
(
list
))
{
//by dg for debug...10.09
log
.
info
(
"{}"
,
"bchcod list is empty!"
);
return
value
;
}
for
(
CodetableItem
item
:
list
)
{
log
.
info
(
"{}"
,
"item.getValue()="
+
item
.
getValue
());
if
(
item
.
getValue
().
equals
(
value
))
{
log
.
info
(
"{}"
,
"item="
+
item
.
getLabel
());
return
item
.
getLabel
();
}
}
}
else
if
(
path
.
startsWith
(
"*"
))
{
if
(
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))))
return
value
;
value
=
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
1
))).
getValue
();
if
(
"X"
.
equals
(
value
))
return
"√"
;
}
else
if
(
path
.
startsWith
(
"?0"
))
{
//处理45A
String
rtvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field
:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)
+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adlcnd
Object
adlcnd
=
flds
.
get
(
"adlcnd"
).
getValue
();
Object
nomton
=
flds
.
get
(
"nomton"
).
getValue
();
Object
nomflg
=
flds
.
get
(
"nomflg"
).
getValue
();
Object
nomtop
=
flds
.
get
(
"nomtop"
).
getValue
();
// log.debug("nomflg=="+nomflg.toString());
// log.debug("nomflg=="+nomflg);
if
(!
MdaUtils
.
isEmpty
(
nomflg
)
&&
TRUE
.
equals
(
nomflg
.
toString
()))
{
rtvalue
=
"+Quantity And Amount "
;
if
(!
MdaUtils
.
isEmpty
(
nomtop
))
rtvalue
+=
nomtop
.
toString
()
+
" PERCENT More "
;
if
(!
MdaUtils
.
isEmpty
(
nomton
))
{
if
(!
MdaUtils
.
isEmpty
(
nomtop
))
rtvalue
+=
" Or "
;
rtvalue
+=
nomton
.
toString
()
+
" PERCENT Less"
;
}
rtvalue
+=
" Are Allowed"
;
}
if
(!
MdaUtils
.
isEmpty
(
adlcnd
))
if
(
rtvalue
==
null
||
""
.
equals
(
rtvalue
))
rtvalue
=
adlcnd
.
toString
();
else
rtvalue
+=
CR
+
adlcnd
.
toString
();
else
rtvalue
=
rtvalue
;
return
rtvalue
;
}
else
if
(
path
.
startsWith
(
"?1"
))
{
//处理47A
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field
:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)
+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adlcnd
Object
lcrgod
=
flds
.
get
(
"lcrgod"
).
getValue
();
Object
trdtrm
=
flds
.
get
(
"trdtrm"
).
getValue
();
Object
trdtrmplc
=
flds
.
get
(
"trdtrmplc"
).
getValue
();
Object
trdtrmver
=
flds
.
get
(
"trdtrmver"
).
getValue
();
if
(!
MdaUtils
.
isEmpty
(
lcrgod
))
returnvalue
=
lcrgod
.
toString
()
+
CR
;
if
(!
MdaUtils
.
isEmpty
(
trdtrm
))
returnvalue
+=
"+Trade Terms: "
+
trdtrm
.
toString
();
if
(!
MdaUtils
.
isEmpty
(
trdtrmplc
))
returnvalue
+=
" "
+
trdtrmplc
.
toString
();
if
(!
MdaUtils
.
isEmpty
(
trdtrmver
))
returnvalue
+=
" "
+
trdtrmver
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?7"
))
{
//处理进口代收,出口托收等申请书期限
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field
:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)
+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adrblk
Object
doctypcod
=
flds
.
get
(
"doctypcod"
).
getValue
();
Object
matpercnt
=
flds
.
get
(
"matpercnt"
).
getValue
();
Object
matpertyp
=
flds
.
get
(
"matpertyp"
).
getValue
();
Object
doctxt
=
flds
.
get
(
"mixdet"
).
getValue
();
if
(
"1"
.
equals
(
doctypcod
.
toString
())
||
"3"
.
equals
(
doctypcod
.
toString
()))
if
(!
MdaUtils
.
isEmpty
(
matpercnt
))
returnvalue
=
matpercnt
+
" Days "
+
MdaUtils
.
getCodetableLabel
(
"matpertyp1"
,
matpertyp
.
toString
());
if
(
"4"
.
equals
(
doctypcod
.
toString
())
&&
doctxt
!=
null
)
returnvalue
=
doctxt
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?8"
))
{
//处理进口代收,出口托收等申请书期限
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field
:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)
+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adrblk
Object
doctypcod
=
flds
.
get
(
"doctypcod"
).
getValue
();
Object
matpercnt
=
flds
.
get
(
"matpercnt"
).
getValue
();
Object
matpertyp
=
flds
.
get
(
"matpertyp"
).
getValue
();
Object
doctxt
=
flds
.
get
(
"doctxt"
).
getValue
();
if
(
"1"
.
equals
(
doctypcod
.
toString
())
||
"3"
.
equals
(
doctypcod
.
toString
()))
if
(!
MdaUtils
.
isEmpty
(
matpercnt
))
returnvalue
=
matpercnt
+
" Days "
+
MdaUtils
.
getCodetableLabel
(
"matpertyp"
,
matpertyp
.
toString
());
if
(
"4"
.
equals
(
doctypcod
.
toString
())
&&
doctxt
!=
null
)
returnvalue
=
doctxt
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?9"
))
{
//处理出口信用证申请内容
String
returnvalue
=
""
;
String
[]
fields
=
path
.
substring
(
2
).
split
(
"\\?"
);
Map
<
String
,
IDatafield
>
flds
=
new
HashMap
<
String
,
IDatafield
>();
for
(
String
field
:
fields
)
{
flds
.
put
(
field
.
substring
(
field
.
lastIndexOf
(
"\\"
)
+
1
),
MdaDriver
.
getDatafield
(
context
,
field
));
}
//adrblk
Object
adrblk
=
flds
.
get
(
"adrblk"
).
getValue
();
Object
details
=
flds
.
get
(
"details"
).
getValue
();
if
(!
MdaUtils
.
isEmpty
(
adrblk
))
returnvalue
=
"THE BENEFICIARY HAS BEEN AMENDED TO "
+
adrblk
.
toString
()
+
CR
;
if
(!
MdaUtils
.
isEmpty
(
details
))
returnvalue
+=
details
.
toString
();
return
returnvalue
.
trim
();
}
else
if
(
path
.
startsWith
(
"?r?n"
))
{
Object
fldVavle
=
(
MdaDriver
.
getDatafield
(
context
,
path
.
substring
(
4
))).
getValue
();
String
valueStr
=
""
;
if
(!
MdaUtils
.
isEmpty
(
fldVavle
))
{
valueStr
=
fldVavle
.
toString
();
if
(
valueStr
.
contains
(
"\n"
))
{
valueStr
=
valueStr
.
replace
(
"\n"
,
" "
);
}
if
(
valueStr
.
contains
(
"\r"
))
{
valueStr
=
valueStr
.
replace
(
"\r"
,
""
);
}
}
value
=
valueStr
;
}
else
if
(!
MdaUtils
.
isEmpty
(
MdaDriver
.
getDatafield
(
context
,
path
)))
value
=
(
MdaDriver
.
getDatafield
(
context
,
path
)).
getValue
();
else
if
(
path
.
endsWith
(
"nomtop"
)
||
path
.
endsWith
(
"nomton"
))
value
=
"0"
;
return
value
;
}
/**
* source:sysmod.@0065.script
*/
public
static
Map
<
String
,
Object
>
convertContentToMap
(
IModule
mctx
,
Map
<
String
,
Object
>
data
,
String
transName
,
String
name
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/**
/**
* source:sysmod.@0103.script
* 功能:将模型内容转换为指定的Map格式
*/
* 参数: mctx - 配置中Datafield的相对模块
public
static
String
headBchcod
()
* transName- 转换配置的参数文件名称
{
* name - 配置文件中的字段定义,使用','隔开 ,默认为DATA
//取得上下文
*/
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
info
(
"{}"
,
"sysmod.convertContentToMap Invoked..."
);
return
"08350000"
;
Map
<
String
,
Object
>
values
=
null
;
}
IModule
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
int
errcod
=
ctx
.
getErrorCode
();
if
(
context
==
null
)
context
=
mctx
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
if
(
MdaUtils
.
isEmpty
(
keys
))
{
log
.
error
(
"{}"
,
"配置文件:"
+
fileName
+
" 未配置 "
+
name
+
" 项 ."
);
return
values
;
}
values
=
data
;
log
.
debug
(
"{}"
,
" keys: "
+
keys
);
for
(
String
key
:
keys
.
split
(
","
))
{
log
.
debug
(
"{}"
,
"key = {"
+
key
+
"}"
);
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
log
.
debug
(
"{}"
,
" sysmod.convertContentToMap : path = "
+
path
);
if
(!
MdaUtils
.
isEmpty
(
path
))
{
values
.
put
(
key
,
Platform
.
getDatafieldValue
(
context
,
path
));
log
.
debug
(
"{}"
,
"xmlMap:{ key="
+
key
+
", value="
+
Platform
.
getDatafieldValue
(
context
,
path
)
+
" }"
);
}
}
/**
values
.
put
(
"locale"
,
ctx
.
getLocale
());
* source:sysmod.@0162.script
return
values
;
*/
}
public
static
Map
execLocalScriptwithLog
(
String
command
)
{
/**
//取得上下文
* source:sysmod.@0073.script
IContext
ctx
=
MdaEnv
.
getContext
();
*/
ctx
.
setErrorCode
(
NO_ERROR
);
public
static
Date
formatDateTime
(
Date
d
,
String
pattern
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
if
(
d
==
null
)
{
d
=
MdaUtils
.
today
();
}
if
(
MdaUtils
.
isEmpty
(
pattern
)
||
"0"
.
equals
(
pattern
))
{
pattern
=
"000000"
;
}
String
time
=
MdaUtils
.
format
(
d
,
"yyyyMMddHHmmss"
);
time
=
time
.
substring
(
0
,
8
);
time
=
time
+
pattern
;
return
MdaUtils
.
parseDate
(
time
,
"yyyyMMddHHmmss"
);
}
/**
* source:sysmod.@0074.script
*/
public
static
boolean
isXmlmapTransaction
(
String
transNam
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 用于判断来报通知是否从xmlmap中映射模块,以便于区分原来的bimenu
*/
log
.
debug
(
"{}"
,
" in isXmlmapTransaction "
+
transNam
);
boolean
ret
=
false
;
if
(!
MdaUtils
.
isEmpty
(
transNam
)
&&
(
"rptshw"
.
equals
(
transNam
)
||
"ersshw"
.
equals
(
transNam
)))
{
ret
=
true
;
}
log
.
debug
(
"{}"
,
" out isXmlmapTransaction = "
+
ret
);
return
ret
;
}
/**
* source:sysmod.@0079.script
*/
public
static
boolean
isNoError
(
Map
msg
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 判断是否没有错误,方便回滚或提交事务
*/
log
.
debug
(
"{}"
,
"in static sysmod.isNoError ... "
);
boolean
ret
=
true
;
if
(!
MdaUtils
.
isEmpty
(
msg
))
{
String
errcod
=
(
String
)
msg
.
get
(
"ERRORCODE"
);
log
.
debug
(
"{}"
,
"msgErrcod = "
+
errcod
+
"."
);
if
(!
MdaUtils
.
isEmpty
(
errcod
)
&&
!
"00000"
.
equals
(
errcod
))
{
ret
=
false
;
}
}
return
ret
;
}
/**
* source:sysmod.@0080.script
*/
public
static
void
setErrorInfo
(
Map
<
String
,
Object
>
msgMap
,
String
errcod
,
String
errMsg
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
debug
(
"{}"
,
"in static sysmod setErrorInfo ... "
);
msgMap
.
put
(
"ERRORMSG"
,
errMsg
);
msgMap
.
put
(
"ERRORCODE"
,
errcod
);
log
.
error
(
"{}"
,
"错误码:"
+
errcod
+
", 错误描述"
+
errMsg
);
}
/**
* source:sysmod.@0103.script
*/
public
static
String
headBchcod
()
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
return
"08350000"
;
}
/**
* source:sysmod.@0162.script
*/
public
static
Map
execLocalScriptwithLog
(
String
command
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
/*
#! 执行command命令,返回执行是否成功标志flg和执行结果result组合成的map
#! 执行command命令,返回执行是否成功标志flg和执行结果result组合成的map
#!========================================
#!========================================
...
@@ -485,422 +429,378 @@ public class Platform
...
@@ -485,422 +429,378 @@ 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
();
java
.
io
.
InputStreamReader
isr1
=
new
java
.
io
.
InputStreamReader
(
is1
);
java
.
io
.
InputStreamReader
isr1
=
new
java
.
io
.
InputStreamReader
(
is1
);
java
.
io
.
BufferedReader
br1
=
new
java
.
io
.
BufferedReader
(
isr1
);
java
.
io
.
BufferedReader
br1
=
new
java
.
io
.
BufferedReader
(
isr1
);
java
.
io
.
InputStream
is2
=
process
.
getErrorStream
();
java
.
io
.
InputStream
is2
=
process
.
getErrorStream
();
java
.
io
.
InputStreamReader
isr2
=
new
java
.
io
.
InputStreamReader
(
is2
);
java
.
io
.
InputStreamReader
isr2
=
new
java
.
io
.
InputStreamReader
(
is2
);
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
();
}
isr1
.
close
();
is1
.
close
();
br1
.
close
();
isr1
.
close
();
br1
.
close
();
String
line2
=
null
;
while
((
line2
=
br2
.
readLine
())
!=
null
)
{
String
line2
=
null
;
err
.
add
(
line2
);
while
((
line2
=
br2
.
readLine
())
!=
null
)
}
{
is2
.
close
();
err
.
add
(
line2
);
isr2
.
close
();
}
br2
.
close
();
is2
.
close
();
}
catch
(
Exception
e
)
{
isr2
.
close
();
e
.
printStackTrace
();
br2
.
close
();
flg
=
false
;
}
}
finally
{
catch
(
Exception
e
)
if
(
process
!=
null
)
{
process
.
destroy
();
e
.
printStackTrace
();
}
flg
=
false
;
map
.
put
(
"flg"
,
flg
);
}
map
.
put
(
"result"
,
result
);
finally
map
.
put
(
"error"
,
err
);
{
return
map
;
if
(
process
!=
null
)
}
process
.
destroy
();
}
/**
map
.
put
(
"flg"
,
flg
);
* source:sysmod.@0106.script
map
.
put
(
"result"
,
result
);
*/
map
.
put
(
"error"
,
err
);
public
static
Object
[]
getValueSMS
(
IModule
mctx
,
String
transName
,
String
name
)
{
return
map
;
//取得上下文
}
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/**
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
* source:sysmod.@0106.script
*/
IModule
context
=
null
;
public
static
Object
[]
getValueSMS
(
IModule
mctx
,
String
transName
,
String
name
)
if
(!
Platform
.
isXmlmapTransaction
(
transName
))
{
{
log
.
debug
(
"{}"
,
"in bimenu "
);
//取得上下文
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
IContext
ctx
=
MdaEnv
.
getContext
();
}
else
{
ctx
.
setErrorCode
(
NO_ERROR
);
log
.
debug
(
"{}"
,
"in xmlmap "
);
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
}
IModule
context
=
null
;
if
(
context
==
null
)
if
(!
Platform
.
isXmlmapTransaction
(
transName
))
context
=
mctx
;
{
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
log
.
debug
(
"{}"
,
"in bimenu "
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
if
(
MdaUtils
.
isEmpty
(
keys
))
}
return
new
Object
[]{};
else
List
<
Object
>
values
=
new
ArrayList
<
Object
>();
{
for
(
String
key
:
keys
.
split
(
","
))
{
log
.
debug
(
"{}"
,
"in xmlmap "
);
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
if
(!
MdaUtils
.
isEmpty
(
path
))
}
values
.
add
(
Platform
.
getDatafieldValue
(
context
,
path
));
if
(
context
==
null
)
}
context
=
mctx
;
return
values
.
toArray
();
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
}
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
if
(
MdaUtils
.
isEmpty
(
keys
))
/**
return
new
Object
[]{};
* source:sysmod.@0107.script
List
<
Object
>
values
=
new
ArrayList
<
Object
>();
*/
for
(
String
key:
keys
.
split
(
","
))
public
static
Object
[]
getValueSM
(
IModule
mctx
,
String
transName
,
String
name
)
{
{
//取得上下文
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
IContext
ctx
=
MdaEnv
.
getContext
();
if
(!
MdaUtils
.
isEmpty
(
path
))
ctx
.
setErrorCode
(
NO_ERROR
);
values
.
add
(
Platform
.
getDatafieldValue
(
context
,
path
));
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
}
return
values
.
toArray
();
IModule
context
=
null
;
}
if
(!
Platform
.
isXmlmapTransaction
(
transName
))
{
log
.
debug
(
"{}"
,
"in bimenu "
);
/**
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
* source:sysmod.@0107.script
}
else
{
*/
log
.
debug
(
"{}"
,
"in xmlmap "
);
public
static
Object
[]
getValueSM
(
IModule
mctx
,
String
transName
,
String
name
)
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
{
}
//取得上下文
if
(
context
==
null
)
IContext
ctx
=
MdaEnv
.
getContext
();
context
=
mctx
;
ctx
.
setErrorCode
(
NO_ERROR
);
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
log
.
info
(
"{}"
,
"Platform.getValueMap Invoked..."
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
IModule
context
=
null
;
String
files
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
"trdnam.properties"
);
if
(!
Platform
.
isXmlmapTransaction
(
transName
))
String
vals
=
MdaUtils
.
getPropertyValue
(
files
,
transName
);
{
if
(
MdaUtils
.
isEmpty
(
keys
)
||
MdaUtils
.
isEmpty
(
vals
))
log
.
debug
(
"{}"
,
"in bimenu "
);
return
new
Object
[]{};
context
=
MdaDriver
.
getModule
(
mctx
,
"\\bimenu"
);
List
<
Object
>
values
=
new
ArrayList
<
Object
>();
}
for
(
String
key
:
keys
.
split
(
","
))
{
else
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
{
if
(!
MdaUtils
.
isEmpty
(
path
))
{
log
.
debug
(
"{}"
,
"in xmlmap "
);
log
.
debug
(
"{}"
,
"Message="
+
Platform
.
getDatafieldValue
(
context
,
path
));
context
=
MdaDriver
.
getModule
(
mctx
,
"\\xmlmap"
);
values
.
add
(
Platform
.
getDatafieldValue
(
context
,
path
));
}
}
if
(
context
==
null
)
}
context
=
mctx
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
name
);
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
[]{};
List
<
Object
>
values
=
new
ArrayList
<
Object
>();
for
(
String
key:
keys
.
split
(
","
))
{
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
if
(!
MdaUtils
.
isEmpty
(
path
))
{
log
.
debug
(
"{}"
,
"Message="
+
Platform
.
getDatafieldValue
(
context
,
path
));
values
.
add
(
Platform
.
getDatafieldValue
(
context
,
path
));
}
}
for
(
String
val:
vals
.
split
(
","
))
{
String
conts
=
null
;
try
{
conts
=
new
String
(
val
.
getBytes
(
"ISO-8859-1"
),
"GBK"
);
log
.
debug
(
"{}"
,
"Message="
+
conts
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"{}"
,
"----------------------------Chage Encoding Error------------------------------------------"
);
e
.
printStackTrace
();
}
values
.
add
(
conts
);
}
//获取所属核心机构号idc
Object
vas
=
null
;
String
bchp
=
transName
.
substring
(
0
,
2
).
trim
();
String
bch
=
bchp
+
"dgrp\\rec\\bchcod"
;
vas
=(
MdaDriver
.
getDatafield
(
context
,
bch
)).
getValue
();
String
sql
=
"SELECT distinct idc FROM pty WHERE cid='"
+
vas
+
"'"
;
ctx
.
getDaoSession
().
dbExecuteSQL
(
sql
);
Argument
<
String
>
idc
=
new
Argument
<
String
>(
"idc"
);
ctx
.
getDaoSession
().
dbFetchFields
(
idc
);
ctx
.
getDaoSession
().
dbCloseCursor
();
values
.
add
(
idc
.
value
);
//if(!Platform.isEmpty(idc.value))
//value = nam.value;
log
.
debug
(
"{}"
,
"idc 值 :"
+
idc
.
value
);
return
values
.
toArray
();
}
/**
* source:sysmod.@0115.script
*/
public
static
boolean
errorDeal
(
boolean
tips
,
String
message
,
boolean
rollback
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/**
tips:true,需要调用Platform.message提示,内容为参数message;否则打印日志
rollback:true则回滚数据库事务,false只是返回
*/
int
errorno
=
ctx
.
getErrorCode
();
if
(
errorno
!=
NO_ERROR
)
{
if
(
tips
)
{
ctx
.
setMessage
(
MdaUtils
.
getI18NString
(
"sysmod"
,
"CT000363"
),
MdaUtils
.
getI18NString
(
"sysmod"
,
"CT000364"
));
}
else
{
log
.
error
(
"{}"
,
message
);
}
ctx
.
getDaoSession
().
dbRollback
();
return
false
;
}
return
true
;
}
/**
* source:sysmod.@0125.script
*/
public
static
boolean
isFromApp
()
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
String
terminalType
=
(
String
)
Platform
.
getLoginData
(
"__terminalType"
);
log
.
info
(
"{}"
,
"terminalType:"
+
terminalType
);
if
(
MdaUtils
.
isEmpty
(
terminalType
))
return
false
;
if
(
"APP"
.
equals
(
terminalType
))
return
true
;
return
false
;
}
/**
* source:sysmod.@0126.script
*/
public
static
boolean
indexGt
(
IDatafield
fld
,
String
str
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
boolean
bool
=
false
;
if
(
MdaUtils
.
isEmpty
(
fld
))
return
false
;
if
(
str
.
indexOf
((
String
)
fld
.
getValue
())>
0
)
bool
=
true
;
return
bool
;
}
/**
* source:sysmod.@0127.script
*/
public
static
boolean
containsValue
(
IDatafield
fld
,
String
splstr
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
boolean
bool
=
false
;
if
(
MdaUtils
.
isEmpty
(
fld
))
return
false
;
String
[]
s
=
splstr
.
split
(
"-"
);
int
len
=
s
.
length
;
for
(
int
i
=
1
;
i
<
len
;
i
++)
{
bool
=
((
String
)
fld
.
getValue
()).
contains
(
s
[
i
]);
if
(
bool
)
break
;
}
return
bool
;
}
/**
* source:sysmod.@0128.script
*/
public
static
boolean
isALLChinese
(
String
content
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
if
(
MdaUtils
.
isEmpty
(
content
))
{
return
false
;
}
///判断字符串中是否全为中文字符
char
[]
charArr
=
content
.
toCharArray
();
Boolean
flag
=
true
;
for
(
int
i
=
0
;
i
<
charArr
.
length
;
i
++)
{
//if(charArr[i] >= 0x4E00 && charArr[i] <= 0x9FA5)
if
(!(
charArr
[
i
]
>=
19968
&&
charArr
[
i
]
<=
40869
))
{
return
false
;
}
}
return
flag
;
}
/**
* source:wfmmod.@0002.script
*/
public
static
boolean
errorHandle
(
IModule
wfe
,
String
reason
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 功能:代替原来在mgrtsk交易下定义的函数 errorHandle.
*/
log
.
error
(
"{}"
,
reason
);
IDatafield
<
String
>
sta
=(
IDatafield
)
wfe
.
get
(
"sta"
);
IDatafield
<
String
>
rtycnt
=(
IDatafield
)
wfe
.
get
(
"rtycnt"
);
if
(
MdaUtils
.
isEmpty
(
rtycnt
))
{
sta
.
setValue
(
"R"
);
rtycnt
.
setValue
(
"1"
);
}
else
{
int
count
=
Integer
.
valueOf
(
rtycnt
.
getValue
());
if
(
count
>=
2
)
sta
.
setValue
(
"E"
);
rtycnt
.
setValue
(
String
.
valueOf
(
count
+
1
));
}
ctx
.
getDaoSession
().
dbBegin
();
ctx
.
getDaoSession
().
dbUpdate
(
wfe
);
ctx
.
getDaoSession
().
dbCommit
();
return
false
;
}
/**
* source:apldoc.@0011.script
*/
public
static
void
setContractFlg
()
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 设置为申请PDF信息
*/
}
/**
for
(
String
val
:
vals
.
split
(
","
))
{
* source:trnmod.@0025.script
String
conts
=
null
;
*/
try
{
public
static
String
sdbCounter
(
IModule
rec
)
conts
=
new
String
(
val
.
getBytes
(
"ISO-8859-1"
),
"GBK"
);
{
log
.
debug
(
"{}"
,
"Message="
+
conts
);
//取得上下文
}
catch
(
Exception
e
)
{
IContext
ctx
=
MdaEnv
.
getContext
();
log
.
debug
(
"{}"
,
"----------------------------Chage Encoding Error------------------------------------------"
);
ctx
.
setErrorCode
(
NO_ERROR
);
e
.
printStackTrace
();
IDatafield
<
String
>
inr
=(
IDatafield
)
MdaDriver
.
getBaseObject
(
rec
,
"inr"
);
}
inr
.
setValue
(
Platform
.
sdbCounter
(
rec
.
getName
()));
values
.
add
(
conts
);
return
inr
.
getValue
();
}
}
//获取所属核心机构号idc
Object
vas
=
null
;
String
bchp
=
transName
.
substring
(
0
,
2
).
trim
();
String
bch
=
bchp
+
"dgrp\\rec\\bchcod"
;
vas
=
(
MdaDriver
.
getDatafield
(
context
,
bch
)).
getValue
();
String
sql
=
"SELECT distinct idc FROM pty WHERE cid='"
+
vas
+
"'"
;
ctx
.
getDaoSession
().
dbExecuteSQL
(
sql
);
Argument
<
String
>
idc
=
new
Argument
<
String
>(
"idc"
);
ctx
.
getDaoSession
().
dbFetchFields
(
idc
);
ctx
.
getDaoSession
().
dbCloseCursor
();
values
.
add
(
idc
.
value
);
//if(!Platform.isEmpty(idc.value))
//value = nam.value;
log
.
debug
(
"{}"
,
"idc 值 :"
+
idc
.
value
);
return
values
.
toArray
();
}
/**
* source:sysmod.@0115.script
*/
public
static
boolean
errorDeal
(
boolean
tips
,
String
message
,
boolean
rollback
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/**
/**
* source:bimenu.@0040.script
tips:true,需要调用Platform.message提示,内容为参数message;否则打印日志
*/
rollback:true则回滚数据库事务,false只是返回
public
static
boolean
closeCursor
(
boolean
flag
)
*/
{
int
errorno
=
ctx
.
getErrorCode
();
//取得上下文
if
(
errorno
!=
NO_ERROR
)
{
IContext
ctx
=
MdaEnv
.
getContext
();
if
(
tips
)
{
ctx
.
setErrorCode
(
NO_ERROR
);
ctx
.
setMessage
(
MdaUtils
.
getI18NString
(
"sysmod"
,
"CT000363"
),
MdaUtils
.
getI18NString
(
"sysmod"
,
"CT000364"
));
ctx
.
getDaoSession
().
dbCloseCursor
();
}
else
{
return
flag
;
log
.
error
(
"{}"
,
message
);
}
}
ctx
.
getDaoSession
().
dbRollback
();
return
false
;
}
return
true
;
}
/**
* source:sysmod.@0125.script
*/
public
static
boolean
isFromApp
()
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
String
terminalType
=
(
String
)
Platform
.
getLoginData
(
"__terminalType"
);
log
.
info
(
"{}"
,
"terminalType:"
+
terminalType
);
if
(
MdaUtils
.
isEmpty
(
terminalType
))
return
false
;
if
(
"APP"
.
equals
(
terminalType
))
return
true
;
return
false
;
}
/**
* source:sysmod.@0126.script
*/
public
static
boolean
indexGt
(
IDatafield
fld
,
String
str
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
boolean
bool
=
false
;
if
(
MdaUtils
.
isEmpty
(
fld
))
return
false
;
if
(
str
.
indexOf
((
String
)
fld
.
getValue
())
>
0
)
bool
=
true
;
return
bool
;
}
/**
* source:sysmod.@0127.script
*/
public
static
boolean
containsValue
(
IDatafield
fld
,
String
splstr
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
boolean
bool
=
false
;
if
(
MdaUtils
.
isEmpty
(
fld
))
return
false
;
String
[]
s
=
splstr
.
split
(
"-"
);
int
len
=
s
.
length
;
for
(
int
i
=
1
;
i
<
len
;
i
++)
{
bool
=
((
String
)
fld
.
getValue
()).
contains
(
s
[
i
]);
if
(
bool
)
break
;
}
return
bool
;
}
/**
* source:sysmod.@0128.script
*/
public
static
boolean
isALLChinese
(
String
content
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
if
(
MdaUtils
.
isEmpty
(
content
))
{
return
false
;
}
///判断字符串中是否全为中文字符
char
[]
charArr
=
content
.
toCharArray
();
Boolean
flag
=
true
;
for
(
int
i
=
0
;
i
<
charArr
.
length
;
i
++)
{
//if(charArr[i] >= 0x4E00 && charArr[i] <= 0x9FA5)
if
(!(
charArr
[
i
]
>=
19968
&&
charArr
[
i
]
<=
40869
))
{
return
false
;
}
}
return
flag
;
}
/**
* source:wfmmod.@0002.script
*/
public
static
boolean
errorHandle
(
IModule
wfe
,
String
reason
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 功能:代替原来在mgrtsk交易下定义的函数 errorHandle.
*/
log
.
error
(
"{}"
,
reason
);
IDatafield
<
String
>
sta
=
(
IDatafield
)
wfe
.
get
(
"sta"
);
IDatafield
<
String
>
rtycnt
=
(
IDatafield
)
wfe
.
get
(
"rtycnt"
);
if
(
MdaUtils
.
isEmpty
(
rtycnt
))
{
sta
.
setValue
(
"R"
);
rtycnt
.
setValue
(
"1"
);
}
else
{
int
count
=
Integer
.
valueOf
(
rtycnt
.
getValue
());
if
(
count
>=
2
)
sta
.
setValue
(
"E"
);
rtycnt
.
setValue
(
String
.
valueOf
(
count
+
1
));
}
ctx
.
getDaoSession
().
dbBegin
();
ctx
.
getDaoSession
().
dbUpdate
(
wfe
);
ctx
.
getDaoSession
().
dbCommit
();
return
false
;
}
/**
* source:apldoc.@0011.script
*/
public
static
void
setContractFlg
()
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 设置为申请PDF信息
*/
}
/**
* source:trnmod.@0025.script
*/
public
static
String
sdbCounter
(
IModule
rec
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
IDatafield
<
String
>
inr
=
(
IDatafield
)
MdaDriver
.
getBaseObject
(
rec
,
"inr"
);
inr
.
setValue
(
Platform
.
sdbCounter
(
rec
.
getName
()));
return
inr
.
getValue
();
}
/**
* source:bimenu.@0040.script
*/
public
static
boolean
closeCursor
(
boolean
flag
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
ctx
.
getDaoSession
().
dbCloseCursor
();
return
flag
;
}
/**
* source:xmlbod.@0004.script
*/
public
static
Map
<
String
,
String
>
loadPropertyPart
(
String
transName
,
String
keyType
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/*
* 功能:将配置文件中的映射关系初始化为map
*/
log
.
debug
(
"{}"
,
" in static xmlbod.getDatafieldMapping ... "
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
log
.
debug
(
"{}"
,
"fileName:"
+
fileName
);
if
(
MdaUtils
.
fileExists
(
fileName
))
{
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
keyType
);
if
(
MdaUtils
.
isEmpty
(
keys
))
{
log
.
error
(
"{}"
,
"未配置 "
+
transName
+
".properties 中的 "
+
keyType
+
" 数据项 "
);
return
map
;
}
for
(
String
key
:
keys
.
split
(
","
))
{
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
if
(!
MdaUtils
.
isEmpty
(
path
))
map
.
put
(
key
,
path
);
}
}
log
.
debug
(
"{}"
,
" out static xmlbod.getDatafieldMapping ... "
);
return
map
;
}
/**
* source:xmlbod.@0005.script
*/
public
static
String
getRef
(
String
prefix
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/**
/**
* source:xmlbod.@0004.script
* 返回业务参考号,如LC-090817-0001)。
*/
*/
public
static
Map
<
String
,
String
>
loadPropertyPart
(
String
transName
,
String
keyType
)
String
ownref
=
""
;
{
if
(!
MdaUtils
.
isEmpty
(
prefix
))
{
//取得上下文
String
seq
=
prefix
+
MdaUtils
.
format
(
MdaUtils
.
today
(),
"yyMMdd"
);
IContext
ctx
=
MdaEnv
.
getContext
();
ownref
=
seq
+
MdaUtils
.
format
(
ctx
.
getDaoSession
().
dbCounter
(
prefix
+
MdaUtils
.
format
(
MdaUtils
.
today
(),
"yy"
)),
"0000"
);
ctx
.
setErrorCode
(
NO_ERROR
);
}
/*
return
ownref
;
* 功能:将配置文件中的映射关系初始化为map
}
*/
log
.
debug
(
"{}"
,
" in static xmlbod.getDatafieldMapping ... "
)
;
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>()
;
String
fileName
=
MdaUtils
.
catPath
(
ctx
.
getEnvConfig
().
getRootPath
(),
"/cfg/"
+
transName
+
".properties"
);
log
.
debug
(
"{}"
,
"fileName:"
+
fileName
);
if
(
MdaUtils
.
fileExists
(
fileName
))
{
String
keys
=
MdaUtils
.
getPropertyValue
(
fileName
,
keyType
);
if
(
MdaUtils
.
isEmpty
(
keys
))
{
log
.
error
(
"{}"
,
"未配置 "
+
transName
+
".properties 中的 "
+
keyType
+
" 数据项 "
)
;
return
map
;
}
for
(
String
key:
keys
.
split
(
","
))
{
String
path
=
MdaUtils
.
getPropertyValue
(
fileName
,
key
);
if
(!
MdaUtils
.
isEmpty
(
path
))
map
.
put
(
key
,
path
);
}
}
log
.
debug
(
"{}"
,
" out static xmlbod.getDatafieldMapping ... "
)
;
return
map
;
}
/**
* source:xmlbod.@0005.script
*/
public
static
String
getRef
(
String
prefix
)
{
//取得上下文
IContext
ctx
=
MdaEnv
.
getContext
();
ctx
.
setErrorCode
(
NO_ERROR
);
/**
* 返回业务参考号,如LC-090817-0001)。
*/
String
ownref
=
""
;
if
(!
MdaUtils
.
isEmpty
(
prefix
))
{
String
seq
=
prefix
+
MdaUtils
.
format
(
MdaUtils
.
today
(),
"yyMMdd"
);
ownref
=
seq
+
MdaUtils
.
format
(
ctx
.
getDaoSession
().
dbCounter
(
prefix
+
MdaUtils
.
format
(
MdaUtils
.
today
(),
"yy"
)),
"0000"
);
}
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
)
{
return
null
;
if
(
"usrinr"
.
equals
(
param
))
{
return
"00000970"
;
}
}
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
)
{
}
}
}
}
\ No newline at end of file
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/manager/Acdopn.java
View file @
cc45a34b
...
@@ -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.*
;
...
@@ -101,7 +103,7 @@ public class Acdopn extends AbstractTransaction{
...
@@ -101,7 +103,7 @@ public class Acdopn extends AbstractTransaction{
if
(!
MdaUtils
.
isEmpty
(
this
.
getAcdgrp
().
getRec
().
getReason
()))
if
(!
MdaUtils
.
isEmpty
(
this
.
getAcdgrp
().
getRec
().
getReason
()))
{
{
this
.
getAcdgrp
().
getRec
().
setReason
(
NULLSTR
);
this
.
getAcdgrp
().
getRec
().
setReason
(
NULLSTR
);
}
}
String
cifno
=
this
.
getAcdgrp
().
getRec
().
getSocialcrdtcd
();
String
cifno
=
this
.
getAcdgrp
().
getRec
().
getSocialcrdtcd
();
if
(!
ctx
.
absGet
(
Sysmod
.
class
).
judgeSWFunctions
(
"open_account"
,
cifno
,
""
))
if
(!
ctx
.
absGet
(
Sysmod
.
class
).
judgeSWFunctions
(
"open_account"
,
cifno
,
""
))
...
@@ -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
));
}
}
}
\ No newline at end of file
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/util/MdaUtils.java
View file @
cc45a34b
...
@@ -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
tru
e
;
return
fals
e
;
}
}
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
();
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment