Commit 7254572e by hulei

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

parent e2fa5b9a
......@@ -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>-->
......
......@@ -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,11 +227,14 @@ public class ActmodComponent {
endif
**/
//检查账号的币别位
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(!api.checkCur(cur,err)){
return false;
}
/*String vbranch = Strings.mid(account,1,4);
Map<String, Object> dyncMap = new HashMap<>();
......
......@@ -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;
......
......@@ -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,12 +530,15 @@ 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 + " 与账号币种不符 ";
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(!api.checkCur(cur,err)){
return false;
}
//检查客户帐的校验位
if (MdaUtils.compareTo(repflg, "C") == 0 && MdaUtils.compareTo(Strings.mid(term_id, 1, 2), "AS") != 0) {
......@@ -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,11 +593,14 @@ 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 + " 与账号币种不符 ";
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(!api.checkCur(cur,err)){
return false;
}
String vbranch = Strings.mid(account, 1, 4);
Map<String, Object> sqlMap = new HashMap<>();
......
<?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 @@
<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
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