Procházet zdrojové kódy

充值配置+ 增加用户属性

wulei před 3 měsíci
rodič
revize
93d5358427

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

@@ -24,5 +24,13 @@ export default {
 	// 获取充值方案配置详情
 	bizRechargePlanConfigDetail(data) {
 		return request('detail', data, 'get')
+	},
+	// 启用充值方案配置详情
+	bizRechargePlanConfigEnable(data) {
+		return request('enableStatus', data, 'get')
+	},
+	// 停用充值方案配置详情
+	bizRechargePlanConfigDisabled(data) {
+		return request('disableStatus', data, 'get')
 	}
 }

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

@@ -6,21 +6,26 @@
 		: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 ref="formRef" :model="formData" :rules="formRules" :label-col="{span: 5}">
+			<a-form-item label="充值金额及以上:" name="rechargeAmount">
+				<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-input v-model:value="formData.couponAmount" placeholder="请输入优惠券金额" allow-clear />
+				<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 v-model:value="formData.couponNum" placeholder="请输入优惠券数量" allow-clear />
+				<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 label="账户余额增加金额:" name="accountBalanceOne">
-				<a-input v-model:value="formData.accountBalanceOne" placeholder="请输入账户余额增加金额" allow-clear />
+			<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/>
 			</a-form-item>
-			<a-form-item label="返点比例(代金券):" name="rebateRatioOne">
-				<a-input v-model:value="formData.rebateRatioOne" placeholder="请输入返点比例(代金券)" allow-clear />
+			<a-form-item label="返点比例(代金券):" name="rebateRatio">
+				<a-input-number v-model:value="formData.rebateRatio" style="width: 100%" :min="0" :max="100"
+								:precision="2" placeholder="请输入返点比例(代金券)" addon-after="%" allow-clear/>
 			</a-form-item>
 		</a-form>
 		<template #footer>
@@ -31,55 +36,61 @@
 </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)
+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 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
-	})
+}
+// 关闭抽屉
+const onClose = () => {
+	formRef.value.resetFields()
+	formData.value = {}
+	open.value = false
+}
+// 默认要校验的
+const formRules = {
+	rechargeAmount: [required('请输入充值金额及以上')],
+	couponAmount: [required('请输入优惠券金额')],
+	couponNum: [required('请输入优惠券数量')],
+	accountBalance: [required('请输入账户到账金额')],
+	rebateRatio: [required('请输入返点比例(代金券)')]
+}
+// 验证并提交数据
+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>

+ 143 - 86
snowy-admin-web/src/views/biz/rechargeplanconfig/index.vue

@@ -1,23 +1,26 @@
 <template>
 	<a-card :bordered="false" class="xn-mb10">
-		<a-form ref="searchFormRef" name="advanced_search" class="ant-advanced-search-form"
-				:model="searchFormState">
+		<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-col :span="6">
+					<a-form-item name="status" label="状态">
+						<a-select v-model:value="searchFormState.status" placeholder="请选择">
+							<a-select-option v-for="item in statusData" :key="item.value" :value="item.value">{{
+								item.label
+							}}</a-select-option>
+						</a-select>
 					</a-form-item>
 				</a-col>
 				<a-col :span="8">
 					<a-button type="primary" @click="tableRef.refresh(true)">
 						<template #icon>
-							<SearchOutlined/>
+							<SearchOutlined />
 						</template>
 						查询
 					</a-button>
-					<a-button class="snowy-button-left" @click="reset">
+					<a-button style="margin-left: 8px" @click="reset">
 						<template #icon>
-							<redo-outlined/>
+							<redo-outlined />
 						</template>
 						重置
 					</a-button>
@@ -26,33 +29,56 @@
 		</a-form>
 	</a-card>
 	<a-card :bordered="false">
-		<s-table
-			ref="tableRef"
-			:columns="columns"
-			:data="loadData"
-			bordered
-			:row-key="(record) => record.id"
-		>
+		<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')">
+					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizRechargePlanConfigAdd')">
 						<template #icon>
-							<plus-outlined/>
+							<plus-outlined />
 						</template>
 						新增
 					</a-button>
 				</a-space>
 			</template>
-			<template #bodyCell="{ column, record }">
+			<template #bodyCell="{ column, record, index }">
+				<template v-if="column.dataIndex === 'serial'">
+					{{ index + 1 }}
+				</template>
+				<template v-if="column.dataIndex === 'rebateRatio'">
+					{{ record.rebateRatio + ' %' }}
+				</template>
+				<template v-if="column.dataIndex === 'status'">
+					<a-switch
+						:loading="loading"
+						:checked="record.status === 'ENABLE'"
+						checked-children="启用"
+						un-checked-children="停用"
+						@change="editStatus(record)"
+						v-if="hasPerm('bizUserUpdataStatus')"
+					/>
+					<span v-else>{{ $TOOL.dictTypeData('COMMON_STATUS', record.userStatus) }}</span>
+				</template>
 				<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
