feat():添加禁用和启用接口
parent
58088c358d
commit
cd341b1a01
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.cloud.pay;
|
package com.muyu.cloud.pay;
|
||||||
|
|
||||||
import com.dtflys.forest.springboot.annotation.ForestScan;
|
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
|
|
@ -107,7 +107,7 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@DeleteMapping("/{orderCustomerId}")
|
@DeleteMapping("/{orderCustomerId}")
|
||||||
@Operation(summary = "客户信息删除",description = "通过ID删除客户信息")
|
@Operation(summary = "客户信息删除",description = "通过ID删除客户信息,七天内有支付支付记录的客户,不可进行删除")
|
||||||
public Result<String> delete(@PathVariable("orderCustomerId") Long orderCustomerId){
|
public Result<String> delete(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||||
orderPayCustomerService.removeById(orderCustomerId);
|
orderPayCustomerService.removeById(orderCustomerId);
|
||||||
return Result.success(null,"操作成功");
|
return Result.success(null,"操作成功");
|
||||||
|
@ -122,12 +122,38 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
|
||||||
@GetMapping("/{orderCustomerId}")
|
@GetMapping("/{orderCustomerId}")
|
||||||
@Operation(summary = "通过ID获取客户信息",description = "通过ID获取客户信息")
|
@Operation(summary = "通过ID获取客户信息",description = "通过ID获取客户信息")
|
||||||
public Result<OrderPayCustomer> findById(@PathVariable("orderCustomerId") Long orderCustomerId){
|
public Result<OrderPayCustomer> findById(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||||
|
log.info("");
|
||||||
return Result.success(orderPayCustomerService.getById(orderCustomerId),"操作成功");
|
return Result.success(orderPayCustomerService.getById(orderCustomerId),"操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID禁用客户
|
||||||
|
* @param orderCustomerId ID
|
||||||
|
* @return 禁用结果
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/disable/{orderCustomerId}")
|
||||||
|
@Operation(summary = "通过ID禁用客户",description = "通过ID禁用客户,禁用之后禁止调用支付相关接口")
|
||||||
|
public Result<OrderPayCustomer> disable(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||||
|
this.orderPayCustomerService.disable(orderCustomerId);
|
||||||
|
return Result.success(null,"操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID启动客户
|
||||||
|
* @param orderCustomerId ID
|
||||||
|
* @return 启动结果
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/enable/{orderCustomerId}")
|
||||||
|
@Operation(summary = "通过ID启动客户",description = "通过ID启用被禁止的客户,启用后可以调用支付相关的接口")
|
||||||
|
public Result<OrderPayCustomer> enable(@PathVariable("orderCustomerId") Long orderCustomerId){
|
||||||
|
this.orderPayCustomerService.enable(orderCustomerId);
|
||||||
|
return Result.success(null,"操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,5 +34,26 @@ public interface OrderPayCustomerService extends IService<OrderPayCustomer> {
|
||||||
|
|
||||||
List<String> getCustomerAllList();
|
List<String> getCustomerAllList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 禁用客户
|
||||||
|
* @param orderCustomerId
|
||||||
|
*/
|
||||||
|
|
||||||
|
void disable(Long orderCustomerId);
|
||||||
|
/**
|
||||||
|
* 启用客户
|
||||||
|
* @param orderCustomerId
|
||||||
|
*/
|
||||||
|
void enable(Long orderCustomerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过客户ID设置客户状态
|
||||||
|
* @param orderCustomerId ID
|
||||||
|
* @param status 状态 SysIsYesNo
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
void settingStatus(Long orderCustomerId,String status);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper;
|
||||||
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
import com.muyu.cloud.pay.service.OrderPayCustomerService;
|
||||||
import com.muyu.cloud.pay.service.OrderPayInfoService;
|
import com.muyu.cloud.pay.service.OrderPayInfoService;
|
||||||
import com.muyu.common.core.enums.SysPayType;
|
import com.muyu.common.core.enums.SysPayType;
|
||||||
|
import com.muyu.common.core.enums.SystemYesNo;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.nacos.remote.service.NacosServerService;
|
import com.muyu.common.nacos.remote.service.NacosServerService;
|
||||||
|
@ -92,6 +93,24 @@ public class OrderPayCustomerServiceImpl extends ServiceImpl<OrderPayCustomerMap
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disable(Long orderCustomerId) {
|
||||||
|
this.settingStatus(orderCustomerId, SystemYesNo.NO.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enable(Long orderCustomerId) {
|
||||||
|
this.settingStatus(orderCustomerId, SystemYesNo.NO.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void settingStatus(Long orderCustomerId,String status){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean save(OrderPayCustomer orderPayCustomer) {
|
public boolean save(OrderPayCustomer orderPayCustomer) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue