|
@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
|
|
|
import com.ym.mec.biz.service.SysPaymentConfigService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -35,4 +36,30 @@ public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPay
|
|
|
public List<SysPaymentConfig> getPaymentConfigs(PaymentChannelEnum payType) {
|
|
|
return sysPaymentConfigDao.getPaymentConfigs(payType);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Boolean checkOutAccount(PaymentChannelEnum payType, String merNos) {
|
|
|
+ if ((!payType.equals(PaymentChannelEnum.ADAPAY) && !payType.equals(PaymentChannelEnum.YQPAY)) || StringUtils.isBlank(merNos)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ List<SysPaymentConfig> accounts = sysPaymentConfigDao.getOutAccounts(payType);
|
|
|
+ String[] merNoArr = merNos.split(",");
|
|
|
+ boolean hasOutAccount = false;
|
|
|
+ NODE1:
|
|
|
+ for (String merNo : merNoArr) {
|
|
|
+ for (SysPaymentConfig account : accounts) {
|
|
|
+ String accountNo = "";
|
|
|
+ if (payType.equals(PaymentChannelEnum.ADAPAY)) {
|
|
|
+ accountNo = account.getHfMerNo();
|
|
|
+ } else {
|
|
|
+ accountNo = account.getYqMerNo();
|
|
|
+ }
|
|
|
+ if (accountNo.equals(merNo)) {
|
|
|
+ hasOutAccount = true;
|
|
|
+ break NODE1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return hasOutAccount;
|
|
|
+ }
|
|
|
}
|