Commit 00486d53c72825d0ce2da9542f9c7d167ce62fbc
1 parent
7188a8ff
更新多个.DS_Store文件,优化代码格式,确保代码整洁性。
Showing
15 changed files
with
785 additions
and
489 deletions
.DS_Store
No preview for this file type
netcore/src/.DS_Store
No preview for this file type
netcore/src/Application/.DS_Store
No preview for this file type
netcore/src/Application/NCC.API/.DS_Store
No preview for this file type
netcore/src/Modularity/.DS_Store
No preview for this file type
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_jlmxb/LqJlmxbEntity.cs
| @@ -16,96 +16,96 @@ namespace NCC.Extend.Entitys.lq_jlmxb | @@ -16,96 +16,96 @@ namespace NCC.Extend.Entitys.lq_jlmxb | ||
| 16 | /// </summary> | 16 | /// </summary> |
| 17 | [SugarColumn(ColumnName = "F_Id", IsPrimaryKey = true)] | 17 | [SugarColumn(ColumnName = "F_Id", IsPrimaryKey = true)] |
| 18 | public string Id { get; set; } | 18 | public string Id { get; set; } |
| 19 | - | 19 | + |
| 20 | /// <summary> | 20 | /// <summary> |
| 21 | /// 门店编号 | 21 | /// 门店编号 |
| 22 | /// </summary> | 22 | /// </summary> |
| 23 | - [SugarColumn(ColumnName = "mdbh")] | 23 | + [SugarColumn(ColumnName = "mdbh")] |
| 24 | public string Mdbh { get; set; } | 24 | public string Mdbh { get; set; } |
| 25 | - | 25 | + |
| 26 | /// <summary> | 26 | /// <summary> |
| 27 | /// 门店名称 | 27 | /// 门店名称 |
| 28 | /// </summary> | 28 | /// </summary> |
| 29 | - [SugarColumn(ColumnName = "mdmc")] | 29 | + [SugarColumn(ColumnName = "mdmc")] |
| 30 | public string Mdmc { get; set; } | 30 | public string Mdmc { get; set; } |
| 31 | - | 31 | + |
| 32 | /// <summary> | 32 | /// <summary> |
| 33 | /// 岗位 | 33 | /// 岗位 |
| 34 | /// </summary> | 34 | /// </summary> |
| 35 | - [SugarColumn(ColumnName = "gw")] | 35 | + [SugarColumn(ColumnName = "gw")] |
| 36 | public string Gw { get; set; } | 36 | public string Gw { get; set; } |
| 37 | - | 37 | + |
| 38 | /// <summary> | 38 | /// <summary> |
| 39 | /// 健康师 | 39 | /// 健康师 |
| 40 | /// </summary> | 40 | /// </summary> |
| 41 | - [SugarColumn(ColumnName = "jks")] | 41 | + [SugarColumn(ColumnName = "jks")] |
| 42 | public string Jks { get; set; } | 42 | public string Jks { get; set; } |
| 43 | - | 43 | + |
| 44 | /// <summary> | 44 | /// <summary> |
| 45 | /// 医美秒杀卡 | 45 | /// 医美秒杀卡 |
| 46 | /// </summary> | 46 | /// </summary> |
| 47 | - [SugarColumn(ColumnName = "ymmsk")] | 47 | + [SugarColumn(ColumnName = "ymmsk")] |
| 48 | public string Ymmsk { get; set; } | 48 | public string Ymmsk { get; set; } |
| 49 | - | 49 | + |
| 50 | /// <summary> | 50 | /// <summary> |
| 51 | /// 科技部秒杀卡 | 51 | /// 科技部秒杀卡 |
| 52 | /// </summary> | 52 | /// </summary> |
| 53 | - [SugarColumn(ColumnName = "kjbmsk")] | 53 | + [SugarColumn(ColumnName = "kjbmsk")] |
| 54 | public string Kjbmsk { get; set; } | 54 | public string Kjbmsk { get; set; } |
| 55 | - | 55 | + |
| 56 | /// <summary> | 56 | /// <summary> |
| 57 | /// 成交奖 | 57 | /// 成交奖 |
| 58 | /// </summary> | 58 | /// </summary> |
| 59 | - [SugarColumn(ColumnName = "cjj")] | 59 | + [SugarColumn(ColumnName = "cjj")] |
| 60 | public string Cjj { get; set; } | 60 | public string Cjj { get; set; } |
| 61 | - | 61 | + |
| 62 | /// <summary> | 62 | /// <summary> |
| 63 | /// PK | 63 | /// PK |
| 64 | /// </summary> | 64 | /// </summary> |
| 65 | - [SugarColumn(ColumnName = "pk")] | 65 | + [SugarColumn(ColumnName = "pk")] |
| 66 | public string Pk { get; set; } | 66 | public string Pk { get; set; } |
| 67 | - | 67 | + |
| 68 | /// <summary> | 68 | /// <summary> |
| 69 | /// 体验 | 69 | /// 体验 |
| 70 | /// </summary> | 70 | /// </summary> |
| 71 | - [SugarColumn(ColumnName = "ty")] | 71 | + [SugarColumn(ColumnName = "ty")] |
| 72 | public string Ty { get; set; } | 72 | public string Ty { get; set; } |
| 73 | - | 73 | + |
| 74 | /// <summary> | 74 | /// <summary> |
| 75 | /// 打版 | 75 | /// 打版 |
| 76 | /// </summary> | 76 | /// </summary> |
| 77 | - [SugarColumn(ColumnName = "db")] | 77 | + [SugarColumn(ColumnName = "db")] |
| 78 | public string Db { get; set; } | 78 | public string Db { get; set; } |
| 79 | - | 79 | + |
| 80 | /// <summary> | 80 | /// <summary> |
| 81 | /// 沉睡 | 81 | /// 沉睡 |
| 82 | /// </summary> | 82 | /// </summary> |
| 83 | - [SugarColumn(ColumnName = "cs")] | 83 | + [SugarColumn(ColumnName = "cs")] |
| 84 | public string Cs { get; set; } | 84 | public string Cs { get; set; } |
| 85 | - | 85 | + |
| 86 | /// <summary> | 86 | /// <summary> |
| 87 | /// 嘉宾 | 87 | /// 嘉宾 |
| 88 | /// </summary> | 88 | /// </summary> |
| 89 | - [SugarColumn(ColumnName = "jb")] | 89 | + [SugarColumn(ColumnName = "jb")] |
| 90 | public string Jb { get; set; } | 90 | public string Jb { get; set; } |
| 91 | - | 91 | + |
| 92 | /// <summary> | 92 | /// <summary> |
| 93 | /// 合计 | 93 | /// 合计 |
| 94 | /// </summary> | 94 | /// </summary> |
| 95 | - [SugarColumn(ColumnName = "hj")] | 95 | + [SugarColumn(ColumnName = "hj")] |
| 96 | public string Hj { get; set; } | 96 | public string Hj { get; set; } |
| 97 | - | 97 | + |
| 98 | /// <summary> | 98 | /// <summary> |
| 99 | /// 扣除明细 | 99 | /// 扣除明细 |
| 100 | /// </summary> | 100 | /// </summary> |
| 101 | - [SugarColumn(ColumnName = "kcmx")] | 101 | + [SugarColumn(ColumnName = "kcmx")] |
| 102 | public string Kcmx { get; set; } | 102 | public string Kcmx { get; set; } |
| 103 | - | 103 | + |
| 104 | /// <summary> | 104 | /// <summary> |
| 105 | /// 不含嘉宾 | 105 | /// 不含嘉宾 |
| 106 | /// </summary> | 106 | /// </summary> |
| 107 | - [SugarColumn(ColumnName = "bhjb")] | 107 | + [SugarColumn(ColumnName = "bhjb")] |
| 108 | public string Bhjb { get; set; } | 108 | public string Bhjb { get; set; } |
| 109 | - | 109 | + |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | \ No newline at end of file | 112 | \ No newline at end of file |
netcore/src/Modularity/Extend/NCC.Extend/LqCpxxService.cs
| @@ -28,7 +28,7 @@ namespace NCC.Extend.LqCpxx | @@ -28,7 +28,7 @@ namespace NCC.Extend.LqCpxx | ||
| 28 | /// <summary> | 28 | /// <summary> |
| 29 | /// 产品资料服务 | 29 | /// 产品资料服务 |
| 30 | /// </summary> | 30 | /// </summary> |
| 31 | - [ApiDescriptionSettings(Tag = "Extend",Name = "LqCpxx", Order = 200)] | 31 | + [ApiDescriptionSettings(Tag = "Extend", Name = "LqCpxx", Order = 200)] |
| 32 | [Route("api/Extend/[controller]")] | 32 | [Route("api/Extend/[controller]")] |
| 33 | public class LqCpxxService : ILqCpxxService, IDynamicApiController, ITransient | 33 | public class LqCpxxService : ILqCpxxService, IDynamicApiController, ITransient |
| 34 | { | 34 | { |
| @@ -43,7 +43,7 @@ namespace NCC.Extend.LqCpxx | @@ -43,7 +43,7 @@ namespace NCC.Extend.LqCpxx | ||
| 43 | ISqlSugarRepository<LqCpxxEntity> lqCpxxRepository, | 43 | ISqlSugarRepository<LqCpxxEntity> lqCpxxRepository, |
| 44 | IUserManager userManager) | 44 | IUserManager userManager) |
| 45 | { | 45 | { |
| 46 | - _lqCpxxRepository = lqCpxxRepository; | 46 | + _lqCpxxRepository = lqCpxxRepository; |
| 47 | _db = _lqCpxxRepository.Context; | 47 | _db = _lqCpxxRepository.Context; |
| 48 | _userManager = userManager; | 48 | _userManager = userManager; |
| 49 | } | 49 | } |
| @@ -93,24 +93,24 @@ namespace NCC.Extend.LqCpxx | @@ -93,24 +93,24 @@ namespace NCC.Extend.LqCpxx | ||
| 93 | .WhereIF(queryHtqdksrq != null, p => p.Htqdksrq <= new DateTime(endHtqdksrq.ToDate().Year, endHtqdksrq.ToDate().Month, endHtqdksrq.ToDate().Day, 23, 59, 59)) | 93 | .WhereIF(queryHtqdksrq != null, p => p.Htqdksrq <= new DateTime(endHtqdksrq.ToDate().Year, endHtqdksrq.ToDate().Month, endHtqdksrq.ToDate().Day, 23, 59, 59)) |
| 94 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq >= new DateTime(startHtqdjsrq.ToDate().Year, startHtqdjsrq.ToDate().Month, startHtqdjsrq.ToDate().Day, 0, 0, 0)) | 94 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq >= new DateTime(startHtqdjsrq.ToDate().Year, startHtqdjsrq.ToDate().Month, startHtqdjsrq.ToDate().Day, 0, 0, 0)) |
| 95 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq <= new DateTime(endHtqdjsrq.ToDate().Year, endHtqdjsrq.ToDate().Month, endHtqdjsrq.ToDate().Day, 23, 59, 59)) | 95 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq <= new DateTime(endHtqdjsrq.ToDate().Year, endHtqdjsrq.ToDate().Month, endHtqdjsrq.ToDate().Day, 23, 59, 59)) |
| 96 | - .Select(it=> new LqCpxxListOutput | 96 | + .Select(it => new LqCpxxListOutput |
| 97 | { | 97 | { |
| 98 | id = it.Id, | 98 | id = it.Id, |
| 99 | - cpmc=it.Cpmc, | ||
| 100 | - bzj=it.Bzj, | ||
| 101 | - sjzt=it.Sjzt, | ||
| 102 | - syzt=it.Syzt, | ||
| 103 | - tjfl=it.Tjfl, | ||
| 104 | - gsck=it.Gsck, | ||
| 105 | - gsbm=it.Gsbm, | ||
| 106 | - bzdw=it.Bzdw, | ||
| 107 | - dwhs=it.Dwhs, | ||
| 108 | - zbq=it.Zbq, | ||
| 109 | - gysxx=it.Gysxx, | ||
| 110 | - htqdksrq=it.Htqdksrq, | ||
| 111 | - htqdjsrq=it.Htqdjsrq, | ||
| 112 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 113 | - return PageResult<LqCpxxListOutput>.SqlSugarPageResult(data); | 99 | + cpmc = it.Cpmc, |
| 100 | + bzj = it.Bzj, | ||
| 101 | + sjzt = it.Sjzt, | ||
| 102 | + syzt = it.Syzt, | ||
| 103 | + tjfl = it.Tjfl, | ||
| 104 | + gsck = it.Gsck, | ||
| 105 | + gsbm = it.Gsbm, | ||
| 106 | + bzdw = it.Bzdw, | ||
| 107 | + dwhs = it.Dwhs, | ||
| 108 | + zbq = it.Zbq, | ||
| 109 | + gysxx = it.Gysxx, | ||
| 110 | + htqdksrq = it.Htqdksrq, | ||
| 111 | + htqdjsrq = it.Htqdjsrq, | ||
| 112 | + }).MergeTable().OrderBy(sidx + " " + input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 113 | + return PageResult<LqCpxxListOutput>.SqlSugarPageResult(data); | ||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | /// <summary> | 116 | /// <summary> |
| @@ -160,24 +160,24 @@ namespace NCC.Extend.LqCpxx | @@ -160,24 +160,24 @@ namespace NCC.Extend.LqCpxx | ||
| 160 | .WhereIF(queryHtqdksrq != null, p => p.Htqdksrq <= new DateTime(endHtqdksrq.ToDate().Year, endHtqdksrq.ToDate().Month, endHtqdksrq.ToDate().Day, 23, 59, 59)) | 160 | .WhereIF(queryHtqdksrq != null, p => p.Htqdksrq <= new DateTime(endHtqdksrq.ToDate().Year, endHtqdksrq.ToDate().Month, endHtqdksrq.ToDate().Day, 23, 59, 59)) |
| 161 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq >= new DateTime(startHtqdjsrq.ToDate().Year, startHtqdjsrq.ToDate().Month, startHtqdjsrq.ToDate().Day, 0, 0, 0)) | 161 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq >= new DateTime(startHtqdjsrq.ToDate().Year, startHtqdjsrq.ToDate().Month, startHtqdjsrq.ToDate().Day, 0, 0, 0)) |
| 162 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq <= new DateTime(endHtqdjsrq.ToDate().Year, endHtqdjsrq.ToDate().Month, endHtqdjsrq.ToDate().Day, 23, 59, 59)) | 162 | .WhereIF(queryHtqdjsrq != null, p => p.Htqdjsrq <= new DateTime(endHtqdjsrq.ToDate().Year, endHtqdjsrq.ToDate().Month, endHtqdjsrq.ToDate().Day, 23, 59, 59)) |
| 163 | - .Select(it=> new LqCpxxListOutput | 163 | + .Select(it => new LqCpxxListOutput |
| 164 | { | 164 | { |
| 165 | id = it.Id, | 165 | id = it.Id, |
| 166 | - cpmc=it.Cpmc, | ||
| 167 | - bzj=it.Bzj, | ||
| 168 | - sjzt=it.Sjzt, | ||
| 169 | - syzt=it.Syzt, | ||
| 170 | - tjfl=it.Tjfl, | ||
| 171 | - gsck=it.Gsck, | ||
| 172 | - gsbm=it.Gsbm, | ||
| 173 | - bzdw=it.Bzdw, | ||
| 174 | - dwhs=it.Dwhs, | ||
| 175 | - zbq=it.Zbq, | ||
| 176 | - gysxx=it.Gysxx, | ||
| 177 | - htqdksrq=it.Htqdksrq, | ||
| 178 | - htqdjsrq=it.Htqdjsrq, | ||
| 179 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | ||
| 180 | - return data; | 166 | + cpmc = it.Cpmc, |
| 167 | + bzj = it.Bzj, | ||
| 168 | + sjzt = it.Sjzt, | ||
| 169 | + syzt = it.Syzt, | ||
| 170 | + tjfl = it.Tjfl, | ||
| 171 | + gsck = it.Gsck, | ||
| 172 | + gsbm = it.Gsbm, | ||
| 173 | + bzdw = it.Bzdw, | ||
| 174 | + dwhs = it.Dwhs, | ||
| 175 | + zbq = it.Zbq, | ||
| 176 | + gysxx = it.Gysxx, | ||
| 177 | + htqdksrq = it.Htqdksrq, | ||
| 178 | + htqdjsrq = it.Htqdjsrq, | ||
| 179 | + }).MergeTable().OrderBy(sidx + " " + input.sort).ToListAsync(); | ||
| 180 | + return data; | ||
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | /// <summary> | 183 | /// <summary> |
| @@ -199,7 +199,7 @@ namespace NCC.Extend.LqCpxx | @@ -199,7 +199,7 @@ namespace NCC.Extend.LqCpxx | ||
| 199 | { | 199 | { |
| 200 | exportData = await this.GetNoPagingList(input); | 200 | exportData = await this.GetNoPagingList(input); |
| 201 | } | 201 | } |
| 202 | - List<ParamsModel> paramList = "[{\"value\":\"产品编号\",\"field\":\"id\"},{\"value\":\"产品名称\",\"field\":\"cpmc\"},{\"value\":\"标准价\",\"field\":\"bzj\"},{\"value\":\"上架状态\",\"field\":\"sjzt\"},{\"value\":\"使用状态\",\"field\":\"syzt\"},{\"value\":\"统计分类\",\"field\":\"tjfl\"},{\"value\":\"归属仓库\",\"field\":\"gsck\"},{\"value\":\"归属部门\",\"field\":\"gsbm\"},{\"value\":\"标准单位\",\"field\":\"bzdw\"},{\"value\":\"单位换算\",\"field\":\"dwhs\"},{\"value\":\"质保期\",\"field\":\"zbq\"},{\"value\":\"供应商信息\",\"field\":\"gysxx\"},{\"value\":\"合同签订日期\",\"field\":\"htqdksrq\"},{\"value\":\"合同结束日期\",\"field\":\"htqdjsrq\"},]".ToList<ParamsModel>(); | 202 | + List<ParamsModel> paramList = "[{\"value\":\"产品编号\",\"field\":\"id\"},{\"value\":\"产品名称\",\"field\":\"cpmc\"},{\"value\":\"标准价\",\"field\":\"bzj\"},{\"value\":\"上架状态\",\"field\":\"sjzt\"},{\"value\":\"使用状态\",\"field\":\"syzt\"},{\"value\":\"统计分类\",\"field\":\"tjfl\"},{\"value\":\"归属仓库\",\"field\":\"gsck\"},{\"value\":\"归属部门\",\"field\":\"gsbm\"},{\"value\":\"标准单位\",\"field\":\"bzdw\"},{\"value\":\"单位换算\",\"field\":\"dwhs\"},{\"value\":\"质保期\",\"field\":\"zbq\"},{\"value\":\"供应商信息\",\"field\":\"gysxx\"},{\"value\":\"合同签订日期\",\"field\":\"htqdksrq\"},{\"value\":\"合同结束日期\",\"field\":\"htqdjsrq\"},]".ToList<ParamsModel>(); |
| 203 | ExcelConfig excelconfig = new ExcelConfig(); | 203 | ExcelConfig excelconfig = new ExcelConfig(); |
| 204 | excelconfig.FileName = "产品资料.xls"; | 204 | excelconfig.FileName = "产品资料.xls"; |
| 205 | excelconfig.HeadFont = "微软雅黑"; | 205 | excelconfig.HeadFont = "微软雅黑"; |
| @@ -242,7 +242,7 @@ namespace NCC.Extend.LqCpxx | @@ -242,7 +242,7 @@ namespace NCC.Extend.LqCpxx | ||
| 242 | //开启事务 | 242 | //开启事务 |
| 243 | _db.BeginTran(); | 243 | _db.BeginTran(); |
| 244 | //批量删除产品资料 | 244 | //批量删除产品资料 |
| 245 | - await _db.Deleteable<LqCpxxEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | 245 | + await _db.Deleteable<LqCpxxEntity>().In(d => d.Id, ids).ExecuteCommandAsync(); |
| 246 | //关闭事务 | 246 | //关闭事务 |
| 247 | _db.CommitTran(); | 247 | _db.CommitTran(); |
| 248 | } | 248 | } |
netcore/src/Modularity/Extend/NCC.Extend/LqHytkHytkService.cs
| 1 | +using System; | ||
| 2 | +using System.Collections.Generic; | ||
| 3 | +using System.Linq; | ||
| 4 | +using System.Threading.Tasks; | ||
| 5 | +using Mapster; | ||
| 6 | +using Microsoft.AspNetCore.Mvc; | ||
| 7 | +using NCC.ClayObject; | ||
| 8 | +using NCC.Common.Configuration; | ||
| 1 | using NCC.Common.Core.Manager; | 9 | using NCC.Common.Core.Manager; |
| 2 | using NCC.Common.Enum; | 10 | using NCC.Common.Enum; |
| 3 | using NCC.Common.Extension; | 11 | using NCC.Common.Extension; |
| 4 | using NCC.Common.Filter; | 12 | using NCC.Common.Filter; |
| 13 | +using NCC.Common.Helper; | ||
| 14 | +using NCC.Common.Model.NPOI; | ||
| 15 | +using NCC.DataEncryption; | ||
| 5 | using NCC.Dependency; | 16 | using NCC.Dependency; |
| 6 | using NCC.DynamicApiController; | 17 | using NCC.DynamicApiController; |
| 7 | -using NCC.FriendlyException; | ||
| 8 | -using NCC.Extend.Interfaces.LqHytkHytk; | ||
| 9 | -using Mapster; | ||
| 10 | -using Microsoft.AspNetCore.Mvc; | ||
| 11 | -using SqlSugar; | ||
| 12 | -using System; | ||
| 13 | -using System.Collections.Generic; | ||
| 14 | -using System.Linq; | ||
| 15 | -using System.Threading.Tasks; | ||
| 16 | -using NCC.Extend.Entitys.lq_hytk_hytk; | ||
| 17 | -using NCC.Extend.Entitys.lq_hytk_mx; | ||
| 18 | -using NCC.Extend.Entitys.lq_hytk_jksyj; | ||
| 19 | -using NCC.Extend.Entitys.lq_hytk_kjbsyj; | ||
| 20 | using NCC.Extend.Entitys.Dto.LqHytkHytk; | 18 | using NCC.Extend.Entitys.Dto.LqHytkHytk; |
| 21 | -using NCC.Extend.Entitys.Dto.LqHytkMx; | ||
| 22 | using NCC.Extend.Entitys.Dto.LqHytkJksyj; | 19 | using NCC.Extend.Entitys.Dto.LqHytkJksyj; |
| 23 | using NCC.Extend.Entitys.Dto.LqHytkKjbsyj; | 20 | using NCC.Extend.Entitys.Dto.LqHytkKjbsyj; |
| 24 | -using Yitter.IdGenerator; | ||
| 25 | -using NCC.Common.Helper; | 21 | +using NCC.Extend.Entitys.Dto.LqHytkMx; |
| 22 | +using NCC.Extend.Entitys.lq_hytk_hytk; | ||
| 23 | +using NCC.Extend.Entitys.lq_hytk_jksyj; | ||
| 24 | +using NCC.Extend.Entitys.lq_hytk_kjbsyj; | ||
| 25 | +using NCC.Extend.Entitys.lq_hytk_mx; | ||
| 26 | +using NCC.Extend.Interfaces.LqHytkHytk; | ||
| 27 | +using NCC.FriendlyException; | ||
| 26 | using NCC.JsonSerialization; | 28 | using NCC.JsonSerialization; |
| 27 | -using NCC.Common.Model.NPOI; | ||
| 28 | -using NCC.Common.Configuration; | ||
| 29 | -using NCC.DataEncryption; | ||
| 30 | -using NCC.ClayObject; | 29 | +using SqlSugar; |
| 30 | +using Yitter.IdGenerator; | ||
| 31 | 31 | ||
| 32 | namespace NCC.Extend.LqHytkHytk | 32 | namespace NCC.Extend.LqHytkHytk |
| 33 | { | 33 | { |
| 34 | /// <summary> | 34 | /// <summary> |
| 35 | /// 退卡_信息表服务 | 35 | /// 退卡_信息表服务 |
| 36 | /// </summary> | 36 | /// </summary> |
| 37 | - [ApiDescriptionSettings(Tag = "绿纤退卡信息表服务",Name = "LqHytkHytk", Order = 200)] | 37 | + [ApiDescriptionSettings(Tag = "绿纤退卡信息表服务", Name = "LqHytkHytk", Order = 200)] |
| 38 | [Route("api/Extend/[controller]")] | 38 | [Route("api/Extend/[controller]")] |
| 39 | public class LqHytkHytkService : ILqHytkHytkService, IDynamicApiController, ITransient | 39 | public class LqHytkHytkService : ILqHytkHytkService, IDynamicApiController, ITransient |
| 40 | { | 40 | { |
| @@ -53,9 +53,10 @@ namespace NCC.Extend.LqHytkHytk | @@ -53,9 +53,10 @@ namespace NCC.Extend.LqHytkHytk | ||
| 53 | ISqlSugarRepository<LqHytkMxEntity> lqHytkMxRepository, | 53 | ISqlSugarRepository<LqHytkMxEntity> lqHytkMxRepository, |
| 54 | ISqlSugarRepository<LqHytkJksyjEntity> lqHytkJksyjRepository, | 54 | ISqlSugarRepository<LqHytkJksyjEntity> lqHytkJksyjRepository, |
| 55 | ISqlSugarRepository<LqHytkKjbsyjEntity> lqHytkKjbsyjRepository, | 55 | ISqlSugarRepository<LqHytkKjbsyjEntity> lqHytkKjbsyjRepository, |
| 56 | - IUserManager userManager) | 56 | + IUserManager userManager |
| 57 | + ) | ||
| 57 | { | 58 | { |
| 58 | - _lqHytkHytkRepository = lqHytkHytkRepository; | 59 | + _lqHytkHytkRepository = lqHytkHytkRepository; |
| 59 | _lqHytkMxRepository = lqHytkMxRepository; | 60 | _lqHytkMxRepository = lqHytkMxRepository; |
| 60 | _lqHytkJksyjRepository = lqHytkJksyjRepository; | 61 | _lqHytkJksyjRepository = lqHytkJksyjRepository; |
| 61 | _lqHytkKjbsyjRepository = lqHytkKjbsyjRepository; | 62 | _lqHytkKjbsyjRepository = lqHytkKjbsyjRepository; |
| @@ -67,12 +68,13 @@ namespace NCC.Extend.LqHytkHytk | @@ -67,12 +68,13 @@ namespace NCC.Extend.LqHytkHytk | ||
| 67 | /// 获取退卡信息列表 | 68 | /// 获取退卡信息列表 |
| 68 | /// </summary> | 69 | /// </summary> |
| 69 | /// <param name="input">查询参数</param> | 70 | /// <param name="input">查询参数</param> |
| 70 | - /// <returns></returns> | 71 | + /// <returns></returns> |
| 71 | [HttpGet("")] | 72 | [HttpGet("")] |
| 72 | public async Task<dynamic> GetList([FromQuery] LqHytkHytkListQueryInput input) | 73 | public async Task<dynamic> GetList([FromQuery] LqHytkHytkListQueryInput input) |
| 73 | { | 74 | { |
| 74 | var sidx = input.sidx == null ? "id" : input.sidx; | 75 | var sidx = input.sidx == null ? "id" : input.sidx; |
| 75 | - List<string> queryTksj = input.tksj != null ? input.tksj.Split(',').ToObeject<List<string>>() : null; | 76 | + List<string> queryTksj = |
| 77 | + input.tksj != null ? input.tksj.Split(',').ToObeject<List<string>>() : null; | ||
| 76 | DateTime? startTksj = queryTksj != null ? Ext.GetDateTime(queryTksj.First()) : null; | 78 | DateTime? startTksj = queryTksj != null ? Ext.GetDateTime(queryTksj.First()) : null; |
| 77 | DateTime? endTksj = queryTksj != null ? Ext.GetDateTime(queryTksj.Last()) : null; | 79 | DateTime? endTksj = queryTksj != null ? Ext.GetDateTime(queryTksj.Last()) : null; |
| 78 | var data = await _db.Queryable<LqHytkHytkEntity>() | 80 | var data = await _db.Queryable<LqHytkHytkEntity>() |
| @@ -89,30 +91,60 @@ namespace NCC.Extend.LqHytkHytk | @@ -89,30 +91,60 @@ namespace NCC.Extend.LqHytkHytk | ||
| 89 | .WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz)) | 91 | .WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz)) |
| 90 | .WhereIF(!string.IsNullOrEmpty(input.tkzt), p => p.Tkzt.Contains(input.tkzt)) | 92 | .WhereIF(!string.IsNullOrEmpty(input.tkzt), p => p.Tkzt.Contains(input.tkzt)) |
| 91 | .WhereIF(!string.IsNullOrEmpty(input.tkyy), p => p.Tkyy.Contains(input.tkyy)) | 93 | .WhereIF(!string.IsNullOrEmpty(input.tkyy), p => p.Tkyy.Contains(input.tkyy)) |
| 92 | - .WhereIF(!string.IsNullOrEmpty(input.fileUrl), p => p.FileUrl.Contains(input.fileUrl)) | ||
| 93 | - .WhereIF(queryTksj != null, p => p.Tksj >= new DateTime(startTksj.ToDate().Year, startTksj.ToDate().Month, startTksj.ToDate().Day, 0, 0, 0)) | ||
| 94 | - .WhereIF(queryTksj != null, p => p.Tksj <= new DateTime(endTksj.ToDate().Year, endTksj.ToDate().Month, endTksj.ToDate().Day, 23, 59, 59)) | 94 | + .WhereIF( |
| 95 | + !string.IsNullOrEmpty(input.fileUrl), | ||
| 96 | + p => p.FileUrl.Contains(input.fileUrl) | ||
| 97 | + ) | ||
| 98 | + .WhereIF( | ||
| 99 | + queryTksj != null, | ||
| 100 | + p => | ||
| 101 | + p.Tksj | ||
| 102 | + >= new DateTime( | ||
| 103 | + startTksj.ToDate().Year, | ||
| 104 | + startTksj.ToDate().Month, | ||
| 105 | + startTksj.ToDate().Day, | ||
| 106 | + 0, | ||
| 107 | + 0, | ||
| 108 | + 0 | ||
| 109 | + ) | ||
| 110 | + ) | ||
| 111 | + .WhereIF( | ||
| 112 | + queryTksj != null, | ||
| 113 | + p => | ||
| 114 | + p.Tksj | ||
| 115 | + <= new DateTime( | ||
| 116 | + endTksj.ToDate().Year, | ||
| 117 | + endTksj.ToDate().Month, | ||
| 118 | + endTksj.ToDate().Day, | ||
| 119 | + 23, | ||
| 120 | + 59, | ||
| 121 | + 59 | ||
| 122 | + ) | ||
| 123 | + ) | ||
| 95 | .WhereIF(!string.IsNullOrEmpty(input.czry), p => p.Czry.Equals(input.czry)) | 124 | .WhereIF(!string.IsNullOrEmpty(input.czry), p => p.Czry.Equals(input.czry)) |
| 96 | - .Select(it=> new LqHytkHytkListOutput | 125 | + .Select(it => new LqHytkHytkListOutput |
| 97 | { | 126 | { |
| 98 | id = it.Id, | 127 | id = it.Id, |
| 99 | - md=it.Md, | ||
| 100 | - mdbh=it.Mdbh, | ||
| 101 | - mdmc=it.Mdmc, | ||
| 102 | - hy=it.Hy, | ||
| 103 | - hymc=it.Hymc, | ||
| 104 | - hyzh=it.Hyzh, | ||
| 105 | - gklx=it.Gklx, | ||
| 106 | - tkje=it.Tkje, | ||
| 107 | - sgfy=it.Sgfy, | ||
| 108 | - bz=it.Bz, | ||
| 109 | - tkzt=it.Tkzt, | ||
| 110 | - tkyy=it.Tkyy, | ||
| 111 | - tksj=it.Tksj, | ||
| 112 | - czry=it.Czry, | ||
| 113 | - fileUrl=it.FileUrl, | ||
| 114 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 115 | - return PageResult<LqHytkHytkListOutput>.SqlSugarPageResult(data); | 128 | + md = it.Md, |
| 129 | + mdbh = it.Mdbh, | ||
| 130 | + mdmc = it.Mdmc, | ||
| 131 | + hy = it.Hy, | ||
| 132 | + hymc = it.Hymc, | ||
| 133 | + hyzh = it.Hyzh, | ||
| 134 | + gklx = it.Gklx, | ||
| 135 | + tkje = it.Tkje, | ||
| 136 | + sgfy = it.Sgfy, | ||
| 137 | + bz = it.Bz, | ||
| 138 | + tkzt = it.Tkzt, | ||
| 139 | + tkyy = it.Tkyy, | ||
| 140 | + tksj = it.Tksj, | ||
| 141 | + czry = it.Czry, | ||
| 142 | + fileUrl = it.FileUrl, | ||
| 143 | + }) | ||
| 144 | + .MergeTable() | ||
| 145 | + .OrderBy(sidx + " " + input.sort) | ||
| 146 | + .ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 147 | + return PageResult<LqHytkHytkListOutput>.SqlSugarPageResult(data); | ||
| 116 | } | 148 | } |
| 117 | 149 | ||
| 118 | /// <summary> | 150 | /// <summary> |
| @@ -120,7 +152,7 @@ namespace NCC.Extend.LqHytkHytk | @@ -120,7 +152,7 @@ namespace NCC.Extend.LqHytkHytk | ||
| 120 | /// </summary> | 152 | /// </summary> |
| 121 | /// <remarks> | 153 | /// <remarks> |
| 122 | /// 创建退卡记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 | 154 | /// 创建退卡记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 |
| 123 | - /// | 155 | + /// |
| 124 | /// 示例请求: | 156 | /// 示例请求: |
| 125 | /// ```json | 157 | /// ```json |
| 126 | /// { | 158 | /// { |
| @@ -172,7 +204,7 @@ namespace NCC.Extend.LqHytkHytk | @@ -172,7 +204,7 @@ namespace NCC.Extend.LqHytkHytk | ||
| 172 | /// ] | 204 | /// ] |
| 173 | /// } | 205 | /// } |
| 174 | /// ``` | 206 | /// ``` |
| 175 | - /// | 207 | + /// |
| 176 | /// 参数说明: | 208 | /// 参数说明: |
| 177 | /// - md: 门店ID | 209 | /// - md: 门店ID |
| 178 | /// - hy: 会员ID | 210 | /// - hy: 会员ID |
| @@ -192,22 +224,24 @@ namespace NCC.Extend.LqHytkHytk | @@ -192,22 +224,24 @@ namespace NCC.Extend.LqHytkHytk | ||
| 192 | entity.F_CreateTime = DateTime.Now; | 224 | entity.F_CreateTime = DateTime.Now; |
| 193 | entity.F_CreateUser = userInfo.userId; | 225 | entity.F_CreateUser = userInfo.userId; |
| 194 | entity.F_DeleteMark = 0; | 226 | entity.F_DeleteMark = 0; |
| 195 | - entity.Tksj = DateTime.Now; | 227 | + entity.Tksj = DateTime.Now; |
| 196 | entity.Czry = userInfo.userId; | 228 | entity.Czry = userInfo.userId; |
| 197 | - | 229 | + |
| 198 | try | 230 | try |
| 199 | { | 231 | { |
| 200 | // 开启事务 | 232 | // 开启事务 |
| 201 | _db.BeginTran(); | 233 | _db.BeginTran(); |
| 202 | - | 234 | + |
| 203 | // 新增退卡主表记录 | 235 | // 新增退卡主表记录 |
| 204 | - var newEntity = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteReturnEntityAsync(); | 236 | + var newEntity = await _db.Insertable(entity) |
| 237 | + .IgnoreColumns(ignoreNullColumn: true) | ||
| 238 | + .ExecuteReturnEntityAsync(); | ||
| 205 | 239 | ||
| 206 | // 收集所有需要插入的实体,然后批量插入 | 240 | // 收集所有需要插入的实体,然后批量插入 |
| 207 | var allMxEntities = new List<LqHytkMxEntity>(); | 241 | var allMxEntities = new List<LqHytkMxEntity>(); |
| 208 | var allJksyjEntities = new List<LqHytkJksyjEntity>(); | 242 | var allJksyjEntities = new List<LqHytkJksyjEntity>(); |
| 209 | var allKjbsyjEntities = new List<LqHytkKjbsyjEntity>(); | 243 | var allKjbsyjEntities = new List<LqHytkKjbsyjEntity>(); |
| 210 | - | 244 | + |
| 211 | // 处理品项明细列表 | 245 | // 处理品项明细列表 |
| 212 | if (input.lqHytkMxList != null && input.lqHytkMxList.Any()) | 246 | if (input.lqHytkMxList != null && input.lqHytkMxList.Any()) |
| 213 | { | 247 | { |
| @@ -228,79 +262,84 @@ namespace NCC.Extend.LqHytkHytk | @@ -228,79 +262,84 @@ namespace NCC.Extend.LqHytkHytk | ||
| 228 | F_ProjectNumber = item.F_ProjectNumber ?? 1, | 262 | F_ProjectNumber = item.F_ProjectNumber ?? 1, |
| 229 | F_IsEnabled = item.F_IsEnabled ?? 1, | 263 | F_IsEnabled = item.F_IsEnabled ?? 1, |
| 230 | F_SourceType = item.F_SourceType, | 264 | F_SourceType = item.F_SourceType, |
| 231 | - F_TotalPrice = item.F_TotalPrice ?? (item.pxjg * (item.F_ProjectNumber ?? 1)), | 265 | + F_TotalPrice = |
| 266 | + item.F_TotalPrice ?? (item.pxjg * (item.F_ProjectNumber ?? 1)), | ||
| 232 | }; | 267 | }; |
| 233 | allMxEntities.Add(lqHytkMxEntity); | 268 | allMxEntities.Add(lqHytkMxEntity); |
| 234 | - | 269 | + |
| 235 | // 收集该品项关联的健康师业绩 | 270 | // 收集该品项关联的健康师业绩 |
| 236 | if (item.lqHytkJksyjList != null && item.lqHytkJksyjList.Any()) | 271 | if (item.lqHytkJksyjList != null && item.lqHytkJksyjList.Any()) |
| 237 | { | 272 | { |
| 238 | foreach (var ijks_tem in item.lqHytkJksyjList) | 273 | foreach (var ijks_tem in item.lqHytkJksyjList) |
| 239 | { | 274 | { |
| 240 | - allJksyjEntities.Add(new LqHytkJksyjEntity | ||
| 241 | - { | ||
| 242 | - Id = YitIdHelper.NextId().ToString(), | ||
| 243 | - Gltkbh = newEntity.Id, | ||
| 244 | - Jks = ijks_tem.jks, | ||
| 245 | - Jksxm = ijks_tem.jksxm, | ||
| 246 | - Jkszh = ijks_tem.jkszh, | ||
| 247 | - Jksyj = ijks_tem.jksyj, | ||
| 248 | - Tksj = DateTime.Now, | ||
| 249 | - F_jsjid = ijks_tem.F_jsjid, | ||
| 250 | - F_tkpxid = ijks_tem.F_tkpxid, | ||
| 251 | - F_LaborCost = ijks_tem.F_LaborCost, | ||
| 252 | - F_tkpxNumber = ijks_tem.F_tkpxNumber, | ||
| 253 | - F_CreateTime = DateTime.Now, | ||
| 254 | - F_CreateUser = userInfo.userId, | ||
| 255 | - F_DeleteMark = 0, | ||
| 256 | - }); | 275 | + allJksyjEntities.Add( |
| 276 | + new LqHytkJksyjEntity | ||
| 277 | + { | ||
| 278 | + Id = YitIdHelper.NextId().ToString(), | ||
| 279 | + Gltkbh = newEntity.Id, | ||
| 280 | + Jks = ijks_tem.jks, | ||
| 281 | + Jksxm = ijks_tem.jksxm, | ||
| 282 | + Jkszh = ijks_tem.jkszh, | ||
| 283 | + Jksyj = ijks_tem.jksyj, | ||
| 284 | + Tksj = DateTime.Now, | ||
| 285 | + F_jsjid = ijks_tem.F_jsjid, | ||
| 286 | + F_tkpxid = ijks_tem.F_tkpxid, | ||
| 287 | + F_LaborCost = ijks_tem.F_LaborCost, | ||
| 288 | + F_tkpxNumber = ijks_tem.F_tkpxNumber, | ||
| 289 | + F_CreateTime = DateTime.Now, | ||
| 290 | + F_CreateUser = userInfo.userId, | ||
| 291 | + F_DeleteMark = 0, | ||
| 292 | + } | ||
| 293 | + ); | ||
| 257 | } | 294 | } |
| 258 | } | 295 | } |
| 259 | - | 296 | + |
| 260 | // 收集该品项关联的科技部老师业绩 | 297 | // 收集该品项关联的科技部老师业绩 |
| 261 | if (item.lqHytkKjbsyjList != null && item.lqHytkKjbsyjList.Any()) | 298 | if (item.lqHytkKjbsyjList != null && item.lqHytkKjbsyjList.Any()) |
| 262 | { | 299 | { |
| 263 | foreach (var ikjbs_tem in item.lqHytkKjbsyjList) | 300 | foreach (var ikjbs_tem in item.lqHytkKjbsyjList) |
| 264 | { | 301 | { |
| 265 | - allKjbsyjEntities.Add(new LqHytkKjbsyjEntity | ||
| 266 | - { | ||
| 267 | - Id = YitIdHelper.NextId().ToString(), | ||
| 268 | - Gltkbh = newEntity.Id, | ||
| 269 | - Kjbls = ikjbs_tem.kjbls, | ||
| 270 | - Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 271 | - Kjblszh = ikjbs_tem.kjblszh, | ||
| 272 | - Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 273 | - Tksj = DateTime.Now, | ||
| 274 | - F_tkpxid = ikjbs_tem.F_tkpxid, | ||
| 275 | - F_LaborCost = ikjbs_tem.F_LaborCost, | ||
| 276 | - F_tkpxNumber = ikjbs_tem.F_tkpxNumber, | ||
| 277 | - F_CreateTime = DateTime.Now, | ||
| 278 | - F_CreateUser = userInfo.userId, | ||
| 279 | - F_DeleteMark = 0, | ||
| 280 | - }); | 302 | + allKjbsyjEntities.Add( |
| 303 | + new LqHytkKjbsyjEntity | ||
| 304 | + { | ||
| 305 | + Id = YitIdHelper.NextId().ToString(), | ||
| 306 | + Gltkbh = newEntity.Id, | ||
| 307 | + Kjbls = ikjbs_tem.kjbls, | ||
| 308 | + Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 309 | + Kjblszh = ikjbs_tem.kjblszh, | ||
| 310 | + Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 311 | + Tksj = DateTime.Now, | ||
| 312 | + F_tkpxid = ikjbs_tem.F_tkpxid, | ||
| 313 | + F_LaborCost = ikjbs_tem.F_LaborCost, | ||
| 314 | + F_tkpxNumber = ikjbs_tem.F_tkpxNumber, | ||
| 315 | + F_CreateTime = DateTime.Now, | ||
| 316 | + F_CreateUser = userInfo.userId, | ||
| 317 | + F_DeleteMark = 0, | ||
| 318 | + } | ||
| 319 | + ); | ||
| 281 | } | 320 | } |
| 282 | } | 321 | } |
| 283 | } | 322 | } |
| 284 | } | 323 | } |
| 285 | - | 324 | + |
| 286 | // 批量插入品项明细 | 325 | // 批量插入品项明细 |
| 287 | if (allMxEntities.Any()) | 326 | if (allMxEntities.Any()) |
| 288 | { | 327 | { |
| 289 | await _db.Insertable(allMxEntities).ExecuteCommandAsync(); | 328 | await _db.Insertable(allMxEntities).ExecuteCommandAsync(); |
| 290 | } | 329 | } |
| 291 | - | 330 | + |
| 292 | // 批量插入健康师业绩 | 331 | // 批量插入健康师业绩 |
| 293 | if (allJksyjEntities.Any()) | 332 | if (allJksyjEntities.Any()) |
| 294 | { | 333 | { |
| 295 | await _db.Insertable(allJksyjEntities).ExecuteCommandAsync(); | 334 | await _db.Insertable(allJksyjEntities).ExecuteCommandAsync(); |
| 296 | } | 335 | } |
| 297 | - | 336 | + |
| 298 | // 批量插入科技部老师业绩 | 337 | // 批量插入科技部老师业绩 |
| 299 | if (allKjbsyjEntities.Any()) | 338 | if (allKjbsyjEntities.Any()) |
| 300 | { | 339 | { |
| 301 | await _db.Insertable(allKjbsyjEntities).ExecuteCommandAsync(); | 340 | await _db.Insertable(allKjbsyjEntities).ExecuteCommandAsync(); |
| 302 | } | 341 | } |
| 303 | - | 342 | + |
| 304 | // 关闭事务 | 343 | // 关闭事务 |
| 305 | _db.CommitTran(); | 344 | _db.CommitTran(); |
| 306 | } | 345 | } |
| @@ -332,25 +371,31 @@ namespace NCC.Extend.LqHytkHytk | @@ -332,25 +371,31 @@ namespace NCC.Extend.LqHytkHytk | ||
| 332 | entity.Id = id; | 371 | entity.Id = id; |
| 333 | entity.F_ModifyTime = DateTime.Now; | 372 | entity.F_ModifyTime = DateTime.Now; |
| 334 | entity.F_ModifyUser = userInfo.userId; | 373 | entity.F_ModifyUser = userInfo.userId; |
| 335 | - | 374 | + |
| 336 | try | 375 | try |
| 337 | { | 376 | { |
| 338 | // 开启事务 | 377 | // 开启事务 |
| 339 | _db.BeginTran(); | 378 | _db.BeginTran(); |
| 340 | - | 379 | + |
| 341 | // 更新退卡主表记录 | 380 | // 更新退卡主表记录 |
| 342 | await _db.Updateable(entity).IgnoreColumns(true).ExecuteCommandAsync(); | 381 | await _db.Updateable(entity).IgnoreColumns(true).ExecuteCommandAsync(); |
| 343 | - | 382 | + |
| 344 | // 删除原有的关联数据 | 383 | // 删除原有的关联数据 |
| 345 | - await _db.Deleteable<LqHytkMxEntity>().Where(x => x.Gltkbh == id).ExecuteCommandAsync(); | ||
| 346 | - await _db.Deleteable<LqHytkJksyjEntity>().Where(x => x.Gltkbh == id).ExecuteCommandAsync(); | ||
| 347 | - await _db.Deleteable<LqHytkKjbsyjEntity>().Where(x => x.Gltkbh == id).ExecuteCommandAsync(); | ||
| 348 | - | 384 | + await _db.Deleteable<LqHytkMxEntity>() |
| 385 | + .Where(x => x.Gltkbh == id) | ||
| 386 | + .ExecuteCommandAsync(); | ||
| 387 | + await _db.Deleteable<LqHytkJksyjEntity>() | ||
| 388 | + .Where(x => x.Gltkbh == id) | ||
| 389 | + .ExecuteCommandAsync(); | ||
| 390 | + await _db.Deleteable<LqHytkKjbsyjEntity>() | ||
| 391 | + .Where(x => x.Gltkbh == id) | ||
| 392 | + .ExecuteCommandAsync(); | ||
| 393 | + | ||
| 349 | // 收集所有需要插入的实体,然后批量插入 | 394 | // 收集所有需要插入的实体,然后批量插入 |
| 350 | var allMxEntities = new List<LqHytkMxEntity>(); | 395 | var allMxEntities = new List<LqHytkMxEntity>(); |
| 351 | var allJksyjEntities = new List<LqHytkJksyjEntity>(); | 396 | var allJksyjEntities = new List<LqHytkJksyjEntity>(); |
| 352 | var allKjbsyjEntities = new List<LqHytkKjbsyjEntity>(); | 397 | var allKjbsyjEntities = new List<LqHytkKjbsyjEntity>(); |
| 353 | - | 398 | + |
| 354 | // 处理品项明细列表 | 399 | // 处理品项明细列表 |
| 355 | if (input.lqHytkMxList != null && input.lqHytkMxList.Any()) | 400 | if (input.lqHytkMxList != null && input.lqHytkMxList.Any()) |
| 356 | { | 401 | { |
| @@ -371,79 +416,82 @@ namespace NCC.Extend.LqHytkHytk | @@ -371,79 +416,82 @@ namespace NCC.Extend.LqHytkHytk | ||
| 371 | F_ProjectNumber = item.F_ProjectNumber ?? 1, | 416 | F_ProjectNumber = item.F_ProjectNumber ?? 1, |
| 372 | F_IsEnabled = item.F_IsEnabled ?? 1, | 417 | F_IsEnabled = item.F_IsEnabled ?? 1, |
| 373 | F_SourceType = item.F_SourceType, | 418 | F_SourceType = item.F_SourceType, |
| 374 | - F_TotalPrice = item.F_TotalPrice ?? (item.pxjg * (item.F_ProjectNumber ?? 1)), | 419 | + F_TotalPrice = |
| 420 | + item.F_TotalPrice ?? (item.pxjg * (item.F_ProjectNumber ?? 1)), | ||
| 375 | }; | 421 | }; |
| 376 | allMxEntities.Add(lqHytkMxEntity); | 422 | allMxEntities.Add(lqHytkMxEntity); |
| 377 | - | 423 | + |
| 378 | // 收集该品项关联的健康师业绩 | 424 | // 收集该品项关联的健康师业绩 |
| 379 | if (item.lqHytkJksyjList != null && item.lqHytkJksyjList.Any()) | 425 | if (item.lqHytkJksyjList != null && item.lqHytkJksyjList.Any()) |
| 380 | { | 426 | { |
| 381 | foreach (var ijks_tem in item.lqHytkJksyjList) | 427 | foreach (var ijks_tem in item.lqHytkJksyjList) |
| 382 | { | 428 | { |
| 383 | - allJksyjEntities.Add(new LqHytkJksyjEntity | ||
| 384 | - { | ||
| 385 | - Id = YitIdHelper.NextId().ToString(), | ||
| 386 | - Gltkbh = id, | ||
| 387 | - Jks = ijks_tem.jks, | ||
| 388 | - Jksxm = ijks_tem.jksxm, | ||
| 389 | - Jkszh = ijks_tem.jkszh, | ||
| 390 | - Jksyj = ijks_tem.jksyj, | ||
| 391 | - Tksj = DateTime.Now, | ||
| 392 | - F_jsjid = ijks_tem.F_jsjid, | ||
| 393 | - F_tkpxid = ijks_tem.F_tkpxid, | ||
| 394 | - F_LaborCost = ijks_tem.F_LaborCost, | ||
| 395 | - F_tkpxNumber = ijks_tem.F_tkpxNumber, | ||
| 396 | - F_CreateTime = DateTime.Now, | ||
| 397 | - F_CreateUser = userInfo.userId, | ||
| 398 | - F_DeleteMark = 0, | ||
| 399 | - }); | 429 | + allJksyjEntities.Add( |
| 430 | + new LqHytkJksyjEntity | ||
| 431 | + { | ||
| 432 | + Id = YitIdHelper.NextId().ToString(), | ||
| 433 | + Gltkbh = id, | ||
| 434 | + Jks = ijks_tem.jks, | ||
| 435 | + Jksxm = ijks_tem.jksxm, | ||
| 436 | + Jkszh = ijks_tem.jkszh, | ||
| 437 | + Jksyj = ijks_tem.jksyj, | ||
| 438 | + Tksj = DateTime.Now, | ||
| 439 | + F_jsjid = ijks_tem.F_jsjid, | ||
| 440 | + F_tkpxid = ijks_tem.F_tkpxid, | ||
| 441 | + F_LaborCost = ijks_tem.F_LaborCost, | ||
| 442 | + F_tkpxNumber = ijks_tem.F_tkpxNumber, | ||
| 443 | + F_CreateTime = DateTime.Now, | ||
| 444 | + F_CreateUser = userInfo.userId, | ||
| 445 | + F_DeleteMark = 0, | ||
| 446 | + } | ||
| 447 | + ); | ||
| 400 | } | 448 | } |
| 401 | } | 449 | } |
| 402 | - | 450 | + |
| 403 | // 收集该品项关联的科技部老师业绩 | 451 | // 收集该品项关联的科技部老师业绩 |
| 404 | if (item.lqHytkKjbsyjList != null && item.lqHytkKjbsyjList.Any()) | 452 | if (item.lqHytkKjbsyjList != null && item.lqHytkKjbsyjList.Any()) |
| 405 | { | 453 | { |
| 406 | foreach (var ikjbs_tem in item.lqHytkKjbsyjList) | 454 | foreach (var ikjbs_tem in item.lqHytkKjbsyjList) |
| 407 | { | 455 | { |
| 408 | - allKjbsyjEntities.Add(new LqHytkKjbsyjEntity | ||
| 409 | - { | ||
| 410 | - Id = YitIdHelper.NextId().ToString(), | ||
| 411 | - Gltkbh = id, | ||
| 412 | - Kjbls = ikjbs_tem.kjbls, | ||
| 413 | - Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 414 | - Kjblszh = ikjbs_tem.kjblszh, | ||
| 415 | - Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 416 | - Tksj = DateTime.Now, | ||
| 417 | - F_tkpxid = ikjbs_tem.F_tkpxid, | ||
| 418 | - F_LaborCost = ikjbs_tem.F_LaborCost, | ||
| 419 | - F_tkpxNumber = ikjbs_tem.F_tkpxNumber, | ||
| 420 | - F_CreateTime = DateTime.Now, | ||
| 421 | - F_CreateUser = userInfo.userId, | ||
| 422 | - F_DeleteMark = 0, | ||
| 423 | - }); | 456 | + allKjbsyjEntities.Add( |
| 457 | + new LqHytkKjbsyjEntity | ||
| 458 | + { | ||
| 459 | + Id = YitIdHelper.NextId().ToString(), | ||
| 460 | + Gltkbh = id, | ||
| 461 | + Kjbls = ikjbs_tem.kjbls, | ||
| 462 | + Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 463 | + Kjblszh = ikjbs_tem.kjblszh, | ||
| 464 | + Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 465 | + Tksj = DateTime.Now, | ||
| 466 | + F_tkpxid = ikjbs_tem.F_tkpxid, | ||
| 467 | + F_LaborCost = ikjbs_tem.F_LaborCost, | ||
| 468 | + F_tkpxNumber = ikjbs_tem.F_tkpxNumber, | ||
| 469 | + F_CreateTime = DateTime.Now, | ||
| 470 | + F_CreateUser = userInfo.userId, | ||
| 471 | + F_DeleteMark = 0, | ||
| 472 | + } | ||
| 473 | + ); | ||
| 424 | } | 474 | } |
| 425 | } | 475 | } |
| 426 | } | 476 | } |
| 427 | } | 477 | } |
| 428 | - | 478 | + |
| 429 | // 批量插入品项明细 | 479 | // 批量插入品项明细 |
| 430 | if (allMxEntities.Any()) | 480 | if (allMxEntities.Any()) |
| 431 | { | 481 | { |
| 432 | await _db.Insertable(allMxEntities).ExecuteCommandAsync(); | 482 | await _db.Insertable(allMxEntities).ExecuteCommandAsync(); |
| 433 | } | 483 | } |
| 434 | - | 484 | + |
| 435 | // 批量插入健康师业绩 | 485 | // 批量插入健康师业绩 |
| 436 | if (allJksyjEntities.Any()) | 486 | if (allJksyjEntities.Any()) |
| 437 | { | 487 | { |
| 438 | await _db.Insertable(allJksyjEntities).ExecuteCommandAsync(); | 488 | await _db.Insertable(allJksyjEntities).ExecuteCommandAsync(); |
| 439 | } | 489 | } |
| 440 | - | ||
| 441 | // 批量插入科技部老师业绩 | 490 | // 批量插入科技部老师业绩 |
| 442 | if (allKjbsyjEntities.Any()) | 491 | if (allKjbsyjEntities.Any()) |
| 443 | { | 492 | { |
| 444 | await _db.Insertable(allKjbsyjEntities).ExecuteCommandAsync(); | 493 | await _db.Insertable(allKjbsyjEntities).ExecuteCommandAsync(); |
| 445 | } | 494 | } |
| 446 | - | ||
| 447 | // 关闭事务 | 495 | // 关闭事务 |
| 448 | _db.CommitTran(); | 496 | _db.CommitTran(); |
| 449 | } | 497 | } |
| @@ -476,7 +524,7 @@ namespace NCC.Extend.LqHytkHytk | @@ -476,7 +524,7 @@ namespace NCC.Extend.LqHytkHytk | ||
| 476 | /// <remarks> | 524 | /// <remarks> |
| 477 | /// 获取退卡记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 | 525 | /// 获取退卡记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 |
| 478 | /// 按照退卡的完整格式返回数据,不包含汇总信息 | 526 | /// 按照退卡的完整格式返回数据,不包含汇总信息 |
| 479 | - /// | 527 | + /// |
| 480 | /// 返回数据结构: | 528 | /// 返回数据结构: |
| 481 | /// - 主表信息:退卡基础信息、门店信息、会员信息、退卡金额等 | 529 | /// - 主表信息:退卡基础信息、门店信息、会员信息、退卡金额等 |
| 482 | /// - 品项明细列表:每个品项包含完整的项目信息(项目次数、是否有效、来源类型等) | 530 | /// - 品项明细列表:每个品项包含完整的项目信息(项目次数、是否有效、来源类型等) |
| @@ -532,7 +580,7 @@ namespace NCC.Extend.LqHytkHytk | @@ -532,7 +580,7 @@ namespace NCC.Extend.LqHytkHytk | ||
| 532 | F_ProjectNumber = mx.F_ProjectNumber, | 580 | F_ProjectNumber = mx.F_ProjectNumber, |
| 533 | F_IsEnabled = mx.F_IsEnabled, | 581 | F_IsEnabled = mx.F_IsEnabled, |
| 534 | F_SourceType = mx.F_SourceType, | 582 | F_SourceType = mx.F_SourceType, |
| 535 | - F_TotalPrice = mx.F_TotalPrice | 583 | + F_TotalPrice = mx.F_TotalPrice, |
| 536 | }; | 584 | }; |
| 537 | 585 | ||
| 538 | // 关联该品项的健康师业绩 | 586 | // 关联该品项的健康师业绩 |
netcore/src/Modularity/Extend/NCC.Extend/LqJlmxbService.cs
| @@ -165,7 +165,7 @@ namespace NCC.Extend.LqJlmxb | @@ -165,7 +165,7 @@ namespace NCC.Extend.LqJlmxb | ||
| 165 | db=it.Db, | 165 | db=it.Db, |
| 166 | cs=it.Cs, | 166 | cs=it.Cs, |
| 167 | jb=it.Jb, | 167 | jb=it.Jb, |
| 168 | - hj=it.Hj, | 168 | + hj = it.Hj, |
| 169 | kcmx=it.Kcmx, | 169 | kcmx=it.Kcmx, |
| 170 | bhjb=it.Bhjb, | 170 | bhjb=it.Bhjb, |
| 171 | }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | 171 | }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); |
netcore/src/Modularity/Extend/NCC.Extend/LqKdKdjlbService.cs
| 1 | -using NCC.Common.Core.Manager; | 1 | +using System; |
| 2 | +using System.Collections.Generic; | ||
| 3 | +using System.Linq; | ||
| 4 | +using System.Net.Http; | ||
| 5 | +using System.Threading.Tasks; | ||
| 6 | +using Mapster; | ||
| 7 | +using Microsoft.AspNetCore.Mvc; | ||
| 8 | +using NCC.ClayObject; | ||
| 9 | +using NCC.Common.Configuration; | ||
| 10 | +using NCC.Common.Core.Manager; | ||
| 2 | using NCC.Common.Enum; | 11 | using NCC.Common.Enum; |
| 3 | using NCC.Common.Extension; | 12 | using NCC.Common.Extension; |
| 4 | using NCC.Common.Filter; | 13 | using NCC.Common.Filter; |
| 14 | +using NCC.Common.Helper; | ||
| 15 | +using NCC.Common.Model.NPOI; | ||
| 16 | +using NCC.DataEncryption; | ||
| 5 | using NCC.Dependency; | 17 | using NCC.Dependency; |
| 6 | using NCC.DynamicApiController; | 18 | using NCC.DynamicApiController; |
| 7 | -using NCC.FriendlyException; | ||
| 8 | -using NCC.Extend.Interfaces.LqKdKdjlb; | ||
| 9 | -using Mapster; | ||
| 10 | -using Microsoft.AspNetCore.Mvc; | ||
| 11 | -using SqlSugar; | ||
| 12 | -using System; | ||
| 13 | -using System.Collections.Generic; | ||
| 14 | -using System.Linq; | ||
| 15 | -using System.Threading.Tasks; | ||
| 16 | -using NCC.Extend.Entitys.lq_kd_kdjlb; | 19 | +using NCC.Extend.Entitys.Dto.LqKdKdjlb; |
| 20 | +using NCC.Extend.Entitys.lq_jinsanjiao_user; | ||
| 17 | using NCC.Extend.Entitys.lq_kd_jksyj; | 21 | using NCC.Extend.Entitys.lq_kd_jksyj; |
| 22 | +using NCC.Extend.Entitys.lq_kd_kdjlb; | ||
| 18 | using NCC.Extend.Entitys.lq_kd_kjbsyj; | 23 | using NCC.Extend.Entitys.lq_kd_kjbsyj; |
| 19 | using NCC.Extend.Entitys.lq_kd_pxmx; | 24 | using NCC.Extend.Entitys.lq_kd_pxmx; |
| 20 | -using NCC.Extend.Entitys.Dto.LqKdKdjlb; | ||
| 21 | -using Yitter.IdGenerator; | ||
| 22 | -using NCC.Common.Helper; | ||
| 23 | -using NCC.JsonSerialization; | ||
| 24 | -using NCC.Common.Model.NPOI; | ||
| 25 | -using NCC.Common.Configuration; | ||
| 26 | -using NCC.DataEncryption; | ||
| 27 | -using NCC.ClayObject; | 25 | +using NCC.Extend.Entitys.lq_xmzl; |
| 26 | +using NCC.Extend.Interfaces.LqKdKdjlb; | ||
| 28 | using NCC.Extend.Utils; | 27 | using NCC.Extend.Utils; |
| 29 | -using System.Net.Http; | ||
| 30 | -using NCC.Extend.Entitys.lq_jinsanjiao_user; | 28 | +using NCC.FriendlyException; |
| 29 | +using NCC.JsonSerialization; | ||
| 31 | using NCC.System.Entitys.Permission; | 30 | using NCC.System.Entitys.Permission; |
| 32 | -using NCC.Extend.Entitys.lq_xmzl; | 31 | +using SqlSugar; |
| 32 | +using Yitter.IdGenerator; | ||
| 33 | 33 | ||
| 34 | namespace NCC.Extend.LqKdKdjlb | 34 | namespace NCC.Extend.LqKdKdjlb |
| 35 | { | 35 | { |
| @@ -59,7 +59,8 @@ namespace NCC.Extend.LqKdKdjlb | @@ -59,7 +59,8 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 59 | ISqlSugarRepository<LqKdPxmxEntity> lqKdPxmxRepository, | 59 | ISqlSugarRepository<LqKdPxmxEntity> lqKdPxmxRepository, |
| 60 | IUserManager userManager, | 60 | IUserManager userManager, |
| 61 | WeChatBotService weChatBotService, | 61 | WeChatBotService weChatBotService, |
| 62 | - LqKdKdjlbStringGenerator stringGenerator) | 62 | + LqKdKdjlbStringGenerator stringGenerator |
| 63 | + ) | ||
| 63 | { | 64 | { |
| 64 | _lqKdKdjlbRepository = lqKdKdjlbRepository; | 65 | _lqKdKdjlbRepository = lqKdKdjlbRepository; |
| 65 | _db = _lqKdKdjlbRepository.Context; | 66 | _db = _lqKdKdjlbRepository.Context; |
| @@ -70,6 +71,7 @@ namespace NCC.Extend.LqKdKdjlb | @@ -70,6 +71,7 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 70 | _weChatBotService = weChatBotService; | 71 | _weChatBotService = weChatBotService; |
| 71 | _stringGenerator = stringGenerator; | 72 | _stringGenerator = stringGenerator; |
| 72 | } | 73 | } |
| 74 | + | ||
| 73 | #region 获取开单记录表 | 75 | #region 获取开单记录表 |
| 74 | /// <summary> | 76 | /// <summary> |
| 75 | /// 获取开单记录表 | 77 | /// 获取开单记录表 |
| @@ -77,7 +79,7 @@ namespace NCC.Extend.LqKdKdjlb | @@ -77,7 +79,7 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 77 | /// <remarks> | 79 | /// <remarks> |
| 78 | /// 获取开单记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 | 80 | /// 获取开单记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 |
| 79 | /// 按照开单的完整格式返回数据,不包含汇总信息 | 81 | /// 按照开单的完整格式返回数据,不包含汇总信息 |
| 80 | - /// | 82 | + /// |
| 81 | /// 返回数据结构: | 83 | /// 返回数据结构: |
| 82 | /// - 主表信息:开单基础信息、业绩信息、支付信息、会员信息等 | 84 | /// - 主表信息:开单基础信息、业绩信息、支付信息、会员信息等 |
| 83 | /// - 品项明细列表:每个品项包含完整的项目信息(项目次数、是否有效、来源类型等) | 85 | /// - 品项明细列表:每个品项包含完整的项目信息(项目次数、是否有效、来源类型等) |
| @@ -134,7 +136,7 @@ namespace NCC.Extend.LqKdKdjlb | @@ -134,7 +136,7 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 134 | sourceType = pxmx.SourceType, | 136 | sourceType = pxmx.SourceType, |
| 135 | memberId = pxmx.MemberId, | 137 | memberId = pxmx.MemberId, |
| 136 | createTime = pxmx.CreateTIme, | 138 | createTime = pxmx.CreateTIme, |
| 137 | - totalPrice = pxmx.TotalPrice | 139 | + totalPrice = pxmx.TotalPrice, |
| 138 | }; | 140 | }; |
| 139 | 141 | ||
| 140 | // 关联该品项的健康师业绩 | 142 | // 关联该品项的健康师业绩 |
| @@ -166,24 +168,50 @@ namespace NCC.Extend.LqKdKdjlb | @@ -166,24 +168,50 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 166 | #endregion | 168 | #endregion |
| 167 | 169 | ||
| 168 | #region 获取开单记录表列表 | 170 | #region 获取开单记录表列表 |
| 171 | + | ||
| 169 | /// <summary> | 172 | /// <summary> |
| 170 | - /// 获取开单记录表列表 | ||
| 171 | - /// </summary> | ||
| 172 | - /// <param name="input">请求参数</param> | ||
| 173 | - /// <returns></returns> | 173 | + /// 获取开单记录表列表 |
| 174 | + /// </summary> | ||
| 175 | + /// <param name="input">请求参数</param> | ||
| 176 | + /// <returns></returns> | ||
| 174 | [HttpGet("")] | 177 | [HttpGet("")] |
| 175 | public async Task<dynamic> GetList([FromQuery] LqKdKdjlbListQueryInput input) | 178 | public async Task<dynamic> GetList([FromQuery] LqKdKdjlbListQueryInput input) |
| 176 | { | 179 | { |
| 177 | var sidx = input.sidx == null ? "id" : input.sidx; | 180 | var sidx = input.sidx == null ? "id" : input.sidx; |
| 178 | - List<string> queryKdrq = input.kdrq != null ? input.kdrq.Split(',').ToObeject<List<string>>() : null; | 181 | + List<string> queryKdrq = |
| 182 | + input.kdrq != null ? input.kdrq.Split(',').ToObeject<List<string>>() : null; | ||
| 179 | DateTime? startKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.First()) : null; | 183 | DateTime? startKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.First()) : null; |
| 180 | DateTime? endKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.Last()) : null; | 184 | DateTime? endKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.Last()) : null; |
| 181 | var data = await _db.Queryable<LqKdKdjlbEntity>() | 185 | var data = await _db.Queryable<LqKdKdjlbEntity>() |
| 182 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | 186 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) |
| 183 | .WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Equals(input.djmd)) | 187 | .WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Equals(input.djmd)) |
| 184 | .WhereIF(!string.IsNullOrEmpty(input.jsj), p => p.Jsj.Equals(input.jsj)) | 188 | .WhereIF(!string.IsNullOrEmpty(input.jsj), p => p.Jsj.Equals(input.jsj)) |
| 185 | - .WhereIF(queryKdrq != null, p => p.Kdrq >= new DateTime(startKdrq.ToDate().Year, startKdrq.ToDate().Month, startKdrq.ToDate().Day, 0, 0, 0)) | ||
| 186 | - .WhereIF(queryKdrq != null, p => p.Kdrq <= new DateTime(endKdrq.ToDate().Year, endKdrq.ToDate().Month, endKdrq.ToDate().Day, 23, 59, 59)) | 189 | + .WhereIF( |
| 190 | + queryKdrq != null, | ||
| 191 | + p => | ||
| 192 | + p.Kdrq | ||
| 193 | + >= new DateTime( | ||
| 194 | + startKdrq.ToDate().Year, | ||
| 195 | + startKdrq.ToDate().Month, | ||
| 196 | + startKdrq.ToDate().Day, | ||
| 197 | + 0, | ||
| 198 | + 0, | ||
| 199 | + 0 | ||
| 200 | + ) | ||
| 201 | + ) | ||
| 202 | + .WhereIF( | ||
| 203 | + queryKdrq != null, | ||
| 204 | + p => | ||
| 205 | + p.Kdrq | ||
| 206 | + <= new DateTime( | ||
| 207 | + endKdrq.ToDate().Year, | ||
| 208 | + endKdrq.ToDate().Month, | ||
| 209 | + endKdrq.ToDate().Day, | ||
| 210 | + 23, | ||
| 211 | + 59, | ||
| 212 | + 59 | ||
| 213 | + ) | ||
| 214 | + ) | ||
| 187 | .WhereIF(!string.IsNullOrEmpty(input.gjlx), p => p.Gjlx.Equals(input.gjlx)) | 215 | .WhereIF(!string.IsNullOrEmpty(input.gjlx), p => p.Gjlx.Equals(input.gjlx)) |
| 188 | .WhereIF(!string.IsNullOrEmpty(input.hgjg), p => p.Hgjg.Equals(input.hgjg)) | 216 | .WhereIF(!string.IsNullOrEmpty(input.hgjg), p => p.Hgjg.Equals(input.hgjg)) |
| 189 | .WhereIF(!string.IsNullOrEmpty(input.zdyj), p => p.Zdyj.Equals(input.zdyj)) | 217 | .WhereIF(!string.IsNullOrEmpty(input.zdyj), p => p.Zdyj.Equals(input.zdyj)) |
| @@ -201,11 +229,20 @@ namespace NCC.Extend.LqKdKdjlb | @@ -201,11 +229,20 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 201 | .WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz)) | 229 | .WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz)) |
| 202 | .WhereIF(!string.IsNullOrEmpty(input.kdhy), p => p.Kdhy.Equals(input.kdhy)) | 230 | .WhereIF(!string.IsNullOrEmpty(input.kdhy), p => p.Kdhy.Equals(input.kdhy)) |
| 203 | .WhereIF(!string.IsNullOrEmpty(input.kdhyc), p => p.Kdhyc.Contains(input.kdhyc)) | 231 | .WhereIF(!string.IsNullOrEmpty(input.kdhyc), p => p.Kdhyc.Contains(input.kdhyc)) |
| 204 | - .WhereIF(!string.IsNullOrEmpty(input.kdhysjh), p => p.Kdhysjh.Contains(input.kdhysjh)) | 232 | + .WhereIF( |
| 233 | + !string.IsNullOrEmpty(input.kdhysjh), | ||
| 234 | + p => p.Kdhysjh.Contains(input.kdhysjh) | ||
| 235 | + ) | ||
| 205 | .WhereIF(!string.IsNullOrEmpty(input.jksyj), p => p.Jksyj.Contains(input.jksyj)) | 236 | .WhereIF(!string.IsNullOrEmpty(input.jksyj), p => p.Jksyj.Contains(input.jksyj)) |
| 206 | - .WhereIF(!string.IsNullOrEmpty(input.kjblsyj), p => p.Kjblsyj.Contains(input.kjblsyj)) | 237 | + .WhereIF( |
| 238 | + !string.IsNullOrEmpty(input.kjblsyj), | ||
| 239 | + p => p.Kjblsyj.Contains(input.kjblsyj) | ||
| 240 | + ) | ||
| 207 | .WhereIF(!string.IsNullOrEmpty(input.pxxx), p => p.Pxxx.Contains(input.pxxx)) | 241 | .WhereIF(!string.IsNullOrEmpty(input.pxxx), p => p.Pxxx.Contains(input.pxxx)) |
| 208 | - .WhereIF(!string.IsNullOrEmpty(input.F_FIleUrl), p => p.F_FIleUrl.Contains(input.F_FIleUrl)) | 242 | + .WhereIF( |
| 243 | + !string.IsNullOrEmpty(input.F_FIleUrl), | ||
| 244 | + p => p.F_FIleUrl.Contains(input.F_FIleUrl) | ||
| 245 | + ) | ||
| 209 | .Select(it => new LqKdKdjlbListOutput | 246 | .Select(it => new LqKdKdjlbListOutput |
| 210 | { | 247 | { |
| 211 | id = it.Id, | 248 | id = it.Id, |
| @@ -234,7 +271,10 @@ namespace NCC.Extend.LqKdKdjlb | @@ -234,7 +271,10 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 234 | kjblsyj = it.Kjblsyj, | 271 | kjblsyj = it.Kjblsyj, |
| 235 | pxxx = it.Pxxx, | 272 | pxxx = it.Pxxx, |
| 236 | F_FIleUrl = it.F_FIleUrl, | 273 | F_FIleUrl = it.F_FIleUrl, |
| 237 | - }).MergeTable().OrderBy(sidx + " " + input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | 274 | + }) |
| 275 | + .MergeTable() | ||
| 276 | + .OrderBy(sidx + " " + input.sort) | ||
| 277 | + .ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 238 | return PageResult<LqKdKdjlbListOutput>.SqlSugarPageResult(data); | 278 | return PageResult<LqKdKdjlbListOutput>.SqlSugarPageResult(data); |
| 239 | } | 279 | } |
| 240 | #endregion | 280 | #endregion |
| @@ -257,7 +297,9 @@ namespace NCC.Extend.LqKdKdjlb | @@ -257,7 +297,9 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 257 | _db.BeginTran(); | 297 | _db.BeginTran(); |
| 258 | //新增开单记录表记录 | 298 | //新增开单记录表记录 |
| 259 | entity.CreateUser = userInfo.userId; | 299 | entity.CreateUser = userInfo.userId; |
| 260 | - var newEntity = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteReturnEntityAsync(); | 300 | + var newEntity = await _db.Insertable(entity) |
| 301 | + .IgnoreColumns(ignoreNullColumn: true) | ||
| 302 | + .ExecuteReturnEntityAsync(); | ||
| 261 | //循环品相信息 | 303 | //循环品相信息 |
| 262 | // 收集所有需要插入的实体,然后批量插入 | 304 | // 收集所有需要插入的实体,然后批量插入 |
| 263 | var allPxmxEntities = new List<LqKdPxmxEntity>(); | 305 | var allPxmxEntities = new List<LqKdPxmxEntity>(); |
| @@ -283,43 +325,47 @@ namespace NCC.Extend.LqKdKdjlb | @@ -283,43 +325,47 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 283 | SourceType = item.sourceType, | 325 | SourceType = item.sourceType, |
| 284 | }; | 326 | }; |
| 285 | allPxmxEntities.Add(lqKdPxmxEntity); | 327 | allPxmxEntities.Add(lqKdPxmxEntity); |
| 286 | - | 328 | + |
| 287 | // 收集该品项关联的健康师业绩 | 329 | // 收集该品项关联的健康师业绩 |
| 288 | if (item.lqKdJksyjList != null && item.lqKdJksyjList.Any()) | 330 | if (item.lqKdJksyjList != null && item.lqKdJksyjList.Any()) |
| 289 | { | 331 | { |
| 290 | foreach (var ijks_tem in item.lqKdJksyjList) | 332 | foreach (var ijks_tem in item.lqKdJksyjList) |
| 291 | { | 333 | { |
| 292 | - allJksyjEntities.Add(new LqKdJksyjEntity | ||
| 293 | - { | ||
| 294 | - Id = YitIdHelper.NextId().ToString(), | ||
| 295 | - Glkdbh = newEntity.Id, | ||
| 296 | - Jks = ijks_tem.jks, | ||
| 297 | - Jksxm = ijks_tem.jksxm, | ||
| 298 | - Jkszh = ijks_tem.jkszh, | ||
| 299 | - Jksyj = ijks_tem.jksyj, | ||
| 300 | - Yjsj = DateTime.Now, | ||
| 301 | - Jsj_id = ijks_tem.jsj_id, | ||
| 302 | - Kdpxid = lqKdPxmxEntity.Id, | ||
| 303 | - }); | 334 | + allJksyjEntities.Add( |
| 335 | + new LqKdJksyjEntity | ||
| 336 | + { | ||
| 337 | + Id = YitIdHelper.NextId().ToString(), | ||
| 338 | + Glkdbh = newEntity.Id, | ||
| 339 | + Jks = ijks_tem.jks, | ||
| 340 | + Jksxm = ijks_tem.jksxm, | ||
| 341 | + Jkszh = ijks_tem.jkszh, | ||
| 342 | + Jksyj = ijks_tem.jksyj, | ||
| 343 | + Yjsj = DateTime.Now, | ||
| 344 | + Jsj_id = ijks_tem.jsj_id, | ||
| 345 | + Kdpxid = lqKdPxmxEntity.Id, | ||
| 346 | + } | ||
| 347 | + ); | ||
| 304 | } | 348 | } |
| 305 | } | 349 | } |
| 306 | - | 350 | + |
| 307 | // 收集该品项关联的科技部老师业绩 | 351 | // 收集该品项关联的科技部老师业绩 |
| 308 | if (item.lqKdKjbsyjList != null && item.lqKdKjbsyjList.Any()) | 352 | if (item.lqKdKjbsyjList != null && item.lqKdKjbsyjList.Any()) |
| 309 | { | 353 | { |
| 310 | foreach (var ikjbs_tem in item.lqKdKjbsyjList) | 354 | foreach (var ikjbs_tem in item.lqKdKjbsyjList) |
| 311 | { | 355 | { |
| 312 | - allKjbsyjEntities.Add(new LqKdKjbsyjEntity | ||
| 313 | - { | ||
| 314 | - Id = YitIdHelper.NextId().ToString(), | ||
| 315 | - Glkdbh = newEntity.Id, | ||
| 316 | - Kjbls = ikjbs_tem.kjbls, | ||
| 317 | - Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 318 | - Kjblszh = ikjbs_tem.kjblszh, | ||
| 319 | - Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 320 | - Yjsj = DateTime.Now, | ||
| 321 | - Kdpxid = lqKdPxmxEntity.Id, | ||
| 322 | - }); | 356 | + allKjbsyjEntities.Add( |
| 357 | + new LqKdKjbsyjEntity | ||
| 358 | + { | ||
| 359 | + Id = YitIdHelper.NextId().ToString(), | ||
| 360 | + Glkdbh = newEntity.Id, | ||
| 361 | + Kjbls = ikjbs_tem.kjbls, | ||
| 362 | + Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 363 | + Kjblszh = ikjbs_tem.kjblszh, | ||
| 364 | + Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 365 | + Yjsj = DateTime.Now, | ||
| 366 | + Kdpxid = lqKdPxmxEntity.Id, | ||
| 367 | + } | ||
| 368 | + ); | ||
| 323 | } | 369 | } |
| 324 | } | 370 | } |
| 325 | } | 371 | } |
| @@ -348,14 +394,18 @@ namespace NCC.Extend.LqKdKdjlb | @@ -348,14 +394,18 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 348 | var entityInfo = await GetInfo(newEntity.Id); | 394 | var entityInfo = await GetInfo(newEntity.Id); |
| 349 | if (entityInfo != null) | 395 | if (entityInfo != null) |
| 350 | { | 396 | { |
| 351 | - var orderRecordString = _stringGenerator.GenerateOrderRecordString(entityInfo); | 397 | + var orderRecordString = _stringGenerator.GenerateOrderRecordString( |
| 398 | + entityInfo | ||
| 399 | + ); | ||
| 352 | Console.WriteLine("开单记录字符串生成成功:"); | 400 | Console.WriteLine("开单记录字符串生成成功:"); |
| 353 | Console.WriteLine(orderRecordString); | 401 | Console.WriteLine(orderRecordString); |
| 354 | 402 | ||
| 355 | // 发送到企业微信群 | 403 | // 发送到企业微信群 |
| 356 | try | 404 | try |
| 357 | { | 405 | { |
| 358 | - var sendResult = await _weChatBotService.SendOrderRecordMessage(orderRecordString); | 406 | + var sendResult = await _weChatBotService.SendOrderRecordMessage( |
| 407 | + orderRecordString | ||
| 408 | + ); | ||
| 359 | if (sendResult) | 409 | if (sendResult) |
| 360 | { | 410 | { |
| 361 | Console.WriteLine("开单记录已成功发送到企业微信群"); | 411 | Console.WriteLine("开单记录已成功发送到企业微信群"); |
| @@ -390,23 +440,48 @@ namespace NCC.Extend.LqKdKdjlb | @@ -390,23 +440,48 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 390 | 440 | ||
| 391 | #region 获取开单记录表无分页列表 | 441 | #region 获取开单记录表无分页列表 |
| 392 | /// <summary> | 442 | /// <summary> |
| 393 | - /// 获取开单记录表无分页列表 | ||
| 394 | - /// </summary> | ||
| 395 | - /// <param name="input">请求参数</param> | ||
| 396 | - /// <returns></returns> | 443 | + /// 获取开单记录表无分页列表 |
| 444 | + /// </summary> | ||
| 445 | + /// <param name="input">请求参数</param> | ||
| 446 | + /// <returns></returns> | ||
| 397 | [NonAction] | 447 | [NonAction] |
| 398 | public async Task<dynamic> GetNoPagingList([FromQuery] LqKdKdjlbListQueryInput input) | 448 | public async Task<dynamic> GetNoPagingList([FromQuery] LqKdKdjlbListQueryInput input) |
| 399 | { | 449 | { |
| 400 | var sidx = input.sidx == null ? "id" : input.sidx; | 450 | var sidx = input.sidx == null ? "id" : input.sidx; |
| 401 | - List<string> queryKdrq = input.kdrq != null ? input.kdrq.Split(',').ToObeject<List<string>>() : null; | 451 | + List<string> queryKdrq = |
| 452 | + input.kdrq != null ? input.kdrq.Split(',').ToObeject<List<string>>() : null; | ||
| 402 | DateTime? startKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.First()) : null; | 453 | DateTime? startKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.First()) : null; |
| 403 | DateTime? endKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.Last()) : null; | 454 | DateTime? endKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.Last()) : null; |
| 404 | var data = await _db.Queryable<LqKdKdjlbEntity>() | 455 | var data = await _db.Queryable<LqKdKdjlbEntity>() |
| 405 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | 456 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) |
| 406 | .WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Equals(input.djmd)) | 457 | .WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Equals(input.djmd)) |
| 407 | .WhereIF(!string.IsNullOrEmpty(input.jsj), p => p.Jsj.Equals(input.jsj)) | 458 | .WhereIF(!string.IsNullOrEmpty(input.jsj), p => p.Jsj.Equals(input.jsj)) |
| 408 | - .WhereIF(queryKdrq != null, p => p.Kdrq >= new DateTime(startKdrq.ToDate().Year, startKdrq.ToDate().Month, startKdrq.ToDate().Day, 0, 0, 0)) | ||
| 409 | - .WhereIF(queryKdrq != null, p => p.Kdrq <= new DateTime(endKdrq.ToDate().Year, endKdrq.ToDate().Month, endKdrq.ToDate().Day, 23, 59, 59)) | 459 | + .WhereIF( |
| 460 | + queryKdrq != null, | ||
| 461 | + p => | ||
| 462 | + p.Kdrq | ||
| 463 | + >= new DateTime( | ||
| 464 | + startKdrq.ToDate().Year, | ||
| 465 | + startKdrq.ToDate().Month, | ||
| 466 | + startKdrq.ToDate().Day, | ||
| 467 | + 0, | ||
| 468 | + 0, | ||
| 469 | + 0 | ||
| 470 | + ) | ||
| 471 | + ) | ||
| 472 | + .WhereIF( | ||
| 473 | + queryKdrq != null, | ||
| 474 | + p => | ||
| 475 | + p.Kdrq | ||
| 476 | + <= new DateTime( | ||
| 477 | + endKdrq.ToDate().Year, | ||
| 478 | + endKdrq.ToDate().Month, | ||
| 479 | + endKdrq.ToDate().Day, | ||
| 480 | + 23, | ||
| 481 | + 59, | ||
| 482 | + 59 | ||
| 483 | + ) | ||
| 484 | + ) | ||
| 410 | .WhereIF(!string.IsNullOrEmpty(input.gjlx), p => p.Gjlx.Equals(input.gjlx)) | 485 | .WhereIF(!string.IsNullOrEmpty(input.gjlx), p => p.Gjlx.Equals(input.gjlx)) |
| 411 | .WhereIF(!string.IsNullOrEmpty(input.hgjg), p => p.Hgjg.Equals(input.hgjg)) | 486 | .WhereIF(!string.IsNullOrEmpty(input.hgjg), p => p.Hgjg.Equals(input.hgjg)) |
| 412 | .WhereIF(!string.IsNullOrEmpty(input.zdyj), p => p.Zdyj.Equals(input.zdyj)) | 487 | .WhereIF(!string.IsNullOrEmpty(input.zdyj), p => p.Zdyj.Equals(input.zdyj)) |
| @@ -424,11 +499,20 @@ namespace NCC.Extend.LqKdKdjlb | @@ -424,11 +499,20 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 424 | .WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz)) | 499 | .WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz)) |
| 425 | .WhereIF(!string.IsNullOrEmpty(input.kdhy), p => p.Kdhy.Equals(input.kdhy)) | 500 | .WhereIF(!string.IsNullOrEmpty(input.kdhy), p => p.Kdhy.Equals(input.kdhy)) |
| 426 | .WhereIF(!string.IsNullOrEmpty(input.kdhyc), p => p.Kdhyc.Contains(input.kdhyc)) | 501 | .WhereIF(!string.IsNullOrEmpty(input.kdhyc), p => p.Kdhyc.Contains(input.kdhyc)) |
| 427 | - .WhereIF(!string.IsNullOrEmpty(input.kdhysjh), p => p.Kdhysjh.Contains(input.kdhysjh)) | 502 | + .WhereIF( |
| 503 | + !string.IsNullOrEmpty(input.kdhysjh), | ||
| 504 | + p => p.Kdhysjh.Contains(input.kdhysjh) | ||
| 505 | + ) | ||
| 428 | .WhereIF(!string.IsNullOrEmpty(input.jksyj), p => p.Jksyj.Contains(input.jksyj)) | 506 | .WhereIF(!string.IsNullOrEmpty(input.jksyj), p => p.Jksyj.Contains(input.jksyj)) |
| 429 | - .WhereIF(!string.IsNullOrEmpty(input.kjblsyj), p => p.Kjblsyj.Contains(input.kjblsyj)) | 507 | + .WhereIF( |
| 508 | + !string.IsNullOrEmpty(input.kjblsyj), | ||
| 509 | + p => p.Kjblsyj.Contains(input.kjblsyj) | ||
| 510 | + ) | ||
| 430 | .WhereIF(!string.IsNullOrEmpty(input.pxxx), p => p.Pxxx.Contains(input.pxxx)) | 511 | .WhereIF(!string.IsNullOrEmpty(input.pxxx), p => p.Pxxx.Contains(input.pxxx)) |
| 431 | - .WhereIF(!string.IsNullOrEmpty(input.F_FIleUrl), p => p.F_FIleUrl.Contains(input.F_FIleUrl)) | 512 | + .WhereIF( |
| 513 | + !string.IsNullOrEmpty(input.F_FIleUrl), | ||
| 514 | + p => p.F_FIleUrl.Contains(input.F_FIleUrl) | ||
| 515 | + ) | ||
| 432 | .Select(it => new LqKdKdjlbListOutput | 516 | .Select(it => new LqKdKdjlbListOutput |
| 433 | { | 517 | { |
| 434 | id = it.Id, | 518 | id = it.Id, |
| @@ -457,17 +541,20 @@ namespace NCC.Extend.LqKdKdjlb | @@ -457,17 +541,20 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 457 | kjblsyj = it.Kjblsyj, | 541 | kjblsyj = it.Kjblsyj, |
| 458 | pxxx = it.Pxxx, | 542 | pxxx = it.Pxxx, |
| 459 | F_FIleUrl = it.F_FIleUrl, | 543 | F_FIleUrl = it.F_FIleUrl, |
| 460 | - }).MergeTable().OrderBy(sidx + " " + input.sort).ToListAsync(); | 544 | + }) |
| 545 | + .MergeTable() | ||
| 546 | + .OrderBy(sidx + " " + input.sort) | ||
| 547 | + .ToListAsync(); | ||
| 461 | return data; | 548 | return data; |
| 462 | } | 549 | } |
| 463 | #endregion | 550 | #endregion |
| 464 | 551 | ||
| 465 | #region 导出开单记录表 | 552 | #region 导出开单记录表 |
| 466 | /// <summary> | 553 | /// <summary> |
| 467 | - /// 导出开单记录表 | ||
| 468 | - /// </summary> | ||
| 469 | - /// <param name="input">请求参数</param> | ||
| 470 | - /// <returns></returns> | 554 | + /// 导出开单记录表 |
| 555 | + /// </summary> | ||
| 556 | + /// <param name="input">请求参数</param> | ||
| 557 | + /// <returns></returns> | ||
| 471 | [HttpGet("Actions/Export")] | 558 | [HttpGet("Actions/Export")] |
| 472 | public async Task<dynamic> Export([FromQuery] LqKdKdjlbListQueryInput input) | 559 | public async Task<dynamic> Export([FromQuery] LqKdKdjlbListQueryInput input) |
| 473 | { | 560 | { |
| @@ -482,7 +569,8 @@ namespace NCC.Extend.LqKdKdjlb | @@ -482,7 +569,8 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 482 | { | 569 | { |
| 483 | exportData = await this.GetNoPagingList(input); | 570 | exportData = await this.GetNoPagingList(input); |
| 484 | } | 571 | } |
| 485 | - List<ParamsModel> paramList = "[{\"value\":\"开单编号\",\"field\":\"id\"},{\"value\":\"开单会员\",\"field\":\"kdhy\"},{\"value\":\"开单会员名称\",\"field\":\"kdhyc\"},{\"value\":\"会员手机号\",\"field\":\"kdhysjh\"},{\"value\":\"单据门店\",\"field\":\"djmd\"},{\"value\":\"金三角\",\"field\":\"jsj\"},{\"value\":\"开单日期\",\"field\":\"kdrq\"},{\"value\":\"顾客类型\",\"field\":\"gjlx\"},{\"value\":\"合作机构\",\"field\":\"hgjg\"},{\"value\":\"整单业绩\",\"field\":\"zdyj\"},{\"value\":\"实付业绩\",\"field\":\"sfyj\"},{\"value\":\"欠款\",\"field\":\"qk\"},{\"value\":\"储扣方式\",\"field\":\"ckfs\"},{\"value\":\"储扣明细\",\"field\":\"ckmx\"},{\"value\":\"付款方式\",\"field\":\"fkfs\"},{\"value\":\"付款医院\",\"field\":\"fkyy\"},{\"value\":\"付款判断\",\"field\":\"fkpd\"},{\"value\":\"客户来源\",\"field\":\"khly\"},{\"value\":\"推荐人\",\"field\":\"tjr\"},{\"value\":\"是否首开订单\",\"field\":\"sfskdd\"},{\"value\":\"简介\",\"field\":\"jj\"},{\"value\":\"备注\",\"field\":\"bz\"},{\"value\":\"健康师业绩\",\"field\":\"jksyj\"},{\"value\":\"科技部老师业绩\",\"field\":\"kjblsyj\"},{\"value\":\"品项信息\",\"field\":\"pxxx\"},{\"value\":\"方案其他\",\"field\":\"F_FIleUrl\"},]".ToList<ParamsModel>(); | 572 | + List<ParamsModel> paramList = |
| 573 | + "[{\"value\":\"开单编号\",\"field\":\"id\"},{\"value\":\"开单会员\",\"field\":\"kdhy\"},{\"value\":\"开单会员名称\",\"field\":\"kdhyc\"},{\"value\":\"会员手机号\",\"field\":\"kdhysjh\"},{\"value\":\"单据门店\",\"field\":\"djmd\"},{\"value\":\"金三角\",\"field\":\"jsj\"},{\"value\":\"开单日期\",\"field\":\"kdrq\"},{\"value\":\"顾客类型\",\"field\":\"gjlx\"},{\"value\":\"合作机构\",\"field\":\"hgjg\"},{\"value\":\"整单业绩\",\"field\":\"zdyj\"},{\"value\":\"实付业绩\",\"field\":\"sfyj\"},{\"value\":\"欠款\",\"field\":\"qk\"},{\"value\":\"储扣方式\",\"field\":\"ckfs\"},{\"value\":\"储扣明细\",\"field\":\"ckmx\"},{\"value\":\"付款方式\",\"field\":\"fkfs\"},{\"value\":\"付款医院\",\"field\":\"fkyy\"},{\"value\":\"付款判断\",\"field\":\"fkpd\"},{\"value\":\"客户来源\",\"field\":\"khly\"},{\"value\":\"推荐人\",\"field\":\"tjr\"},{\"value\":\"是否首开订单\",\"field\":\"sfskdd\"},{\"value\":\"简介\",\"field\":\"jj\"},{\"value\":\"备注\",\"field\":\"bz\"},{\"value\":\"健康师业绩\",\"field\":\"jksyj\"},{\"value\":\"科技部老师业绩\",\"field\":\"kjblsyj\"},{\"value\":\"品项信息\",\"field\":\"pxxx\"},{\"value\":\"方案其他\",\"field\":\"F_FIleUrl\"},]".ToList<ParamsModel>(); | ||
| 486 | ExcelConfig excelconfig = new ExcelConfig(); | 574 | ExcelConfig excelconfig = new ExcelConfig(); |
| 487 | excelconfig.FileName = "开单记录表.xls"; | 575 | excelconfig.FileName = "开单记录表.xls"; |
| 488 | excelconfig.HeadFont = "微软雅黑"; | 576 | excelconfig.HeadFont = "微软雅黑"; |
| @@ -495,7 +583,13 @@ namespace NCC.Extend.LqKdKdjlb | @@ -495,7 +583,13 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 495 | var isExist = paramList.Find(p => p.field == item); | 583 | var isExist = paramList.Find(p => p.field == item); |
| 496 | if (isExist != null) | 584 | if (isExist != null) |
| 497 | { | 585 | { |
| 498 | - excelconfig.ColumnModel.Add(new ExcelColumnModel() { Column = isExist.field, ExcelColumn = isExist.value }); | 586 | + excelconfig.ColumnModel.Add( |
| 587 | + new ExcelColumnModel() | ||
| 588 | + { | ||
| 589 | + Column = isExist.field, | ||
| 590 | + ExcelColumn = isExist.value, | ||
| 591 | + } | ||
| 592 | + ); | ||
| 499 | } | 593 | } |
| 500 | } | 594 | } |
| 501 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; | 595 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; |
| @@ -504,7 +598,7 @@ namespace NCC.Extend.LqKdKdjlb | @@ -504,7 +598,7 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 504 | var output = new | 598 | var output = new |
| 505 | { | 599 | { |
| 506 | name = excelconfig.FileName, | 600 | name = excelconfig.FileName, |
| 507 | - url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | 601 | + url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC"), |
| 508 | }; | 602 | }; |
| 509 | return output; | 603 | return output; |
| 510 | } | 604 | } |
| @@ -527,16 +621,24 @@ namespace NCC.Extend.LqKdKdjlb | @@ -527,16 +621,24 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 527 | //开启事务 | 621 | //开启事务 |
| 528 | _db.BeginTran(); | 622 | _db.BeginTran(); |
| 529 | //批量删除开单记录表 | 623 | //批量删除开单记录表 |
| 530 | - await _db.Deleteable<LqKdKdjlbEntity>().In(d => d.Id, ids).ExecuteCommandAsync(); | 624 | + await _db.Deleteable<LqKdKdjlbEntity>() |
| 625 | + .In(d => d.Id, ids) | ||
| 626 | + .ExecuteCommandAsync(); | ||
| 531 | 627 | ||
| 532 | //清空子表数据 | 628 | //清空子表数据 |
| 533 | - await _db.Deleteable<LqKdJksyjEntity>().In(u => u.Glkdbh, ids).ExecuteCommandAsync(); | 629 | + await _db.Deleteable<LqKdJksyjEntity>() |
| 630 | + .In(u => u.Glkdbh, ids) | ||
| 631 | + .ExecuteCommandAsync(); | ||
| 534 | 632 | ||
| 535 | //清空子表数据 | 633 | //清空子表数据 |
| 536 | - await _db.Deleteable<LqKdKjbsyjEntity>().In(u => u.Glkdbh, ids).ExecuteCommandAsync(); | 634 | + await _db.Deleteable<LqKdKjbsyjEntity>() |
| 635 | + .In(u => u.Glkdbh, ids) | ||
| 636 | + .ExecuteCommandAsync(); | ||
| 537 | 637 | ||
| 538 | //清空子表数据 | 638 | //清空子表数据 |
| 539 | - await _db.Deleteable<LqKdPxmxEntity>().In(u => u.Glkdbh, ids).ExecuteCommandAsync(); | 639 | + await _db.Deleteable<LqKdPxmxEntity>() |
| 640 | + .In(u => u.Glkdbh, ids) | ||
| 641 | + .ExecuteCommandAsync(); | ||
| 540 | //关闭事务 | 642 | //关闭事务 |
| 541 | _db.CommitTran(); | 643 | _db.CommitTran(); |
| 542 | } | 644 | } |
| @@ -556,7 +658,7 @@ namespace NCC.Extend.LqKdKdjlb | @@ -556,7 +658,7 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 556 | /// </summary> | 658 | /// </summary> |
| 557 | /// <remarks> | 659 | /// <remarks> |
| 558 | /// 更新开单记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 | 660 | /// 更新开单记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 |
| 559 | - /// | 661 | + /// |
| 560 | /// 示例请求: | 662 | /// 示例请求: |
| 561 | /// ```json | 663 | /// ```json |
| 562 | /// { | 664 | /// { |
| @@ -582,7 +684,7 @@ namespace NCC.Extend.LqKdKdjlb | @@ -582,7 +684,7 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 582 | /// ] | 684 | /// ] |
| 583 | /// } | 685 | /// } |
| 584 | /// ``` | 686 | /// ``` |
| 585 | - /// | 687 | + /// |
| 586 | /// 参数说明: | 688 | /// 参数说明: |
| 587 | /// - id: 开单记录主键ID | 689 | /// - id: 开单记录主键ID |
| 588 | /// - input: 开单记录更新参数,包含品项明细和业绩信息 | 690 | /// - input: 开单记录更新参数,包含品项明细和业绩信息 |
| @@ -603,12 +705,20 @@ namespace NCC.Extend.LqKdKdjlb | @@ -603,12 +705,20 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 603 | _db.BeginTran(); | 705 | _db.BeginTran(); |
| 604 | 706 | ||
| 605 | //更新开单记录表记录 | 707 | //更新开单记录表记录 |
| 606 | - await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | 708 | + await _db.Updateable(entity) |
| 709 | + .IgnoreColumns(ignoreAllNullColumns: true) | ||
| 710 | + .ExecuteCommandAsync(); | ||
| 607 | 711 | ||
| 608 | //清空原有数据 | 712 | //清空原有数据 |
| 609 | - await _db.Deleteable<LqKdJksyjEntity>().Where(u => u.Glkdbh == id).ExecuteCommandAsync(); | ||
| 610 | - await _db.Deleteable<LqKdKjbsyjEntity>().Where(u => u.Glkdbh == id).ExecuteCommandAsync(); | ||
| 611 | - await _db.Deleteable<LqKdPxmxEntity>().Where(u => u.Glkdbh == id).ExecuteCommandAsync(); | 713 | + await _db.Deleteable<LqKdJksyjEntity>() |
| 714 | + .Where(u => u.Glkdbh == id) | ||
| 715 | + .ExecuteCommandAsync(); | ||
| 716 | + await _db.Deleteable<LqKdKjbsyjEntity>() | ||
| 717 | + .Where(u => u.Glkdbh == id) | ||
| 718 | + .ExecuteCommandAsync(); | ||
| 719 | + await _db.Deleteable<LqKdPxmxEntity>() | ||
| 720 | + .Where(u => u.Glkdbh == id) | ||
| 721 | + .ExecuteCommandAsync(); | ||
| 612 | 722 | ||
| 613 | // 收集所有需要插入的实体,然后批量插入 | 723 | // 收集所有需要插入的实体,然后批量插入 |
| 614 | var allPxmxEntities = new List<LqKdPxmxEntity>(); | 724 | var allPxmxEntities = new List<LqKdPxmxEntity>(); |
| @@ -636,43 +746,47 @@ namespace NCC.Extend.LqKdKdjlb | @@ -636,43 +746,47 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 636 | SourceType = item.sourceType, | 746 | SourceType = item.sourceType, |
| 637 | }; | 747 | }; |
| 638 | allPxmxEntities.Add(lqKdPxmxEntity); | 748 | allPxmxEntities.Add(lqKdPxmxEntity); |
| 639 | - | 749 | + |
| 640 | // 收集该品项关联的健康师业绩 | 750 | // 收集该品项关联的健康师业绩 |
| 641 | if (item.lqKdJksyjList != null && item.lqKdJksyjList.Any()) | 751 | if (item.lqKdJksyjList != null && item.lqKdJksyjList.Any()) |
| 642 | { | 752 | { |
| 643 | foreach (var ijks_tem in item.lqKdJksyjList) | 753 | foreach (var ijks_tem in item.lqKdJksyjList) |
| 644 | { | 754 | { |
| 645 | - allJksyjEntities.Add(new LqKdJksyjEntity | ||
| 646 | - { | ||
| 647 | - Id = YitIdHelper.NextId().ToString(), | ||
| 648 | - Glkdbh = entity.Id, | ||
| 649 | - Jks = ijks_tem.jks, | ||
| 650 | - Jksxm = ijks_tem.jksxm, | ||
| 651 | - Jkszh = ijks_tem.jkszh, | ||
| 652 | - Jksyj = ijks_tem.jksyj, | ||
| 653 | - Yjsj = DateTime.Now, | ||
| 654 | - Jsj_id = ijks_tem.jsj_id, | ||
| 655 | - Kdpxid = lqKdPxmxEntity.Id, | ||
| 656 | - }); | 755 | + allJksyjEntities.Add( |
| 756 | + new LqKdJksyjEntity | ||
| 757 | + { | ||
| 758 | + Id = YitIdHelper.NextId().ToString(), | ||
| 759 | + Glkdbh = entity.Id, | ||
| 760 | + Jks = ijks_tem.jks, | ||
| 761 | + Jksxm = ijks_tem.jksxm, | ||
| 762 | + Jkszh = ijks_tem.jkszh, | ||
| 763 | + Jksyj = ijks_tem.jksyj, | ||
| 764 | + Yjsj = DateTime.Now, | ||
| 765 | + Jsj_id = ijks_tem.jsj_id, | ||
| 766 | + Kdpxid = lqKdPxmxEntity.Id, | ||
| 767 | + } | ||
| 768 | + ); | ||
| 657 | } | 769 | } |
| 658 | } | 770 | } |
| 659 | - | 771 | + |
| 660 | // 收集该品项关联的科技部老师业绩 | 772 | // 收集该品项关联的科技部老师业绩 |
| 661 | if (item.lqKdKjbsyjList != null && item.lqKdKjbsyjList.Any()) | 773 | if (item.lqKdKjbsyjList != null && item.lqKdKjbsyjList.Any()) |
| 662 | { | 774 | { |
| 663 | foreach (var ikjbs_tem in item.lqKdKjbsyjList) | 775 | foreach (var ikjbs_tem in item.lqKdKjbsyjList) |
| 664 | { | 776 | { |
| 665 | - allKjbsyjEntities.Add(new LqKdKjbsyjEntity | ||
| 666 | - { | ||
| 667 | - Id = YitIdHelper.NextId().ToString(), | ||
| 668 | - Glkdbh = entity.Id, | ||
| 669 | - Kjbls = ikjbs_tem.kjbls, | ||
| 670 | - Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 671 | - Kjblszh = ikjbs_tem.kjblszh, | ||
| 672 | - Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 673 | - Yjsj = DateTime.Now, | ||
| 674 | - Kdpxid = lqKdPxmxEntity.Id, | ||
| 675 | - }); | 777 | + allKjbsyjEntities.Add( |
| 778 | + new LqKdKjbsyjEntity | ||
| 779 | + { | ||
| 780 | + Id = YitIdHelper.NextId().ToString(), | ||
| 781 | + Glkdbh = entity.Id, | ||
| 782 | + Kjbls = ikjbs_tem.kjbls, | ||
| 783 | + Kjblsxm = ikjbs_tem.kjblsxm, | ||
| 784 | + Kjblszh = ikjbs_tem.kjblszh, | ||
| 785 | + Kjblsyj = ikjbs_tem.kjblsyj, | ||
| 786 | + Yjsj = DateTime.Now, | ||
| 787 | + Kdpxid = lqKdPxmxEntity.Id, | ||
| 788 | + } | ||
| 789 | + ); | ||
| 676 | } | 790 | } |
| 677 | } | 791 | } |
| 678 | } | 792 | } |
| @@ -721,16 +835,24 @@ namespace NCC.Extend.LqKdKdjlb | @@ -721,16 +835,24 @@ namespace NCC.Extend.LqKdKdjlb | ||
| 721 | _db.BeginTran(); | 835 | _db.BeginTran(); |
| 722 | 836 | ||
| 723 | //删除开单记录表记录 | 837 | //删除开单记录表记录 |
| 724 | - await _db.Deleteable<LqKdKdjlbEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | 838 | + await _db.Deleteable<LqKdKdjlbEntity>() |
| 839 | + .Where(d => d.Id == id) | ||
| 840 | + .ExecuteCommandAsync(); | ||
| 725 | 841 | ||
| 726 | //清空子表数据 | 842 | //清空子表数据 |
| 727 | - await _db.Deleteable<LqKdJksyjEntity>().Where(u => u.Glkdbh == id).ExecuteCommandAsync(); | 843 | + await _db.Deleteable<LqKdJksyjEntity>() |
| 844 | + .Where(u => u.Glkdbh == id) | ||
| 845 | + .ExecuteCommandAsync(); | ||
| 728 | 846 | ||
| 729 | //清空子表数据 | 847 | //清空子表数据 |
| 730 | - await _db.Deleteable<LqKdKjbsyjEntity>().Where(u => u.Glkdbh == id).ExecuteCommandAsync(); | 848 | + await _db.Deleteable<LqKdKjbsyjEntity>() |
| 849 | + .Where(u => u.Glkdbh == id) | ||
| 850 | + .ExecuteCommandAsync(); | ||
| 731 | 851 | ||
| 732 | //清空子表数据 | 852 | //清空子表数据 |
| 733 | - await _db.Deleteable<LqKdPxmxEntity>().Where(u => u.Glkdbh == id).ExecuteCommandAsync(); | 853 | + await _db.Deleteable<LqKdPxmxEntity>() |
| 854 | + .Where(u => u.Glkdbh == id) | ||
| 855 | + .ExecuteCommandAsync(); | ||
| 734 | 856 | ||
| 735 | //关闭事务 | 857 | //关闭事务 |
| 736 | _db.CommitTran(); | 858 | _db.CommitTran(); |
netcore/src/Modularity/Extend/NCC.Extend/LqLssjService.cs
| 1 | -using NCC.Common.Core.Manager; | 1 | +using System; |
| 2 | +using System.Collections.Generic; | ||
| 3 | +using System.Linq; | ||
| 4 | +using System.Threading.Tasks; | ||
| 5 | +using Mapster; | ||
| 6 | +using Microsoft.AspNetCore.Mvc; | ||
| 7 | +using NCC.ClayObject; | ||
| 8 | +using NCC.Common.Configuration; | ||
| 9 | +using NCC.Common.Core.Manager; | ||
| 2 | using NCC.Common.Enum; | 10 | using NCC.Common.Enum; |
| 3 | using NCC.Common.Extension; | 11 | using NCC.Common.Extension; |
| 4 | using NCC.Common.Filter; | 12 | using NCC.Common.Filter; |
| 13 | +using NCC.Common.Helper; | ||
| 14 | +using NCC.Common.Model.NPOI; | ||
| 15 | +using NCC.DataEncryption; | ||
| 5 | using NCC.Dependency; | 16 | using NCC.Dependency; |
| 6 | using NCC.DynamicApiController; | 17 | using NCC.DynamicApiController; |
| 7 | -using NCC.FriendlyException; | 18 | +using NCC.Extend.Entitys.Dto.LqLssj; |
| 19 | +using NCC.Extend.Entitys.lq_lssj; | ||
| 8 | using NCC.Extend.Interfaces.LqLssj; | 20 | using NCC.Extend.Interfaces.LqLssj; |
| 9 | -using Mapster; | ||
| 10 | -using Microsoft.AspNetCore.Mvc; | 21 | +using NCC.FriendlyException; |
| 22 | +using NCC.JsonSerialization; | ||
| 11 | using SqlSugar; | 23 | using SqlSugar; |
| 12 | -using System; | ||
| 13 | -using System.Collections.Generic; | ||
| 14 | -using System.Linq; | ||
| 15 | -using System.Threading.Tasks; | ||
| 16 | -using NCC.Extend.Entitys.lq_lssj; | ||
| 17 | -using NCC.Extend.Entitys.Dto.LqLssj; | ||
| 18 | using Yitter.IdGenerator; | 24 | using Yitter.IdGenerator; |
| 19 | -using NCC.Common.Helper; | ||
| 20 | -using NCC.JsonSerialization; | ||
| 21 | -using NCC.Common.Model.NPOI; | ||
| 22 | -using NCC.Common.Configuration; | ||
| 23 | -using NCC.DataEncryption; | ||
| 24 | -using NCC.ClayObject; | ||
| 25 | 25 | ||
| 26 | namespace NCC.Extend.LqLssj | 26 | namespace NCC.Extend.LqLssj |
| 27 | { | 27 | { |
| 28 | /// <summary> | 28 | /// <summary> |
| 29 | /// 历史数据服务 | 29 | /// 历史数据服务 |
| 30 | /// </summary> | 30 | /// </summary> |
| 31 | - [ApiDescriptionSettings(Tag = "Extend",Name = "LqLssj", Order = 200)] | 31 | + [ApiDescriptionSettings(Tag = "Extend", Name = "LqLssj", Order = 200)] |
| 32 | [Route("api/Extend/[controller]")] | 32 | [Route("api/Extend/[controller]")] |
| 33 | public class LqLssjService : ILqLssjService, IDynamicApiController, ITransient | 33 | public class LqLssjService : ILqLssjService, IDynamicApiController, ITransient |
| 34 | { | 34 | { |
| @@ -41,9 +41,10 @@ namespace NCC.Extend.LqLssj | @@ -41,9 +41,10 @@ namespace NCC.Extend.LqLssj | ||
| 41 | /// </summary> | 41 | /// </summary> |
| 42 | public LqLssjService( | 42 | public LqLssjService( |
| 43 | ISqlSugarRepository<LqLssjEntity> lqLssjRepository, | 43 | ISqlSugarRepository<LqLssjEntity> lqLssjRepository, |
| 44 | - IUserManager userManager) | 44 | + IUserManager userManager |
| 45 | + ) | ||
| 45 | { | 46 | { |
| 46 | - _lqLssjRepository = lqLssjRepository; | 47 | + _lqLssjRepository = lqLssjRepository; |
| 47 | _db = _lqLssjRepository.Context; | 48 | _db = _lqLssjRepository.Context; |
| 48 | _userManager = userManager; | 49 | _userManager = userManager; |
| 49 | } | 50 | } |
| @@ -62,10 +63,10 @@ namespace NCC.Extend.LqLssj | @@ -62,10 +63,10 @@ namespace NCC.Extend.LqLssj | ||
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | /// <summary> | 65 | /// <summary> |
| 65 | - /// 获取历史数据列表 | ||
| 66 | - /// </summary> | ||
| 67 | - /// <param name="input">请求参数</param> | ||
| 68 | - /// <returns></returns> | 66 | + /// 获取历史数据列表 |
| 67 | + /// </summary> | ||
| 68 | + /// <param name="input">请求参数</param> | ||
| 69 | + /// <returns></returns> | ||
| 69 | [HttpGet("")] | 70 | [HttpGet("")] |
| 70 | public async Task<dynamic> GetList([FromQuery] LqLssjListQueryInput input) | 71 | public async Task<dynamic> GetList([FromQuery] LqLssjListQueryInput input) |
| 71 | { | 72 | { |
| @@ -81,20 +82,23 @@ namespace NCC.Extend.LqLssj | @@ -81,20 +82,23 @@ namespace NCC.Extend.LqLssj | ||
| 81 | .WhereIF(!string.IsNullOrEmpty(input.rts), p => p.Rts.Equals(input.rts)) | 82 | .WhereIF(!string.IsNullOrEmpty(input.rts), p => p.Rts.Equals(input.rts)) |
| 82 | .WhereIF(!string.IsNullOrEmpty(input.rcs), p => p.Rcs.Equals(input.rcs)) | 83 | .WhereIF(!string.IsNullOrEmpty(input.rcs), p => p.Rcs.Equals(input.rcs)) |
| 83 | .WhereIF(!string.IsNullOrEmpty(input.xms), p => p.Xms.Equals(input.xms)) | 84 | .WhereIF(!string.IsNullOrEmpty(input.xms), p => p.Xms.Equals(input.xms)) |
| 84 | - .Select(it=> new LqLssjListOutput | 85 | + .Select(it => new LqLssjListOutput |
| 85 | { | 86 | { |
| 86 | id = it.Id, | 87 | id = it.Id, |
| 87 | - syb=it.Syb, | ||
| 88 | - md=it.Md, | ||
| 89 | - yf=it.Yf, | ||
| 90 | - nf=it.Nf, | ||
| 91 | - zyj=it.Zyj, | ||
| 92 | - zxh=it.Zxh, | ||
| 93 | - rts=it.Rts, | ||
| 94 | - rcs=it.Rcs, | ||
| 95 | - xms=it.Xms, | ||
| 96 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 97 | - return PageResult<LqLssjListOutput>.SqlSugarPageResult(data); | 88 | + syb = it.Syb, |
| 89 | + md = it.Md, | ||
| 90 | + yf = it.Yf, | ||
| 91 | + nf = it.Nf, | ||
| 92 | + zyj = it.Zyj, | ||
| 93 | + zxh = it.Zxh, | ||
| 94 | + rts = it.Rts, | ||
| 95 | + rcs = it.Rcs, | ||
| 96 | + xms = it.Xms, | ||
| 97 | + }) | ||
| 98 | + .MergeTable() | ||
| 99 | + .OrderBy(sidx + " " + input.sort) | ||
| 100 | + .ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 101 | + return PageResult<LqLssjListOutput>.SqlSugarPageResult(data); | ||
| 98 | } | 102 | } |
| 99 | 103 | ||
| 100 | /// <summary> | 104 | /// <summary> |
| @@ -108,15 +112,18 @@ namespace NCC.Extend.LqLssj | @@ -108,15 +112,18 @@ namespace NCC.Extend.LqLssj | ||
| 108 | var userInfo = await _userManager.GetUserInfo(); | 112 | var userInfo = await _userManager.GetUserInfo(); |
| 109 | var entity = input.Adapt<LqLssjEntity>(); | 113 | var entity = input.Adapt<LqLssjEntity>(); |
| 110 | entity.Id = YitIdHelper.NextId().ToString(); | 114 | entity.Id = YitIdHelper.NextId().ToString(); |
| 111 | - var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | ||
| 112 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | 115 | + var isOk = await _db.Insertable(entity) |
| 116 | + .IgnoreColumns(ignoreNullColumn: true) | ||
| 117 | + .ExecuteCommandAsync(); | ||
| 118 | + if (!(isOk > 0)) | ||
| 119 | + throw NCCException.Oh(ErrorCode.COM1000); | ||
| 113 | } | 120 | } |
| 114 | 121 | ||
| 115 | /// <summary> | 122 | /// <summary> |
| 116 | - /// 获取历史数据无分页列表 | ||
| 117 | - /// </summary> | ||
| 118 | - /// <param name="input">请求参数</param> | ||
| 119 | - /// <returns></returns> | 123 | + /// 获取历史数据无分页列表 |
| 124 | + /// </summary> | ||
| 125 | + /// <param name="input">请求参数</param> | ||
| 126 | + /// <returns></returns> | ||
| 120 | [NonAction] | 127 | [NonAction] |
| 121 | public async Task<dynamic> GetNoPagingList([FromQuery] LqLssjListQueryInput input) | 128 | public async Task<dynamic> GetNoPagingList([FromQuery] LqLssjListQueryInput input) |
| 122 | { | 129 | { |
| @@ -132,27 +139,30 @@ namespace NCC.Extend.LqLssj | @@ -132,27 +139,30 @@ namespace NCC.Extend.LqLssj | ||
| 132 | .WhereIF(!string.IsNullOrEmpty(input.rts), p => p.Rts.Equals(input.rts)) | 139 | .WhereIF(!string.IsNullOrEmpty(input.rts), p => p.Rts.Equals(input.rts)) |
| 133 | .WhereIF(!string.IsNullOrEmpty(input.rcs), p => p.Rcs.Equals(input.rcs)) | 140 | .WhereIF(!string.IsNullOrEmpty(input.rcs), p => p.Rcs.Equals(input.rcs)) |
| 134 | .WhereIF(!string.IsNullOrEmpty(input.xms), p => p.Xms.Equals(input.xms)) | 141 | .WhereIF(!string.IsNullOrEmpty(input.xms), p => p.Xms.Equals(input.xms)) |
| 135 | - .Select(it=> new LqLssjListOutput | 142 | + .Select(it => new LqLssjListOutput |
| 136 | { | 143 | { |
| 137 | id = it.Id, | 144 | id = it.Id, |
| 138 | - syb=it.Syb, | ||
| 139 | - md=it.Md, | ||
| 140 | - yf=it.Yf, | ||
| 141 | - nf=it.Nf, | ||
| 142 | - zyj=it.Zyj, | ||
| 143 | - zxh=it.Zxh, | ||
| 144 | - rts=it.Rts, | ||
| 145 | - rcs=it.Rcs, | ||
| 146 | - xms=it.Xms, | ||
| 147 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | ||
| 148 | - return data; | 145 | + syb = it.Syb, |
| 146 | + md = it.Md, | ||
| 147 | + yf = it.Yf, | ||
| 148 | + nf = it.Nf, | ||
| 149 | + zyj = it.Zyj, | ||
| 150 | + zxh = it.Zxh, | ||
| 151 | + rts = it.Rts, | ||
| 152 | + rcs = it.Rcs, | ||
| 153 | + xms = it.Xms, | ||
| 154 | + }) | ||
| 155 | + .MergeTable() | ||
| 156 | + .OrderBy(sidx + " " + input.sort) | ||
| 157 | + .ToListAsync(); | ||
| 158 | + return data; | ||
| 149 | } | 159 | } |
| 150 | 160 | ||
| 151 | /// <summary> | 161 | /// <summary> |
| 152 | - /// 导出历史数据 | ||
| 153 | - /// </summary> | ||
| 154 | - /// <param name="input">请求参数</param> | ||
| 155 | - /// <returns></returns> | 162 | + /// 导出历史数据 |
| 163 | + /// </summary> | ||
| 164 | + /// <param name="input">请求参数</param> | ||
| 165 | + /// <returns></returns> | ||
| 156 | [HttpGet("Actions/Export")] | 166 | [HttpGet("Actions/Export")] |
| 157 | public async Task<dynamic> Export([FromQuery] LqLssjListQueryInput input) | 167 | public async Task<dynamic> Export([FromQuery] LqLssjListQueryInput input) |
| 158 | { | 168 | { |
| @@ -167,7 +177,8 @@ namespace NCC.Extend.LqLssj | @@ -167,7 +177,8 @@ namespace NCC.Extend.LqLssj | ||
| 167 | { | 177 | { |
| 168 | exportData = await this.GetNoPagingList(input); | 178 | exportData = await this.GetNoPagingList(input); |
| 169 | } | 179 | } |
| 170 | - List<ParamsModel> paramList = "[{\"value\":\"数据编号\",\"field\":\"id\"},{\"value\":\"事业部\",\"field\":\"syb\"},{\"value\":\"门店\",\"field\":\"md\"},{\"value\":\"月份\",\"field\":\"yf\"},{\"value\":\"年份\",\"field\":\"nf\"},{\"value\":\"总业绩\",\"field\":\"zyj\"},{\"value\":\"总消耗\",\"field\":\"zxh\"},{\"value\":\"人头数\",\"field\":\"rts\"},{\"value\":\"人次数\",\"field\":\"rcs\"},{\"value\":\"项目数\",\"field\":\"xms\"},]".ToList<ParamsModel>(); | 180 | + List<ParamsModel> paramList = |
| 181 | + "[{\"value\":\"数据编号\",\"field\":\"id\"},{\"value\":\"事业部\",\"field\":\"syb\"},{\"value\":\"门店\",\"field\":\"md\"},{\"value\":\"月份\",\"field\":\"yf\"},{\"value\":\"年份\",\"field\":\"nf\"},{\"value\":\"总业绩\",\"field\":\"zyj\"},{\"value\":\"总消耗\",\"field\":\"zxh\"},{\"value\":\"人头数\",\"field\":\"rts\"},{\"value\":\"人次数\",\"field\":\"rcs\"},{\"value\":\"项目数\",\"field\":\"xms\"},]".ToList<ParamsModel>(); | ||
| 171 | ExcelConfig excelconfig = new ExcelConfig(); | 182 | ExcelConfig excelconfig = new ExcelConfig(); |
| 172 | excelconfig.FileName = "历史数据.xls"; | 183 | excelconfig.FileName = "历史数据.xls"; |
| 173 | excelconfig.HeadFont = "微软雅黑"; | 184 | excelconfig.HeadFont = "微软雅黑"; |
| @@ -180,7 +191,13 @@ namespace NCC.Extend.LqLssj | @@ -180,7 +191,13 @@ namespace NCC.Extend.LqLssj | ||
| 180 | var isExist = paramList.Find(p => p.field == item); | 191 | var isExist = paramList.Find(p => p.field == item); |
| 181 | if (isExist != null) | 192 | if (isExist != null) |
| 182 | { | 193 | { |
| 183 | - excelconfig.ColumnModel.Add(new ExcelColumnModel() { Column = isExist.field, ExcelColumn = isExist.value }); | 194 | + excelconfig.ColumnModel.Add( |
| 195 | + new ExcelColumnModel() | ||
| 196 | + { | ||
| 197 | + Column = isExist.field, | ||
| 198 | + ExcelColumn = isExist.value, | ||
| 199 | + } | ||
| 200 | + ); | ||
| 184 | } | 201 | } |
| 185 | } | 202 | } |
| 186 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; | 203 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; |
| @@ -189,7 +206,7 @@ namespace NCC.Extend.LqLssj | @@ -189,7 +206,7 @@ namespace NCC.Extend.LqLssj | ||
| 189 | var output = new | 206 | var output = new |
| 190 | { | 207 | { |
| 191 | name = excelconfig.FileName, | 208 | name = excelconfig.FileName, |
| 192 | - url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | 209 | + url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC"), |
| 193 | }; | 210 | }; |
| 194 | return output; | 211 | return output; |
| 195 | } | 212 | } |
| @@ -210,7 +227,7 @@ namespace NCC.Extend.LqLssj | @@ -210,7 +227,7 @@ namespace NCC.Extend.LqLssj | ||
| 210 | //开启事务 | 227 | //开启事务 |
| 211 | _db.BeginTran(); | 228 | _db.BeginTran(); |
| 212 | //批量删除历史数据 | 229 | //批量删除历史数据 |
| 213 | - await _db.Deleteable<LqLssjEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | 230 | + await _db.Deleteable<LqLssjEntity>().In(d => d.Id, ids).ExecuteCommandAsync(); |
| 214 | //关闭事务 | 231 | //关闭事务 |
| 215 | _db.CommitTran(); | 232 | _db.CommitTran(); |
| 216 | } | 233 | } |
| @@ -233,8 +250,11 @@ namespace NCC.Extend.LqLssj | @@ -233,8 +250,11 @@ namespace NCC.Extend.LqLssj | ||
| 233 | public async Task Update(string id, [FromBody] LqLssjUpInput input) | 250 | public async Task Update(string id, [FromBody] LqLssjUpInput input) |
| 234 | { | 251 | { |
| 235 | var entity = input.Adapt<LqLssjEntity>(); | 252 | var entity = input.Adapt<LqLssjEntity>(); |
| 236 | - var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | ||
| 237 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | 253 | + var isOk = await _db.Updateable(entity) |
| 254 | + .IgnoreColumns(ignoreAllNullColumns: true) | ||
| 255 | + .ExecuteCommandAsync(); | ||
| 256 | + if (!(isOk > 0)) | ||
| 257 | + throw NCCException.Oh(ErrorCode.COM1001); | ||
| 238 | } | 258 | } |
| 239 | 259 | ||
| 240 | /// <summary> | 260 | /// <summary> |
| @@ -246,8 +266,11 @@ namespace NCC.Extend.LqLssj | @@ -246,8 +266,11 @@ namespace NCC.Extend.LqLssj | ||
| 246 | { | 266 | { |
| 247 | var entity = await _db.Queryable<LqLssjEntity>().FirstAsync(p => p.Id == id); | 267 | var entity = await _db.Queryable<LqLssjEntity>().FirstAsync(p => p.Id == id); |
| 248 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | 268 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); |
| 249 | - var isOk = await _db.Deleteable<LqLssjEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | ||
| 250 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | 269 | + var isOk = await _db.Deleteable<LqLssjEntity>() |
| 270 | + .Where(d => d.Id == id) | ||
| 271 | + .ExecuteCommandAsync(); | ||
| 272 | + if (!(isOk > 0)) | ||
| 273 | + throw NCCException.Oh(ErrorCode.COM1002); | ||
| 251 | } | 274 | } |
| 252 | } | 275 | } |
| 253 | } | 276 | } |
netcore/src/Modularity/Extend/NCC.Extend/LqMdXdbhsjService.cs
| 1 | +using System; | ||
| 2 | +using System.Collections.Generic; | ||
| 3 | +using System.Linq; | ||
| 4 | +using System.Threading.Tasks; | ||
| 5 | +using Mapster; | ||
| 6 | +using Microsoft.AspNetCore.Mvc; | ||
| 7 | +using NCC.ClayObject; | ||
| 8 | +using NCC.Common.Configuration; | ||
| 1 | using NCC.Common.Core.Manager; | 9 | using NCC.Common.Core.Manager; |
| 2 | using NCC.Common.Enum; | 10 | using NCC.Common.Enum; |
| 3 | using NCC.Common.Extension; | 11 | using NCC.Common.Extension; |
| 4 | using NCC.Common.Filter; | 12 | using NCC.Common.Filter; |
| 13 | +using NCC.Common.Helper; | ||
| 14 | +using NCC.Common.Model.NPOI; | ||
| 15 | +using NCC.DataEncryption; | ||
| 5 | using NCC.Dependency; | 16 | using NCC.Dependency; |
| 6 | using NCC.DynamicApiController; | 17 | using NCC.DynamicApiController; |
| 7 | -using NCC.FriendlyException; | 18 | +using NCC.Extend.Entitys.Dto.LqMdXdbhsj; |
| 19 | +using NCC.Extend.Entitys.lq_md_xdbhsj; | ||
| 8 | using NCC.Extend.Interfaces.LqMdXdbhsj; | 20 | using NCC.Extend.Interfaces.LqMdXdbhsj; |
| 9 | -using Mapster; | ||
| 10 | -using Microsoft.AspNetCore.Mvc; | 21 | +using NCC.FriendlyException; |
| 22 | +using NCC.JsonSerialization; | ||
| 11 | using SqlSugar; | 23 | using SqlSugar; |
| 12 | -using System; | ||
| 13 | -using System.Collections.Generic; | ||
| 14 | -using System.Linq; | ||
| 15 | -using System.Threading.Tasks; | ||
| 16 | -using NCC.Extend.Entitys.lq_md_xdbhsj; | ||
| 17 | -using NCC.Extend.Entitys.Dto.LqMdXdbhsj; | ||
| 18 | using Yitter.IdGenerator; | 24 | using Yitter.IdGenerator; |
| 19 | -using NCC.Common.Helper; | ||
| 20 | -using NCC.JsonSerialization; | ||
| 21 | -using NCC.Common.Model.NPOI; | ||
| 22 | -using NCC.Common.Configuration; | ||
| 23 | -using NCC.DataEncryption; | ||
| 24 | -using NCC.ClayObject; | ||
| 25 | 25 | ||
| 26 | namespace NCC.Extend.LqMdXdbhsj | 26 | namespace NCC.Extend.LqMdXdbhsj |
| 27 | { | 27 | { |
| @@ -41,7 +41,8 @@ namespace NCC.Extend.LqMdXdbhsj | @@ -41,7 +41,8 @@ namespace NCC.Extend.LqMdXdbhsj | ||
| 41 | /// </summary> | 41 | /// </summary> |
| 42 | public LqMdXdbhsjService( | 42 | public LqMdXdbhsjService( |
| 43 | ISqlSugarRepository<LqMdXdbhsjEntity> lqMdXdbhsjRepository, | 43 | ISqlSugarRepository<LqMdXdbhsjEntity> lqMdXdbhsjRepository, |
| 44 | - IUserManager userManager) | 44 | + IUserManager userManager |
| 45 | + ) | ||
| 45 | { | 46 | { |
| 46 | _lqMdXdbhsjRepository = lqMdXdbhsjRepository; | 47 | _lqMdXdbhsjRepository = lqMdXdbhsjRepository; |
| 47 | _db = _lqMdXdbhsjRepository.Context; | 48 | _db = _lqMdXdbhsjRepository.Context; |
| @@ -83,8 +84,11 @@ namespace NCC.Extend.LqMdXdbhsj | @@ -83,8 +84,11 @@ namespace NCC.Extend.LqMdXdbhsj | ||
| 83 | bhjssj = it.Bhjssj, | 84 | bhjssj = it.Bhjssj, |
| 84 | sm = it.Sm, | 85 | sm = it.Sm, |
| 85 | cjsj = it.Cjsj, | 86 | cjsj = it.Cjsj, |
| 86 | - sfqy = it.Sfqy | ||
| 87 | - }).MergeTable().OrderBy(sidx + " " + input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | 87 | + sfqy = it.Sfqy, |
| 88 | + }) | ||
| 89 | + .MergeTable() | ||
| 90 | + .OrderBy(sidx + " " + input.sort) | ||
| 91 | + .ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 88 | return PageResult<LqMdXdbhsjListOutput>.SqlSugarPageResult(data); | 92 | return PageResult<LqMdXdbhsjListOutput>.SqlSugarPageResult(data); |
| 89 | } | 93 | } |
| 90 | 94 | ||
| @@ -100,28 +104,33 @@ namespace NCC.Extend.LqMdXdbhsj | @@ -100,28 +104,33 @@ namespace NCC.Extend.LqMdXdbhsj | ||
| 100 | var entity = input.Adapt<LqMdXdbhsjEntity>(); | 104 | var entity = input.Adapt<LqMdXdbhsjEntity>(); |
| 101 | entity.Id = YitIdHelper.NextId().ToString(); | 105 | entity.Id = YitIdHelper.NextId().ToString(); |
| 102 | entity.Cjsj = DateTime.Now; | 106 | entity.Cjsj = DateTime.Now; |
| 103 | - | 107 | + |
| 104 | // 验证时间逻辑 | 108 | // 验证时间逻辑 |
| 105 | if (entity.Bhkssj >= entity.Bhjssj) | 109 | if (entity.Bhkssj >= entity.Bhjssj) |
| 106 | { | 110 | { |
| 107 | throw NCCException.Oh(ErrorCode.COM1000, "保护开始时间必须早于保护结束时间"); | 111 | throw NCCException.Oh(ErrorCode.COM1000, "保护开始时间必须早于保护结束时间"); |
| 108 | } | 112 | } |
| 109 | - | 113 | + |
| 110 | // 检查是否存在重叠的保护时间 | 114 | // 检查是否存在重叠的保护时间 |
| 111 | var exists = await _db.Queryable<LqMdXdbhsjEntity>() | 115 | var exists = await _db.Queryable<LqMdXdbhsjEntity>() |
| 112 | .Where(p => p.Mdid == entity.Mdid && p.Sfqy == 1) | 116 | .Where(p => p.Mdid == entity.Mdid && p.Sfqy == 1) |
| 113 | - .Where(p => (p.Bhkssj <= entity.Bhkssj && p.Bhjssj > entity.Bhkssj) || | ||
| 114 | - (p.Bhkssj < entity.Bhjssj && p.Bhjssj >= entity.Bhjssj) || | ||
| 115 | - (p.Bhkssj >= entity.Bhkssj && p.Bhjssj <= entity.Bhjssj)) | 117 | + .Where(p => |
| 118 | + (p.Bhkssj <= entity.Bhkssj && p.Bhjssj > entity.Bhkssj) | ||
| 119 | + || (p.Bhkssj < entity.Bhjssj && p.Bhjssj >= entity.Bhjssj) | ||
| 120 | + || (p.Bhkssj >= entity.Bhkssj && p.Bhjssj <= entity.Bhjssj) | ||
| 121 | + ) | ||
| 116 | .AnyAsync(); | 122 | .AnyAsync(); |
| 117 | - | 123 | + |
| 118 | if (exists) | 124 | if (exists) |
| 119 | { | 125 | { |
| 120 | throw NCCException.Oh(ErrorCode.COM1000, "该门店在指定时间段内已存在保护时间设置"); | 126 | throw NCCException.Oh(ErrorCode.COM1000, "该门店在指定时间段内已存在保护时间设置"); |
| 121 | } | 127 | } |
| 122 | - | ||
| 123 | - var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | ||
| 124 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | 128 | + |
| 129 | + var isOk = await _db.Insertable(entity) | ||
| 130 | + .IgnoreColumns(ignoreNullColumn: true) | ||
| 131 | + .ExecuteCommandAsync(); | ||
| 132 | + if (!(isOk > 0)) | ||
| 133 | + throw NCCException.Oh(ErrorCode.COM1000); | ||
| 125 | } | 134 | } |
| 126 | 135 | ||
| 127 | /// <summary> | 136 | /// <summary> |
| @@ -135,28 +144,33 @@ namespace NCC.Extend.LqMdXdbhsj | @@ -135,28 +144,33 @@ namespace NCC.Extend.LqMdXdbhsj | ||
| 135 | { | 144 | { |
| 136 | var entity = input.Adapt<LqMdXdbhsjEntity>(); | 145 | var entity = input.Adapt<LqMdXdbhsjEntity>(); |
| 137 | entity.Id = id; | 146 | entity.Id = id; |
| 138 | - | 147 | + |
| 139 | // 验证时间逻辑 | 148 | // 验证时间逻辑 |
| 140 | if (entity.Bhkssj >= entity.Bhjssj) | 149 | if (entity.Bhkssj >= entity.Bhjssj) |
| 141 | { | 150 | { |
| 142 | throw NCCException.Oh(ErrorCode.COM1000, "保护开始时间必须早于保护结束时间"); | 151 | throw NCCException.Oh(ErrorCode.COM1000, "保护开始时间必须早于保护结束时间"); |
| 143 | } | 152 | } |
| 144 | - | 153 | + |
| 145 | // 检查是否存在重叠的保护时间(排除当前记录) | 154 | // 检查是否存在重叠的保护时间(排除当前记录) |
| 146 | var exists = await _db.Queryable<LqMdXdbhsjEntity>() | 155 | var exists = await _db.Queryable<LqMdXdbhsjEntity>() |
| 147 | .Where(p => p.Mdid == entity.Mdid && p.Sfqy == 1 && p.Id != id) | 156 | .Where(p => p.Mdid == entity.Mdid && p.Sfqy == 1 && p.Id != id) |
| 148 | - .Where(p => (p.Bhkssj <= entity.Bhkssj && p.Bhjssj > entity.Bhkssj) || | ||
| 149 | - (p.Bhkssj < entity.Bhjssj && p.Bhjssj >= entity.Bhjssj) || | ||
| 150 | - (p.Bhkssj >= entity.Bhkssj && p.Bhjssj <= entity.Bhjssj)) | 157 | + .Where(p => |
| 158 | + (p.Bhkssj <= entity.Bhkssj && p.Bhjssj > entity.Bhkssj) | ||
| 159 | + || (p.Bhkssj < entity.Bhjssj && p.Bhjssj >= entity.Bhjssj) | ||
| 160 | + || (p.Bhkssj >= entity.Bhkssj && p.Bhjssj <= entity.Bhjssj) | ||
| 161 | + ) | ||
| 151 | .AnyAsync(); | 162 | .AnyAsync(); |
| 152 | - | 163 | + |
| 153 | if (exists) | 164 | if (exists) |
| 154 | { | 165 | { |
| 155 | throw NCCException.Oh(ErrorCode.COM1000, "该门店在指定时间段内已存在保护时间设置"); | 166 | throw NCCException.Oh(ErrorCode.COM1000, "该门店在指定时间段内已存在保护时间设置"); |
| 156 | } | 167 | } |
| 157 | - | ||
| 158 | - var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | ||
| 159 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | 168 | + |
| 169 | + var isOk = await _db.Updateable(entity) | ||
| 170 | + .IgnoreColumns(ignoreAllNullColumns: true) | ||
| 171 | + .ExecuteCommandAsync(); | ||
| 172 | + if (!(isOk > 0)) | ||
| 173 | + throw NCCException.Oh(ErrorCode.COM1001); | ||
| 160 | } | 174 | } |
| 161 | 175 | ||
| 162 | /// <summary> | 176 | /// <summary> |
| @@ -168,8 +182,11 @@ namespace NCC.Extend.LqMdXdbhsj | @@ -168,8 +182,11 @@ namespace NCC.Extend.LqMdXdbhsj | ||
| 168 | { | 182 | { |
| 169 | var entity = await _db.Queryable<LqMdXdbhsjEntity>().FirstAsync(p => p.Id == id); | 183 | var entity = await _db.Queryable<LqMdXdbhsjEntity>().FirstAsync(p => p.Id == id); |
| 170 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | 184 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); |
| 171 | - var isOk = await _db.Deleteable<LqMdXdbhsjEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | ||
| 172 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | 185 | + var isOk = await _db.Deleteable<LqMdXdbhsjEntity>() |
| 186 | + .Where(d => d.Id == id) | ||
| 187 | + .ExecuteCommandAsync(); | ||
| 188 | + if (!(isOk > 0)) | ||
| 189 | + throw NCCException.Oh(ErrorCode.COM1002); | ||
| 173 | } | 190 | } |
| 174 | 191 | ||
| 175 | /// <summary> | 192 | /// <summary> |
| @@ -181,7 +198,12 @@ namespace NCC.Extend.LqMdXdbhsj | @@ -181,7 +198,12 @@ namespace NCC.Extend.LqMdXdbhsj | ||
| 181 | { | 198 | { |
| 182 | var list = await _db.Queryable<LqMdXdbhsjEntity>() | 199 | var list = await _db.Queryable<LqMdXdbhsjEntity>() |
| 183 | .Where(p => p.Sfqy == 1) | 200 | .Where(p => p.Sfqy == 1) |
| 184 | - .Select(it => new { id = it.Id, fullName = it.Mdid, enCode = it.Id }) | 201 | + .Select(it => new |
| 202 | + { | ||
| 203 | + id = it.Id, | ||
| 204 | + fullName = it.Mdid, | ||
| 205 | + enCode = it.Id, | ||
| 206 | + }) | ||
| 185 | .ToListAsync(); | 207 | .ToListAsync(); |
| 186 | return new { list = list }; | 208 | return new { list = list }; |
| 187 | } | 209 | } |
| @@ -199,12 +221,12 @@ namespace NCC.Extend.LqMdXdbhsj | @@ -199,12 +221,12 @@ namespace NCC.Extend.LqMdXdbhsj | ||
| 199 | .Where(p => p.Mdid == mdid && p.Sfqy == 1) | 221 | .Where(p => p.Mdid == mdid && p.Sfqy == 1) |
| 200 | .Where(p => p.Bhkssj <= now && p.Bhjssj >= now) | 222 | .Where(p => p.Bhkssj <= now && p.Bhjssj >= now) |
| 201 | .FirstAsync(); | 223 | .FirstAsync(); |
| 202 | - | 224 | + |
| 203 | if (entity == null) | 225 | if (entity == null) |
| 204 | { | 226 | { |
| 205 | return new { hasProtection = false, message = "该门店当前无保护时间设置" }; | 227 | return new { hasProtection = false, message = "该门店当前无保护时间设置" }; |
| 206 | } | 228 | } |
| 207 | - | 229 | + |
| 208 | var output = entity.Adapt<LqMdXdbhsjInfoOutput>(); | 230 | var output = entity.Adapt<LqMdXdbhsjInfoOutput>(); |
| 209 | return new { hasProtection = true, data = output }; | 231 | return new { hasProtection = true, data = output }; |
| 210 | } | 232 | } |
netcore/src/Modularity/Extend/NCC.Extend/LqSkzhService.cs
| 1 | -using NCC.Common.Core.Manager; | 1 | +using System; |
| 2 | +using System.Collections.Generic; | ||
| 3 | +using System.Linq; | ||
| 4 | +using System.Threading.Tasks; | ||
| 5 | +using Mapster; | ||
| 6 | +using Microsoft.AspNetCore.Mvc; | ||
| 7 | +using NCC.ClayObject; | ||
| 8 | +using NCC.Common.Configuration; | ||
| 9 | +using NCC.Common.Core.Manager; | ||
| 2 | using NCC.Common.Enum; | 10 | using NCC.Common.Enum; |
| 3 | using NCC.Common.Extension; | 11 | using NCC.Common.Extension; |
| 4 | using NCC.Common.Filter; | 12 | using NCC.Common.Filter; |
| 13 | +using NCC.Common.Helper; | ||
| 14 | +using NCC.Common.Model.NPOI; | ||
| 15 | +using NCC.DataEncryption; | ||
| 5 | using NCC.Dependency; | 16 | using NCC.Dependency; |
| 6 | using NCC.DynamicApiController; | 17 | using NCC.DynamicApiController; |
| 7 | -using NCC.FriendlyException; | 18 | +using NCC.Extend.Entitys.Dto.LqSkzh; |
| 19 | +using NCC.Extend.Entitys.lq_skzh; | ||
| 8 | using NCC.Extend.Interfaces.LqSkzh; | 20 | using NCC.Extend.Interfaces.LqSkzh; |
| 9 | -using Mapster; | ||
| 10 | -using Microsoft.AspNetCore.Mvc; | 21 | +using NCC.FriendlyException; |
| 22 | +using NCC.JsonSerialization; | ||
| 11 | using SqlSugar; | 23 | using SqlSugar; |
| 12 | -using System; | ||
| 13 | -using System.Collections.Generic; | ||
| 14 | -using System.Linq; | ||
| 15 | -using System.Threading.Tasks; | ||
| 16 | -using NCC.Extend.Entitys.lq_skzh; | ||
| 17 | -using NCC.Extend.Entitys.Dto.LqSkzh; | ||
| 18 | using Yitter.IdGenerator; | 24 | using Yitter.IdGenerator; |
| 19 | -using NCC.Common.Helper; | ||
| 20 | -using NCC.JsonSerialization; | ||
| 21 | -using NCC.Common.Model.NPOI; | ||
| 22 | -using NCC.Common.Configuration; | ||
| 23 | -using NCC.DataEncryption; | ||
| 24 | -using NCC.ClayObject; | ||
| 25 | 25 | ||
| 26 | namespace NCC.Extend.LqSkzh | 26 | namespace NCC.Extend.LqSkzh |
| 27 | { | 27 | { |
| 28 | /// <summary> | 28 | /// <summary> |
| 29 | /// 收款账户服务 | 29 | /// 收款账户服务 |
| 30 | /// </summary> | 30 | /// </summary> |
| 31 | - [ApiDescriptionSettings(Tag = "Extend",Name = "LqSkzh", Order = 200)] | 31 | + [ApiDescriptionSettings(Tag = "Extend", Name = "LqSkzh", Order = 200)] |
| 32 | [Route("api/Extend/[controller]")] | 32 | [Route("api/Extend/[controller]")] |
| 33 | public class LqSkzhService : ILqSkzhService, IDynamicApiController, ITransient | 33 | public class LqSkzhService : ILqSkzhService, IDynamicApiController, ITransient |
| 34 | { | 34 | { |
| @@ -41,9 +41,10 @@ namespace NCC.Extend.LqSkzh | @@ -41,9 +41,10 @@ namespace NCC.Extend.LqSkzh | ||
| 41 | /// </summary> | 41 | /// </summary> |
| 42 | public LqSkzhService( | 42 | public LqSkzhService( |
| 43 | ISqlSugarRepository<LqSkzhEntity> lqSkzhRepository, | 43 | ISqlSugarRepository<LqSkzhEntity> lqSkzhRepository, |
| 44 | - IUserManager userManager) | 44 | + IUserManager userManager |
| 45 | + ) | ||
| 45 | { | 46 | { |
| 46 | - _lqSkzhRepository = lqSkzhRepository; | 47 | + _lqSkzhRepository = lqSkzhRepository; |
| 47 | _db = _lqSkzhRepository.Context; | 48 | _db = _lqSkzhRepository.Context; |
| 48 | _userManager = userManager; | 49 | _userManager = userManager; |
| 49 | } | 50 | } |
| @@ -62,10 +63,10 @@ namespace NCC.Extend.LqSkzh | @@ -62,10 +63,10 @@ namespace NCC.Extend.LqSkzh | ||
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | /// <summary> | 65 | /// <summary> |
| 65 | - /// 获取收款账户列表 | ||
| 66 | - /// </summary> | ||
| 67 | - /// <param name="input">请求参数</param> | ||
| 68 | - /// <returns></returns> | 66 | + /// 获取收款账户列表 |
| 67 | + /// </summary> | ||
| 68 | + /// <param name="input">请求参数</param> | ||
| 69 | + /// <returns></returns> | ||
| 69 | [HttpGet("")] | 70 | [HttpGet("")] |
| 70 | public async Task<dynamic> GetList([FromQuery] LqSkzhListQueryInput input) | 71 | public async Task<dynamic> GetList([FromQuery] LqSkzhListQueryInput input) |
| 71 | { | 72 | { |
| @@ -74,13 +75,16 @@ namespace NCC.Extend.LqSkzh | @@ -74,13 +75,16 @@ namespace NCC.Extend.LqSkzh | ||
| 74 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | 75 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) |
| 75 | .WhereIF(!string.IsNullOrEmpty(input.sktj), p => p.Sktj.Contains(input.sktj)) | 76 | .WhereIF(!string.IsNullOrEmpty(input.sktj), p => p.Sktj.Contains(input.sktj)) |
| 76 | .WhereIF(!string.IsNullOrEmpty(input.skzh), p => p.Skzh.Contains(input.skzh)) | 77 | .WhereIF(!string.IsNullOrEmpty(input.skzh), p => p.Skzh.Contains(input.skzh)) |
| 77 | - .Select(it=> new LqSkzhListOutput | 78 | + .Select(it => new LqSkzhListOutput |
| 78 | { | 79 | { |
| 79 | id = it.Id, | 80 | id = it.Id, |
| 80 | - sktj=it.Sktj, | ||
| 81 | - skzh=it.Skzh, | ||
| 82 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 83 | - return PageResult<LqSkzhListOutput>.SqlSugarPageResult(data); | 81 | + sktj = it.Sktj, |
| 82 | + skzh = it.Skzh, | ||
| 83 | + }) | ||
| 84 | + .MergeTable() | ||
| 85 | + .OrderBy(sidx + " " + input.sort) | ||
| 86 | + .ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 87 | + return PageResult<LqSkzhListOutput>.SqlSugarPageResult(data); | ||
| 84 | } | 88 | } |
| 85 | 89 | ||
| 86 | /// <summary> | 90 | /// <summary> |
| @@ -94,15 +98,18 @@ namespace NCC.Extend.LqSkzh | @@ -94,15 +98,18 @@ namespace NCC.Extend.LqSkzh | ||
| 94 | var userInfo = await _userManager.GetUserInfo(); | 98 | var userInfo = await _userManager.GetUserInfo(); |
| 95 | var entity = input.Adapt<LqSkzhEntity>(); | 99 | var entity = input.Adapt<LqSkzhEntity>(); |
| 96 | entity.Id = YitIdHelper.NextId().ToString(); | 100 | entity.Id = YitIdHelper.NextId().ToString(); |
| 97 | - var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | ||
| 98 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | 101 | + var isOk = await _db.Insertable(entity) |
| 102 | + .IgnoreColumns(ignoreNullColumn: true) | ||
| 103 | + .ExecuteCommandAsync(); | ||
| 104 | + if (!(isOk > 0)) | ||
| 105 | + throw NCCException.Oh(ErrorCode.COM1000); | ||
| 99 | } | 106 | } |
| 100 | 107 | ||
| 101 | /// <summary> | 108 | /// <summary> |
| 102 | - /// 获取收款账户无分页列表 | ||
| 103 | - /// </summary> | ||
| 104 | - /// <param name="input">请求参数</param> | ||
| 105 | - /// <returns></returns> | 109 | + /// 获取收款账户无分页列表 |
| 110 | + /// </summary> | ||
| 111 | + /// <param name="input">请求参数</param> | ||
| 112 | + /// <returns></returns> | ||
| 106 | [NonAction] | 113 | [NonAction] |
| 107 | public async Task<dynamic> GetNoPagingList([FromQuery] LqSkzhListQueryInput input) | 114 | public async Task<dynamic> GetNoPagingList([FromQuery] LqSkzhListQueryInput input) |
| 108 | { | 115 | { |
| @@ -111,20 +118,23 @@ namespace NCC.Extend.LqSkzh | @@ -111,20 +118,23 @@ namespace NCC.Extend.LqSkzh | ||
| 111 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | 118 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) |
| 112 | .WhereIF(!string.IsNullOrEmpty(input.sktj), p => p.Sktj.Contains(input.sktj)) | 119 | .WhereIF(!string.IsNullOrEmpty(input.sktj), p => p.Sktj.Contains(input.sktj)) |
| 113 | .WhereIF(!string.IsNullOrEmpty(input.skzh), p => p.Skzh.Contains(input.skzh)) | 120 | .WhereIF(!string.IsNullOrEmpty(input.skzh), p => p.Skzh.Contains(input.skzh)) |
| 114 | - .Select(it=> new LqSkzhListOutput | 121 | + .Select(it => new LqSkzhListOutput |
| 115 | { | 122 | { |
| 116 | id = it.Id, | 123 | id = it.Id, |
| 117 | - sktj=it.Sktj, | ||
| 118 | - skzh=it.Skzh, | ||
| 119 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | ||
| 120 | - return data; | 124 | + sktj = it.Sktj, |
| 125 | + skzh = it.Skzh, | ||
| 126 | + }) | ||
| 127 | + .MergeTable() | ||
| 128 | + .OrderBy(sidx + " " + input.sort) | ||
| 129 | + .ToListAsync(); | ||
| 130 | + return data; | ||
| 121 | } | 131 | } |
| 122 | 132 | ||
| 123 | /// <summary> | 133 | /// <summary> |
| 124 | - /// 导出收款账户 | ||
| 125 | - /// </summary> | ||
| 126 | - /// <param name="input">请求参数</param> | ||
| 127 | - /// <returns></returns> | 134 | + /// 导出收款账户 |
| 135 | + /// </summary> | ||
| 136 | + /// <param name="input">请求参数</param> | ||
| 137 | + /// <returns></returns> | ||
| 128 | [HttpGet("Actions/Export")] | 138 | [HttpGet("Actions/Export")] |
| 129 | public async Task<dynamic> Export([FromQuery] LqSkzhListQueryInput input) | 139 | public async Task<dynamic> Export([FromQuery] LqSkzhListQueryInput input) |
| 130 | { | 140 | { |
| @@ -139,7 +149,8 @@ namespace NCC.Extend.LqSkzh | @@ -139,7 +149,8 @@ namespace NCC.Extend.LqSkzh | ||
| 139 | { | 149 | { |
| 140 | exportData = await this.GetNoPagingList(input); | 150 | exportData = await this.GetNoPagingList(input); |
| 141 | } | 151 | } |
| 142 | - List<ParamsModel> paramList = "[{\"value\":\"收款途径编号\",\"field\":\"id\"},{\"value\":\"收款途径\",\"field\":\"sktj\"},{\"value\":\"收款账号\",\"field\":\"skzh\"},]".ToList<ParamsModel>(); | 152 | + List<ParamsModel> paramList = |
| 153 | + "[{\"value\":\"收款途径编号\",\"field\":\"id\"},{\"value\":\"收款途径\",\"field\":\"sktj\"},{\"value\":\"收款账号\",\"field\":\"skzh\"},]".ToList<ParamsModel>(); | ||
| 143 | ExcelConfig excelconfig = new ExcelConfig(); | 154 | ExcelConfig excelconfig = new ExcelConfig(); |
| 144 | excelconfig.FileName = "收款账户.xls"; | 155 | excelconfig.FileName = "收款账户.xls"; |
| 145 | excelconfig.HeadFont = "微软雅黑"; | 156 | excelconfig.HeadFont = "微软雅黑"; |
| @@ -152,7 +163,13 @@ namespace NCC.Extend.LqSkzh | @@ -152,7 +163,13 @@ namespace NCC.Extend.LqSkzh | ||
| 152 | var isExist = paramList.Find(p => p.field == item); | 163 | var isExist = paramList.Find(p => p.field == item); |
| 153 | if (isExist != null) | 164 | if (isExist != null) |
| 154 | { | 165 | { |
| 155 | - excelconfig.ColumnModel.Add(new ExcelColumnModel() { Column = isExist.field, ExcelColumn = isExist.value }); | 166 | + excelconfig.ColumnModel.Add( |
| 167 | + new ExcelColumnModel() | ||
| 168 | + { | ||
| 169 | + Column = isExist.field, | ||
| 170 | + ExcelColumn = isExist.value, | ||
| 171 | + } | ||
| 172 | + ); | ||
| 156 | } | 173 | } |
| 157 | } | 174 | } |
| 158 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; | 175 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; |
| @@ -161,7 +178,7 @@ namespace NCC.Extend.LqSkzh | @@ -161,7 +178,7 @@ namespace NCC.Extend.LqSkzh | ||
| 161 | var output = new | 178 | var output = new |
| 162 | { | 179 | { |
| 163 | name = excelconfig.FileName, | 180 | name = excelconfig.FileName, |
| 164 | - url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | 181 | + url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC"), |
| 165 | }; | 182 | }; |
| 166 | return output; | 183 | return output; |
| 167 | } | 184 | } |
| @@ -182,7 +199,7 @@ namespace NCC.Extend.LqSkzh | @@ -182,7 +199,7 @@ namespace NCC.Extend.LqSkzh | ||
| 182 | //开启事务 | 199 | //开启事务 |
| 183 | _db.BeginTran(); | 200 | _db.BeginTran(); |
| 184 | //批量删除收款账户 | 201 | //批量删除收款账户 |
| 185 | - await _db.Deleteable<LqSkzhEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | 202 | + await _db.Deleteable<LqSkzhEntity>().In(d => d.Id, ids).ExecuteCommandAsync(); |
| 186 | //关闭事务 | 203 | //关闭事务 |
| 187 | _db.CommitTran(); | 204 | _db.CommitTran(); |
| 188 | } | 205 | } |
| @@ -205,8 +222,11 @@ namespace NCC.Extend.LqSkzh | @@ -205,8 +222,11 @@ namespace NCC.Extend.LqSkzh | ||
| 205 | public async Task Update(string id, [FromBody] LqSkzhUpInput input) | 222 | public async Task Update(string id, [FromBody] LqSkzhUpInput input) |
| 206 | { | 223 | { |
| 207 | var entity = input.Adapt<LqSkzhEntity>(); | 224 | var entity = input.Adapt<LqSkzhEntity>(); |
| 208 | - var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | ||
| 209 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | 225 | + var isOk = await _db.Updateable(entity) |
| 226 | + .IgnoreColumns(ignoreAllNullColumns: true) | ||
| 227 | + .ExecuteCommandAsync(); | ||
| 228 | + if (!(isOk > 0)) | ||
| 229 | + throw NCCException.Oh(ErrorCode.COM1001); | ||
| 210 | } | 230 | } |
| 211 | 231 | ||
| 212 | /// <summary> | 232 | /// <summary> |
| @@ -218,8 +238,11 @@ namespace NCC.Extend.LqSkzh | @@ -218,8 +238,11 @@ namespace NCC.Extend.LqSkzh | ||
| 218 | { | 238 | { |
| 219 | var entity = await _db.Queryable<LqSkzhEntity>().FirstAsync(p => p.Id == id); | 239 | var entity = await _db.Queryable<LqSkzhEntity>().FirstAsync(p => p.Id == id); |
| 220 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | 240 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); |
| 221 | - var isOk = await _db.Deleteable<LqSkzhEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | ||
| 222 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | 241 | + var isOk = await _db.Deleteable<LqSkzhEntity>() |
| 242 | + .Where(d => d.Id == id) | ||
| 243 | + .ExecuteCommandAsync(); | ||
| 244 | + if (!(isOk > 0)) | ||
| 245 | + throw NCCException.Oh(ErrorCode.COM1002); | ||
| 223 | } | 246 | } |
| 224 | } | 247 | } |
| 225 | } | 248 | } |
创建事业部业绩统计流水表视图.sql
0 → 100644
| 1 | +-- 创建事业部业绩统计流水表视图 | ||
| 2 | +-- 统计各个事业部的目标业绩、完成业绩、完成率 | ||
| 3 | + | ||
| 4 | +DROP VIEW IF EXISTS `v_department_performance_flow`; | ||
| 5 | + | ||
| 6 | +CREATE VIEW `v_department_performance_flow` AS | ||
| 7 | +SELECT | ||
| 8 | + o.F_Id AS department_id, -- 部门ID | ||
| 9 | + o.F_FullName AS department_name, -- 部门名称 | ||
| 10 | + o.F_ParentId AS parent_id, -- 上级部门ID | ||
| 11 | + parent.F_FullName AS parent_name, -- 上级部门名称 | ||
| 12 | + o.F_Category AS department_category, -- 部门分类 | ||
| 13 | + kd.F_Id AS order_id, -- 开单ID | ||
| 14 | + kd.kdrq AS order_date, -- 开单时间 | ||
| 15 | + kd.djmd AS store_id, -- 开单门店ID | ||
| 16 | + m.mdbm AS store_code, -- 门店编号 | ||
| 17 | + m.dm AS store_name, -- 门店名称 | ||
| 18 | + m.xsyj AS target_amount, -- 目标业绩(门店生命线) | ||
| 19 | + kd.zdyj AS completed_amount, -- 完成业绩(整单业绩) | ||
| 20 | + kd.sfyj AS actual_amount, -- 实付业绩 | ||
| 21 | + kd.qk AS debt_amount, -- 欠款 | ||
| 22 | + kd.jsj AS golden_triangle, -- 金三角 | ||
| 23 | + kd.kdhy AS member_id, -- 开单会员ID | ||
| 24 | + kd.kdhyc AS member_name, -- 开单会员名称 | ||
| 25 | + kd.kdhysjh AS member_phone, -- 开单会员手机号 | ||
| 26 | + kd.gjlx AS customer_type, -- 顾客类型 | ||
| 27 | + kd.hgjg AS partner_institution, -- 合作机构 | ||
| 28 | + kd.fkfs AS payment_method, -- 付款方式 | ||
| 29 | + kd.khly AS customer_source, -- 客户来源 | ||
| 30 | + kd.tjr AS referrer, -- 推荐人 | ||
| 31 | + kd.sfskdd AS is_first_order, -- 是否首开订单 | ||
| 32 | + kd.jj AS description, -- 简介 | ||
| 33 | + kd.bz AS remarks, -- 备注 | ||
| 34 | + kd.F_CreateUser AS create_user, -- 开单用户 | ||
| 35 | + kd.F_FIleUrl AS file_url, -- 方案其他 | ||
| 36 | + -- 计算完成率 | ||
| 37 | + CASE | ||
| 38 | + WHEN m.xsyj > 0 THEN ROUND((kd.zdyj / m.xsyj) * 100, 2) | ||
| 39 | + ELSE 0 | ||
| 40 | + END AS completion_rate, -- 完成率(%) | ||
| 41 | + -- 时间维度字段 | ||
| 42 | + YEAR(kd.kdrq) AS order_year, -- 开单年份 | ||
| 43 | + MONTH(kd.kdrq) AS order_month, -- 开单月份 | ||
| 44 | + QUARTER(kd.kdrq) AS order_quarter, -- 开单季度 | ||
| 45 | + DATE(kd.kdrq) AS order_date_only, -- 开单日期(不含时间) | ||
| 46 | + -- 使用开单日期作为创建时间 | ||
| 47 | + kd.kdrq AS create_time, -- 创建时间(使用开单日期) | ||
| 48 | + kd.kdrq AS modify_time -- 修改时间(使用开单日期) | ||
| 49 | +FROM base_organize o | ||
| 50 | +LEFT JOIN base_organize parent ON o.F_ParentId = parent.F_Id | ||
| 51 | +LEFT JOIN lq_mdxx m ON m.syb = o.F_Id | ||
| 52 | +LEFT JOIN lq_kd_kdjlb kd ON kd.djmd = m.F_Id | ||
| 53 | +WHERE (o.F_DeleteMark IS NULL OR o.F_DeleteMark != 1) | ||
| 54 | + AND o.F_Category = 'department' -- 只统计部门类型 | ||
| 55 | + AND kd.kdrq IS NOT NULL; -- 只包含有开单日期的记录 | ||
| 56 | + | ||
| 57 | +-- 添加视图注释 | ||
| 58 | +ALTER VIEW `v_department_performance_flow` COMMENT = '事业部业绩统计流水表视图 - 统计各事业部目标业绩、完成业绩、完成率等详细信息'; |
参考资料/.DS_Store
No preview for this file type