瀏覽代碼

充值方案配置

wulei 3 月之前
父節點
當前提交
0dbd443c77
共有 15 個文件被更改,包括 895 次插入0 次删除
  1. 二進制
      snowy-admin-web/public/img/tanglogo.png
  2. 28 0
      snowy-admin-web/src/api/biz/bizRechargePlanConfigApi.js
  3. 85 0
      snowy-admin-web/src/views/biz/rechargeplanconfig/form.vue
  4. 139 0
      snowy-admin-web/src/views/biz/rechargeplanconfig/index.vue
  5. 123 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/controller/BizRechargePlanConfigController.java
  6. 83 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/entity/BizRechargePlanConfig.java
  7. 34 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/enums/BizRechargePlanConfigEnum.java
  8. 25 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/mapper/BizRechargePlanConfigMapper.java
  9. 5 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/mapper/mapping/BizRechargePlanConfigMapper.xml
  10. 54 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigAddParam.java
  11. 59 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigEditParam.java
  12. 35 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigIdParam.java
  13. 51 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigPageParam.java
  14. 80 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/service/BizRechargePlanConfigService.java
  15. 94 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/service/impl/BizRechargePlanConfigServiceImpl.java

二進制
snowy-admin-web/public/img/tanglogo.png


+ 28 - 0
snowy-admin-web/src/api/biz/bizRechargePlanConfigApi.js

