diff --git a/admin-client/src/components.d.ts b/admin-client/src/components.d.ts index 25ada05..379a237 100644 --- a/admin-client/src/components.d.ts +++ b/admin-client/src/components.d.ts @@ -85,8 +85,10 @@ declare module 'vue' { FindBack: typeof import('./core/components/FindBack.vue')['default'] GenerateCron: typeof import('./core/components/GenerateCron.vue')['default'] HmActionTypeSelect: typeof import('./core/components/curd/select-components/hm-action-type-select.vue')['default'] + HmCommonSelect: typeof import('./core/components/curd/select-components/hm-common-select.vue')['default'] HmImage: typeof import('./core/components/huanmeng/hm-image.vue')['default'] HmImageTypeSelect: typeof import('./core/components/curd/select-components/hm-image-type-select.vue')['default'] + HmProductTypeSelect: typeof import('./core/components/curd/select-components/hm-product-type-select.vue')['default'] HmTenantGroupSelect: typeof import('./core/components/curd/select-components/hm-tenant-group-select.vue')['default'] HmTenantSelect: typeof import('./core/components/curd/select-components/hm-tenant-select.vue')['default'] Index: typeof import('./core/components/vue3-cron-core/Index.vue')['default'] diff --git a/admin-client/src/core/components/curd/select-components/hm-common-select.vue b/admin-client/src/core/components/curd/select-components/hm-common-select.vue new file mode 100644 index 0000000..ee5f5cd --- /dev/null +++ b/admin-client/src/core/components/curd/select-components/hm-common-select.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/admin-client/src/core/components/curd/select-components/hm-product-type-select.vue b/admin-client/src/core/components/curd/select-components/hm-product-type-select.vue new file mode 100644 index 0000000..b3d5485 --- /dev/null +++ b/admin-client/src/core/components/curd/select-components/hm-product-type-select.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/admin-client/src/core/utils/AppDictionaryCache.ts b/admin-client/src/core/utils/AppDictionaryCache.ts index 7d72c4b..24444a4 100644 --- a/admin-client/src/core/utils/AppDictionaryCache.ts +++ b/admin-client/src/core/utils/AppDictionaryCache.ts @@ -6,6 +6,9 @@ import AppDictionaryTypesCache from "./cache/AppDictionaryTypesCache"; import AppDictionaryPersonalitysCache from "./cache/AppDictionaryPersonalitysCache"; import AppDictionaryLablesCache from "./cache/AppDictionaryLablesCache"; import AppDictionaryActionTypeCache from "./cache/AppDictionaryActionTypeCache"; +import AppDictionaryProductTypeCache from "./cache/AppDictionaryProductTypeCache"; +import AppDictionaryCurrencyCache from "./cache/AppDictionaryCurrencyCache"; + /** * 基础数据缓存类 */ @@ -39,6 +42,17 @@ class AppDictionaryCache { * 动作类型 */ static appDictionaryActionTypeCache: AbstractDictionaryCache = new AppDictionaryActionTypeCache(); + + /** + * 产品类型 hm-product-type + */ + static appDictionaryProductTypeCache: AbstractDictionaryCache = new AppDictionaryProductTypeCache(); + + /** + * 用户货币类型 + */ + static appDictionaryCurrencyCache: AbstractDictionaryCache = new AppDictionaryCurrencyCache(); + } export default AppDictionaryCache; diff --git a/admin-client/src/core/utils/cache/AppDictionaryActionTypeCache.ts b/admin-client/src/core/utils/cache/AppDictionaryActionTypeCache.ts index 1888444..cc8bab4 100644 --- a/admin-client/src/core/utils/cache/AppDictionaryActionTypeCache.ts +++ b/admin-client/src/core/utils/cache/AppDictionaryActionTypeCache.ts @@ -2,7 +2,7 @@ import { AbstractDictionaryCache, AppDictionaryModel, _AbstractDictionaryCache } import { DefaultOptionType } from "ant-design-vue/es/select"; /** - * 图片类型配置 + * 图片类型配置 */ class AppDictionaryActionTypeCache extends AbstractDictionaryCache { protected code: string = "categorymenu_actiontype"; diff --git a/admin-client/src/core/utils/cache/AppDictionaryCurrencyCache.ts b/admin-client/src/core/utils/cache/AppDictionaryCurrencyCache.ts new file mode 100644 index 0000000..0643f50 --- /dev/null +++ b/admin-client/src/core/utils/cache/AppDictionaryCurrencyCache.ts @@ -0,0 +1,22 @@ +import { AbstractDictionaryCache } from './AbstractDictionaryCache' +import { DefaultOptionType } from "ant-design-vue/es/select"; + +/** + * 产品配置 + */ +class AppDictionaryCurrencyCache extends AbstractDictionaryCache { + protected code: string = "aiproject_currency_type"; + public static _lock: Promise | null = null; + constructor() { + super(AppDictionaryCurrencyCache._lock); + } + public async getDataListSelect(): Promise { + const _data = await this.getDataList(); + return _data.map((item) => { + return { label: item.name, value: item.value, name: item.name, } as DefaultOptionType; + }); + } + +} + +export default AppDictionaryCurrencyCache; \ No newline at end of file diff --git a/admin-client/src/core/utils/cache/AppDictionaryProductTypeCache.ts b/admin-client/src/core/utils/cache/AppDictionaryProductTypeCache.ts new file mode 100644 index 0000000..5c39839 --- /dev/null +++ b/admin-client/src/core/utils/cache/AppDictionaryProductTypeCache.ts @@ -0,0 +1,22 @@ +import { AbstractDictionaryCache } from './AbstractDictionaryCache' +import { DefaultOptionType } from "ant-design-vue/es/select"; + +/** + * 产品配置 + */ +class AppDictionaryProductTypeCache extends AbstractDictionaryCache { + protected code: string = "aiproject_product_type"; + public static _lock: Promise | null = null; + constructor() { + super(AppDictionaryProductTypeCache._lock); + } + public async getDataListSelect(): Promise { + const _data = await this.getDataList(); + return _data.map((item) => { + return { label: item.name, value: item.value, name: item.name, } as DefaultOptionType; + }); + } + +} + +export default AppDictionaryProductTypeCache; \ No newline at end of file diff --git a/admin-client/src/services/apps/T_Products_Rewards/T_Products_RewardService.ts b/admin-client/src/services/apps/T_Products_Rewards/T_Products_RewardService.ts new file mode 100644 index 0000000..2461a90 --- /dev/null +++ b/admin-client/src/services/apps/T_Products_Rewards/T_Products_RewardService.ts @@ -0,0 +1,81 @@ +import Http from "@/core/utils/Http"; + +/** + * T_Products_Reward服务 + */ +export default class T_Products_RewardService { + + static urlPrefix = "/api/v1/admin/T_Products_Reward"; + + /** + * 获取数据列表 + * @param current + * @param pageSize + * @param search + * @param searchSort + * @returns + */ + static findList(current: number, pageSize: number, search: any = {}, searchSort: any[] = []) { + return Http.post(`${this.urlPrefix}/findList`, { + page: current, + size: pageSize, + search, + searchSort + }) + } + + /** + * 删除集合数据 + * + * @param ids + * @returns + */ + static deleteList(ids: string[]) { + return Http.post(`${this.urlPrefix}/deleteList`, ids) + } + + /** + * 查询表单 + * + * @param id + * @returns + */ + static findForm(id?: string | undefined) { + return Http.get(`${this.urlPrefix}/findForm${(id ? '/' + id : '')}`) + } + + /** + * 保存表单数据 + * + * @param id + * @param formData + * @returns + */ + static saveForm(id: string | undefined, formData: any) { + return Http.post(`${this.urlPrefix}/${id ? 'update' : 'create'}`, formData) + } + + /** + * 导出 excel + * + * @param search + * @param searchSort + * @returns + */ + static exportExcel(search: any = {}, searchSort: any[] = []) { + return Http.download(`${this.urlPrefix}/exportExcel`, { + page: -1, + size: -1, + search, + searchSort + }); + } + /** + * 获取数据列表 + * @param productId + * @returns + */ + static getList(productId: number) { + return Http.get(`${this.urlPrefix}/findList/${productId}`,) + } +} \ No newline at end of file diff --git a/admin-client/src/services/apps/T_Productss/T_ProductsService.ts b/admin-client/src/services/apps/T_Productss/T_ProductsService.ts new file mode 100644 index 0000000..e02a792 --- /dev/null +++ b/admin-client/src/services/apps/T_Productss/T_ProductsService.ts @@ -0,0 +1,92 @@ +import Http from "@/core/utils/Http"; + +/** + * T_Products服务 + */ +export default class T_ProductsService { + + static urlPrefix = "/api/v1/admin/T_Products"; + + /** + * 获取数据列表 + * @param current + * @param pageSize + * @param search + * @param searchSort + * @returns + */ + static findList(current: number, pageSize: number, search: any = {}, searchSort: any[] = []) { + return Http.post(`${this.urlPrefix}/findList`, { + page: current, + size: pageSize, + search, + searchSort + }) + } + + /** + * 删除集合数据 + * + * @param ids + * @returns + */ + static deleteList(ids: string[]) { + return Http.post(`${this.urlPrefix}/deleteList`, ids) + } + + /** + * 查询表单 + * + * @param id + * @returns + */ + static findForm(id?: string | undefined) { + return Http.get(`${this.urlPrefix}/findForm${(id ? '/' + id : '')}`) + } + + /** + * 保存表单数据 + * + * @param id + * @param formData + * @returns + */ + static saveForm(id: string | undefined, formData: any) { + return Http.post(`${this.urlPrefix}/${id ? 'update' : 'create'}`, formData) + } + + /** + * 导出 excel + * + * @param search + * @param searchSort + * @returns + */ + static exportExcel(search: any = {}, searchSort: any[] = []) { + return Http.download(`${this.urlPrefix}/exportExcel`, { + page: -1, + size: -1, + search, + searchSort + }); + } + /** + * 修改首充状态 + * @param id + * @param v + * @returns + */ + static async setFirstCharge(id: number | undefined, v: boolean | undefined) { + return await Http.post(`${this.urlPrefix}/UpdateFirstCharge/${id}/${(v == true ? "1" : "0")}`) + } + + /** + * 修改修改上架,下架状态 + * @param id + * @param v + * @returns + */ + static async setState(id: number | undefined, v: boolean | undefined) { + return await Http.post(`${this.urlPrefix}/UpdateState/${id}/${(v == true ? "1" : "0")}`) + } +} \ No newline at end of file diff --git a/admin-client/src/views/apps/T_Products_Rewards/Index.vue b/admin-client/src/views/apps/T_Products_Rewards/Index.vue new file mode 100644 index 0000000..498be6e --- /dev/null +++ b/admin-client/src/views/apps/T_Products_Rewards/Index.vue @@ -0,0 +1,232 @@ + + + \ No newline at end of file diff --git a/admin-client/src/views/apps/T_Products_Rewards/Info.vue b/admin-client/src/views/apps/T_Products_Rewards/Info.vue new file mode 100644 index 0000000..c6d658d --- /dev/null +++ b/admin-client/src/views/apps/T_Products_Rewards/Info.vue @@ -0,0 +1,155 @@ + + + diff --git a/admin-client/src/views/apps/T_Productss/Index.vue b/admin-client/src/views/apps/T_Productss/Index.vue new file mode 100644 index 0000000..ab3c0eb --- /dev/null +++ b/admin-client/src/views/apps/T_Productss/Index.vue @@ -0,0 +1,584 @@ + + + diff --git a/admin-client/src/views/apps/T_Productss/Info.vue b/admin-client/src/views/apps/T_Productss/Info.vue new file mode 100644 index 0000000..9ff4cf7 --- /dev/null +++ b/admin-client/src/views/apps/T_Productss/Info.vue @@ -0,0 +1,204 @@ + + + diff --git a/admin-client/src/views/apps/T_Productss/InfoRawards.vue b/admin-client/src/views/apps/T_Productss/InfoRawards.vue new file mode 100644 index 0000000..6596caa --- /dev/null +++ b/admin-client/src/views/apps/T_Productss/InfoRawards.vue @@ -0,0 +1,137 @@ + + + diff --git a/admin-client/src/views/apps/T_Productss/Rewards.vue b/admin-client/src/views/apps/T_Productss/Rewards.vue new file mode 100644 index 0000000..6913010 --- /dev/null +++ b/admin-client/src/views/apps/T_Productss/Rewards.vue @@ -0,0 +1,191 @@ + + + diff --git a/admin-server/MiaoYu.Api.Admin/ApplicationServices/Apps/MiaoYuChat/T_ProductsService.cs b/admin-server/MiaoYu.Api.Admin/ApplicationServices/Apps/MiaoYuChat/T_ProductsService.cs new file mode 100644 index 0000000..1603a8b --- /dev/null +++ b/admin-server/MiaoYu.Api.Admin/ApplicationServices/Apps/MiaoYuChat/T_ProductsService.cs @@ -0,0 +1,176 @@ +using FreeSql; + +using MiaoYu.Repository.ChatAI.Admin.Entities; +using MiaoYu.Repository.ChatAI.Admin.Entities.Apps; + +using TencentCloud.Tsf.V20180326.Models; +namespace MiaoYu.Api.Admin.ApplicationServices.Apps; + +/// +/// 商城表 服务 T_ProductsService +/// +public class T_ProductsService : ApplicationService> +{ + private IRepository imageRepository; + public T_ProductsService(IRepository defaultRepository, + IRepository imageRepository) + : base(defaultRepository) + { + this.imageRepository = imageRepository; + } + + /// + /// 获取列表数据 + /// + /// + /// + public async Task FindListAsync(PagingSearchInput pagingSearchInput) + { + + var query = this._defaultRepository.Select + + //项目 + .WhereIf(pagingSearchInput.Search?.TenantId != null, + w => w.TenantId == pagingSearchInput.Search.TenantId) + + + + //道具名称 + .WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.ProductName), + w => w.ProductName.Contains(pagingSearchInput.Search.ProductName ?? "")) + + + //道具类型 + .WhereIf(pagingSearchInput.Search?.ProductType != null && pagingSearchInput.Search?.ProductType > 0, + w => w.ProductType == pagingSearchInput.Search.ProductType) + + + .OrderBy(w => w.OrderById) + .Select(w => new + { + w.Id, + w.TenantId, + w.ProductId, + w.ProductName, + w.ProductType, + w.ProductDesc, + w.Price, + w.ProductImgId, + w.IsProductDelisting, + w.IsFirstCharge, + w.FirstChargeImgId, + w.FirstChargePrice, + w.CreateTime, + w.UpdateTime, + w.OrderById, + ProductImg = w.ProductImgId == 0 ? "" : imageRepository.Select.FirstOrDefault(it => it.ImageId == w.ProductImgId).Url, + FirstChargeImg = (w.FirstChargeImgId == null || w.FirstChargeImgId == 0) ? "" : imageRepository.Select.FirstOrDefault(it => it.ImageId == w.FirstChargeImgId).Url + // w.LastModificationTime, + // w.CreationTime + }) + ; + + var result = await _defaultRepository.AsPagingViewAsync(query, pagingSearchInput); + // result + // .FormatValue(query, w => w.CreationTime, (oldValue) => oldValue.ToString("yyyy-MM-dd")) + // .FormatValue(query, w => w.LastModificationTime, (oldValue) => oldValue?.ToString("yyyy-MM-dd")) + // ; + // 设置列 + //result.GetColumn(query, w => w.OperatorName).SetColumn("操作人"); + //result.GetColumn(query, w => w.OperatorName!).SetColumn(w => w.Name!); + + return result; + } + + /// + /// 根据id数组删除 + /// + /// ids + /// + public async Task DeleteListAsync(List ids) + { + await this._defaultRepository.DeleteByIdsAsync(ids); + } + + /// + /// 查询表单数据 + /// + /// id + /// + public async Task> FindFormAsync(int id) + { + var res = new Dictionary(); + var form = await this._defaultRepository.FindByIdAsync(id); + form = form.NullSafe(); + if (form.CreateTime == null || form.CreateTime == DateTime.MinValue) + { + form.CreateTime = DateTime.Now; + } + if (form.UpdateTime == null || form.UpdateTime == DateTime.MinValue) + { + form.UpdateTime = DateTime.Now; + } + res[nameof(id)] = id; + res[nameof(form)] = form; + return res; + } + + /// + /// 保存数据 + /// + /// form + /// + public Task SaveFormAsync(T_Products form) + { + return this._defaultRepository.InsertOrUpdateAsync(form); + } + + /// + /// 导出Excel + /// + /// + /// + public async Task ExportExcelAsync(PagingSearchInput pagingSearchInput) + { + pagingSearchInput.Page = -1; + var tableViewModel = await this.FindListAsync(pagingSearchInput); + return ExcelUtil.ExportExcelByPagingView(tableViewModel, null, "Id"); + } + + /// + /// 修改首充状态 + /// + /// + /// + /// + + public async Task UpdateFirstCharge(bool state, int id) + { + var form = await this._defaultRepository.FindByIdAsync(id); + if (form == null) + { + return false; + } + form.IsFirstCharge = state; + await SaveFormAsync(form); + return true; + } + /// + /// 修改上架,下架状态 + /// + /// + /// + /// + + public async Task UpdateFirstCharge(int state, int id) + { + var form = await this._defaultRepository.FindByIdAsync(id); + if (form == null) + { + return false; + } + form.IsProductDelisting = state; + await SaveFormAsync(form); + return true; + } +} \ No newline at end of file diff --git a/admin-server/MiaoYu.Api.Admin/ApplicationServices/Apps/MiaoYuChat/T_Products_RewardService.cs b/admin-server/MiaoYu.Api.Admin/ApplicationServices/Apps/MiaoYuChat/T_Products_RewardService.cs new file mode 100644 index 0000000..ae7ec54 --- /dev/null +++ b/admin-server/MiaoYu.Api.Admin/ApplicationServices/Apps/MiaoYuChat/T_Products_RewardService.cs @@ -0,0 +1,126 @@ +using MiaoYu.Repository.ChatAI.Admin.Entities.Apps; +namespace MiaoYu.Api.Admin.ApplicationServices.Apps; + +/// +/// 产品表奖励 服务 T_Products_RewardService +/// +public class T_Products_RewardService : ApplicationService> +{ + public T_Products_RewardService(IRepository defaultRepository) + : base(defaultRepository) + { + + } + + /// + /// 获取列表数据 + /// + /// + /// + public async Task FindListAsync(PagingSearchInput pagingSearchInput) + { + var query = this._defaultRepository.Select + + //项目 + .WhereIf(pagingSearchInput.Search?.TenantId != null, + w => w.TenantId == pagingSearchInput.Search.TenantId) + + + + .OrderByDescending(w => w.Id) + .Select(w => new + { + w.Id, + w.CurrencyType, + w.Money, + w.T_ProductId, + w.FirstChargeMoney, + w.ProductId, + w.TenantId, + // w.LastModificationTime, + // w.CreationTime + }) + ; + + var result = await _defaultRepository.AsPagingViewAsync(query, pagingSearchInput); + // result + // .FormatValue(query, w => w.CreationTime, (oldValue) => oldValue.ToString("yyyy-MM-dd")) + // .FormatValue(query, w => w.LastModificationTime, (oldValue) => oldValue?.ToString("yyyy-MM-dd")) + // ; + // 设置列 + //result.GetColumn(query, w => w.OperatorName).SetColumn("操作人"); + //result.GetColumn(query, w => w.OperatorName!).SetColumn(w => w.Name!); + + return result; + } + + + /// + /// 获取列表数据 + /// + /// + /// + public async Task> FindListAsync(int productId) + { + var query = await this._defaultRepository.SelectNoTracking.Where(it => it.T_ProductId == productId).OrderByDescending(w => w.Id).ToListAsync(); + return query; + } + + /// + /// 根据id数组删除 + /// + /// ids + /// + public async Task DeleteListAsync(List ids) + { + await this._defaultRepository.DeleteByIdsAsync(ids); + } + + /// + /// 查询表单数据 + /// + /// id + /// + public async Task> FindFormAsync(int id) + { + var res = new Dictionary(); + var form = await this._defaultRepository.FindByIdAsync(id); + form = form.NullSafe(); + //if (form.CreateTime == null || form.CreateTime == DateTime.MinValue) + //{ + // form.CreateTime = DateTime.Now; + //} + //if (form.UpdateTime == null || form.UpdateTime == DateTime.MinValue) + //{ + // form.UpdateTime = DateTime.Now; + //} + res[nameof(id)] = id; + res[nameof(form)] = form; + return res; + } + + /// + /// 保存数据 + /// + /// form + /// + public Task SaveFormAsync(T_Products_Reward form) + { + return this._defaultRepository.InsertOrUpdateAsync(form); + } + + /// + /// 导出Excel + /// + /// + /// + public async Task ExportExcelAsync(PagingSearchInput pagingSearchInput) + { + pagingSearchInput.Page = -1; + var tableViewModel = await this.FindListAsync(pagingSearchInput); + return ExcelUtil.ExportExcelByPagingView(tableViewModel, null, "Id"); + } + + + +} \ No newline at end of file diff --git a/admin-server/MiaoYu.Api.Admin/Controllers/Apps/MiaoYuChat/T_ProductsController.cs b/admin-server/MiaoYu.Api.Admin/Controllers/Apps/MiaoYuChat/T_ProductsController.cs new file mode 100644 index 0000000..eedc26b --- /dev/null +++ b/admin-server/MiaoYu.Api.Admin/Controllers/Apps/MiaoYuChat/T_ProductsController.cs @@ -0,0 +1,124 @@ +using MiaoYu.Api.Admin.ApplicationServices.Apps; +using MiaoYu.Repository.ChatAI.Admin.Entities.Apps; +namespace MiaoYu.Api.Admin.Controllers.Apps; + +/// +/// 商城表 控制器 +/// +[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找,如果不设置不受权限保护!", DisplayName = "商城表")] +public class T_ProductsController : AdminControllerBase +{ + public T_ProductsController(T_ProductsService defaultService) + : base(defaultService) + { + + } + + /// + /// 获取列表 + /// + /// + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Display, DisplayName = "查看数据")] + [HttpPost] + public Task FindListAsync([FromBody] PagingSearchInput pagingSearchInput) + { + return this._defaultService.FindListAsync(pagingSearchInput); + } + + /// + /// 根据id数组删除 + /// + /// ids + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Delete, DisplayName = "删除数据")] + [HttpPost] + public async Task DeleteListAsync([FromBody] List ids) + { + await this._defaultService.DeleteListAsync(ids); + return true; + } + + /// + /// 查询表单数据 + /// + /// id + /// + [ActionDescriptor(DisplayName = "查看表单")] + [HttpGet("{id?}")] + public Task> FindFormAsync([FromRoute] int id) + { + return this._defaultService.FindFormAsync(id); + } + + /// + /// 添加 + /// + /// + /// + [RequestLimitFilter(Duration = 1, LimitCount = 1)] + [ActionDescriptor(PermissionFunctionConsts.Function_Insert, DisplayName = "创建表单")] + [HttpPost] + [ApiCheckModel] + public Task CreateAsync([FromBody] T_Products form) + { + return this._defaultService.SaveFormAsync(form); + } + + /// + /// 编辑 + /// + /// + /// + [RequestLimitFilter(Duration = 1, LimitCount = 1)] + [ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "编辑表单")] + [HttpPost] + [ApiCheckModel] + public Task UpdateAsync([FromBody] T_Products form) + { + return this._defaultService.SaveFormAsync(form); + } + + /// + /// 导出Excel + /// + /// + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Export, DisplayName = "导出数据")] + [ApiResourceCacheFilter(10)] + [HttpPost] + public async Task ExportExcelAsync([FromBody] PagingSearchInput pagingSearchInput) + { + var data = await this._defaultService.ExportExcelAsync(pagingSearchInput); + var name = $"{PermissionUtil.GetControllerDisplayName(this.GetType())}列表数据 {DateTime.Now.ToString("yyyy-MM-dd")}.xls"; + base.HttpContext.DownLoadFile(data, Tools.GetFileContentType[".xls"].ToStr(), name); + } + + /// + /// 修改角色状态 + /// + /// + /// + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "修改首充")] + [HttpPost("{id?}/{v?}")] + public async Task UpdateFirstCharge([FromRoute] int id, [FromRoute] int v) + { + return await this._defaultService.UpdateFirstCharge(v == 0 ? false : true, id); + } + + + /// + /// 修改角色状态 + /// + /// + /// + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "修改上线,下线")] + [HttpPost("{id?}/{v?}")] + public async Task UpdateState([FromRoute] int id, [FromRoute] int v) + { + return await this._defaultService.UpdateFirstCharge(v, id); + } + +} \ No newline at end of file diff --git a/admin-server/MiaoYu.Api.Admin/Controllers/Apps/MiaoYuChat/T_Products_RewardController.cs b/admin-server/MiaoYu.Api.Admin/Controllers/Apps/MiaoYuChat/T_Products_RewardController.cs new file mode 100644 index 0000000..d6bd6b2 --- /dev/null +++ b/admin-server/MiaoYu.Api.Admin/Controllers/Apps/MiaoYuChat/T_Products_RewardController.cs @@ -0,0 +1,110 @@ +using MiaoYu.Api.Admin.ApplicationServices.Apps; +using MiaoYu.Repository.ChatAI.Admin.Entities.Apps; +namespace MiaoYu.Api.Admin.Controllers.Apps; + +/// +/// 产品表奖励 控制器 +/// +[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找,如果不设置不受权限保护!", DisplayName = "产品表奖励")] +public class T_Products_RewardController : AdminControllerBase +{ + public T_Products_RewardController(T_Products_RewardService defaultService) + : base(defaultService) + { + + } + + /// + /// 获取列表 + /// + /// + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Display, DisplayName = "查看数据")] + [HttpPost] + public Task FindListAsync([FromBody] PagingSearchInput pagingSearchInput) + { + return this._defaultService.FindListAsync(pagingSearchInput); + } + /// + /// 获取列表 + /// + /// + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Display, DisplayName = "查看数据")] + [HttpGet("{productId?}")] + public async Task> FindListAsync([FromRoute] int productId) + { + return await this._defaultService.FindListAsync(productId); + } + /// + /// 根据id数组删除 + /// + /// ids + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Delete, DisplayName = "删除数据")] + [HttpPost] + public async Task DeleteListAsync([FromBody] List ids) + { + await this._defaultService.DeleteListAsync(ids); + return true; + } + + /// + /// 查询表单数据 + /// + /// id + /// + [ActionDescriptor(DisplayName = "查看表单")] + [HttpGet("{id?}")] + public Task> FindFormAsync([FromRoute] int id) + { + return this._defaultService.FindFormAsync(id); + } + + /// + /// 添加 + /// + /// + /// + [RequestLimitFilter(Duration = 1, LimitCount = 1)] + [ActionDescriptor(PermissionFunctionConsts.Function_Insert, DisplayName = "创建表单")] + [HttpPost] + [ApiCheckModel] + public Task CreateAsync([FromBody] T_Products_Reward form) + { + return this._defaultService.SaveFormAsync(form); + } + + /// + /// 编辑 + /// + /// + /// + [RequestLimitFilter(Duration = 1, LimitCount = 1)] + [ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "编辑表单")] + [HttpPost] + [ApiCheckModel] + public Task UpdateAsync([FromBody] T_Products_Reward form) + { + return this._defaultService.SaveFormAsync(form); + } + + /// + /// 导出Excel + /// + /// + /// + [ActionDescriptor(PermissionFunctionConsts.Function_Export, DisplayName = "导出数据")] + [ApiResourceCacheFilter(10)] + [HttpPost] + public async Task ExportExcelAsync([FromBody] PagingSearchInput pagingSearchInput) + { + var data = await this._defaultService.ExportExcelAsync(pagingSearchInput); + var name = $"{PermissionUtil.GetControllerDisplayName(this.GetType())}列表数据 {DateTime.Now.ToString("yyyy-MM-dd")}.xls"; + base.HttpContext.DownLoadFile(data, Tools.GetFileContentType[".xls"].ToStr(), name); + } + + + + +} \ No newline at end of file diff --git a/admin-server/MiaoYu.Api.Admin/MiaoYu.Api.Admin.xml b/admin-server/MiaoYu.Api.Admin/MiaoYu.Api.Admin.xml index 766459d..a721311 100644 --- a/admin-server/MiaoYu.Api.Admin/MiaoYu.Api.Admin.xml +++ b/admin-server/MiaoYu.Api.Admin/MiaoYu.Api.Admin.xml @@ -663,6 +663,109 @@ + + + 商城表 服务 T_ProductsService + + + + + 获取列表数据 + + + + + + + 根据id数组删除 + + ids + + + + + 查询表单数据 + + id + + + + + 保存数据 + + form + + + + + 导出Excel + + + + + + + 修改首充状态 + + + + + + + + 修改上架,下架状态 + + + + + + + + 产品表奖励 服务 T_Products_RewardService + + + + + 获取列表数据 + + + + + + + 获取列表数据 + + + + + + + 根据id数组删除 + + ids + + + + + 查询表单数据 + + id + + + + + 保存数据 + + form + + + + + 导出Excel + + + + 用户表 服务 T_UserService @@ -2656,6 +2759,123 @@ + + + 商城表 控制器 + + + + + 获取列表 + + + + + + + 根据id数组删除 + + ids + + + + + 查询表单数据 + + id + + + + + 添加 + + + + + + + 编辑 + + + + + + + 导出Excel + + + + + + + 修改角色状态 + + + + + + + + 修改角色状态 + + + + + + + + 产品表奖励 控制器 + + + + + 获取列表 + + + + + + + 获取列表 + + + + + + + 根据id数组删除 + + ids + + + + + 查询表单数据 + + id + + + + + 添加 + + + + + + + 编辑 + + + + + + + 导出Excel + + + + 用户表 控制器 diff --git a/admin-server/MiaoYu.Repository.ChatAI.Admin/Entities/Apps/T_Products.cs b/admin-server/MiaoYu.Repository.ChatAI.Admin/Entities/Apps/T_Products.cs new file mode 100644 index 0000000..928f8dc --- /dev/null +++ b/admin-server/MiaoYu.Repository.ChatAI.Admin/Entities/Apps/T_Products.cs @@ -0,0 +1,86 @@ +namespace MiaoYu.Repository.ChatAI.Admin.Entities.Apps; + +/// +/// 商城表 +/// +[EntityDescription(FieldIgnored = true)] +public class T_Products : DefaultEntityV4 +{ + + + /// + /// 道具Id => 备注: 道具Id + /// + public string? ProductId { get; set; } + + + /// + /// 道具名称 => 备注: 道具名称 + /// + public string? ProductName { get; set; } + + + /// + /// 道具类型 => 备注: 道具类型,0商城,1商店 + /// + public Int32 ProductType { get; set; } + + + /// + /// 道具描述 => 备注: 道具描述 + /// + public string? ProductDesc { get; set; } + + + /// + /// 价格 => 备注: 价格 + /// + public Decimal Price { get; set; } + + + /// + /// 道具图片 => 备注: 道具图片配置 图片id + /// + public Int32 ProductImgId { get; set; } + + + /// + /// 商品状态 => 备注: 商品是否下架 0否1是 + /// + public Int32 IsProductDelisting { get; set; } + + + /// + /// 首充 => 备注: 是否有首充 + /// + public Boolean IsFirstCharge { get; set; } + + + /// + /// 首充图片 => 备注: 首充图片 + /// + public Int32? FirstChargeImgId { get; set; } + + + /// + /// 首充价格 => 备注: 首充价格 + /// + public Decimal? FirstChargePrice { get; set; } + + + /// + /// 创建时间 => 备注: 创建时间 + /// + public DateTime CreateTime { get; set; } + + + /// + /// 更新时间 => 备注: 更新时间 + /// + public DateTime? UpdateTime { get; set; } + + /// + /// 排序 => 备注: 排序 + /// + public Int32? OrderById { get; set; } +} \ No newline at end of file diff --git a/admin-server/MiaoYu.Repository.ChatAI.Admin/Entities/Apps/T_Products_Reward.cs b/admin-server/MiaoYu.Repository.ChatAI.Admin/Entities/Apps/T_Products_Reward.cs new file mode 100644 index 0000000..caffbd0 --- /dev/null +++ b/admin-server/MiaoYu.Repository.ChatAI.Admin/Entities/Apps/T_Products_Reward.cs @@ -0,0 +1,41 @@ +namespace MiaoYu.Repository.ChatAI.Admin.Entities.Apps; + +/// +/// 产品表奖励 +/// +[EntityDescription(FieldIgnored = true)] +public class T_Products_Reward : DefaultEntityV4 +{ + + + /// + /// 奖励类型 => 备注: 奖励类型 + /// + public Int32 CurrencyType { get; set; } + + + /// + /// 送多少奖励 => 备注: 送多少奖励 + /// + public Int32 Money { get; set; } + + + /// + /// 所属商品 => 备注: 所属商品 + /// + public Int32 T_ProductId { get; set; } + + + /// + /// 首充送多少奖励 => 备注: 首充送多少奖励 + /// + public Int32? FirstChargeMoney { get; set; } + + + /// + /// 所属商品 => 备注: 所属商品 + /// + public string? ProductId { get; set; } + + +} \ No newline at end of file diff --git a/admin-server/MiaoYu.Repository.ChatAI.Admin/MiaoYu.Repository.ChatAI.Admin.xml b/admin-server/MiaoYu.Repository.ChatAI.Admin/MiaoYu.Repository.ChatAI.Admin.xml index 208740f..1db6f40 100644 --- a/admin-server/MiaoYu.Repository.ChatAI.Admin/MiaoYu.Repository.ChatAI.Admin.xml +++ b/admin-server/MiaoYu.Repository.ChatAI.Admin/MiaoYu.Repository.ChatAI.Admin.xml @@ -482,6 +482,106 @@ 其它的模板 + + + 商城表 + + + + + 道具Id => 备注: 道具Id + + + + + 道具名称 => 备注: 道具名称 + + + + + 道具类型 => 备注: 道具类型,0商城,1商店 + + + + + 道具描述 => 备注: 道具描述 + + + + + 价格 => 备注: 价格 + + + + + 道具图片 => 备注: 道具图片配置 图片id + + + + + 商品状态 => 备注: 商品是否下架 0否1是 + + + + + 首充 => 备注: 是否有首充 + + + + + 首充图片 => 备注: 首充图片 + + + + + 首充价格 => 备注: 首充价格 + + + + + 创建时间 => 备注: 创建时间 + + + + + 更新时间 => 备注: 更新时间 + + + + + 排序 => 备注: 排序 + + + + + 产品表奖励 + + + + + 奖励类型 => 备注: 奖励类型 + + + + + 送多少奖励 => 备注: 送多少奖励 + + + + + 所属商品 => 备注: 所属商品 + + + + + 首充送多少奖励 => 备注: 首充送多少奖励 + + + + + 所属商品 => 备注: 所属商品 + + 用户表