From fb9d5c60ae21c51735a10716828a3e32c725866c Mon Sep 17 00:00:00 2001 From: “wangming” <“wangming@antissoft.com”> Date: Thu, 16 Oct 2025 14:35:06 +0800 Subject: [PATCH] feat: 更新LqHytkHytk和LqMdxx服务,增强数据处理和接口功能 --- antis-ncc-admin/.env.development | 4 ++-- netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkInfoOutput.cs | 10 ++++++++++ netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkListOutput.cs | 5 +++++ netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkMx/LqHytkMxInfoOutput.cs | 3 ++- netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKdDeductinfo/LqKdDeductinfoCrInput.cs | 1 - netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxCrInput.cs | 66 ++++++++++++++++++++++++++++++++++++++---------------------------- netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxInfoOutput.cs | 65 +++++++++++++++++++++++++++++++++++++++++++---------------------- netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxListOutput.cs | 75 ++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_hytk_hytk/LqHytkHytkEntity.cs | 6 ++++++ netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_mdxx/LqMdxxEntity.cs | 6 ++++++ netcore/src/Modularity/Extend/NCC.Extend.Entitys/Enum/StoreCategoryEnum.cs | 28 ++++++++++++++++++++++++++++ netcore/src/Modularity/Extend/NCC.Extend/LqHytkHytkService.cs | 13 ++++++++----- netcore/src/Modularity/Extend/NCC.Extend/LqMdxxService.cs | 41 +++++++++++++++++++++++++++++++++++++++-- 13 files changed, 235 insertions(+), 88 deletions(-) create mode 100644 netcore/src/Modularity/Extend/NCC.Extend.Entitys/Enum/StoreCategoryEnum.cs diff --git a/antis-ncc-admin/.env.development b/antis-ncc-admin/.env.development index d2ff3fb..be31aec 100644 --- a/antis-ncc-admin/.env.development +++ b/antis-ncc-admin/.env.development @@ -1,7 +1,7 @@ # 开发 VUE_CLI_BABEL_TRANSPILE_MODULES = true -VUE_APP_BASE_API = 'http://lvqian.antissoft.com' +# VUE_APP_BASE_API = 'http://lvqian.antissoft.com' # VUE_APP_BASE_API = 'http://erp_test.lvqianmeiye.com' -# VUE_APP_BASE_API = 'http://localhost:2011' +VUE_APP_BASE_API = 'http://localhost:2011' VUE_APP_BASE_WSS = 'ws://192.168.110.45:2011/websocket' diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkInfoOutput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkInfoOutput.cs index 4b94cad..d6b4825 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkInfoOutput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkInfoOutput.cs @@ -97,6 +97,16 @@ namespace NCC.Extend.Entitys.Dto.LqHytkHytk public string signatureFile { get; set; } /// + /// 作废备注 + /// + public string cancelRemark { get; set; } + + /// + /// 是否有效 + /// + public int isEffective { get; set; } + + /// /// 退卡品项明细列表 /// public List lqHytkMxList { get; set; } diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkListOutput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkListOutput.cs index 1b31ffc..aa19208 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkListOutput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkHytk/LqHytkHytkListOutput.cs @@ -92,5 +92,10 @@ namespace NCC.Extend.Entitys.Dto.LqHytkHytk /// public int isEffective { get; set; } + /// + /// 作废备注 + /// + public string cancelRemark { get; set; } + } } diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkMx/LqHytkMxInfoOutput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkMx/LqHytkMxInfoOutput.cs index c4628e7..623329e 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkMx/LqHytkMxInfoOutput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqHytkMx/LqHytkMxInfoOutput.cs @@ -50,10 +50,11 @@ namespace NCC.Extend.Entitys.Dto.LqHytkMx /// public int projectNumber { get; set; } + /// /// 是否有效 /// - public int isEnabled { get; set; } + public int isEffective { get; set; } /// /// 来源类型(开卡/赠送/其他) diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKdDeductinfo/LqKdDeductinfoCrInput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKdDeductinfo/LqKdDeductinfoCrInput.cs index 61e1480..526e376 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKdDeductinfo/LqKdDeductinfoCrInput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKdDeductinfo/LqKdDeductinfoCrInput.cs @@ -34,7 +34,6 @@ namespace NCC.Extend.Entitys.Dto.LqKdDeductinfo /// 合计金额 /// [Required(ErrorMessage = "合计金额不能为空")] - [Range(0.01, 999999.99, ErrorMessage = "合计金额必须在0.01到999999.99之间")] public decimal? Amount { get; set; } /// diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxCrInput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxCrInput.cs index f3e2481..967b52b 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxCrInput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxCrInput.cs @@ -12,141 +12,151 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx /// 主键 /// public string id { get; set; } - + /// /// 门店编码 /// public string mdbm { get; set; } - + /// /// 单据门店编号 /// public string djmdbh { get; set; } - + /// /// 单据门店 /// public string djmd { get; set; } - + /// /// 店名 /// public string dm { get; set; } - + /// /// 城市 /// public string cs { get; set; } - + /// /// 地址 /// public string dz { get; set; } - + /// /// 姓名 /// public string xm { get; set; } - + /// /// 电话号码 /// public string dhhm { get; set; } - + /// /// 座机 /// public string zj { get; set; } - + /// /// 开业时间 /// public DateTime? kysj { get; set; } - + /// /// 最新状态 /// public string zxzt { get; set; } - + /// /// 工商名称 /// public string gsmc { get; set; } - + /// /// 法人 /// public string fr { get; set; } - + /// /// 有无社保 /// public string ywsb { get; set; } - + /// /// 事业部 /// public string syb { get; set; } - + /// /// 教育部 /// public string jyb { get; set; } - + /// /// 科技部 /// public string kjb { get; set; } - + /// /// 大项目部 /// public string dxmb { get; set; } - + /// /// 归属起始时间 /// public DateTime? gsqssj { get; set; } - + /// /// 归属终止时间 /// public DateTime? gszzsj { get; set; } - + /// /// 状态 /// public int? status { get; set; } - + /// /// 目标-门店生命线 /// public decimal? xsyj { get; set; } - + /// /// 目标-消耗业绩 /// public decimal? xhyj { get; set; } - + /// /// 目标-项目数 /// public int? xms { get; set; } - + /// /// 目标-人头1 /// public int? rt1 { get; set; } - + /// /// 目标-人头2 /// public int? rt2 { get; set; } - + /// /// 目标-人次 /// public int? rc { get; set; } - + + /// + /// 门店类别 + /// + public int? StoreCategory { get; set; } + + /// + /// 门店类型 + /// + public int? StoreType { get; set; } + } } diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxInfoOutput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxInfoOutput.cs index b33da10..1438b6c 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxInfoOutput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxInfoOutput.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using NCC.Code; +using NCC.Extend.Entitys.Enum; namespace NCC.Extend.Entitys.Dto.LqMdxx { @@ -12,111 +14,130 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx /// 主键 /// public string id { get; set; } - + /// /// 门店编码 /// public string mdbm { get; set; } - + /// /// 单据门店编号 /// public string djmdbh { get; set; } - + /// /// 单据门店 /// public string djmd { get; set; } - + /// /// 店名 /// public string dm { get; set; } - + /// /// 城市 /// public string cs { get; set; } - + /// /// 地址 /// public string dz { get; set; } - + /// /// 姓名 /// public string xm { get; set; } - + /// /// 电话号码 /// public string dhhm { get; set; } - + /// /// 座机 /// public string zj { get; set; } - + /// /// 开业时间 /// public DateTime? kysj { get; set; } - + /// /// 最新状态 /// public string zxzt { get; set; } - + /// /// 工商名称 /// public string gsmc { get; set; } - + /// /// 法人 /// public string fr { get; set; } - + /// /// 有无社保 /// public string ywsb { get; set; } - + /// /// 事业部 /// public string syb { get; set; } - + /// /// 教育部 /// public string jyb { get; set; } - + /// /// 科技部 /// public string kjb { get; set; } - + /// /// 大项目部 /// public string dxmb { get; set; } - + /// /// 归属起始时间 /// public DateTime? gsqssj { get; set; } - + /// /// 归属终止时间 /// public DateTime? gszzsj { get; set; } - + /// /// 状态 /// public int? status { get; set; } - + + /// + /// 门店类别 + /// + public int? StoreCategory { get; set; } + + /// + /// 门店类别名称 + /// + public string StoreCategoryName => StoreCategory.HasValue ? EnumHelper.GetEnumDesc(StoreCategory.Value) : string.Empty; + + /// + /// 门店类型 + /// + public int? StoreType { get; set; } + + /// + /// 门店类型名称 + /// + public string StoreTypeName => StoreType.HasValue ? EnumHelper.GetEnumDesc(StoreType.Value) : string.Empty; } } diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxListOutput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxListOutput.cs index cfe4bdd..64df5e5 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxListOutput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxListOutput.cs @@ -1,4 +1,6 @@ using System; +using NCC.Code; +using NCC.Extend.Entitys.Enum; namespace NCC.Extend.Entitys.Dto.LqMdxx { @@ -11,107 +13,107 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx /// 主键 /// public string id { get; set; } - + /// /// 门店编码 /// public string mdbm { get; set; } - + /// /// 单据门店编号 /// public string djmdbh { get; set; } - + /// /// 单据门店 /// public string djmd { get; set; } - + /// /// 店名 /// public string dm { get; set; } - + /// /// 城市 /// public string cs { get; set; } - + /// /// 地址 /// public string dz { get; set; } - + /// /// 姓名 /// public string xm { get; set; } - + /// /// 电话号码 /// public string dhhm { get; set; } - + /// /// 座机 /// public string zj { get; set; } - + /// /// 开业时间 /// public DateTime? kysj { get; set; } - + /// /// 最新状态 /// public string zxzt { get; set; } - + /// /// 工商名称 /// public string gsmc { get; set; } - + /// /// 法人 /// public string fr { get; set; } - + /// /// 有无社保 /// public string ywsb { get; set; } - + /// /// 事业部 /// public string syb { get; set; } - + /// /// 教育部 /// public string jyb { get; set; } - + /// /// 科技部 /// public string kjb { get; set; } - + /// /// 大项目部 /// public string dxmb { get; set; } - + /// /// 归属起始时间 /// public DateTime? gsqssj { get; set; } - + /// /// 归属终止时间 /// public DateTime? gszzsj { get; set; } - + /// /// 状态 /// @@ -121,31 +123,50 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx /// 目标-门店生命线 /// public decimal? xsyj { get; set; } - + /// /// 目标-消耗业绩 /// public decimal? xhyj { get; set; } - + /// /// 目标-项目数 /// public int? xms { get; set; } - + /// /// 目标-人头1 /// public int? rt1 { get; set; } - + /// /// 目标-人头2 /// public int? rt2 { get; set; } - + /// /// 目标-人次 /// public int? rc { get; set; } - + + /// + /// 门店类别 + /// + public int? StoreCategory { get; set; } + + /// + /// 门店类别名称 + /// + public string StoreCategoryName => StoreCategory.HasValue ? EnumHelper.GetEnumDesc(StoreCategory.Value) : string.Empty; + + /// + /// 门店类型 + /// + public int? StoreType { get; set; } + + /// + /// 门店类型名称 + /// + public string StoreTypeName => StoreType.HasValue ? EnumHelper.GetEnumDesc(StoreType.Value) : string.Empty; } } diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_hytk_hytk/LqHytkHytkEntity.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_hytk_hytk/LqHytkHytkEntity.cs index 327e6e5..6905bc1 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_hytk_hytk/LqHytkHytkEntity.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_hytk_hytk/LqHytkHytkEntity.cs @@ -143,5 +143,11 @@ namespace NCC.Extend.Entitys.lq_hytk_hytk /// [SugarColumn(ColumnName = "F_SignatureFile")] public string SignatureFile { get; set; } + + /// + /// 作废备注 + /// + [SugarColumn(ColumnName = "F_CancelRemark")] + public string CancelRemark { get; set; } } } \ No newline at end of file diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_mdxx/LqMdxxEntity.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_mdxx/LqMdxxEntity.cs index 5cc89e8..2555204 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_mdxx/LqMdxxEntity.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_mdxx/LqMdxxEntity.cs @@ -185,5 +185,11 @@ namespace NCC.Extend.Entitys.lq_mdxx [SugarColumn(ColumnName = "F_StoreType")] public int? StoreType { get; set; } + /// + /// 门店类别 + /// + [SugarColumn(ColumnName = "F_StoreCategory")] + public int? StoreCategory { get; set; } + } } \ No newline at end of file diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Enum/StoreCategoryEnum.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Enum/StoreCategoryEnum.cs new file mode 100644 index 0000000..4c1ba13 --- /dev/null +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Enum/StoreCategoryEnum.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; + +namespace NCC.Extend.Entitys.Enum +{ + /// + /// 门店分类枚举 + /// + public enum StoreCategoryEnum + { + /// + /// A类门店 + /// + [Description("A类门店")] + A类门店 = 1, + + /// + /// B类门店 + /// + [Description("B类门店")] + B类门店 = 2, + + /// + /// C类门店 + /// + [Description("C类门店")] + C类门店 = 3, + } +} diff --git a/netcore/src/Modularity/Extend/NCC.Extend/LqHytkHytkService.cs b/netcore/src/Modularity/Extend/NCC.Extend/LqHytkHytkService.cs index 7f74edb..b5e80d6 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend/LqHytkHytkService.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend/LqHytkHytkService.cs @@ -115,6 +115,7 @@ namespace NCC.Extend.LqHytkHytk czry = it.Czry, fileUrl = it.FileUrl, isEffective = it.IsEffective, + cancelRemark = it.CancelRemark, }) .MergeTable() .OrderBy(sidx + " " + input.sort) @@ -477,7 +478,7 @@ namespace NCC.Extend.LqHytkHytk /// 主键 /// [HttpPut("VoidRefundCardInfo/{id}")] - public async Task VoidRefundCardInfo(string id) + public async Task VoidRefundCardInfo(string id, [FromQuery] string remarks = null) { try { @@ -491,6 +492,7 @@ namespace NCC.Extend.LqHytkHytk // 更新主表 entity.IsEffective = StatusEnum.无效.GetHashCode(); entity.F_ModifyTime = DateTime.Now; + entity.CancelRemark = remarks; await _db.Updateable(entity).ExecuteCommandAsync(); // 更新明细表 await _db.Updateable().SetColumns(it => new LqHytkMxEntity { IsEffective = StatusEnum.无效.GetHashCode() }).Where(w => w.RefundInfoId == id).ExecuteCommandAsync(); @@ -600,10 +602,10 @@ namespace NCC.Extend.LqHytkHytk try { // 1. 查询主表信息 - var entity = await _db.Queryable().Where(p => p.Id == id && p.IsEffective == StatusEnum.有效.GetHashCode()).FirstAsync(); + var entity = await _db.Queryable().Where(p => p.Id == id).FirstAsync(); if (entity == null) { - throw NCCException.Oh(ErrorCode.COM1005, "退卡记录不存在或已作废"); + throw NCCException.Oh("退卡记录不存在"); } var output = entity.Adapt(); @@ -633,6 +635,7 @@ namespace NCC.Extend.LqHytkHytk projectNumber = mx.ProjectNumber, sourceType = mx.SourceType, totalPrice = mx.TotalPrice, + isEffective = mx.IsEffective, }; // 关联该品项的健康师业绩 @@ -655,9 +658,9 @@ namespace NCC.Extend.LqHytkHytk return output; } - catch (Exception) + catch (Exception ex) { - throw NCCException.Oh(ErrorCode.COM1000, "获取退卡记录失败"); + throw NCCException.Oh($"获取退卡记录详情失败: {ex.Message}"); } } #endregion diff --git a/netcore/src/Modularity/Extend/NCC.Extend/LqMdxxService.cs b/netcore/src/Modularity/Extend/NCC.Extend/LqMdxxService.cs index 56ee1c3..90a7359 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend/LqMdxxService.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend/LqMdxxService.cs @@ -22,6 +22,8 @@ using NCC.Common.Model.NPOI; using NCC.Common.Configuration; using NCC.DataEncryption; using NCC.ClayObject; +using NCC.Extend.Entitys.Enum; +using NCC.Code; namespace NCC.Extend.LqMdxx { @@ -118,6 +120,8 @@ namespace NCC.Extend.LqMdxx rt1 = it.Rt1, rt2 = it.Rt2, rc = it.Rc, + StoreCategory = it.StoreCategory, + StoreType = it.StoreType, }).MergeTable().OrderBy(sidx + " " + input.sort).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(data); } @@ -187,6 +191,8 @@ namespace NCC.Extend.LqMdxx gsmc = it.Gsmc, fr = it.Fr, ywsb = it.Ywsb, + StoreCategory = it.StoreCategory, + StoreType = it.StoreType, }).MergeTable().OrderBy(sidx + " " + input.sort).ToListAsync(); return data; } @@ -322,10 +328,13 @@ namespace NCC.Extend.LqMdxx [HttpDelete("{id}")] public async Task Delete(string id) { + var entity = await _db.Queryable().FirstAsync(p => p.Id == id); _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); - var isOk = await _db.Deleteable().Where(d => d.Id == id).ExecuteCommandAsync(); - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); + //直接修改status为0 + entity.Status = StatusEnum.删除.GetHashCode(); + var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); } #endregion @@ -343,5 +352,33 @@ namespace NCC.Extend.LqMdxx return new { list = list }; } #endregion + + #region 获取门店类别下拉选择数据 + /// + /// 获取门店类别下拉选择数据 + /// + /// + [HttpGet("Selector/StoreCategory")] + public async Task GetStoreCategorySelector() + { + //从Enum中获取门店类别 + var storeCategoryEnum = EnumExtensions.GetEnumDescDictionary(typeof(StoreCategoryEnum)); + return new { list = storeCategoryEnum }; + } + #endregion + + #region 获取门店类型下拉选择数据 + /// + /// 获取门店类型下拉选择数据 + /// + /// + [HttpGet("Selector/StoreType")] + public async Task GetStoreTypeSelector() + { + //从Enum中获取门店类型 + var storeTypeEnum = EnumExtensions.GetEnumDescDictionary(typeof(StoreTypeEnum)); + return new { list = storeTypeEnum }; + } + #endregion } } -- libgit2 0.21.4