From a8e18cce82f6581d3472c469d3ac97e0c35581ec Mon Sep 17 00:00:00 2001 From: XinYi Song <2037158277@qq.com> Date: Mon, 20 Dec 2021 17:37:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=BB=9D=E5=95=86?= =?UTF-8?q?=E5=AE=B6=E5=85=A5=E9=A9=BB=E7=9A=84=E8=AF=B7=E6=B1=82=EF=BC=88?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E4=B8=8D=E9=80=9A=E8=BF=87=EF=BC=89=E7=9A=84?= =?UTF-8?q?=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 | 16 +++++++++++++++- .../service/MerchantSettlementService.java | 17 +++++++++++++++-- .../impl/MerchantSettlementServiceImpl.java | 18 ++++++++++++++++-- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/xkrs/controller/MerchantSettlementController.java b/src/main/java/com/xkrs/controller/MerchantSettlementController.java index 85bb199..e2986c9 100644 --- a/src/main/java/com/xkrs/controller/MerchantSettlementController.java +++ b/src/main/java/com/xkrs/controller/MerchantSettlementController.java @@ -1,5 +1,6 @@ package com.xkrs.controller; +import com.aliyuncs.exceptions.ClientException; import com.xkrs.common.config.RedisUtil; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.common.tool.TokenUtil; @@ -124,7 +125,7 @@ public class MerchantSettlementController { * @return */ @PostMapping("/updatePassBusiness") - public String updatePassBusiness(@RequestBody Map map){ + public String updatePassBusiness(@RequestBody Map map) throws ClientException { Integer id = (Integer) map.get("id"); String username = (String) map.get("username"); String province = (String) map.get("province"); @@ -132,4 +133,17 @@ public class MerchantSettlementController { String county = (String) map.get("county"); return merchantSettlementService.updatePassBusiness(id,username,province,city,county); } + + /** + * 拒绝商家入驻的请求(审核不通过) + * @param map + * @return + * @throws ClientException + */ + @PostMapping("/updateNotPassBusiness") + public String updateNotPassBusiness(@RequestBody Map map) throws ClientException { + Integer id = (Integer) map.get("id"); + String phone = (String) map.get("phone"); + return merchantSettlementService.updateNotPassBusiness(id,phone); + } } diff --git a/src/main/java/com/xkrs/service/MerchantSettlementService.java b/src/main/java/com/xkrs/service/MerchantSettlementService.java index b314cdb..99992f4 100644 --- a/src/main/java/com/xkrs/service/MerchantSettlementService.java +++ b/src/main/java/com/xkrs/service/MerchantSettlementService.java @@ -60,9 +60,22 @@ public interface MerchantSettlementService { /** * 对商家入驻进行审核(1审核通过 2审核不通过) - * @param id - * @param + * @param id 商家入驻的id + * @param username + * @param province + * @param city + * @param county * @return + * @throws ClientException */ String updatePassBusiness(Integer id,String username,String province,String city,String county) throws ClientException; + + /** + * 拒绝商家入驻的请求(审核不通过) + * @param id + * @param phone + * @return + * @throws ClientException + */ + String updateNotPassBusiness(Integer id,String phone) throws ClientException; } diff --git a/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java b/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java index 0bbb183..54851a5 100644 --- a/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/MerchantSettlementServiceImpl.java @@ -170,10 +170,10 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService @Override public String updatePassBusiness(Integer id,String username,String province,String city,String county) throws ClientException { Locale locale = LocaleContextHolder.getLocale(); - BusinessEntity businessEntity = businessDao.findById(id); + /*BusinessEntity businessEntity = businessDao.findById(id); if("1".equals(businessEntity.getBusinessType())){ return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该商家已被审核并已通过审核!",locale); - } + }*/ String salt = KeyGenerators.string().generateKey(); SysUserEntity sysUserEntity = new SysUserEntity(); sysUserEntity.setUserName(username); @@ -211,4 +211,18 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功!",locale); } + + /** + * 拒绝商家入驻的请求(审核不通过) + * @param id + * @param phone + * @return + */ + @Override + public String updateNotPassBusiness(Integer id, String phone) throws ClientException { + Locale locale = LocaleContextHolder.getLocale(); + SendSmsResponse sendSmsResponse = AliYunSmsUtils.sendSmsToBusinessNotPass(phone); + businessDao.updateNotPassBusiness(id); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功!",locale); + } }