From 24fa8a0c9d779073a05b87b1a8f8969f39fae880 Mon Sep 17 00:00:00 2001 From: XinYi Song <2037158277@qq.com> Date: Tue, 21 Dec 2021 16:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=95=86=E5=AE=B6?= =?UTF-8?q?=E5=85=A5=E9=A9=BB=E7=9A=84=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BA=86=E6=8E=A5=E6=94=B6list?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/common/config/WebSecurityConfig.java | 1 + .../controller/MerchantSettlementController.java | 2 +- .../xkrs/service/MerchantSettlementService.java | 2 +- .../impl/MerchantSettlementServiceImpl.java | 16 ++++++++++------ 4 files changed, 13 insertions(+), 8 deletions(-) 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());