+							@click="formRef.onOpen(record)"
+							v-if="hasPerm('bizRechargePlanConfigEdit') && record.status === 'DISABLED'"
+							>编辑</a
+						>
+						<a-divider
+							type="vertical"
+							v-if="
+								hasPerm(['bizRechargePlanConfigEdit', 'bizRechargePlanConfigDelete'], 'and') &&
+								record.status === 'DISABLED'
+							"
+						/>
 						<a-popconfirm title="确定要删除吗?" @confirm="deleteBizRechargePlanConfig(record)">
-							<a-button type="link" danger size="small"
-									  v-if="hasPerm('bizRechargePlanConfigDelete')">删除
+							<a-button
+								type="link"
+								danger
+								size="small"
+								v-if="hasPerm('bizRechargePlanConfigDelete') && record.status === 'DISABLED'"
+								>删除
 							</a-button>
 						</a-popconfirm>
 					</a-space>
@@ -60,73 +86,104 @@
 			</template>
 		</s-table>
 	</a-card>
-	<Form ref="formRef" @successful="tableRef.refresh()"/>
+	<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 = [
+	import Form from './form.vue'
+	import bizRechargePlanConfigApi from '@/api/biz/bizRechargePlanConfigApi'
+	import tool from '@/utils/tool'
+	import { ref } from 'vue'
+	const searchFormRef = ref()
+	const searchFormState = ref({})
+	const tableRef = ref()
+	const formRef = ref()
+	const loading = ref(false)
+	const statusData = tool.dictList('COMMON_STATUS')
+	const columns = [
+		{
+			title: '序号',
+			dataIndex: 'serial',
+			width: 80
+		},
+		{
+			title: '充值金额及以上(元)',
+			dataIndex: 'rechargeAmount'
+		},
 		{
-			id: record.id
+			title: '优惠券金额(元)',
+			dataIndex: 'couponAmount'
+		},
+		{
+			title: '优惠券数量',
+			dataIndex: 'couponNum'
+		},
+		{
+			title: '账户余额增加金额(元)',
+			dataIndex: 'accountBalance'
+		},
+		{
+			title: '返点比例(代金券)',
+			dataIndex: 'rebateRatio'
+		},
+		{
+			title: '状态',
+			dataIndex: 'status'
 		}
 	]
-	bizRechargePlanConfigApi.bizRechargePlanConfigDelete(params).then(() => {
+	// 操作栏通过权限判断是否显示
+	if (hasPerm(['bizRechargePlanConfigEdit', 'bizRechargePlanConfigDelete'])) {
+		columns.push({
+			title: '操作',
+			dataIndex: 'action',
+			align: 'center',
+			width: 150
+		})
+	}
+	const loadData = (parameter) => {
+		return bizRechargePlanConfigApi
+			.bizRechargePlanConfigPage(Object.assign(parameter, searchFormState.value))
+			.then((data) => {
+				return data
+			})
+	}
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
 		tableRef.value.refresh(true)
-	})
-}
-// 批量删除
-const deleteBatchBizRechargePlanConfig = (params) => {
-	bizRechargePlanConfigApi.bizRechargePlanConfigDelete(params).then(() => {
-		tableRef.value.clearRefreshSelected()
-	})
-}
+	}
+	// 删除
+	const deleteBizRechargePlanConfig = (record) => {
+		let params = [
+			{
+				id: record.id
+			}
+		]
+		bizRechargePlanConfigApi.bizRechargePlanConfigDelete(params).then(() => {
+			tableRef.value.refresh(true)
+		})
+	}
+	// 修改状态
+	const editStatus = (record) => {
+		loading.value = true
+		if (record.status === 'ENABLE') {
+			bizRechargePlanConfigApi
+				.bizRechargePlanConfigDisabled({ id: record.id })
+				.then(() => {
+					tableRef.value.refresh()
+				})
+				.finally(() => {
+					loading.value = false
+				})
+		} else {
+			bizRechargePlanConfigApi
+				.bizRechargePlanConfigEnable({ id: record.id })
+				.then(() => {
+					tableRef.value.refresh()
+				})
+				.finally(() => {
+					loading.value = false
+				})
+		}
+	}
 </script>

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

