fanzherong_v hace 1 mes
padre
commit
aa2bf7e25d
Se han modificado 20 ficheros con 1137 adiciones y 6 borrados
  1. 28 0
      snowy-admin-web/src/api/biz/couponConfigApi.js
  2. 82 0
      snowy-admin-web/src/views/biz/couponconfig/form.vue
  3. 121 0
      snowy-admin-web/src/views/biz/couponconfig/index.vue
  4. 95 0
      snowy-admin-web/src/views/biz/rechargeplanconfig/config.vue
  5. 133 0
      snowy-admin-web/src/views/biz/rechargeplanconfig/detail.vue
  6. 2 2
      snowy-admin-web/src/views/biz/rechargeplanconfig/form.vue
  7. 18 3
      snowy-admin-web/src/views/biz/rechargeplanconfig/index.vue
  8. 131 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/controller/CouponConfigController.java
  9. 58 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/entity/CouponConfig.java
  10. 34 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/enums/CouponConfigEnum.java
  11. 25 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/mapper/CouponConfigMapper.java
  12. 5 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/mapper/mapping/CouponConfigMapper.xml
  13. 50 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigAddParam.java
  14. 55 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigEditParam.java
  15. 35 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigIdParam.java
  16. 54 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigPageParam.java
  17. 87 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/service/CouponConfigService.java
  18. 97 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/service/impl/CouponConfigServiceImpl.java
  19. 2 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponrecord/entity/BizCouponRecord.java
  20. 25 1
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/wx/WxPayNotifyController.java

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

