From 52033376507a2039cd269a07b07052f5290e90e8 Mon Sep 17 00:00:00 2001 From: XinYi Song <2037158277@qq.com> Date: Fri, 17 Dec 2021 10:03:13 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MerchantSettlementController.java | 13 ++++++++----- .../service/MerchantSettlementService.java | 8 ++++---- .../impl/MerchantSettlementServiceImpl.java | 18 ++++-------------- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/xkrs/controller/MerchantSettlementController.java b/src/main/java/com/xkrs/controller/MerchantSettlementController.java index 25133cc..83555b4 100644 --- a/src/main/java/com/xkrs/controller/MerchantSettlementController.java +++ b/src/main/java/com/xkrs/controller/MerchantSettlementController.java @@ -40,15 +40,14 @@ public class MerchantSettlementController { /** * 商家入驻 * @param - * @param businessPhoto - * @param businessLicense + * @param + * @param * @param * @param * @return */ @PostMapping("/merchantSettlement") - public String merchantSettlement(@RequestBody Map map, @RequestParam("businessPhoto") MultipartFile businessPhoto, - @RequestParam("businessLicense") MultipartFile businessLicense) throws IOException { + public String merchantSettlement(@RequestBody Map map) throws IOException { Locale locale = LocaleContextHolder.getLocale(); String businessName = (String) map.get("businessName"); String businessPro = (String) map.get("businessPro"); @@ -56,6 +55,8 @@ public class MerchantSettlementController { String businessCountry = (String) map.get("businessCountry"); String businessAddress = (String) map.get("businessAddress"); String businessPhone = (String) map.get("businessPhone"); + String businessPhoto = (String) map.get("businessPhoto"); + String businessLicense = (String) map.get("businessLicense"); Double businessDiscount = (Double) map.get("businessDiscount"); String headIdentifier = (String) map.get("headIdentifier"); List bankCardQos = (List) map.get("bankCardQos"); @@ -67,6 +68,8 @@ public class MerchantSettlementController { businessQo.setBusinessCountry(businessCountry); businessQo.setBusinessAddress(businessAddress); businessQo.setBusinessPhone(businessPhone); + businessQo.setBusinessPhoto(businessPhoto); + businessQo.setBusinessLicense(businessLicense); businessQo.setBusinessDiscount(businessDiscount); businessQo.setHeadIdentifier(headIdentifier); String o = (String) redisUtil.get(businessPhone); @@ -76,7 +79,7 @@ public class MerchantSettlementController { if(!redisUtil.get(businessPhone).equals(verificationCode)){ return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG,"验证码错误,请重新输入!",locale); } - return merchantSettlementService.merchantSettlement(businessQo,businessPhoto,businessLicense,bankCardQos); + return merchantSettlementService.merchantSettlement(businessQo,bankCardQos); } /** diff --git a/src/main/java/com/xkrs/service/MerchantSettlementService.java b/src/main/java/com/xkrs/service/MerchantSettlementService.java index b264771..1cc0589 100644 --- a/src/main/java/com/xkrs/service/MerchantSettlementService.java +++ b/src/main/java/com/xkrs/service/MerchantSettlementService.java @@ -17,14 +17,14 @@ public interface MerchantSettlementService { /** * 商家入驻 * @param businessQo - * @param businessPhoto - * @param businessLicense + * @param + * @param * @param bankCardQos - * @param businessId + * @param * @return * @throws IOException */ - String merchantSettlement(BusinessQo businessQo, MultipartFile businessPhoto, MultipartFile businessLicense, 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 83c3348..037d289 100644 --- a/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java @@ -41,14 +41,14 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService /** * 商家入驻 * @param businessQo - * @param businessPhoto - * @param businessLicense + * @param + * @param * @param bankCardQos * @param * @return */ @Override - public String merchantSettlement(BusinessQo businessQo, MultipartFile businessPhoto, MultipartFile businessLicense, 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){ @@ -58,16 +58,6 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService if(byBusinessPhone != null){ return outputEncapsulationObject(PromptMessageEnum.FILE_EXISTS,"您已入驻,请勿重复入驻或提交!",locale); } - if(businessPhoto == null){ - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"商家图片不能为空!",locale); - } - if(businessLicense == null){ - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"营业执照不能为空!",locale); - } - // 上传商家图片 - //String busPhoto = PhotoUtil.memoryPhoto(businessPhoto); - // 上传商家营业执照 - //String photo = PhotoUtil.memoryPhoto(businessLicense); for(BankCardQo bankCardQo : bankCardQos){ Map stringObjectMap = VerifyBankCardUtil.checkBankCar(bankCardQo.getBankCardNumber()); if(!((Boolean) stringObjectMap.get("card")) || "findNotName".equals(stringObjectMap.get("cardName").toString())){ @@ -95,7 +85,7 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService businessEntity.setBusinessType("0"); businessEntity.setSettleInTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); businessDao.save(businessEntity); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"入驻成功!",locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"提交成功!等待总部审核!",locale); } /**