@@ -22,6 +22,7 @@ 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.annotation.CommonNoRepeat;
 import vip.xiaonuo.common.pojo.CommonResult;
 import vip.xiaonuo.biz.modular.rechargeplanconfig.entity.BizRechargePlanConfig;
 import vip.xiaonuo.biz.modular.rechargeplanconfig.param.BizRechargePlanConfigAddParam;
@@ -33,13 +34,14 @@ import vip.xiaonuo.biz.modular.rechargeplanconfig.service.BizRechargePlanConfigS
 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
+ * @date 2025/02/04 16:32
  */
 @Tag(name = "充值方案配置控制器")
 @RestController
@@ -53,7 +55,7 @@ public class BizRechargePlanConfigController {
      * 获取充值方案配置分页
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     @Operation(summary = "获取充值方案配置分页")
     @SaCheckPermission("/biz/rechargeplanconfig/page")
@@ -66,7 +68,7 @@ public class BizRechargePlanConfigController {
      * 添加充值方案配置
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     @Operation(summary = "添加充值方案配置")
     @CommonLog("添加充值方案配置")
@@ -81,7 +83,7 @@ public class BizRechargePlanConfigController {
      * 编辑充值方案配置
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     @Operation(summary = "编辑充值方案配置")
     @CommonLog("编辑充值方案配置")
@@ -96,14 +98,14 @@ public class BizRechargePlanConfigController {
      * 删除充值方案配置
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @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) {
+                                       List<BizRechargePlanConfigIdParam> bizRechargePlanConfigIdParamList) {
         bizRechargePlanConfigService.delete(bizRechargePlanConfigIdParamList);
         return CommonResult.ok();
     }
@@ -112,7 +114,7 @@ public class BizRechargePlanConfigController {
      * 获取充值方案配置详情
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     @Operation(summary = "获取充值方案配置详情")
     @SaCheckPermission("/biz/rechargeplanconfig/detail")
@@ -120,4 +122,39 @@ public class BizRechargePlanConfigController {
     public CommonResult<BizRechargePlanConfig> detail(@Valid BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam) {
         return CommonResult.data(bizRechargePlanConfigService.detail(bizRechargePlanConfigIdParam));
     }
+
+
+    /**
+     * 获取充值方案配置详情
+     *
+     * @author wulei
+     * @date 2025/02/04 16:32
+     */
+    @Operation(summary = "启用充值方案")
+    @SaCheckPermission("/biz/rechargeplanconfig/enableStatus")
+    @CommonLog("启用充值方案")
+    @GetMapping("/biz/rechargeplanconfig/enableStatus")
+    @CommonNoRepeat
+    public CommonResult<String> enableStatus(@Valid BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam) {
+        bizRechargePlanConfigService.enableStatus(bizRechargePlanConfigIdParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 获取充值方案配置详情
+     *
+     * @author wulei
+     * @date 2025/02/04 16:32
+     */
+    @Operation(summary = "停用充值方案")
+    @SaCheckPermission("/biz/rechargeplanconfig/disableStatus")
+    @CommonLog("停用充值方案")
+    @GetMapping("/biz/rechargeplanconfig/disableStatus")
+    @CommonNoRepeat
+    public CommonResult<String> disableStatus(@Valid BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam) {
+        bizRechargePlanConfigService.disableStatus(bizRechargePlanConfigIdParam);
+        return CommonResult.ok();
+    }
+
+
 }

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

@@ -16,6 +16,8 @@ import com.baomidou.mybatisplus.annotation.*;
 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;
 
@@ -28,7 +30,7 @@ import java.util.Date;
 @Getter
 @Setter
 @TableName("biz_recharge_plan_config")
-public class BizRechargePlanConfig {
+public class BizRechargePlanConfig extends CommonEntity {
 
     /** 充值方案配置id */
     @TableId
@@ -37,7 +39,7 @@ public class BizRechargePlanConfig {
 
     /** 充值金额底线 */
     @Schema(description = "充值金额底线")
-    private BigDecimal rechargeAmountOne;
+    private BigDecimal rechargeAmount;
 
     /** 优惠券金额 */
     @Schema(description = "优惠券金额")
@@ -49,35 +51,15 @@ public class BizRechargePlanConfig {
 
     /** 账户余额增加金额 */
     @Schema(description = "账户余额增加金额")
-    private BigDecimal accountBalanceOne;
+    private BigDecimal accountBalance;
 
     /** 返点比例(代金券) */
     @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;
+    private BigDecimal rebateRatio;
 
-    /** 创建时间 */
-    @Schema(description = "创建时间")
-    @TableField(fill = FieldFill.INSERT)
-    private Date createTime;
+    /** 状态:ENABLE.启用 DISABLED.停用 */
+    @Schema(description = "状态:ENABLE.启用 DISABLED.停用")
+    private String status;
 
-    /** 修改时间 */
-    @Schema(description = "修改时间")
-    @TableField(fill = FieldFill.UPDATE)
-    private Date updateTime;
 
-    /** 修改人 */
-    @Schema(description = "修改人")
-    @TableField(fill = FieldFill.UPDATE)
-    private String updateUser;
 }

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

@@ -33,7 +33,7 @@ public class BizRechargePlanConfigAddParam {
 
     /** 充值金额底线 */
     @Schema(description = "充值金额底线")
-    private BigDecimal rechargeAmountOne;
+    private BigDecimal rechargeAmount;
 
     /** 优惠券金额 */
     @Schema(description = "优惠券金额")
@@ -45,10 +45,10 @@ public class BizRechargePlanConfigAddParam {
 
     /** 账户余额增加金额 */
     @Schema(description = "账户余额增加金额")
-    private BigDecimal accountBalanceOne;
+    private BigDecimal accountBalance;
 
     /** 返点比例(代金券) */
     @Schema(description = "返点比例(代金券)")
-    private BigDecimal rebateRatioOne;
+    private BigDecimal rebateRatio;
 
 }

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

@@ -38,7 +38,7 @@ public class BizRechargePlanConfigEditParam {
 
     /** 充值金额底线 */
     @Schema(description = "充值金额底线")
-    private BigDecimal rechargeAmountOne;
+    private BigDecimal rechargeAmount;
 
     /** 优惠券金额 */
     @Schema(description = "优惠券金额")
@@ -50,10 +50,10 @@ public class BizRechargePlanConfigEditParam {
 
     /** 账户余额增加金额 */
     @Schema(description = "账户余额增加金额")
-    private BigDecimal accountBalanceOne;
+    private BigDecimal accountBalance;
 
     /** 返点比例(代金券) */
     @Schema(description = "返点比例(代金券)")
-    private BigDecimal rebateRatioOne;
+    private BigDecimal rebateRatio;
 
 }

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

@@ -48,4 +48,8 @@ public class BizRechargePlanConfigPageParam {
     @Schema(description = "关键词")
     private String searchKey;
 
+    /** 状态 */
+    @Schema(description = "状态")
+    private String status;
+
 }

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

@@ -26,7 +26,7 @@ import java.util.List;
  * 充值方案配置Service接口
  *
  * @author wulei
- * @date  2025/02/04 16:32
+ * @date 2025/02/04 16:32
  **/
 public interface BizRechargePlanConfigService extends IService<BizRechargePlanConfig> {
 
@@ -34,7 +34,7 @@ public interface BizRechargePlanConfigService extends IService<BizRechargePlanCo
      * 获取充值方案配置分页
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     Page<BizRechargePlanConfig> page(BizRechargePlanConfigPageParam bizRechargePlanConfigPageParam);
 
@@ -42,7 +42,7 @@ public interface BizRechargePlanConfigService extends IService<BizRechargePlanCo
      * 添加充值方案配置
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     void add(BizRechargePlanConfigAddParam bizRechargePlanConfigAddParam);
 
@@ -50,7 +50,7 @@ public interface BizRechargePlanConfigService extends IService<BizRechargePlanCo
      * 编辑充值方案配置
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     void edit(BizRechargePlanConfigEditParam bizRechargePlanConfigEditParam);
 
@@ -58,7 +58,7 @@ public interface BizRechargePlanConfigService extends IService<BizRechargePlanCo
      * 删除充值方案配置
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     void delete(List<BizRechargePlanConfigIdParam> bizRechargePlanConfigIdParamList);
 
@@ -66,7 +66,7 @@ public interface BizRechargePlanConfigService extends IService<BizRechargePlanCo
      * 获取充值方案配置详情
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      */
     BizRechargePlanConfig detail(BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam);
 
@@ -74,7 +74,19 @@ public interface BizRechargePlanConfigService extends IService<BizRechargePlanCo
      * 获取充值方案配置详情
      *
      * @author wulei
-     * @date  2025/02/04 16:32
+     * @date 2025/02/04 16:32
      **/
     BizRechargePlanConfig queryEntity(String id);
+
+    /**
+     * 启用充值方案
+     * @param bizRechargePlanConfigIdParam
+     */
+    void enableStatus(BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam);
+
+    /**
+     * 停用充值方案
+     * @param bizRechargePlanConfigIdParam
+     */
+    void disableStatus(BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam);
 }

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

@@ -21,6 +21,7 @@ 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.biz.modular.user.enums.BizUserStatusEnum;
 import vip.xiaonuo.common.enums.CommonSortOrderEnum;
 import vip.xiaonuo.common.exception.CommonException;
 import vip.xiaonuo.common.page.CommonPageRequest;
@@ -38,7 +39,7 @@ import java.util.List;
  * 充值方案配置Service接口实现类
  *
  * @author wulei
- * @date  2025/02/04 16:32
+ * @date 2025/02/04 16:32
  **/
 @Service
 public class BizRechargePlanConfigServiceImpl extends ServiceImpl<BizRechargePlanConfigMapper, BizRechargePlanConfig> implements BizRechargePlanConfigService {
@@ -46,13 +47,10 @@ public class BizRechargePlanConfigServiceImpl extends ServiceImpl<BizRechargePla
     @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);
+        if (ObjectUtil.isNotEmpty(bizRechargePlanConfigPageParam.getStatus())) {
+            queryWrapper.lambda().eq(BizRechargePlanConfig::getStatus, bizRechargePlanConfigPageParam.getStatus());
         }
+        queryWrapper.lambda().orderByDesc(BizRechargePlanConfig::getCreateTime);
         return this.page(CommonPageRequest.defaultPage(), queryWrapper);
     }
 
@@ -86,9 +84,23 @@ public class BizRechargePlanConfigServiceImpl extends ServiceImpl<BizRechargePla
     @Override
     public BizRechargePlanConfig queryEntity(String id) {
         BizRechargePlanConfig bizRechargePlanConfig = this.getById(id);
-        if(ObjectUtil.isEmpty(bizRechargePlanConfig)) {
-            throw new CommonException("充值方案配置不存在,id值为:{}", id);
+        if (ObjectUtil.isEmpty(bizRechargePlanConfig)) {
+            throw new CommonException("充值配置信息不存在");
         }
         return bizRechargePlanConfig;
     }
+
+    @Override
+    public void enableStatus(BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam) {
+        BizRechargePlanConfig bizRechargePlanConfig = queryEntity(bizRechargePlanConfigIdParam.getId());
+        bizRechargePlanConfig.setStatus(BizUserStatusEnum.ENABLE.getValue());
+        this.updateById(bizRechargePlanConfig);
+    }
+
+    @Override
+    public void disableStatus(BizRechargePlanConfigIdParam bizRechargePlanConfigIdParam) {
+        BizRechargePlanConfig bizRechargePlanConfig = queryEntity(bizRechargePlanConfigIdParam.getId());
+        bizRechargePlanConfig.setStatus(BizUserStatusEnum.DISABLED.getValue());
+        this.updateById(bizRechargePlanConfig);
+    }
 }

+ 13 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/user/entity/BizUser.java

@@ -27,6 +27,7 @@ import vip.xiaonuo.biz.modular.position.entity.BizPosition;
 import vip.xiaonuo.common.handler.CommonSm4CbcTypeHandler;
 import vip.xiaonuo.common.pojo.CommonEntity;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -72,6 +73,18 @@ public class BizUser extends CommonEntity {
     @Schema(description = "用户推荐码")
     private String userReferralCode;
 
+    /**用户类型: 1. 管理员 2.门店 3.会员*/
+    @Schema(description = "用户类型: 1. 管理员 2.门店 3.会员")
+    private Integer userType;
+
+    /**账户余额*/
+    @Schema(description = "账户余额")
+    private BigDecimal accountBalance;
+
+    /**代金券余额*/
+    @Schema(description = "代金券余额")
+    private BigDecimal voucherBalance;
+
     /** 昵称 */
     @Schema(description = "昵称")
     @TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)

+ 13 - 0
snowy-plugin/snowy-plugin-sys/src/main/java/vip/xiaonuo/sys/modular/user/entity/SysUser.java

@@ -27,6 +27,7 @@ import vip.xiaonuo.common.pojo.CommonEntity;
 import vip.xiaonuo.sys.modular.org.entity.SysOrg;
 import vip.xiaonuo.sys.modular.position.entity.SysPosition;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -72,6 +73,18 @@ public class SysUser extends CommonEntity {
     @Schema(description = "用户推荐码")
     private String userReferralCode;
 
+    /**用户类型: 1. 管理员 2.门店 3.会员*/
+    @Schema(description = "用户类型: 1. 管理员 2.门店 3.会员")
+    private Integer userType;
+
+    /**账户余额*/
+    @Schema(description = "账户余额")
+    private BigDecimal accountBalance;
+
+    /**代金券余额*/
+    @Schema(description = "代金券余额")
+    private BigDecimal voucherBalance;
+
     /** 昵称 */
     @Schema(description = "昵称")
     @TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)