@@ -0,0 +1,28 @@
+import { baseRequest } from '@/utils/request'
+
+const request = (url, ...arg) => baseRequest(`/biz/couponconfig/` + url, ...arg)
+
+/**
+ * 蛋糕券配置Api接口管理器
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+export default {
+	// 获取蛋糕券配置分页
+	couponConfigPage(data) {
+		return request('page', data, 'get')
+	},
+	// 提交蛋糕券配置表单 edit为true时为编辑,默认为新增
+	couponConfigSubmitForm(data, edit = false) {
+		return request(edit ? 'edit' : 'add', data)
+	},
+	// 删除蛋糕券配置
+	couponConfigDelete(data) {
+		return request('delete', data)
+	},
+	// 获取蛋糕券配置详情
+	couponConfigDetail(data) {
+		return request('detail', data, 'get')
+	}
+}

+ 82 - 0
snowy-admin-web/src/views/biz/couponconfig/form.vue

@@ -0,0 +1,82 @@
+<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="充值方案id:" name="rechargePlanId">
+				<a-input v-model:value="formData.rechargePlanId" placeholder="请输入充值方案id" 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="类型:1:寸  2:元:" name="couponType">
+				<a-input v-model:value="formData.couponType" placeholder="请输入类型:1:寸  2:元" 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>
+		<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="couponConfigForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import couponConfigApi from '@/api/biz/couponConfigApi'
+	// 抽屉状态
+	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)
+				couponConfigApi
+					.couponConfigSubmitForm(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 121 - 0
snowy-admin-web/src/views/biz/couponconfig/index.vue

@@ -0,0 +1,121 @@
+<template>
+	<a-card :bordered="false">
+		<s-table
+			ref="tableRef"
+			:columns="columns"
+			:data="loadData"
+			:alert="options.alert.show"
+			bordered
+			:row-key="(record) => record.id"
+			:tool-config="toolConfig"
+			:row-selection="options.rowSelection"
+		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('couponConfigAdd')">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+					<xn-batch-button
+						v-if="hasPerm('couponConfigBatchDelete')"
+						buttonName="批量删除"
+                        icon="DeleteOutlined"
+						:selectedRowKeys="selectedRowKeys"
+						@batchCallBack="deleteBatchCouponConfig"
+					/>
+				</a-space>
+			</template>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a @click="formRef.onOpen(record)" v-if="hasPerm('couponConfigEdit')">编辑</a>
+						<a-divider type="vertical" v-if="hasPerm(['couponConfigEdit', 'couponConfigDelete'], 'and')" />
+						<a-popconfirm title="确定要删除吗?" @confirm="deleteCouponConfig(record)">
+							<a-button type="link" danger size="small" v-if="hasPerm('couponConfigDelete')">删除</a-button>
+						</a-popconfirm>
+					</a-space>
+				</template>
+			</template>
+		</s-table>
+	</a-card>
+	<Form ref="formRef" @successful="tableRef.refresh()" />
+</template>
+
+<script setup name="couponconfig">
+	import { cloneDeep } from 'lodash-es'
+	import Form from './form.vue'
+	import couponConfigApi from '@/api/biz/couponConfigApi'
+	const tableRef = ref()
+	const formRef = ref()
+	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
+	const columns = [
+		{
+			title: '充值方案id',
+			dataIndex: 'rechargePlanId'
+		},
+		{
+			title: '蛋糕券金额',
+			dataIndex: 'couponAmount'
+		},
+		{
+			title: '类型:1:寸  2:元',
+			dataIndex: 'couponType'
+		},
+		{
+			title: '蛋糕券数量',
+			dataIndex: 'couponNum'
+		},
+	]
+	// 操作栏通过权限判断是否显示
+	if (hasPerm(['couponConfigEdit', 'couponConfigDelete'])) {
+		columns.push({
+			title: '操作',
+			dataIndex: 'action',
+			align: 'center',
+			width: 150
+		})
+	}
+	const selectedRowKeys = ref([])
+	// 列表选择配置
+	const options = {
+		// columns数字类型字段加入 needTotal: true 可以勾选自动算账
+		alert: {
+			show: true,
+			clear: () => {
+				selectedRowKeys.value = ref([])
+			}
+		},
+		rowSelection: {
+			onChange: (selectedRowKey, selectedRows) => {
+				selectedRowKeys.value = selectedRowKey
+			}
+		}
+	}
+	const loadData = (parameter) => {
+		return couponConfigApi.couponConfigPage(parameter).then((data) => {
+			return data
+		})
+	}
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
+		tableRef.value.refresh(true)
+	}
+	// 删除
+	const deleteCouponConfig = (record) => {
+		let params = [
+			{
+				id: record.id
+			}
+		]
+		couponConfigApi.couponConfigDelete(params).then(() => {
+			tableRef.value.refresh(true)
+		})
+	}
+	// 批量删除
+	const deleteBatchCouponConfig = (params) => {
+		couponConfigApi.couponConfigDelete(params).then(() => {
+			tableRef.value.clearRefreshSelected()
+		})
+	}
+</script>

+ 95 - 0
snowy-admin-web/src/views/biz/rechargeplanconfig/config.vue

@@ -0,0 +1,95 @@
+<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" :label-col="{span: 5}">
+			<a-form-item label="蛋糕券:" name="couponAmount">
+				<a-input-number v-model:value="formData.couponAmount" style="width: 100%" :min="0" :max="99999999"
+								:precision="2" placeholder="请输入蛋糕券" allow-clear/>
+			</a-form-item>
+			<a-form-item label="蛋糕券类型:" name="couponType">
+				<a-radio-group button-style="solid" v-model:value="formData.couponType">
+					<a-radio-button value="1">
+						寸
+					</a-radio-button>
+					<a-radio-button value="2">
+						元
+					</a-radio-button>
+				</a-radio-group>
+			</a-form-item>
+			<a-form-item label="蛋糕券数量:" name="couponNum">
+				<a-input-number v-model:value="formData.couponNum" style="width: 100%" :min="0" :max="99999999"
+								:precision="0" 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="couponConfigForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import couponConfigApi from '@/api/biz/couponConfigApi'
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	// 打开抽屉
+	const onOpen = (planId,record) => {
+		console.log("planID:"+planId)
+		open.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}else{
+			formData.value.couponType = '1'
+			formData.value.rechargePlanId = planId
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+	}
+	// 默认要校验的
+	const formRules = {
+		couponAmount: [required('请输入蛋糕券')],
+		couponType: [required('请选择蛋糕券类型')],
+		couponNum: [required('请输入蛋糕券数量')],
+	}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				couponConfigApi
+					.couponConfigSubmitForm(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 133 - 0
snowy-admin-web/src/views/biz/rechargeplanconfig/detail.vue

@@ -0,0 +1,133 @@
+<template>
+	<xn-form-container
+		title="蛋糕券"
+		:width="800"
+		:visible="visible"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+
+		<a-form ref="formRef" :model="formData" layout="vertical">
+			<s-table
+				ref="tableRef"
+				:columns="columns"
+				:data="loadData"
+				:alert="false"
+				:showPagination="true"
+				bordered
+				:row-key="(record) => record.id"
+			>
+				<template #operator class="table-operator">
+					<a-space>
+						<a-button type="primary" @click="configFormRef.onOpen(planId,'')" v-if="hasPerm('couponConfigAdd')">
+							<template #icon>
+								<plus-outlined />
+							</template>
+							新增
+						</a-button>
+					</a-space>
+				</template>
+				<template #bodyCell="{ column, record }">
+					<template v-if="column.dataIndex === 'couponType'">
+						{{ $TOOL.dictTypeData('coupon_type', record.couponType) }}
+					</template>
+					<template v-if="column.dataIndex === 'action'">
+						<a-space>
+							<a @click="configFormRef.onOpen(planId,record)" v-if="hasPerm('couponConfigEdit')">编辑</a>
+							<a-divider type="vertical" v-if="hasPerm(['couponConfigEdit', 'couponConfigDelete'], 'and')" />
+							<a-popconfirm title="确定要删除吗?" @confirm="deleteCouponConfig(record)">
+								<a-button type="link" danger size="small" v-if="hasPerm('couponConfigDelete')">删除</a-button>
+							</a-popconfirm>
+						</a-space>
+					</template>
+				</template>
+			</s-table>
+
+		</a-form>
+		<Config ref="configFormRef" @successful="tableRef.refresh()" />
+	</xn-form-container>
+
+</template>
+
+<script setup name="messageDetail">
+	import consumptionRecordApi from '@/api/biz/consumptionRecordApi'
+	import bizUserApi from "@/api/biz/bizUserApi";
+	import {cloneDeep} from "lodash-es";
+	import couponConfigApi from "@/api/biz/couponConfigApi";
+	const receiveInfoList = ref([])
+	const emit = defineEmits({ successful: null })
+	import Config from './config.vue'
+
+	// 默认是关闭状态
+	const visible = ref(false)
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const tableRef = ref()
+	const configFormRef = ref()
+	const columns = [
+		{
+			title: '蛋糕券',
+			dataIndex: 'couponAmount',
+			align: 'center',
+		},
+		{
+			title: '蛋糕券类型',
+			dataIndex: 'couponType',
+			align: 'center',
+		},
+		{
+			title: '蛋糕券数量',
+			dataIndex: 'couponNum',
+			align: 'center',
+		},
+	]
+	columns.push({
+		title: '操作',
+		dataIndex: 'action',
+		align: 'center',
+		width: 200
+	})
+
+	const planId = ref()
+	// 打开抽屉
+	const onOpen = (record) => {
+		visible.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+			planId.value = formData.value.id
+		}
+	}
+
+	const loadData = () => {
+		let param = {
+			rechargePlanId: formData.value.id,
+		}
+		return couponConfigApi.couponConfigPage(param).then((res) => {
+			return res
+		})
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		receiveInfoList.value = []
+		visible.value = false
+		emit('successful')
+	}
+
+	// 删除
+	const deleteCouponConfig = (record) => {
+		let params = [
+			{
+				id: record.id
+			}
+		]
+		couponConfigApi.couponConfigDelete(params).then(() => {
+			tableRef.value.refresh(true)
+		})
+	}
+	// 调用这个函数将子组件的一些数据和方法暴露出去
+	defineExpose({
+		onOpen
+	})
+</script>

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

@@ -29,14 +29,14 @@
 				<a-input-number v-model:value="formData.rechargeAmount" style="width: 100%" :min="0" :max="99999999"
 								:precision="2" placeholder="请输入充值金额及以上" allow-clear/>
 			</a-form-item>
-			<a-form-item label="蛋糕券大小(寸):" name="couponAmount">
+<!--			<a-form-item label="蛋糕券大小(寸):" name="couponAmount">
 				<a-input-number v-model:value="formData.couponAmount" style="width: 100%" :min="0" :max="99999999"
 								:precision="2" placeholder="请输入蛋糕券大小(寸)" allow-clear/>
 			</a-form-item>
 			<a-form-item label="蛋糕券数量:" name="couponNum">
 				<a-input-number v-model:value="formData.couponNum" style="width: 100%" :min="0" :max="99999999"
 								:precision="0" placeholder="请输入优惠券数量" allow-clear/>
-			</a-form-item>
+			</a-form-item>-->
 			<a-form-item label="账户到账糕点:" name="accountBalance">
 				<a-input-number v-model:value="formData.accountBalance" style="width: 100%" :min="0" :max="99999999"
 								:precision="2" placeholder="请输入账户到账糕点" allow-clear/>

+ 18 - 3
snowy-admin-web/src/views/biz/rechargeplanconfig/index.vue

@@ -96,6 +96,17 @@
 				</template>
 				<template v-if="column.dataIndex === 'action'">
 					<a-space>
+						<a
+							@click="detailRef.onOpen(record)"
+							v-if="hasPerm('bizCakeAdd') && record.status === 'DISABLED'"
+						>蛋糕券</a>
+						<a-divider
+							type="vertical"
+							v-if="
+								hasPerm(['bizCakeAdd', 'bizRechargePlanConfigEdit'], 'and') &&
+								record.status === 'DISABLED'
+							"
+						/>
 						<a
 							@click="formRef.onOpen(record)"
 							v-if="hasPerm('bizRechargePlanConfigEdit') && record.status === 'DISABLED'"
@@ -123,6 +134,7 @@
 		</s-table>
 	</a-card>
 	<Form ref="formRef" @successful="tableRef.refresh()" />
+	<Detail ref="detailRef" @successful="tableRef.refresh()" />
 </template>
 
 <script setup name="rechargeplanconfig">
@@ -131,10 +143,13 @@
 	import bizOrgApi from '@/api/biz/bizOrgApi'
 	import tool from '@/utils/tool'
 	import { ref } from 'vue'
+	import Detail from './detail.vue'
+
 	const searchFormRef = ref()
 	const searchFormState = ref({})
 	const tableRef = ref()
 	const formRef = ref()
+	const detailRef = ref()
 	const loading = ref(false)
 	const statusData = tool.dictList('COMMON_STATUS')
 	const treeData = ref([])
@@ -155,7 +170,7 @@
 			dataIndex: 'rechargeAmount',
 			align: 'center',
 		},
-		{
+		/*{
 			title: '蛋糕券大小(寸)',
 			dataIndex: 'couponAmount',
 			align: 'center',
@@ -164,7 +179,7 @@
 			title: '蛋糕券数量',
 			dataIndex: 'couponNum',
 			align: 'center',
-		},
+		},*/
 		{
 			title: '账户到账糕点(个)',
 			dataIndex: 'accountBalance',
@@ -197,7 +212,7 @@
 			title: '操作',
 			dataIndex: 'action',
 			align: 'center',
-			width: 150
+			width: 200
 		})
 	}
 	const loadData = (parameter) => {

+ 131 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/controller/CouponConfigController.java

@@ -0,0 +1,131 @@
+/*
+ * 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.couponconfig.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.couponconfig.entity.CouponConfig;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigAddParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigEditParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigIdParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigPageParam;
+import vip.xiaonuo.biz.modular.couponconfig.service.CouponConfigService;
+
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * 蛋糕券配置控制器
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ */
+@Tag(name = "蛋糕券配置控制器")
+@RestController
+@Validated
+public class CouponConfigController {
+
+    @Resource
+    private CouponConfigService couponConfigService;
+
+    /**
+     * 获取蛋糕券配置分页
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    @Operation(summary = "获取蛋糕券配置分页")
+    @SaCheckPermission("/biz/couponconfig/page")
+    @GetMapping("/biz/couponconfig/page")
+    public CommonResult<Page<CouponConfig>> page(CouponConfigPageParam couponConfigPageParam) {
+        return CommonResult.data(couponConfigService.page(couponConfigPageParam));
+    }
+
+    /**
+     * 添加蛋糕券配置
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    @Operation(summary = "添加蛋糕券配置")
+    @CommonLog("添加蛋糕券配置")
+    @PostMapping("/biz/couponconfig/add")
+    public CommonResult<String> add(@RequestBody @Valid CouponConfigAddParam couponConfigAddParam) {
+        couponConfigService.add(couponConfigAddParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 编辑蛋糕券配置
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    @Operation(summary = "编辑蛋糕券配置")
+    @CommonLog("编辑蛋糕券配置")
+    @PostMapping("/biz/couponconfig/edit")
+    public CommonResult<String> edit(@RequestBody @Valid CouponConfigEditParam couponConfigEditParam) {
+        couponConfigService.edit(couponConfigEditParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 删除蛋糕券配置
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    @Operation(summary = "删除蛋糕券配置")
+    @CommonLog("删除蛋糕券配置")
+    @PostMapping("/biz/couponconfig/delete")
+    public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
+                                                   List<CouponConfigIdParam> couponConfigIdParamList) {
+        couponConfigService.delete(couponConfigIdParamList);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 获取蛋糕券配置详情
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    @Operation(summary = "获取蛋糕券配置详情")
+    @GetMapping("/biz/couponconfig/detail")
+    public CommonResult<CouponConfig> detail(@Valid CouponConfigIdParam couponConfigIdParam) {
+        return CommonResult.data(couponConfigService.detail(couponConfigIdParam));
+    }
+
+    /**
+     * 获取蛋糕券配置列表
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    @Operation(summary = "获取蛋糕券配置列表")
+    @GetMapping("/biz/couponconfig/getList")
+    public CommonResult<List<CouponConfig>> getList(CouponConfigPageParam couponConfigPageParam) {
+        return CommonResult.data(couponConfigService.getList(couponConfigPageParam));
+    }
+}

+ 58 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/entity/CouponConfig.java

@@ -0,0 +1,58 @@
+/*
+ * 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.couponconfig.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fhs.core.trans.anno.Trans;
+import com.fhs.core.trans.constant.TransType;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+import vip.xiaonuo.common.pojo.CommonEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 蛋糕券配置实体
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+@Getter
+@Setter
+@TableName("biz_coupon_config")
+public class CouponConfig extends CommonEntity {
+
+    /** 主键ID */
+    @TableId
+    @Schema(description = "主键ID")
+    private String id;
+
+    /** 充值方案id */
+    @Schema(description = "充值方案id")
+    private String rechargePlanId;
+
+    /** 蛋糕券金额 */
+    @Schema(description = "蛋糕券金额")
+    private BigDecimal couponAmount;
+
+    /** 类型:1:寸  2:元 */
+    @Schema(description = "类型:1:寸  2:元")
+    @Trans(type = TransType.DICTIONARY, key = "coupon_type")
+    private String couponType;
+
+    /** 蛋糕券数量 */
+    @Schema(description = "蛋糕券数量")
+    private Integer couponNum;
+}

+ 34 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/enums/CouponConfigEnum.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.couponconfig.enums;
+
+import lombok.Getter;
+
+/**
+ * 蛋糕券配置枚举
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+@Getter
+public enum CouponConfigEnum {
+
+    /** 测试 */
+    TEST("TEST");
+
+    private final String value;
+
+    CouponConfigEnum(String value) {
+        this.value = value;
+    }
+}

