diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index 4b640ec..fe1b900 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -44,6 +44,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { // 手机号登录 .antMatchers(HttpMethod.POST,"/api/user/loginByPhone").permitAll() .antMatchers(HttpMethod.POST,"/qiNiuUploadFile").permitAll() + .antMatchers(HttpMethod.POST,"/merchantSettlement").permitAll() // 所有其它请求需要身份认证 .anyRequest().authenticated() .and() diff --git a/src/main/java/com/xkrs/controller/MerchantSettlementController.java b/src/main/java/com/xkrs/controller/MerchantSettlementController.java index a23f90f..12710a5 100644 --- a/src/main/java/com/xkrs/controller/MerchantSettlementController.java +++ b/src/main/java/com/xkrs/controller/MerchantSettlementController.java @@ -60,7 +60,7 @@ public class MerchantSettlementController { String businessLicense = (String) map.get("businessLicense"); Double businessDiscount = (Double) map.get("businessDiscount"); String headIdentifier = (String) map.get("headIdentifier"); - List bankCardQos = (List) map.get("bankCardQos"); + List bankCardQos = (List) map.get("bankCardQos"); String verificationCode = (String) map.get("verificationCode"); BusinessQo businessQo = new BusinessQo(); businessQo.setBusinessName(businessName); diff --git a/src/main/java/com/xkrs/service/MerchantSettlementService.java b/src/main/java/com/xkrs/service/MerchantSettlementService.java index 6e108d6..7bd6d5f 100644 --- a/src/main/java/com/xkrs/service/MerchantSettlementService.java +++ b/src/main/java/com/xkrs/service/MerchantSettlementService.java @@ -25,7 +25,7 @@ public interface MerchantSettlementService { * @return * @throws IOException */ - String merchantSettlement(BusinessQo businessQo, List bankCardQos) throws IOException; + String merchantSettlement(BusinessQo businessQo, List bankCardQos) throws IOException; /** * 通过状态查询商家入驻信息 diff --git a/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java b/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java index 60495d6..07aea86 100644 --- a/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java @@ -1,5 +1,7 @@ package com.xkrs.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.aliyuncs.exceptions.ClientException; import com.xkrs.common.encapsulation.PromptMessageEnum; @@ -63,7 +65,7 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService * @return */ @Override - public String merchantSettlement(BusinessQo businessQo, List bankCardQos) throws IOException { + public String merchantSettlement(BusinessQo businessQo, List bankCardQos) throws IOException { Locale locale = LocaleContextHolder.getLocale(); BusinessEntity byBusinessName = businessDao.findByBusinessName(businessQo.getBusinessName()); if(byBusinessName != null){ @@ -71,16 +73,18 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService } BusinessEntity byBusinessPhone = businessDao.findByBusinessPhone(businessQo.getBusinessPhone()); if(byBusinessPhone != null){ - return outputEncapsulationObject(PromptMessageEnum.FILE_EXISTS,"您已入驻,请勿重复入驻或提交!",locale); + return outputEncapsulationObject(PromptMessageEnum.FILE_EXISTS,"该手机号已用于入驻,请勿重复使用!",locale); } - for(BankCardQo bankCardQo : bankCardQos){ - Map stringObjectMap = VerifyBankCardUtil.checkBankCar(bankCardQo.getBankCardNumber()); + for(Object bankCardQo : bankCardQos){ + JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(bankCardQo)); + BankCardQo bankCardQo1 = jsonObject.toJavaObject(BankCardQo.class); + Map stringObjectMap = VerifyBankCardUtil.checkBankCar(bankCardQo1.getBankCardNumber()); if(!((Boolean) stringObjectMap.get("card")) || "findNotName".equals(stringObjectMap.get("cardName").toString())){ return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG,"银行卡信息有误,请检查重新填写!",locale); } BankCardEntity bankCardEntity = new BankCardEntity(); - bankCardEntity.setBankCardNumber(bankCardQo.getBankCardNumber()); - bankCardEntity.setAccountBank(bankCardQo.getAccountBank()); + bankCardEntity.setBankCardNumber(bankCardQo1.getBankCardNumber()); + bankCardEntity.setAccountBank(bankCardQo1.getAccountBank()); bankCardEntity.setBankName(stringObjectMap.get("cardName").toString()); // bankCardEntity.setBusinessId(businessId); bankCardEntity.setBusinessPhone(businessQo.getBusinessPhone());