|
@@ -61,6 +61,9 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
@Resource
|
|
|
private BaseMapper baseMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private cmOfflineCollectionMapper collectionMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 只有当识别出来的收款类型是广发银行-5461 ,中信银行-0897,中信银行0897-财付通 和 中信银行0897-支付宝时,才会显示手续费,并且自动勾选上手续费,默认按收款金额的千分之一计算 (收款金额 - 手续费 = 短信中收到的金额)
|
|
|
*/
|
|
@@ -200,6 +203,11 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
// 短信已存在不需要识别
|
|
|
return ResponseJson.error("短信已存在不需要重复识别", null);
|
|
|
}
|
|
|
+ // 验证银行卡号是否已经被删除
|
|
|
+ String account = detectionAccount(smsContent);
|
|
|
+ if ("-1".equals(account)) {
|
|
|
+ return ResponseJson.error(-2,"该收款银行账号已被删除,请检查短信是否有误或联系管理员!", null);
|
|
|
+ }
|
|
|
try {
|
|
|
// 识别短信内容
|
|
|
ResponseJson<ReceiptVo> receipt = identifyMessage(smsContent);
|
|
@@ -210,6 +218,25 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
log.error("【线下收款】短信识别错误!", e);
|
|
|
}
|
|
|
return ResponseJson.error("短信识别错误!", null);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 验证银行卡号是否已经被删除
|
|
|
+ * @param message
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String detectionAccount(String message) {
|
|
|
+ if (message.length() > 10) {
|
|
|
+ int index = message.indexOf("尾号");
|
|
|
+ String account = message.substring(index + 2, index + 2 + 4);
|
|
|
+ cmOfflineCollectionPo collectionPo = collectionMapper.detectionAccount(account);
|
|
|
+ if (collectionPo.getIsDisable() == 0) {
|
|
|
+ return "-1";
|
|
|
+ }
|
|
|
+ return "0";
|
|
|
+ }
|
|
|
+ return "-1";
|
|
|
}
|
|
|
|
|
|
/**
|