+ 25 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/mapper/CouponConfigMapper.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.couponconfig.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import vip.xiaonuo.biz.modular.couponconfig.entity.CouponConfig;
+
+/**
+ * 蛋糕券配置Mapper接口
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+public interface CouponConfigMapper extends BaseMapper<CouponConfig> {
+}

+ 5 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/mapper/mapping/CouponConfigMapper.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.couponconfig.mapper.CouponConfigMapper">
+
+</mapper>

+ 50 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigAddParam.java

@@ -0,0 +1,50 @@
+/*
+ * 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.couponconfig.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 fanzherong
+ * @date  2025/04/14 10:32
+ **/
+@Getter
+@Setter
+public class CouponConfigAddParam {
+
+    /** 充值方案id */
+    @Schema(description = "充值方案id")
+    private String rechargePlanId;
+
+    /** 蛋糕券金额 */
+    @Schema(description = "蛋糕券金额")
+    private BigDecimal couponAmount;
+
+    /** 类型:1:寸  2:元 */
+    @Schema(description = "类型:1:寸  2:元")
+    private String couponType;
+
+    /** 蛋糕券数量 */
+    @Schema(description = "蛋糕券数量")
+    private Integer couponNum;
+
+}

+ 55 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigEditParam.java

@@ -0,0 +1,55 @@
+/*
+ * 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.couponconfig.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 fanzherong
+ * @date  2025/04/14 10:32
+ **/
+@Getter
+@Setter
+public class CouponConfigEditParam {
+
+    /** 主键ID */
+    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "id不能为空")
+    private String id;
+
+    /** 充值方案id */
+    @Schema(description = "充值方案id")
+    private String rechargePlanId;
+
+    /** 蛋糕券金额 */
+    @Schema(description = "蛋糕券金额")
+    private BigDecimal couponAmount;
+
+    /** 类型:1:寸  2:元 */
+    @Schema(description = "类型:1:寸  2:元")
+    private String couponType;
+
+    /** 蛋糕券数量 */
+    @Schema(description = "蛋糕券数量")
+    private Integer couponNum;
+
+}

