添加了绝商家入驻的请求(审核不通过)的功能模块

This commit is contained in:
XinYi Song 2021-12-20 17:37:13 +08:00
parent ab8ab40fab
commit a8e18cce82
3 changed files with 46 additions and 5 deletions

View File

@ -1,5 +1,6 @@
package com.xkrs.controller; package com.xkrs.controller;
import com.aliyuncs.exceptions.ClientException;
import com.xkrs.common.config.RedisUtil; import com.xkrs.common.config.RedisUtil;
import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.common.encapsulation.PromptMessageEnum;
import com.xkrs.common.tool.TokenUtil; import com.xkrs.common.tool.TokenUtil;
@ -124,7 +125,7 @@ public class MerchantSettlementController {
* @return * @return
*/ */
@PostMapping("/updatePassBusiness") @PostMapping("/updatePassBusiness")
public String updatePassBusiness(@RequestBody Map map){ public String updatePassBusiness(@RequestBody Map map) throws ClientException {
Integer id = (Integer) map.get("id"); Integer id = (Integer) map.get("id");
String username = (String) map.get("username"); String username = (String) map.get("username");
String province = (String) map.get("province"); String province = (String) map.get("province");
@ -132,4 +133,17 @@ public class MerchantSettlementController {
String county = (String) map.get("county"); String county = (String) map.get("county");
return merchantSettlementService.updatePassBusiness(id,username,province,city,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);
}
} }

View File

@ -60,9 +60,22 @@ public interface MerchantSettlementService {
/** /**
* 对商家入驻进行审核1审核通过 2审核不通过 * 对商家入驻进行审核1审核通过 2审核不通过
* @param id * @param id 商家入驻的id
* @param * @param username
* @param province
* @param city
* @param county
* @return * @return
* @throws ClientException
*/ */
String updatePassBusiness(Integer id,String username,String province,String city,String county) 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;
} }

View File

@ -170,10 +170,10 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService
@Override @Override
public String updatePassBusiness(Integer id,String username,String province,String city,String county) throws ClientException { public String updatePassBusiness(Integer id,String username,String province,String city,String county) throws ClientException {
Locale locale = LocaleContextHolder.getLocale(); Locale locale = LocaleContextHolder.getLocale();
BusinessEntity businessEntity = businessDao.findById(id); /*BusinessEntity businessEntity = businessDao.findById(id);
if("1".equals(businessEntity.getBusinessType())){ if("1".equals(businessEntity.getBusinessType())){
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该商家已被审核并已通过审核!",locale); return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该商家已被审核并已通过审核!",locale);
} }*/
String salt = KeyGenerators.string().generateKey(); String salt = KeyGenerators.string().generateKey();
SysUserEntity sysUserEntity = new SysUserEntity(); SysUserEntity sysUserEntity = new SysUserEntity();
sysUserEntity.setUserName(username); sysUserEntity.setUserName(username);
@ -211,4 +211,18 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功!",locale); 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);
}
} }