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); + } }