+ 35 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigIdParam.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.couponconfig.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+import jakarta.validation.constraints.NotBlank;
+
+/**
+ * 蛋糕券配置Id参数
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+@Getter
+@Setter
+public class CouponConfigIdParam {
+
+    /** 主键ID */
+    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "id不能为空")
+    private String id;
+}

+ 54 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/param/CouponConfigPageParam.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.couponconfig.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 蛋糕券配置查询参数
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+@Getter
+@Setter
+public class CouponConfigPageParam {
+
+    /** 当前页 */
+    @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;
+
+    /**充值方案id*/
+    private String rechargePlanId;
+
+}

+ 87 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/service/CouponConfigService.java

@@ -0,0 +1,87 @@
+/*
+ * 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.couponconfig.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import vip.xiaonuo.biz.modular.couponconfig.entity.CouponConfig;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigAddParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigEditParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigIdParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigPageParam;
+
+import java.util.List;
+
+/**
+ * 蛋糕券配置Service接口
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+public interface CouponConfigService extends IService<CouponConfig> {
+
+    /**
+     * 获取蛋糕券配置分页
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    Page<CouponConfig> page(CouponConfigPageParam couponConfigPageParam);
+
+    /**
+     * 添加蛋糕券配置
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    void add(CouponConfigAddParam couponConfigAddParam);
+
+    /**
+     * 编辑蛋糕券配置
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    void edit(CouponConfigEditParam couponConfigEditParam);
+
+    /**
+     * 删除蛋糕券配置
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    void delete(List<CouponConfigIdParam> couponConfigIdParamList);
+
+    /**
+     * 获取蛋糕券配置详情
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     */
+    CouponConfig detail(CouponConfigIdParam couponConfigIdParam);
+
+    /**
+     * 获取蛋糕券配置详情
+     *
+     * @author fanzherong
+     * @date  2025/04/14 10:32
+     **/
+    CouponConfig queryEntity(String id);
+
+    /**
+     * 获取蛋糕券列表
+     * @param couponConfigPageParam
+     * @return
+     */
+    List<CouponConfig> getList(CouponConfigPageParam couponConfigPageParam);
+}

