mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-03-03 19:03:11 +08:00
feat: 新增支付渠道表及其相关接口
This commit is contained in:
parent
f7c62a7e2b
commit
1b4ff1a13f
7 changed files with 229 additions and 9 deletions
|
@ -0,0 +1,88 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.pay.controller;
|
||||
|
||||
import com.skyeye.annotation.api.Api;
|
||||
import com.skyeye.annotation.api.ApiImplicitParam;
|
||||
import com.skyeye.annotation.api.ApiImplicitParams;
|
||||
import com.skyeye.annotation.api.ApiOperation;
|
||||
import com.skyeye.common.entity.search.CommonPageInfo;
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
||||
import com.skyeye.pay.entity.PayChannel;
|
||||
import com.skyeye.pay.service.PayChannelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName: PayChannelController
|
||||
* @Description: 支付渠道信息管理
|
||||
* @author: skyeye云系列--卫志强
|
||||
* @date: 2024/3/9 14:31.
|
||||
* @Copyright: 2024 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
|
||||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
@RestController
|
||||
@Api(value = "支付渠道管理", tags = "支付渠道管理", modelName = "支付渠道管理")
|
||||
public class PayChannelController {
|
||||
|
||||
@Autowired
|
||||
private PayChannelService payChannelService;
|
||||
|
||||
/**
|
||||
* 新增/修改支付渠道信息
|
||||
*
|
||||
* @param inputObject 入参以及用户信息等获取对象
|
||||
* @param outputObject 出参以及提示信息的返回值对象
|
||||
*/
|
||||
@ApiOperation(id = "writePayChannel", value = "新增/修改支付渠道信息", method = "POST", allUse = "1")
|
||||
@ApiImplicitParams(classBean = PayChannel.class)
|
||||
@RequestMapping("/post/PayChannelController/writePayChannel")
|
||||
public void writePayChannel(InputObject inputObject, OutputObject outputObject) {
|
||||
payChannelService.saveOrUpdateEntity(inputObject, outputObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除支付渠道信息
|
||||
*
|
||||
* @param inputObject 入参以及用户信息等获取对象
|
||||
* @param outputObject 出参以及提示信息的返回值对象
|
||||
*/
|
||||
@ApiOperation(id = "deletePayChannelById", value = "根据id删除支付渠道信息", method = "DELETE", allUse = "1")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")})
|
||||
@RequestMapping("/post/PayChannelController/deletePayChannelById")
|
||||
public void deletePayChannelById(InputObject inputObject, OutputObject outputObject) {
|
||||
payChannelService.deleteById(inputObject, outputObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询支付渠道信息
|
||||
*
|
||||
* @param inputObject 入参以及用户信息等获取对象
|
||||
* @param outputObject 出参以及提示信息的返回值对象
|
||||
*/
|
||||
@ApiOperation(id = "queryPayChannelById", value = "根据id查询支付渠道信息", method = "POST", allUse = "2")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")})
|
||||
@RequestMapping("/post/PayChannelController/queryPayChannelById")
|
||||
public void queryPayChannelById(InputObject inputObject, OutputObject outputObject) {
|
||||
payChannelService.selectById(inputObject, outputObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询支付渠道信息列表
|
||||
*
|
||||
* @param inputObject 入参以及用户信息等获取对象
|
||||
* @param outputObject 出参以及提示信息的返回值对象
|
||||
*/
|
||||
@ApiOperation(id = "queryPayChannelList", value = "分页查询支付渠道信息列表", method = "POST", allUse = "2")
|
||||
@ApiImplicitParams(classBean = CommonPageInfo.class)
|
||||
@RequestMapping("/post/PayChannelController/queryPayChannelList")
|
||||
public void queryPayChannelList(InputObject inputObject, OutputObject outputObject) {
|
||||
payChannelService.queryPageList(inputObject, outputObject);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.pay.dao;
|
||||
|
||||
import com.skyeye.eve.dao.SkyeyeBaseMapper;
|
||||
import com.skyeye.pay.entity.PayChannel;
|
||||
|
||||
/**
|
||||
* @ClassName: PayChannelDao
|
||||
* @Description: 支付渠道信息数据层
|
||||
* @author: xqz
|
||||
* @date: 2024/3/9 14:31
|
||||
* @Copyright: 2023 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
|
||||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
public interface PayChannelDao extends SkyeyeBaseMapper<PayChannel> {
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.pay.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.skyeye.annotation.api.ApiModel;
|
||||
import com.skyeye.annotation.api.ApiModelProperty;
|
||||
import com.skyeye.annotation.cache.RedisCacheField;
|
||||
import com.skyeye.annotation.unique.UniqueField;
|
||||
import com.skyeye.common.constans.RedisConstants;
|
||||
import com.skyeye.common.entity.features.OperatorUserInfo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName: PayChannel
|
||||
* @Description: 支付渠道实体类
|
||||
* @author: skyeye云系列--卫志强
|
||||
* @date: 2024/3/9 14:31
|
||||
* @Copyright: 2023 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
|
||||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
@Data
|
||||
@UniqueField({"codeNum", "appId"})
|
||||
@RedisCacheField(name = "skyeye:payChannel", cacheTime = RedisConstants.THIRTY_DAY_SECONDS)
|
||||
@TableName("skyeye_pay_channel")
|
||||
@ApiModel("支付渠道实体类")
|
||||
public class PayChannel extends OperatorUserInfo {
|
||||
|
||||
@TableId("id")
|
||||
@ApiModelProperty(value = "主键id。为空时新增,不为空时编辑")
|
||||
private String id;
|
||||
|
||||
@TableField("code_num")
|
||||
@ApiModelProperty(value = "渠道编码", required = "required")
|
||||
private String codeNum;
|
||||
|
||||
@TableField("enabled")
|
||||
@ApiModelProperty(value = "启用状态", required = "required")
|
||||
private Integer enabled;
|
||||
|
||||
@TableField("feeRate")
|
||||
@ApiModelProperty(value = "渠道费率,单位:百分比", required = "required")
|
||||
private Long feeRate;
|
||||
|
||||
@TableField("app_id")
|
||||
@ApiModelProperty(value = "应用id", required = "required")
|
||||
private String appId;
|
||||
|
||||
@TableField("config")
|
||||
@ApiModelProperty(value = "支付渠道配置", required = "required")
|
||||
private String config;
|
||||
|
||||
@TableField("remark")
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.pay.service;
|
||||
|
||||
import com.skyeye.base.business.service.SkyeyeBusinessService;
|
||||
import com.skyeye.pay.entity.PayChannel;
|
||||
|
||||
/**
|
||||
* @ClassName: PayChannelService
|
||||
* @Description: 支付渠道服务接口层
|
||||
* @author: skyeye云系列--卫志强
|
||||
* @date: 2024/3/9 14:31
|
||||
* @Copyright: 2023 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
|
||||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
public interface PayChannelService extends SkyeyeBusinessService<PayChannel> {
|
||||
}
|
|
@ -30,7 +30,7 @@ import java.util.Map;
|
|||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
@Service
|
||||
@SkyeyeService
|
||||
@SkyeyeService(name = "支付应用管理", groupName = "支付应用管理")
|
||||
public class PayAppServiceImpl extends SkyeyeBusinessServiceImpl<PayAppDao, PayApp> implements PayAppService {
|
||||
|
||||
@Override
|
||||
|
@ -58,11 +58,4 @@ public class PayAppServiceImpl extends SkyeyeBusinessServiceImpl<PayAppDao, PayA
|
|||
throw new CustomException("该支付应用信息不存在");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void deletePreExecution(PayApp payApp){
|
||||
String userId = InputObject.getLogParamsStatic().get("id").toString();
|
||||
if (!userId.equals(payApp.getCreateId())) {
|
||||
throw new CustomException("无权限!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
|
||||
******************************************************************************/
|
||||
|
||||
package com.skyeye.pay.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.skyeye.annotation.service.SkyeyeService;
|
||||
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
|
||||
import com.skyeye.common.constans.CommonConstants;
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.exception.CustomException;
|
||||
import com.skyeye.pay.dao.PayChannelDao;
|
||||
import com.skyeye.pay.entity.PayApp;
|
||||
import com.skyeye.pay.entity.PayChannel;
|
||||
import com.skyeye.pay.service.PayChannelService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @ClassName: PayChannelServiceImpl
|
||||
* @Description: 支付渠道服务层
|
||||
* @author: skyeye云系列--卫志强
|
||||
* @date: 2024/3/9 14:31
|
||||
* @Copyright: 2023 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
|
||||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
@Service
|
||||
@SkyeyeService(name = "支付渠道",groupName = "支付渠道")
|
||||
public class PayChannelServiceImpl extends SkyeyeBusinessServiceImpl<PayChannelDao, PayChannel> implements PayChannelService {
|
||||
|
||||
@Override
|
||||
public void updatePrepose(PayChannel payChannel) {
|
||||
QueryWrapper<PayChannel> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(CommonConstants.ID, payChannel.getId());
|
||||
PayChannel one = getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(one)) {
|
||||
throw new CustomException("该支付应用信息不存在");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ import java.util.Map;
|
|||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
@Service
|
||||
@SkyeyeService
|
||||
@SkyeyeService(name = "门店商品分类管理", groupName = "门店商品分类管理")
|
||||
public class StoreTypeServiceImpl extends SkyeyeBusinessServiceImpl<StoreTypeDao, StoreType> implements StoreTypeService {
|
||||
|
||||
@Autowired
|
||||
|
|
Loading…
Reference in a new issue