Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
isc-core
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
isc-v3.1-tmp
isc-core
Commits
7254572e
Commit
7254572e
authored
Nov 02, 2024
by
hulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账户检查切分至客户化代码
parent
e2fa5b9a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
164 additions
and
37 deletions
+164
-37
pom.xml
isc-common-service/pom.xml
+5
-0
ActmodComponent.java
.../com/brilliance/isc/common/component/ActmodComponent.java
+34
-21
FecmodServiceImpl.java
...nce/isc/common/fecmod/service/impl/FecmodServiceImpl.java
+11
-3
LiaccvCheck.java
.../brilliance/isc/common/transaction/check/LiaccvCheck.java
+29
-13
pom.xml
isc-customized/pom.xml
+27
-0
AccountCustomizedService.java
...iance/isc/customized/acount/AccountCustomizedService.java
+42
-0
AccountCustomizedApi.java
...m/brilliance/isc/customized/api/AccountCustomizedApi.java
+14
-0
pom.xml
pom.xml
+2
-0
No files found.
isc-common-service/pom.xml
View file @
7254572e
...
...
@@ -39,6 +39,11 @@
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.brilliance.isc
</groupId>
<artifactId>
isc-customized
</artifactId>
<version>
3.1.0
</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.camel.springboot</groupId>-->
<!-- <artifactId>camel-spring-boot-starter</artifactId>-->
...
...
isc-common-service/src/main/java/com/brilliance/isc/common/component/ActmodComponent.java
View file @
7254572e
...
...
@@ -5,6 +5,8 @@ import com.brilliance.isc.bo.Trm;
import
com.brilliance.isc.common.api.bch.service.BchService
;
import
com.brilliance.isc.common.codetable.service.CodetableService
;
import
com.brilliance.isc.common.context.SettleContext
;
import
com.brilliance.isc.common.context.SpringEnvContext
;
import
com.brilliance.isc.customized.api.AccountCustomizedApi
;
import
com.brilliance.isc.mda.dao.TrmMapper
;
import
com.brilliance.mda.runtime.mda.impl.Argument
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
...
...
@@ -62,8 +64,12 @@ public class ActmodComponent {
if
(
length
==
20
&&
MdaUtils
.
compareTo
(
Strings
.
mid
(
account
,
1
,
3
),
"NRA"
)
==
0
)
{
return
checkAccount
(
Strings
.
mid
(
account
,
4
,
17
),
term_id
,
branch
,
cur
,
manFLG
,
err
);
}
else
{
if
(
length
!=
17
&&
length
!=
21
)
{
err
.
value
=
"账号位数错误"
;
// if (length != 17 && length != 21) {
// err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi
api
=
SpringEnvContext
.
getBean
(
AccountCustomizedApi
.
class
);
if
(!
api
.
checkAccount
(
account
,
err
)){
return
false
;
}
/**
...
...
@@ -163,20 +169,20 @@ public class ActmodComponent {
}
//label checkEnd
//检查账号的币别位
if
(!
MdaUtils
.
isEmpty
(
cur
))
{
if
(
MdaUtils
.
compareTo
(
vcur
,
Strings
.
mid
(
codetableService
.
getTblLabel
(
cur
,
"CURKEY"
),
1
,
2
))
!=
0
)
{
err
.
value
=
"记账币种 "
+
cur
+
" 与账号币种不符"
;
return
false
;
}
}
//
if (!MdaUtils.isEmpty(cur)) {
//
if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
//
err.value = "记账币种 " + cur + " 与账号币种不符";
//
return false;
//
}
//
}
//检查客户帐的校验位
if
(
MdaUtils
.
compareTo
(
repflg
,
"C"
)
==
0
&&
MdaUtils
.
compareTo
(
Strings
.
mid
(
term_id
,
1
,
2
),
"AS"
)
!=
0
)
{
if
(!
chkActMac
(
account
))
{
err
.
value
=
"客户帐号合法性校验错误"
;
// Err = "MAC[" + GetActMac( Account ) + "]," + Err
return
false
;
}
}
//
if (MdaUtils.compareTo(repflg, "C") == 0 && MdaUtils.compareTo(Strings.mid(term_id, 1, 2), "AS") != 0) {
//
if (!chkActMac(account)) {
//
err.value = "客户帐号合法性校验错误";
//
// Err = "MAC[" + GetActMac( Account ) + "]," + Err
//
return false;
//
}
//
}
return
true
;
}
}
...
...
@@ -199,8 +205,12 @@ public class ActmodComponent {
//---------------------------------------------
int
length
=
Strings
.
len
(
account
);
//------ZMQZMQ---------------------------------------
if
(
length
!=
17
&&
length
!=
21
)
{
err
.
value
=
"账号位数错误"
;
// if (length != 17 && length != 21) {
// err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi
api
=
SpringEnvContext
.
getBean
(
AccountCustomizedApi
.
class
);
if
(!
api
.
checkAccount
(
account
,
err
)){
return
false
;
}
String
vcur
=
Strings
.
mid
(
account
,
5
,
2
);
...
...
@@ -217,12 +227,15 @@ public class ActmodComponent {
endif
**/
//检查账号的币别位
if
(!
MdaUtils
.
isEmpty
(
cur
))
{
if
(
MdaUtils
.
compareTo
(
vcur
,
Strings
.
mid
(
codetableService
.
getTblLabel
(
cur
,
"CURKEY"
),
1
,
2
))
!=
0
)
{
err
.
value
=
"记账币种 "
+
cur
+
" 与账号币种不符 "
;
// if (!MdaUtils.isEmpty(cur)) {
// if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
// err.value = "记账币种 " + cur + " 与账号币种不符 ";
// return false;
// }
// }
if
(!
api
.
checkCur
(
cur
,
err
)){
return
false
;
}
}
/*String vbranch = Strings.mid(account,1,4);
Map<String, Object> dyncMap = new HashMap<>();
String sql = "select count(*) from sysbch where YNGYJG='" + vbranch + "'";
...
...
isc-common-service/src/main/java/com/brilliance/isc/common/fecmod/service/impl/FecmodServiceImpl.java
View file @
7254572e
...
...
@@ -18,12 +18,15 @@ import com.brilliance.mda.runtime.mda.impl.Argument;
import
com.brilliance.mda.runtime.mda.util.Dates
;
import
com.brilliance.mda.runtime.mda.util.Decimals
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.Maps
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
(
"fecmodService"
)
...
...
@@ -71,6 +74,7 @@ public class FecmodServiceImpl implements FecmodService {
}
Cty
wrkCty
=
null
;
Reg
wrkReg
=
null
;
Map
<
String
,
Object
>
params
=
Maps
.
newHashMap
();
//根据wrkpty获取wrkcty wrkreg
if
(
wrkPty
!=
null
)
{
if
(!
StringUtils
.
isEmpty
(
wrkPty
.
getRskcty
()))
{
...
...
@@ -92,9 +96,11 @@ public class FecmodServiceImpl implements FecmodService {
fecsql
+=
" AND LOWAMT <= "
+
argAmt
.
abs
().
toPlainString
()
+
""
;
fecsql
+=
" AND HIGAMT > "
+
argAmt
.
abs
().
toPlainString
()
+
""
;
Date
fecDate
=
fecRefDat
==
null
?
Dates
.
today
()
:
fecRefDat
;
String
rngSql
=
"( BEGDAT <= "
+
Utils
.
dbSqlDate
(
fecDate
)
+
" AND ENDDAT > "
+
Utils
.
dbSqlDate
(
fecDate
)
+
" )"
;
// String rngSql = "( BEGDAT <= " + Utils.dbSqlDate(fecDate) + " AND ENDDAT > " + Utils.dbSqlDate(fecDate) + " )";
String
rngSql
=
"( BEGDAT <= #{begdat} AND ENDDAT > #{enddat} )"
;
params
.
put
(
"begdat"
,
fecDate
);
params
.
put
(
"enddat"
,
fecDate
);
fecsql
+=
" AND "
+
rngSql
;
String
pfx
=
" AND ("
;
if
(
MdaUtils
.
isEmpty
(
argFeePri
)
)
{
...
...
@@ -117,7 +123,9 @@ public class FecmodServiceImpl implements FecmodService {
}
fecsql
=
Utils
.
sdbEtyGenSql
(
"FEC"
,
fecsql
);
String
sql
=
fecsql
+
" ORDER BY FEEPRI DESC"
;
List
<
Fec
>
wrkfecList
=
fecMapper
.
selectFecByConditionSql
(
sql
);
// List<Fec> wrkfecList = fecMapper.selectFecByConditionSql(sql);
params
.
put
(
"conditionSql"
,
sql
);
List
<
Fec
>
wrkfecList
=
fecMapper
.
selectFecByConditionSqlAndParams
(
params
);
if
(
wrkfecList
!=
null
&&
wrkfecList
.
size
()
>
0
)
{
//获取到默认计费规则
Fec
defaultFec
=
null
;
...
...
isc-common-service/src/main/java/com/brilliance/isc/common/transaction/check/LiaccvCheck.java
View file @
7254572e
...
...
@@ -3,8 +3,10 @@ package com.brilliance.isc.common.transaction.check;
import
com.brilliance.isc.bo.Bch
;
import
com.brilliance.isc.common.codetable.service.CodetableService
;
import
com.brilliance.isc.common.context.SettleContext
;
import
com.brilliance.isc.common.context.SpringEnvContext
;
import
com.brilliance.isc.common.liaccv.vo.LiaccvVo
;
import
com.brilliance.isc.common.util.I18nUtil
;
import
com.brilliance.isc.customized.api.AccountCustomizedApi
;
import
com.brilliance.isc.mda.dao.PublicMapper
;
import
com.brilliance.mda.runtime.mda.impl.Argument
;
import
com.brilliance.mda.runtime.mda.util.*
;
...
...
@@ -420,8 +422,12 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
if
(
length
==
20
&&
MdaUtils
.
compareTo
(
Strings
.
mid
(
account
,
1
,
3
),
"NRA"
)
==
0
)
{
return
checkAccount
(
Strings
.
mid
(
account
,
4
,
17
),
term_id
,
branch
,
cur
,
manFLG
,
err
);
}
else
{
if
(
length
!=
17
&&
length
!=
21
)
{
err
.
value
=
"账号位数错误"
;
// if (length != 17 && length != 21) {
// err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi
api
=
SpringEnvContext
.
getBean
(
AccountCustomizedApi
.
class
);
if
(!
api
.
checkAccount
(
account
,
err
)){
return
false
;
}
/*
...
...
@@ -524,13 +530,16 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
}
//label checkEnd
//检查账号的币别位
if
(!
MdaUtils
.
isEmpty
(
cur
))
{
if
(
MdaUtils
.
compareTo
(
vcur
,
Strings
.
mid
(
codetableService
.
getTblLabel
(
cur
,
"CURKEY"
),
1
,
2
))
!=
0
)
{
err
.
value
=
"记账币种 "
+
cur
+
" 与账号币种不符 "
;
// if (!MdaUtils.isEmpty(cur)) {
// if (MdaUtils.compareTo(vcur,
// Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
// err.value = "记账币种 " + cur + " 与账号币种不符 ";
// return false;
// }
// }
if
(!
api
.
checkCur
(
cur
,
err
)){
return
false
;
}
}
//检查客户帐的校验位
if
(
MdaUtils
.
compareTo
(
repflg
,
"C"
)
==
0
&&
MdaUtils
.
compareTo
(
Strings
.
mid
(
term_id
,
1
,
2
),
"AS"
)
!=
0
)
{
if
(!
chkActMac
(
account
))
{
...
...
@@ -562,8 +571,12 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
//---------------------------------------------
int
length
=
Strings
.
len
(
account
);
//------ZMQZMQ---------------------------------------
if
(
length
!=
17
&&
length
!=
21
)
{
err
.
value
=
"账号位数错误"
;
// if (length != 17 && length != 21 && length != 18 && length != 22) {
// err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi
api
=
SpringEnvContext
.
getBean
(
AccountCustomizedApi
.
class
);
if
(!
api
.
checkAccount
(
account
,
err
)){
return
false
;
}
String
vcur
=
Strings
.
mid
(
account
,
5
,
2
);
...
...
@@ -580,12 +593,15 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
endif
*/
//检查账号的币别位
if
(!
MdaUtils
.
isEmpty
(
cur
))
{
if
(
MdaUtils
.
compareTo
(
vcur
,
Strings
.
mid
(
codetableService
.
getTblLabel
(
cur
,
"CURKEY"
),
1
,
2
))
!=
0
)
{
err
.
value
=
"记账币种 "
+
cur
+
" 与账号币种不符 "
;
// if (!MdaUtils.isEmpty(cur)) {
// if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
// err.value = "记账币种 " + cur + " 与账号币种不符 ";
// return false;
// }
// }
if
(!
api
.
checkCur
(
cur
,
err
)){
return
false
;
}
}
String
vbranch
=
Strings
.
mid
(
account
,
1
,
4
);
Map
<
String
,
Object
>
sqlMap
=
new
HashMap
<>();
sqlMap
.
put
(
"sql"
,
" select count(*) from sysbch where YNGYJG='"
+
vbranch
+
"'"
);
...
...
isc-customized/pom.xml
0 → 100644
View file @
7254572e
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
isc-core
</artifactId>
<groupId>
com.brilliance.isc
</groupId>
<version>
3.1.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
isc-customized
</artifactId>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
com.brilliance.isc
</groupId>
<artifactId>
isc-common-core
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
isc-customized/src/main/java/com/brilliance/isc/customized/acount/AccountCustomizedService.java
0 → 100644
View file @
7254572e
package
com
.
brilliance
.
isc
.
customized
.
acount
;
import
cn.hutool.core.util.StrUtil
;
import
com.brilliance.isc.customized.api.AccountCustomizedApi
;
import
com.brilliance.mda.runtime.mda.impl.Argument
;
import
org.springframework.stereotype.Service
;
@Service
public
class
AccountCustomizedService
implements
AccountCustomizedApi
{
@Override
public
boolean
checkAccount
(
String
account
,
Argument
<
String
>
errMsg
)
{
if
(!
StrUtil
.
isEmpty
(
account
)){
int
length
=
account
.
length
();
if
(
length
==
17
||
length
==
21
||
length
==
18
||
length
==
22
){
return
true
;
}
}
errMsg
.
value
=
"账户长度错误!"
;
return
false
;
}
@Override
public
boolean
checkCur
(
String
cur
,
Argument
<
String
>
errMsg
)
{
//TODO 依据实际逻辑校验币种 以下为原有校验逻辑
// if (!MdaUtils.isEmpty(cur)) {
// if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
// err.value = "记账币种 " + cur + " 与账号币种不符";
// return false;
// }
// }
if
(
true
){
return
true
;
}
errMsg
.
value
=
"账户长度错误!"
;
return
false
;
}
}
isc-customized/src/main/java/com/brilliance/isc/customized/api/AccountCustomizedApi.java
0 → 100644
View file @
7254572e
package
com
.
brilliance
.
isc
.
customized
.
api
;
import
com.brilliance.mda.runtime.mda.impl.Argument
;
public
interface
AccountCustomizedApi
{
/**
* 检验账号长度
* @param account
* @return
*/
boolean
checkAccount
(
String
account
,
Argument
<
String
>
errMsg
);
boolean
checkCur
(
String
cur
,
Argument
<
String
>
errMsg
);
}
pom.xml
View file @
7254572e
...
...
@@ -19,6 +19,7 @@
<module>
isc-common-esb
</module>
<module>
isc-common-counter
</module>
<module>
isc-common-automatic
</module>
<module>
isc-customized
</module>
</modules>
</project>
\ No newline at end of file
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