+ 97 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponconfig/service/impl/CouponConfigServiceImpl.java

@@ -0,0 +1,97 @@
+/*
+ * 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.couponconfig.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.couponconfig.entity.CouponConfig;
+import vip.xiaonuo.biz.modular.couponconfig.mapper.CouponConfigMapper;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigAddParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigEditParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigIdParam;
+import vip.xiaonuo.biz.modular.couponconfig.param.CouponConfigPageParam;
+import vip.xiaonuo.biz.modular.couponconfig.service.CouponConfigService;
+
+import java.util.List;
+
+/**
+ * 蛋糕券配置Service接口实现类
+ *
+ * @author fanzherong
+ * @date  2025/04/14 10:32
+ **/
+@Service
+public class CouponConfigServiceImpl extends ServiceImpl<CouponConfigMapper, CouponConfig> implements CouponConfigService {
+
+    @Override
+    public Page<CouponConfig> page(CouponConfigPageParam couponConfigPageParam) {
+        QueryWrapper<CouponConfig> queryWrapper = new QueryWrapper<CouponConfig>().checkSqlInjection();
+        if(ObjectUtil.isNotEmpty(couponConfigPageParam.getRechargePlanId())){
+            queryWrapper.lambda().eq(CouponConfig::getRechargePlanId,couponConfigPageParam.getRechargePlanId());
+        }
+        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void add(CouponConfigAddParam couponConfigAddParam) {
+        CouponConfig couponConfig = BeanUtil.toBean(couponConfigAddParam, CouponConfig.class);
+        this.save(couponConfig);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void edit(CouponConfigEditParam couponConfigEditParam) {
+        CouponConfig couponConfig = this.queryEntity(couponConfigEditParam.getId());
+        BeanUtil.copyProperties(couponConfigEditParam, couponConfig);
+        this.updateById(couponConfig);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void delete(List<CouponConfigIdParam> couponConfigIdParamList) {
+        // 执行删除
+        this.removeByIds(CollStreamUtil.toList(couponConfigIdParamList, CouponConfigIdParam::getId));
+    }
+
+    @Override
+    public CouponConfig detail(CouponConfigIdParam couponConfigIdParam) {
+        return this.queryEntity(couponConfigIdParam.getId());
+    }
+
+    @Override
+    public CouponConfig queryEntity(String id) {
+        CouponConfig couponConfig = this.getById(id);
+        if(ObjectUtil.isEmpty(couponConfig)) {
+            throw new CommonException("蛋糕券配置不存在,id值为:{}", id);
+        }
+        return couponConfig;
+    }
+
+    @Override
+    public List<CouponConfig> getList(CouponConfigPageParam couponConfigPageParam) {
+        List<CouponConfig> couponConfigList = this.list(new QueryWrapper<CouponConfig>().lambda().
+                eq(CouponConfig::getRechargePlanId, couponConfigPageParam.getRechargePlanId()));
+        return couponConfigList;
+    }
+}

+ 2 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/couponrecord/entity/BizCouponRecord.java

@@ -96,4 +96,6 @@ public class BizCouponRecord extends CommonEntity {
     /**清除状态  1:已清除  0:未清除*/
     private Integer destroyStatus;
 
+    private String couponId;
+
 }

+ 25 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/wx/WxPayNotifyController.java

@@ -29,6 +29,8 @@ import vip.xiaonuo.biz.modular.bizactivate.entity.BizActivate;
 import vip.xiaonuo.biz.modular.bizactivate.service.BizActivateService;
 import vip.xiaonuo.biz.modular.bizactivatedetail.entity.BizActivateDetail;
 import vip.xiaonuo.biz.modular.bizactivatedetail.service.BizActivateDetailService;
+import vip.xiaonuo.biz.modular.couponconfig.entity.CouponConfig;
+import vip.xiaonuo.biz.modular.couponconfig.service.CouponConfigService;
 import vip.xiaonuo.biz.modular.couponrecord.entity.BizCouponRecord;
 import vip.xiaonuo.biz.modular.couponrecord.service.BizCouponRecordService;
 import vip.xiaonuo.biz.modular.rebaterecord.entity.BizRebateRecord;
@@ -88,6 +90,8 @@ public class WxPayNotifyController {
     private BizActivateService bizActivateService;
     @Resource
     private BizActivateDetailService bizActivateDetailService;
+    @Resource
+    private CouponConfigService couponConfigService;
 
     /**
      * 微信支付回调通知
@@ -199,7 +203,7 @@ public class WxPayNotifyController {
             bizUserFundChangeRecord.setNewVoucherBalance(bizUser.getVoucherBalance());
             bizUserFundChangeRecordService.save(bizUserFundChangeRecord);
             //生成蛋糕券
-            if (bizRechargeRecord.getCouponNum() != null && bizRechargeRecord.getCouponNum() > 0) {
+            /*if (bizRechargeRecord.getCouponNum() != null && bizRechargeRecord.getCouponNum() > 0) {
                 log.info("=========== 生成优惠券 ========");
                 DateTime date = DateUtil.date();
                 for (int i = 0; i < bizRechargeRecord.getCouponNum(); i++) {
@@ -212,6 +216,26 @@ public class WxPayNotifyController {
                     bizCouponRecord.setRechargeRecordId(bizRechargeRecord.getId());
                     bizCouponRecordService.save(bizCouponRecord);
                 }
+            }*/
+            if (ObjectUtil.isNotEmpty(bizRechargeRecord.getRechargePlanId())){
+                //查询充值方案蛋糕券
+                List<CouponConfig> couponList = couponConfigService.list(new QueryWrapper<CouponConfig>().lambda().
+                        eq(CouponConfig::getRechargePlanId, bizRechargeRecord.getRechargePlanId()));
+                for(CouponConfig couponConfig : couponList){
+                    log.info("=========== 生成优惠券 ========");
+                    DateTime date = DateUtil.date();
+                    for (int i = 0; i < couponConfig.getCouponNum(); i++) {
+                        BizCouponRecord bizCouponRecord = new BizCouponRecord();
+                        bizCouponRecord.setCouponNo(CommonCouponGeneratorUtil.generateCouponCode());
+                        bizCouponRecord.setTime(date);
+                        bizCouponRecord.setStartTime(date);
+                        bizCouponRecord.setEndTime(DateUtil.offset(date, DateField.YEAR,1));
+                        bizCouponRecord.setRechargePlanId(bizRechargeRecord.getRechargePlanId());
+                        bizCouponRecord.setRechargeRecordId(bizRechargeRecord.getId());
+                        bizCouponRecord.setCouponId(couponConfig.getId());
+                        bizCouponRecordService.save(bizCouponRecord);
+                    }
+                }
             }
             // 生成推荐人返点
             if (ObjectUtil.isNotEmpty(bizUser.getReferralUser())) {