@@ -0,0 +1,28 @@
+import { baseRequest } from '@/utils/request'
+
+const request = (url, ...arg) => baseRequest(`/biz/rechargeplanconfig/` + url, ...arg)
+
+/**
+ * 充值方案配置Api接口管理器
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+export default {
+	// 获取充值方案配置分页
+	bizRechargePlanConfigPage(data) {
+		return request('page', data, 'get')
+	},
+	// 提交充值方案配置表单 edit为true时为编辑,默认为新增
+	bizRechargePlanConfigSubmitForm(data, edit = false) {
+		return request(edit ? 'edit' : 'add', data)
+	},
+	// 删除充值方案配置
+	bizRechargePlanConfigDelete(data) {
+		return request('delete', data)
+	},
+	// 获取充值方案配置详情
+	bizRechargePlanConfigDetail(data) {
+		return request('detail', data, 'get')
+	}
+}

+ 85 - 0
snowy-admin-web/src/views/biz/rechargeplanconfig/form.vue

@@ -0,0 +1,85 @@
+<template>
+	<xn-form-container
+		:title="formData.id ? '编辑充值方案配置' : '增加充值方案配置'"
+		:width="700"
+		v-model:open="open"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
+			<a-form-item label="充值金额底线:" name="rechargeAmountOne">
+				<a-input v-model:value="formData.rechargeAmountOne" placeholder="请输入充值金额底线" allow-clear />
+			</a-form-item>
+			<a-form-item label="优惠券金额:" name="couponAmount">
+				<a-input v-model:value="formData.couponAmount" placeholder="请输入优惠券金额" allow-clear />
+			</a-form-item>
+			<a-form-item label="优惠券数量:" name="couponNum">
+				<a-input v-model:value="formData.couponNum" placeholder="请输入优惠券数量" allow-clear />
+			</a-form-item>
+			<a-form-item label="账户余额增加金额:" name="accountBalanceOne">
+				<a-input v-model:value="formData.accountBalanceOne" placeholder="请输入账户余额增加金额" allow-clear />
+			</a-form-item>
+			<a-form-item label="返点比例(代金券):" name="rebateRatioOne">
+				<a-input v-model:value="formData.rebateRatioOne" placeholder="请输入返点比例(代金券)" allow-clear />
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
+</template>
+
+<script setup name="bizRechargePlanConfigForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import bizRechargePlanConfigApi from '@/api/biz/bizRechargePlanConfigApi'
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	// 打开抽屉
+	const onOpen = (record) => {
+		open.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+	}
+	// 默认要校验的
+	const formRules = {
+	}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				bizRechargePlanConfigApi
+					.bizRechargePlanConfigSubmitForm(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 139 - 0
snowy-admin-web/src/views/biz/rechargeplanconfig/index.vue

@@ -0,0 +1,139 @@
+<template>
+	<a-card :bordered="false" class="xn-mb10">
+		<a-form ref="searchFormRef" name="advanced_search" class="ant-advanced-search-form"
+				:model="searchFormState">
+			<a-row :gutter="24">
+				<a-col :span="8">
+					<a-form-item name="searchKey" label="名称关键词">
+						<a-input v-model:value="searchFormState.searchKey" placeholder="请输入机构名称关键词"/>
+					</a-form-item>
+				</a-col>
+				<a-col :span="8">
+					<a-button type="primary" @click="tableRef.refresh(true)">
+						<template #icon>
+							<SearchOutlined/>
+						</template>
+						查询
+					</a-button>
+					<a-button class="snowy-button-left" @click="reset">
+						<template #icon>
+							<redo-outlined/>
+						</template>
+						重置
+					</a-button>
+				</a-col>
+			</a-row>
+		</a-form>
+	</a-card>
+	<a-card :bordered="false">
+		<s-table
+			ref="tableRef"
+			:columns="columns"
+			:data="loadData"
+			bordered
+			:row-key="(record) => record.id"
+		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="formRef.onOpen()"
+							  v-if="hasPerm('bizRechargePlanConfigAdd')">
+						<template #icon>
+							<plus-outlined/>
+						</template>
+						新增
+					</a-button>
+					<xn-batch-button
+						v-if="hasPerm('bizRechargePlanConfigBatchDelete')"
+						buttonName="批量删除"
+						icon="DeleteOutlined"
+						:selectedRowKeys="selectedRowKeys"
+						@batchCallBack="deleteBatchBizRechargePlanConfig"
+					/>
+				</a-space>
+			</template>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a @click="formRef.onOpen(record)" v-if="hasPerm('bizRechargePlanConfigEdit')">编辑</a>
+						<a-divider type="vertical"
+								   v-if="hasPerm(['bizRechargePlanConfigEdit', 'bizRechargePlanConfigDelete'], 'and')"/>
+						<a-popconfirm title="确定要删除吗?" @confirm="deleteBizRechargePlanConfig(record)">
+							<a-button type="link" danger size="small"
+									  v-if="hasPerm('bizRechargePlanConfigDelete')">删除
+							</a-button>
+						</a-popconfirm>
+					</a-space>
+				</template>
+			</template>
+		</s-table>
+	</a-card>
+	<Form ref="formRef" @successful="tableRef.refresh()"/>
+</template>
+
+<script setup name="rechargeplanconfig">
+import {cloneDeep} from 'lodash-es'
+import Form from './form.vue'
+import bizRechargePlanConfigApi from '@/api/biz/bizRechargePlanConfigApi'
+const searchFormRef = ref()
+const searchFormState = ref({})
+const tableRef = ref()
+const formRef = ref()
+const columns = [
+	{
+		title: '充值金额底线',
+		dataIndex: 'rechargeAmountOne'
+	},
+	{
+		title: '优惠券金额',
+		dataIndex: 'couponAmount'
+	},
+	{
+		title: '优惠券数量',
+		dataIndex: 'couponNum'
+	},
+	{
+		title: '账户余额增加金额',
+		dataIndex: 'accountBalanceOne'
+	},
+	{
+		title: '返点比例(代金券)',
+		dataIndex: 'rebateRatioOne'
+	},
+]
+// 操作栏通过权限判断是否显示
+if (hasPerm(['bizRechargePlanConfigEdit', 'bizRechargePlanConfigDelete'])) {
+	columns.push({
+		title: '操作',
+		dataIndex: 'action',
+		align: 'center',
+		width: 150
+	})
+}
+const loadData = (parameter) => {
+	return bizRechargePlanConfigApi.bizRechargePlanConfigPage(parameter).then((data) => {
+		return data
+	})
+}
+// 重置
+const reset = () => {
+	searchFormRef.value.resetFields()
+	tableRef.value.refresh(true)
+}
+// 删除
+const deleteBizRechargePlanConfig = (record) => {
+	let params = [
+		{
+			id: record.id
+		}
+	]
+	bizRechargePlanConfigApi.bizRechargePlanConfigDelete(params).then(() => {
+		tableRef.value.refresh(true)
+	})
+}
+// 批量删除
+const deleteBatchBizRechargePlanConfig = (params) => {
+	bizRechargePlanConfigApi.bizRechargePlanConfigDelete(params).then(() => {
+		tableRef.value.clearRefreshSelected()
+	})
+}
+</script>

+ 123 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/controller/BizRechargePlanConfigController.java

@@ -0,0 +1,123 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import vip.xiaonuo.common.annotation.CommonLog;
+import vip.xiaonuo.common.pojo.CommonResult;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.entity.BizRechargePlanConfig;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigAddParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigEditParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigIdParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigPageParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.service.BizRechargePlanConfigService;
+
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * 充值方案配置控制器
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ */
+@Tag(name = "充值方案配置控制器")
+@RestController
+@Validated
+public class BizRechargePlanConfigController {
+
+    @Resource
+    private BizRechargePlanConfigService bizRechargePlanConfigService;
+
+    /**
+     * 获取充值方案配置分页
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    @Operation(summary = "获取充值方案配置分页")
+    @SaCheckPermission("/biz/rechargeplanconfig/page")
+    @GetMapping("/biz/rechargeplanconfig/page")
+    public CommonResult<Page<BizRechargePlanConfig>> page(BizRechargePlanConfigPageParam bizRechargePlanConfigPageParam) {
+        return CommonResult.data(bizRechargePlanConfigService.page(bizRechargePlanConfigPageParam));
+    }
+
+    /**
+     * 添加充值方案配置
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    @Operation(summary = "添加充值方案配置")
+    @CommonLog("添加充值方案配置")
+    @SaCheckPermission("/biz/rechargeplanconfig/add")
+    @PostMapping("/biz/rechargeplanconfig/add")
+    public CommonResult<String> add(@RequestBody @Valid BizRechargePlanConfigAddParam bizRechargePlanConfigAddParam) {
+        bizRechargePlanConfigService.add(bizRechargePlanConfigAddParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 编辑充值方案配置
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    @Operation(summary = "编辑充值方案配置")
+    @CommonLog("编辑充值方案配置")
+    @SaCheckPermission("/biz/rechargeplanconfig/edit")
+    @PostMapping("/biz/rechargeplanconfig/edit")
+    public CommonResult<String> edit(@RequestBody @Valid BizRechargePlanConfigEditParam bizRechargePlanConfigEditParam) {
+        bizRechargePlanConfigService.edit(bizRechargePlanConfigEditParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 删除充值方案配置
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    @Operation(summary = "删除充值方案配置")
+    @CommonLog("删除充值方案配置")
+    @SaCheckPermission("/biz/rechargeplanconfig/delete")
+    @PostMapping("/biz/rechargeplanconfig/delete")
+    public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
+                                                   List<BizRechargePlanConfigIdParam> bizRechargePlanConfigIdParamList) {
+        bizRechargePlanConfigService.delete(bizRechargePlanConfigIdParamList);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 获取充值方案配置详情
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    @Operation(summary = "获取充值方案配置详情")
+    @SaCheckPermission("/biz/rechargeplanconfig/detail")
+    @GetMapping("/biz/rechargeplanconfig/detail")
+    public CommonResult<BizRechargePlanConfig> detail(@Valid BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam) {
+        return CommonResult.data(bizRechargePlanConfigService.detail(bizRechargePlanConfigIdParam));
+    }
+}

+ 83 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/entity/BizRechargePlanConfig.java

@@ -0,0 +1,83 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 充值方案配置实体
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+@Getter
+@Setter
+@TableName("biz_recharge_plan_config")
+public class BizRechargePlanConfig {
+
+    /** 充值方案配置id */
+    @TableId
+    @Schema(description = "充值方案配置id")
+    private String id;
+
+    /** 充值金额底线 */
+    @Schema(description = "充值金额底线")
+    private BigDecimal rechargeAmountOne;
+
+    /** 优惠券金额 */
+    @Schema(description = "优惠券金额")
+    private BigDecimal couponAmount;
+
+    /** 优惠券数量 */
+    @Schema(description = "优惠券数量")
+    private Integer couponNum;
+
+    /** 账户余额增加金额 */
+    @Schema(description = "账户余额增加金额")
+    private BigDecimal accountBalanceOne;
+
+    /** 返点比例(代金券) */
+    @Schema(description = "返点比例(代金券)")
+    private BigDecimal rebateRatioOne;
+
+    /** 删除标志:NOT_DELETE 正常,DELETED 已删除 */
+    @Schema(description = "删除标志:NOT_DELETE 正常,DELETED 已删除")
+    @TableLogic
+    @TableField(fill = FieldFill.INSERT)
+    private String deleteFlag;
+
+    /** 创建人 */
+    @Schema(description = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    /** 创建时间 */
+    @Schema(description = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    /** 修改时间 */
+    @Schema(description = "修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date updateTime;
+
+    /** 修改人 */
+    @Schema(description = "修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private String updateUser;
+}

+ 34 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/enums/BizRechargePlanConfigEnum.java

@@ -0,0 +1,34 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.enums;
+
+import lombok.Getter;
+
+/**
+ * 充值方案配置枚举
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+@Getter
+public enum BizRechargePlanConfigEnum {
+
+    /** 测试 */
+    TEST("TEST");
+
+    private final String value;
+
+    BizRechargePlanConfigEnum(String value) {
+        this.value = value;
+    }
+}

+ 25 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/mapper/BizRechargePlanConfigMapper.java

@@ -0,0 +1,25 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.entity.BizRechargePlanConfig;
+
+/**
+ * 充值方案配置Mapper接口
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+public interface BizRechargePlanConfigMapper extends BaseMapper<BizRechargePlanConfig> {
+}

+ 5 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/mapper/mapping/BizRechargePlanConfigMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="vip.xiaonuo.biz.modular.rechargeplanconfig.mapper.BizRechargePlanConfigMapper">
+
+</mapper>

+ 54 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigAddParam.java

@@ -0,0 +1,54 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 充值方案配置添加参数
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+@Getter
+@Setter
+public class BizRechargePlanConfigAddParam {
+
+    /** 充值金额底线 */
+    @Schema(description = "充值金额底线")
+    private BigDecimal rechargeAmountOne;
+
+    /** 优惠券金额 */
+    @Schema(description = "优惠券金额")
+    private BigDecimal couponAmount;
+
+    /** 优惠券数量 */
+    @Schema(description = "优惠券数量")
+    private Integer couponNum;
+
+    /** 账户余额增加金额 */
+    @Schema(description = "账户余额增加金额")
+    private BigDecimal accountBalanceOne;
+
+    /** 返点比例(代金券) */
+    @Schema(description = "返点比例(代金券)")
+    private BigDecimal rebateRatioOne;
+
+}

+ 59 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigEditParam.java

@@ -0,0 +1,59 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 充值方案配置编辑参数
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+@Getter
+@Setter
+public class BizRechargePlanConfigEditParam {
+
+    /** 充值方案配置id */
+    @Schema(description = "充值方案配置id", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "id不能为空")
+    private String id;
+
+    /** 充值金额底线 */
+    @Schema(description = "充值金额底线")
+    private BigDecimal rechargeAmountOne;
+
+    /** 优惠券金额 */
+    @Schema(description = "优惠券金额")
+    private BigDecimal couponAmount;
+
+    /** 优惠券数量 */
+    @Schema(description = "优惠券数量")
+    private Integer couponNum;
+
+    /** 账户余额增加金额 */
+    @Schema(description = "账户余额增加金额")
+    private BigDecimal accountBalanceOne;
+
+    /** 返点比例(代金券) */
+    @Schema(description = "返点比例(代金券)")
+    private BigDecimal rebateRatioOne;
+
+}

+ 35 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigIdParam.java

@@ -0,0 +1,35 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+import jakarta.validation.constraints.NotBlank;
+
+/**
+ * 充值方案配置Id参数
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+@Getter
+@Setter
+public class BizRechargePlanConfigIdParam {
+
+    /** 充值方案配置id */
+    @Schema(description = "充值方案配置id", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "id不能为空")
+    private String id;
+}

+ 51 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/param/BizRechargePlanConfigPageParam.java

@@ -0,0 +1,51 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 充值方案配置查询参数
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+@Getter
+@Setter
+public class BizRechargePlanConfigPageParam {
+
+    /** 当前页 */
+    @Schema(description = "当前页码")
+    private Integer current;
+
+    /** 每页条数 */
+    @Schema(description = "每页条数")
+    private Integer size;
+
+    /** 排序字段 */
+    @Schema(description = "排序字段,字段驼峰名称,如:userName")
+    private String sortField;
+
+    /** 排序方式 */
+    @Schema(description = "排序方式,升序:ASCEND;降序:DESCEND")
+    private String sortOrder;
+
+    /** 关键词 */
+    @Schema(description = "关键词")
+    private String searchKey;
+
+}

+ 80 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/service/BizRechargePlanConfigService.java

@@ -0,0 +1,80 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.entity.BizRechargePlanConfig;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigAddParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigEditParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigIdParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigPageParam;
+
+import java.util.List;
+
+/**
+ * 充值方案配置Service接口
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+public interface BizRechargePlanConfigService extends IService<BizRechargePlanConfig> {
+
+    /**
+     * 获取充值方案配置分页
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    Page<BizRechargePlanConfig> page(BizRechargePlanConfigPageParam bizRechargePlanConfigPageParam);
+
+    /**
+     * 添加充值方案配置
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    void add(BizRechargePlanConfigAddParam bizRechargePlanConfigAddParam);
+
+    /**
+     * 编辑充值方案配置
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    void edit(BizRechargePlanConfigEditParam bizRechargePlanConfigEditParam);
+
+    /**
+     * 删除充值方案配置
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    void delete(List<BizRechargePlanConfigIdParam> bizRechargePlanConfigIdParamList);
+
+    /**
+     * 获取充值方案配置详情
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     */
+    BizRechargePlanConfig detail(BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam);
+
+    /**
+     * 获取充值方案配置详情
+     *
+     * @author wulei
+     * @date  2025/02/04 16:32
+     **/
+    BizRechargePlanConfig queryEntity(String id);
+}

