Commit 7254572e by hulei

账户检查切分至客户化代码

parent e2fa5b9a
...@@ -39,6 +39,11 @@ ...@@ -39,6 +39,11 @@
<groupId>com.github.pagehelper</groupId> <groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId> <artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.brilliance.isc</groupId>
<artifactId>isc-customized</artifactId>
<version>3.1.0</version>
</dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.apache.camel.springboot</groupId>--> <!-- <groupId>org.apache.camel.springboot</groupId>-->
<!-- <artifactId>camel-spring-boot-starter</artifactId>--> <!-- <artifactId>camel-spring-boot-starter</artifactId>-->
......
...@@ -5,6 +5,8 @@ import com.brilliance.isc.bo.Trm; ...@@ -5,6 +5,8 @@ import com.brilliance.isc.bo.Trm;
import com.brilliance.isc.common.api.bch.service.BchService; import com.brilliance.isc.common.api.bch.service.BchService;
import com.brilliance.isc.common.codetable.service.CodetableService; import com.brilliance.isc.common.codetable.service.CodetableService;
import com.brilliance.isc.common.context.SettleContext; 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.isc.mda.dao.TrmMapper;
import com.brilliance.mda.runtime.mda.impl.Argument; import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.util.MdaUtils; import com.brilliance.mda.runtime.mda.util.MdaUtils;
...@@ -62,8 +64,12 @@ public class ActmodComponent { ...@@ -62,8 +64,12 @@ public class ActmodComponent {
if (length == 20 && MdaUtils.compareTo(Strings.mid(account, 1, 3), "NRA") == 0) { 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); return checkAccount(Strings.mid(account, 4, 17), term_id, branch, cur, manFLG, err);
} else { } else {
if (length != 17 && length != 21) { // if (length != 17 && length != 21) {
err.value = "账号位数错误"; // err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi api = SpringEnvContext.getBean(AccountCustomizedApi.class);
if(!api.checkAccount(account,err)){
return false; return false;
} }
/** /**
...@@ -163,20 +169,20 @@ public class ActmodComponent { ...@@ -163,20 +169,20 @@ public class ActmodComponent {
} }
//label checkEnd //label checkEnd
//检查账号的币别位 //检查账号的币别位
if (!MdaUtils.isEmpty(cur)) { // if (!MdaUtils.isEmpty(cur)) {
if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) { // if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
err.value = "记账币种 " + cur + " 与账号币种不符"; // err.value = "记账币种 " + cur + " 与账号币种不符";
return false; // return false;
} // }
} // }
//检查客户帐的校验位 //检查客户帐的校验位
if (MdaUtils.compareTo(repflg, "C") == 0 && MdaUtils.compareTo(Strings.mid(term_id, 1, 2), "AS") != 0) { // if (MdaUtils.compareTo(repflg, "C") == 0 && MdaUtils.compareTo(Strings.mid(term_id, 1, 2), "AS") != 0) {
if (!chkActMac(account)) { // if (!chkActMac(account)) {
err.value = "客户帐号合法性校验错误"; // err.value = "客户帐号合法性校验错误";
// Err = "MAC[" + GetActMac( Account ) + "]," + Err // // Err = "MAC[" + GetActMac( Account ) + "]," + Err
return false; // return false;
} // }
} // }
return true; return true;
} }
} }
...@@ -199,8 +205,12 @@ public class ActmodComponent { ...@@ -199,8 +205,12 @@ public class ActmodComponent {
//--------------------------------------------- //---------------------------------------------
int length = Strings.len(account); int length = Strings.len(account);
//------ZMQZMQ--------------------------------------- //------ZMQZMQ---------------------------------------
if (length != 17 && length != 21) { // if (length != 17 && length != 21) {
err.value = "账号位数错误"; // err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi api = SpringEnvContext.getBean(AccountCustomizedApi.class);
if(!api.checkAccount(account,err)){
return false; return false;
} }
String vcur = Strings.mid(account, 5, 2); String vcur = Strings.mid(account, 5, 2);
...@@ -217,12 +227,15 @@ public class ActmodComponent { ...@@ -217,12 +227,15 @@ public class ActmodComponent {
endif endif
**/ **/
//检查账号的币别位 //检查账号的币别位
if (!MdaUtils.isEmpty(cur)) { // if (!MdaUtils.isEmpty(cur)) {
if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) { // if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
err.value = "记账币种 " + cur + " 与账号币种不符 "; // err.value = "记账币种 " + cur + " 与账号币种不符 ";
// return false;
// }
// }
if(!api.checkCur(cur,err)){
return false; return false;
} }
}
/*String vbranch = Strings.mid(account,1,4); /*String vbranch = Strings.mid(account,1,4);
Map<String, Object> dyncMap = new HashMap<>(); Map<String, Object> dyncMap = new HashMap<>();
String sql = "select count(*) from sysbch where YNGYJG='" + vbranch + "'"; String sql = "select count(*) from sysbch where YNGYJG='" + vbranch + "'";
......
...@@ -18,12 +18,15 @@ import com.brilliance.mda.runtime.mda.impl.Argument; ...@@ -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.Dates;
import com.brilliance.mda.runtime.mda.util.Decimals; import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.mda.runtime.mda.util.MdaUtils; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
@Service("fecmodService") @Service("fecmodService")
...@@ -71,6 +74,7 @@ public class FecmodServiceImpl implements FecmodService { ...@@ -71,6 +74,7 @@ public class FecmodServiceImpl implements FecmodService {
} }
Cty wrkCty = null; Cty wrkCty = null;
Reg wrkReg = null; Reg wrkReg = null;
Map<String,Object> params = Maps.newHashMap();
//根据wrkpty获取wrkcty wrkreg //根据wrkpty获取wrkcty wrkreg
if (wrkPty != null) { if (wrkPty != null) {
if (!StringUtils.isEmpty(wrkPty.getRskcty())) { if (!StringUtils.isEmpty(wrkPty.getRskcty())) {
...@@ -92,9 +96,11 @@ public class FecmodServiceImpl implements FecmodService { ...@@ -92,9 +96,11 @@ public class FecmodServiceImpl implements FecmodService {
fecsql += " AND LOWAMT <= " + argAmt.abs().toPlainString() + ""; fecsql += " AND LOWAMT <= " + argAmt.abs().toPlainString() + "";
fecsql += " AND HIGAMT > " + argAmt.abs().toPlainString() + ""; fecsql += " AND HIGAMT > " + argAmt.abs().toPlainString() + "";
Date fecDate = fecRefDat == null ? Dates.today() : fecRefDat; 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; fecsql += " AND " + rngSql;
String pfx = " AND ("; String pfx = " AND (";
if( MdaUtils.isEmpty(argFeePri) ) if( MdaUtils.isEmpty(argFeePri) )
{ {
...@@ -117,7 +123,9 @@ public class FecmodServiceImpl implements FecmodService { ...@@ -117,7 +123,9 @@ public class FecmodServiceImpl implements FecmodService {
} }
fecsql = Utils.sdbEtyGenSql("FEC", fecsql); fecsql = Utils.sdbEtyGenSql("FEC", fecsql);
String sql = fecsql + " ORDER BY FEEPRI DESC"; 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) { if (wrkfecList != null && wrkfecList.size() > 0) {
//获取到默认计费规则 //获取到默认计费规则
Fec defaultFec = null; Fec defaultFec = null;
......
...@@ -3,8 +3,10 @@ package com.brilliance.isc.common.transaction.check; ...@@ -3,8 +3,10 @@ package com.brilliance.isc.common.transaction.check;
import com.brilliance.isc.bo.Bch; import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.common.codetable.service.CodetableService; import com.brilliance.isc.common.codetable.service.CodetableService;
import com.brilliance.isc.common.context.SettleContext; 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.liaccv.vo.LiaccvVo;
import com.brilliance.isc.common.util.I18nUtil; import com.brilliance.isc.common.util.I18nUtil;
import com.brilliance.isc.customized.api.AccountCustomizedApi;
import com.brilliance.isc.mda.dao.PublicMapper; import com.brilliance.isc.mda.dao.PublicMapper;
import com.brilliance.mda.runtime.mda.impl.Argument; import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.util.*; import com.brilliance.mda.runtime.mda.util.*;
...@@ -420,8 +422,12 @@ public class LiaccvCheck implements ICheck<LiaccvVo> { ...@@ -420,8 +422,12 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
if (length == 20 && MdaUtils.compareTo(Strings.mid(account, 1, 3), "NRA") == 0) { 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); return checkAccount(Strings.mid(account, 4, 17), term_id, branch, cur, manFLG, err);
} else { } else {
if (length != 17 && length != 21) { // if (length != 17 && length != 21) {
err.value = "账号位数错误"; // err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi api = SpringEnvContext.getBean(AccountCustomizedApi.class);
if(!api.checkAccount(account,err)){
return false; return false;
} }
/* /*
...@@ -524,13 +530,16 @@ public class LiaccvCheck implements ICheck<LiaccvVo> { ...@@ -524,13 +530,16 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
} }
//label checkEnd //label checkEnd
//检查账号的币别位 //检查账号的币别位
if (!MdaUtils.isEmpty(cur)) { // if (!MdaUtils.isEmpty(cur)) {
if (MdaUtils.compareTo(vcur, // if (MdaUtils.compareTo(vcur,
Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) { // Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
err.value = "记账币种 " + cur + " 与账号币种不符 "; // err.value = "记账币种 " + cur + " 与账号币种不符 ";
// return false;
// }
// }
if(!api.checkCur(cur,err)){
return false; return false;
} }
}
//检查客户帐的校验位 //检查客户帐的校验位
if (MdaUtils.compareTo(repflg, "C") == 0 && MdaUtils.compareTo(Strings.mid(term_id, 1, 2), "AS") != 0) { if (MdaUtils.compareTo(repflg, "C") == 0 && MdaUtils.compareTo(Strings.mid(term_id, 1, 2), "AS") != 0) {
if (!chkActMac(account)) { if (!chkActMac(account)) {
...@@ -562,8 +571,12 @@ public class LiaccvCheck implements ICheck<LiaccvVo> { ...@@ -562,8 +571,12 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
//--------------------------------------------- //---------------------------------------------
int length = Strings.len(account); int length = Strings.len(account);
//------ZMQZMQ--------------------------------------- //------ZMQZMQ---------------------------------------
if (length != 17 && length != 21) { // if (length != 17 && length != 21 && length != 18 && length != 22) {
err.value = "账号位数错误"; // err.value = "账号位数错误";
// return false;
// }
AccountCustomizedApi api = SpringEnvContext.getBean(AccountCustomizedApi.class);
if(!api.checkAccount(account,err)){
return false; return false;
} }
String vcur = Strings.mid(account, 5, 2); String vcur = Strings.mid(account, 5, 2);
...@@ -580,12 +593,15 @@ public class LiaccvCheck implements ICheck<LiaccvVo> { ...@@ -580,12 +593,15 @@ public class LiaccvCheck implements ICheck<LiaccvVo> {
endif endif
*/ */
//检查账号的币别位 //检查账号的币别位
if (!MdaUtils.isEmpty(cur)) { // if (!MdaUtils.isEmpty(cur)) {
if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) { // if (MdaUtils.compareTo(vcur, Strings.mid(codetableService.getTblLabel(cur, "CURKEY"), 1, 2)) != 0) {
err.value = "记账币种 " + cur + " 与账号币种不符 "; // err.value = "记账币种 " + cur + " 与账号币种不符 ";
// return false;
// }
// }
if(!api.checkCur(cur,err)){
return false; return false;
} }
}
String vbranch = Strings.mid(account, 1, 4); String vbranch = Strings.mid(account, 1, 4);
Map<String, Object> sqlMap = new HashMap<>(); Map<String, Object> sqlMap = new HashMap<>();
sqlMap.put("sql", " select count(*) from sysbch where YNGYJG='" + vbranch + "'"); sqlMap.put("sql", " select count(*) from sysbch where YNGYJG='" + vbranch + "'");
......
<?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
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;
}
}
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);
}
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<module>isc-common-esb</module> <module>isc-common-esb</module>
<module>isc-common-counter</module> <module>isc-common-counter</module>
<module>isc-common-automatic</module> <module>isc-common-automatic</module>
<module>isc-customized</module>
</modules> </modules>
</project> </project>
\ No newline at end of file
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