+ 94 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargeplanconfig/service/impl/BizRechargePlanConfigServiceImpl.java

@@ -0,0 +1,94 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.rechargeplanconfig.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollStreamUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.common.enums.CommonSortOrderEnum;
+import vip.xiaonuo.common.exception.CommonException;
+import vip.xiaonuo.common.page.CommonPageRequest;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.entity.BizRechargePlanConfig;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.mapper.BizRechargePlanConfigMapper;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigAddParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigEditParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigIdParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigPageParam;
+import vip.xiaonuo.biz.modular.rechargeplanconfig.service.BizRechargePlanConfigService;
+
+import java.util.List;
+
+/**
+ * 充值方案配置Service接口实现类
+ *
+ * @author wulei
+ * @date  2025/02/04 16:32
+ **/
+@Service
+public class BizRechargePlanConfigServiceImpl extends ServiceImpl<BizRechargePlanConfigMapper, BizRechargePlanConfig> implements BizRechargePlanConfigService {
+
+    @Override
+    public Page<BizRechargePlanConfig> page(BizRechargePlanConfigPageParam bizRechargePlanConfigPageParam) {
+        QueryWrapper<BizRechargePlanConfig> queryWrapper = new QueryWrapper<BizRechargePlanConfig>().checkSqlInjection();
+        if(ObjectUtil.isAllNotEmpty(bizRechargePlanConfigPageParam.getSortField(), bizRechargePlanConfigPageParam.getSortOrder())) {
+            CommonSortOrderEnum.validate(bizRechargePlanConfigPageParam.getSortOrder());
+            queryWrapper.orderBy(true, bizRechargePlanConfigPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
+                    StrUtil.toUnderlineCase(bizRechargePlanConfigPageParam.getSortField()));
+        } else {
+            queryWrapper.lambda().orderByAsc(BizRechargePlanConfig::getId);
+        }
+        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void add(BizRechargePlanConfigAddParam bizRechargePlanConfigAddParam) {
+        BizRechargePlanConfig bizRechargePlanConfig = BeanUtil.toBean(bizRechargePlanConfigAddParam, BizRechargePlanConfig.class);
+        this.save(bizRechargePlanConfig);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void edit(BizRechargePlanConfigEditParam bizRechargePlanConfigEditParam) {
+        BizRechargePlanConfig bizRechargePlanConfig = this.queryEntity(bizRechargePlanConfigEditParam.getId());
+        BeanUtil.copyProperties(bizRechargePlanConfigEditParam, bizRechargePlanConfig);
+        this.updateById(bizRechargePlanConfig);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void delete(List<BizRechargePlanConfigIdParam> bizRechargePlanConfigIdParamList) {
+        // 执行删除
+        this.removeByIds(CollStreamUtil.toList(bizRechargePlanConfigIdParamList, BizRechargePlanConfigIdParam::getId));
+    }
+
+    @Override
+    public BizRechargePlanConfig detail(BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam) {
+        return this.queryEntity(bizRechargePlanConfigIdParam.getId());
+    }
+
+    @Override
+    public BizRechargePlanConfig queryEntity(String id) {
+        BizRechargePlanConfig bizRechargePlanConfig = this.getById(id);
+        if(ObjectUtil.isEmpty(bizRechargePlanConfig)) {
+            throw new CommonException("充值方案配置不存在,id值为:{}", id);
+        }
+        return bizRechargePlanConfig;
+    }
+}