00486d53
“wangming”
更新多个.DS_Store文件,优...
|
1
2
3
4
5
6
7
8
9
10
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using NCC.ClayObject;
using NCC.Common.Configuration;
using NCC.Common.Core.Manager;
|
96009bc9
hexiaodong
hxd
|
11
12
13
|
using NCC.Common.Enum;
using NCC.Common.Extension;
using NCC.Common.Filter;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
14
15
16
|
using NCC.Common.Helper;
using NCC.Common.Model.NPOI;
using NCC.DataEncryption;
|
96009bc9
hexiaodong
hxd
|
17
18
|
using NCC.Dependency;
using NCC.DynamicApiController;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
19
20
|
using NCC.Extend.Entitys.Dto.LqKdKdjlb;
using NCC.Extend.Entitys.lq_jinsanjiao_user;
|
efde7d04
“wangming”
更新多个文件,删除不再使用的CSS...
|
21
|
using NCC.Extend.Entitys.lq_kd_jksyj;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
22
|
using NCC.Extend.Entitys.lq_kd_kdjlb;
|
efde7d04
“wangming”
更新多个文件,删除不再使用的CSS...
|
23
24
|
using NCC.Extend.Entitys.lq_kd_kjbsyj;
using NCC.Extend.Entitys.lq_kd_pxmx;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
25
26
|
using NCC.Extend.Entitys.lq_xmzl;
using NCC.Extend.Interfaces.LqKdKdjlb;
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
27
|
using NCC.Extend.Utils;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
28
29
|
using NCC.FriendlyException;
using NCC.JsonSerialization;
|
06553fb7
“wangming”
1
|
30
|
using NCC.System.Entitys.Permission;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
31
32
|
using SqlSugar;
using Yitter.IdGenerator;
|
96009bc9
hexiaodong
hxd
|
33
34
35
36
37
38
|
namespace NCC.Extend.LqKdKdjlb
{
/// <summary>
/// 开单记录表服务
/// </summary>
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
39
|
[ApiDescriptionSettings(Tag = "绿纤开单记录表服务", Name = "LqKdKdjlb", Order = 200)]
|
96009bc9
hexiaodong
hxd
|
40
41
42
43
44
45
46
47
48
|
[Route("api/Extend/[controller]")]
public class LqKdKdjlbService : ILqKdKdjlbService, IDynamicApiController, ITransient
{
private readonly ISqlSugarRepository<LqKdKdjlbEntity> _lqKdKdjlbRepository;
private readonly ISqlSugarRepository<LqKdJksyjEntity> _lqKdJksyjRepository;
private readonly ISqlSugarRepository<LqKdKjbsyjEntity> _lqKdKjbsyjRepository;
private readonly ISqlSugarRepository<LqKdPxmxEntity> _lqKdPxmxRepository;
private readonly SqlSugarScope _db;
private readonly IUserManager _userManager;
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
49
50
|
private readonly WeChatBotService _weChatBotService;
private readonly LqKdKdjlbStringGenerator _stringGenerator;
|
96009bc9
hexiaodong
hxd
|
51
52
53
54
55
56
57
58
59
|
/// <summary>
/// 初始化一个<see cref="LqKdKdjlbService"/>类型的新实例
/// </summary>
public LqKdKdjlbService(
ISqlSugarRepository<LqKdKdjlbEntity> lqKdKdjlbRepository,
ISqlSugarRepository<LqKdJksyjEntity> lqKdJksyjRepository,
ISqlSugarRepository<LqKdKjbsyjEntity> lqKdKjbsyjRepository,
ISqlSugarRepository<LqKdPxmxEntity> lqKdPxmxRepository,
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
60
61
|
IUserManager userManager,
WeChatBotService weChatBotService,
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
62
63
|
LqKdKdjlbStringGenerator stringGenerator
)
|
96009bc9
hexiaodong
hxd
|
64
|
{
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
65
|
_lqKdKdjlbRepository = lqKdKdjlbRepository;
|
96009bc9
hexiaodong
hxd
|
66
67
68
69
70
|
_db = _lqKdKdjlbRepository.Context;
_lqKdJksyjRepository = lqKdJksyjRepository;
_lqKdKjbsyjRepository = lqKdKjbsyjRepository;
_lqKdPxmxRepository = lqKdPxmxRepository;
_userManager = userManager;
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
71
72
|
_weChatBotService = weChatBotService;
_stringGenerator = stringGenerator;
|
96009bc9
hexiaodong
hxd
|
73
|
}
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
74
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
75
|
#region 获取开单记录表
|
96009bc9
hexiaodong
hxd
|
76
77
78
|
/// <summary>
/// 获取开单记录表
/// </summary>
|
2b23ca5e
“wangming”
更新退卡相关功能,重构退卡信息表及...
|
79
80
81
|
/// <remarks>
/// 获取开单记录及其关联的品项明细、健康师业绩、科技部老师业绩信息
/// 按照开单的完整格式返回数据,不包含汇总信息
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
82
|
///
|
2b23ca5e
“wangming”
更新退卡相关功能,重构退卡信息表及...
|
83
84
85
86
87
88
89
90
91
92
93
|
/// 返回数据结构:
/// - 主表信息:开单基础信息、业绩信息、支付信息、会员信息等
/// - 品项明细列表:每个品项包含完整的项目信息(项目次数、是否有效、来源类型等)
/// - 健康师业绩列表:按品项关联的健康师业绩信息
/// - 科技部老师业绩列表:按品项关联的科技部老师业绩信息
/// </remarks>
/// <param name="id">开单记录主键ID</param>
/// <returns>开单记录完整信息</returns>
/// <response code="200">查询成功</response>
/// <response code="404">开单记录不存在</response>
/// <response code="500">服务器内部错误</response>
|
96009bc9
hexiaodong
hxd
|
94
95
96
|
[HttpGet("{id}")]
public async Task<dynamic> GetInfo(string id)
{
|
2b23ca5e
“wangming”
更新退卡相关功能,重构退卡信息表及...
|
97
98
99
100
101
102
103
104
|
try
{
// 1. 查询主表信息
var entity = await _db.Queryable<LqKdKdjlbEntity>().FirstAsync(p => p.Id == id);
if (entity == null)
{
throw NCCException.Oh(ErrorCode.COM1005, "开单记录不存在");
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
105
|
|
2b23ca5e
“wangming”
更新退卡相关功能,重构退卡信息表及...
|
106
|
var output = entity.Adapt<LqKdKdjlbInfoOutput>();
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
107
|
|
2b23ca5e
“wangming”
更新退卡相关功能,重构退卡信息表及...
|
108
109
110
111
|
// 2. 查询品项明细列表
var lqKdPxmxList = await _db.Queryable<LqKdPxmxEntity>()
.Where(w => w.Glkdbh == entity.Id)
.ToListAsync();
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
112
|
|
2b23ca5e
“wangming”
更新退卡相关功能,重构退卡信息表及...
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
// 3. 查询健康师业绩列表
var lqKdJksyjList = await _db.Queryable<LqKdJksyjEntity>()
.Where(w => w.Glkdbh == entity.Id)
.ToListAsync();
// 4. 查询科技部老师业绩列表
var lqKdKjbsyjList = await _db.Queryable<LqKdKjbsyjEntity>()
.Where(w => w.Glkdbh == entity.Id)
.ToListAsync();
// 5. 构建品项明细输出,每个品项关联对应的业绩信息
var pxmxOutputList = new List<LqKdPxmxInfoOutput>();
foreach (var pxmx in lqKdPxmxList)
{
var pxmxOutput = new LqKdPxmxInfoOutput
{
id = pxmx.Id,
glkdbh = pxmx.Glkdbh,
px = pxmx.Px,
pxmc = pxmx.Pxmc,
pxjg = pxmx.Pxjg,
projectNumber = pxmx.ProjectNumber,
isEnabled = pxmx.IsEnabled,
sourceType = pxmx.SourceType,
memberId = pxmx.MemberId,
createTime = pxmx.CreateTIme,
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
139
|
totalPrice = pxmx.TotalPrice,
|
2b23ca5e
“wangming”
更新退卡相关功能,重构退卡信息表及...
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
};
// 关联该品项的健康师业绩
var jksyjForPx = lqKdJksyjList.Where(j => j.Kdpxid == pxmx.Id).ToList();
pxmxOutput.lqKdJksyjList = jksyjForPx.Adapt<List<LqKdJksyjInfoOutput>>();
// 关联该品项的科技部老师业绩
var kjbsyjForPx = lqKdKjbsyjList.Where(k => k.Kdpxid == pxmx.Id).ToList();
pxmxOutput.lqKdKjbsyjList = kjbsyjForPx.Adapt<List<LqKdKjbsyjInfoOutput>>();
pxmxOutputList.Add(pxmxOutput);
}
// 6. 设置输出结果
output.lqKdPxmxList = pxmxOutputList;
// 7. 设置全局业绩列表(用于兼容性,但主要使用品项关联的业绩)
output.lqKdJksyjList = lqKdJksyjList.Adapt<List<LqKdJksyjInfoOutput>>();
output.lqKdKjbsyjList = lqKdKjbsyjList.Adapt<List<LqKdKjbsyjInfoOutput>>();
return output;
}
catch (Exception ex)
{
Console.WriteLine($"获取开单记录失败: {ex.Message}");
throw NCCException.Oh(ErrorCode.COM1000, "获取开单记录失败");
}
|
96009bc9
hexiaodong
hxd
|
167
|
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
168
|
#endregion
|
96009bc9
hexiaodong
hxd
|
169
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
170
|
#region 获取开单记录表列表
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
171
|
|
96009bc9
hexiaodong
hxd
|
172
|
/// <summary>
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
173
174
175
176
|
/// 获取开单记录表列表
/// </summary>
/// <param name="input">请求参数</param>
/// <returns></returns>
|
96009bc9
hexiaodong
hxd
|
177
178
179
180
|
[HttpGet("")]
public async Task<dynamic> GetList([FromQuery] LqKdKdjlbListQueryInput input)
{
var sidx = input.sidx == null ? "id" : input.sidx;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
181
182
|
List<string> queryKdrq =
input.kdrq != null ? input.kdrq.Split(',').ToObeject<List<string>>() : null;
|
96009bc9
hexiaodong
hxd
|
183
184
185
186
187
188
|
DateTime? startKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.First()) : null;
DateTime? endKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.Last()) : null;
var data = await _db.Queryable<LqKdKdjlbEntity>()
.WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id))
.WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Equals(input.djmd))
.WhereIF(!string.IsNullOrEmpty(input.jsj), p => p.Jsj.Equals(input.jsj))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
.WhereIF(
queryKdrq != null,
p =>
p.Kdrq
>= new DateTime(
startKdrq.ToDate().Year,
startKdrq.ToDate().Month,
startKdrq.ToDate().Day,
0,
0,
0
)
)
.WhereIF(
queryKdrq != null,
p =>
p.Kdrq
<= new DateTime(
endKdrq.ToDate().Year,
endKdrq.ToDate().Month,
endKdrq.ToDate().Day,
23,
59,
59
)
)
|
96009bc9
hexiaodong
hxd
|
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
.WhereIF(!string.IsNullOrEmpty(input.gjlx), p => p.Gjlx.Equals(input.gjlx))
.WhereIF(!string.IsNullOrEmpty(input.hgjg), p => p.Hgjg.Equals(input.hgjg))
.WhereIF(!string.IsNullOrEmpty(input.zdyj), p => p.Zdyj.Equals(input.zdyj))
.WhereIF(!string.IsNullOrEmpty(input.sfyj), p => p.Sfyj.Equals(input.sfyj))
.WhereIF(!string.IsNullOrEmpty(input.qk), p => p.Qk.Equals(input.qk))
.WhereIF(!string.IsNullOrEmpty(input.ckfs), p => p.Ckfs.Equals(input.ckfs))
.WhereIF(!string.IsNullOrEmpty(input.ckmx), p => p.Ckmx.Contains(input.ckmx))
.WhereIF(!string.IsNullOrEmpty(input.fkfs), p => p.Fkfs.Equals(input.fkfs))
.WhereIF(!string.IsNullOrEmpty(input.fkyy), p => p.Fkyy.Equals(input.fkyy))
.WhereIF(!string.IsNullOrEmpty(input.fkpd), p => p.Fkpd.Contains(input.fkpd))
.WhereIF(!string.IsNullOrEmpty(input.khly), p => p.Khly.Equals(input.khly))
.WhereIF(!string.IsNullOrEmpty(input.tjr), p => p.Tjr.Contains(input.tjr))
.WhereIF(!string.IsNullOrEmpty(input.sfskdd), p => p.Sfskdd.Equals(input.sfskdd))
.WhereIF(!string.IsNullOrEmpty(input.jj), p => p.Jj.Contains(input.jj))
.WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz))
.WhereIF(!string.IsNullOrEmpty(input.kdhy), p => p.Kdhy.Equals(input.kdhy))
.WhereIF(!string.IsNullOrEmpty(input.kdhyc), p => p.Kdhyc.Contains(input.kdhyc))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
232
233
234
235
|
.WhereIF(
!string.IsNullOrEmpty(input.kdhysjh),
p => p.Kdhysjh.Contains(input.kdhysjh)
)
|
96009bc9
hexiaodong
hxd
|
236
|
.WhereIF(!string.IsNullOrEmpty(input.jksyj), p => p.Jksyj.Contains(input.jksyj))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
237
238
239
240
|
.WhereIF(
!string.IsNullOrEmpty(input.kjblsyj),
p => p.Kjblsyj.Contains(input.kjblsyj)
)
|
96009bc9
hexiaodong
hxd
|
241
|
.WhereIF(!string.IsNullOrEmpty(input.pxxx), p => p.Pxxx.Contains(input.pxxx))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
242
243
244
245
|
.WhereIF(
!string.IsNullOrEmpty(input.F_FIleUrl),
p => p.F_FIleUrl.Contains(input.F_FIleUrl)
)
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
246
|
.Select(it => new LqKdKdjlbListOutput
|
96009bc9
hexiaodong
hxd
|
247
248
|
{
id = it.Id,
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
djmd = it.Djmd,
jsj = it.Jsj,
kdrq = it.Kdrq,
gjlx = it.Gjlx,
hgjg = it.Hgjg,
zdyj = it.Zdyj,
sfyj = it.Sfyj,
qk = it.Qk,
ckfs = it.Ckfs,
ckmx = it.Ckmx,
fkfs = it.Fkfs,
fkyy = it.Fkyy,
fkpd = it.Fkpd,
khly = it.Khly,
tjr = it.Tjr,
sfskdd = it.Sfskdd,
jj = it.Jj,
bz = it.Bz,
kdhy = it.Kdhy,
kdhyc = it.Kdhyc,
kdhysjh = it.Kdhysjh,
jksyj = it.Jksyj,
kjblsyj = it.Kjblsyj,
pxxx = it.Pxxx,
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
273
|
F_FIleUrl = it.F_FIleUrl,
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
274
275
276
277
|
})
.MergeTable()
.OrderBy(sidx + " " + input.sort)
.ToPagedListAsync(input.currentPage, input.pageSize);
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
278
|
return PageResult<LqKdKdjlbListOutput>.SqlSugarPageResult(data);
|
96009bc9
hexiaodong
hxd
|
279
|
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
280
|
#endregion
|
96009bc9
hexiaodong
hxd
|
281
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
282
|
#region 新建开单记录表
|
96009bc9
hexiaodong
hxd
|
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
/// <summary>
/// 新建开单记录表
/// </summary>
/// <param name="input">参数</param>
/// <returns></returns>
[HttpPost("")]
public async Task Create([FromBody] LqKdKdjlbCrInput input)
{
var userInfo = await _userManager.GetUserInfo();
var entity = input.Adapt<LqKdKdjlbEntity>();
entity.Id = YitIdHelper.NextId().ToString();
try
{
//开启事务
_db.BeginTran();
|
96009bc9
hexiaodong
hxd
|
298
|
//新增开单记录表记录
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
299
|
entity.CreateUser = userInfo.userId;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
300
301
302
|
var newEntity = await _db.Insertable(entity)
.IgnoreColumns(ignoreNullColumn: true)
.ExecuteReturnEntityAsync();
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
303
304
305
306
307
308
309
310
|
//循环品相信息
// 收集所有需要插入的实体,然后批量插入
var allPxmxEntities = new List<LqKdPxmxEntity>();
var allJksyjEntities = new List<LqKdJksyjEntity>();
var allKjbsyjEntities = new List<LqKdKjbsyjEntity>();
// 处理品项明细列表
foreach (var item in input.lqKdPxmxList)
|
96009bc9
hexiaodong
hxd
|
311
|
{
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
312
313
|
// 创建品项明细实体
var lqKdPxmxEntity = new LqKdPxmxEntity
|
96009bc9
hexiaodong
hxd
|
314
|
{
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
315
316
317
318
319
320
321
322
323
324
325
326
327
|
Id = YitIdHelper.NextId().ToString(),
Glkdbh = newEntity.Id,
CreateTIme = DateTime.Now,
MemberId = entity.Kdhy,
IsEnabled = 0,
ProjectNumber = item.projectNumber ?? 1,
TotalPrice = (decimal)(item.pxjg * (item.projectNumber ?? 1)),
Px = item.px,
Pxmc = item.pxmc,
Pxjg = item.pxjg,
SourceType = item.sourceType,
};
allPxmxEntities.Add(lqKdPxmxEntity);
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
328
|
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
329
330
|
// 收集该品项关联的健康师业绩
if (item.lqKdJksyjList != null && item.lqKdJksyjList.Any())
|
96009bc9
hexiaodong
hxd
|
331
|
{
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
332
|
foreach (var ijks_tem in item.lqKdJksyjList)
|
06553fb7
“wangming”
1
|
333
|
{
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
allJksyjEntities.Add(
new LqKdJksyjEntity
{
Id = YitIdHelper.NextId().ToString(),
Glkdbh = newEntity.Id,
Jks = ijks_tem.jks,
Jksxm = ijks_tem.jksxm,
Jkszh = ijks_tem.jkszh,
Jksyj = ijks_tem.jksyj,
Yjsj = DateTime.Now,
Jsj_id = ijks_tem.jsj_id,
Kdpxid = lqKdPxmxEntity.Id,
}
);
|
06553fb7
“wangming”
1
|
348
|
}
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
349
|
}
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
350
|
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
351
352
353
354
|
// 收集该品项关联的科技部老师业绩
if (item.lqKdKjbsyjList != null && item.lqKdKjbsyjList.Any())
{
foreach (var ikjbs_tem in item.lqKdKjbsyjList)
|
06553fb7
“wangming”
1
|
355
|
{
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
356
357
358
359
360
361
362
363
364
365
366
367
368
|
allKjbsyjEntities.Add(
new LqKdKjbsyjEntity
{
Id = YitIdHelper.NextId().ToString(),
Glkdbh = newEntity.Id,
Kjbls = ikjbs_tem.kjbls,
Kjblsxm = ikjbs_tem.kjblsxm,
Kjblszh = ikjbs_tem.kjblszh,
Kjblsyj = ikjbs_tem.kjblsyj,
Yjsj = DateTime.Now,
Kdpxid = lqKdPxmxEntity.Id,
}
);
|
06553fb7
“wangming”
1
|
369
|
}
|
96009bc9
hexiaodong
hxd
|
370
|
}
|
96009bc9
hexiaodong
hxd
|
371
372
|
}
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
// 批量插入品项明细
if (allPxmxEntities.Any())
{
await _db.Insertable(allPxmxEntities).ExecuteCommandAsync();
}
// 批量插入健康师业绩
if (allJksyjEntities.Any())
{
await _db.Insertable(allJksyjEntities).ExecuteCommandAsync();
}
// 批量插入科技部老师业绩
if (allKjbsyjEntities.Any())
{
await _db.Insertable(allKjbsyjEntities).ExecuteCommandAsync();
}
|
96009bc9
hexiaodong
hxd
|
388
389
|
//关闭事务
_db.CommitTran();
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
390
|
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
391
392
393
394
395
396
|
// 生成开单记录字符串并发送到企业微信
try
{
var entityInfo = await GetInfo(newEntity.Id);
if (entityInfo != null)
{
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
397
398
399
|
var orderRecordString = _stringGenerator.GenerateOrderRecordString(
entityInfo
);
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
400
401
|
Console.WriteLine("开单记录字符串生成成功:");
Console.WriteLine(orderRecordString);
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
402
|
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
403
404
405
|
// 发送到企业微信群
try
{
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
406
407
408
|
var sendResult = await _weChatBotService.SendOrderRecordMessage(
orderRecordString
);
|
bdf9e891
“wangming”
更新.gitignore以包含.z...
|
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
|
if (sendResult)
{
Console.WriteLine("开单记录已成功发送到企业微信群");
}
else
{
Console.WriteLine("开单记录发送到企业微信群失败");
}
}
catch (Exception wechatEx)
{
Console.WriteLine($"发送企业微信消息异常: {wechatEx.Message}");
}
}
}
catch (Exception ex)
{
// 字符串生成失败不影响主流程,只记录日志
Console.WriteLine($"生成开单记录字符串失败: {ex.Message}");
}
|
96009bc9
hexiaodong
hxd
|
429
|
}
|
06553fb7
“wangming”
1
|
430
|
catch (Exception ex)
|
96009bc9
hexiaodong
hxd
|
431
432
433
|
{
//回滚事务
_db.RollbackTran();
|
06553fb7
“wangming”
1
|
434
435
|
Console.WriteLine($"开单创建失败: {ex.Message}");
Console.WriteLine($"异常堆栈: {ex.StackTrace}");
|
96009bc9
hexiaodong
hxd
|
436
437
438
|
throw NCCException.Oh(ErrorCode.COM1000);
}
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
439
|
#endregion
|
96009bc9
hexiaodong
hxd
|
440
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
441
|
#region 获取开单记录表无分页列表
|
96009bc9
hexiaodong
hxd
|
442
|
/// <summary>
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
443
444
445
446
|
/// 获取开单记录表无分页列表
/// </summary>
/// <param name="input">请求参数</param>
/// <returns></returns>
|
96009bc9
hexiaodong
hxd
|
447
448
449
450
|
[NonAction]
public async Task<dynamic> GetNoPagingList([FromQuery] LqKdKdjlbListQueryInput input)
{
var sidx = input.sidx == null ? "id" : input.sidx;
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
451
452
|
List<string> queryKdrq =
input.kdrq != null ? input.kdrq.Split(',').ToObeject<List<string>>() : null;
|
96009bc9
hexiaodong
hxd
|
453
454
455
456
457
458
|
DateTime? startKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.First()) : null;
DateTime? endKdrq = queryKdrq != null ? Ext.GetDateTime(queryKdrq.Last()) : null;
var data = await _db.Queryable<LqKdKdjlbEntity>()
.WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id))
.WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Equals(input.djmd))
.WhereIF(!string.IsNullOrEmpty(input.jsj), p => p.Jsj.Equals(input.jsj))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
|
.WhereIF(
queryKdrq != null,
p =>
p.Kdrq
>= new DateTime(
startKdrq.ToDate().Year,
startKdrq.ToDate().Month,
startKdrq.ToDate().Day,
0,
0,
0
)
)
.WhereIF(
queryKdrq != null,
p =>
p.Kdrq
<= new DateTime(
endKdrq.ToDate().Year,
endKdrq.ToDate().Month,
endKdrq.ToDate().Day,
23,
59,
59
)
)
|
96009bc9
hexiaodong
hxd
|
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
|
.WhereIF(!string.IsNullOrEmpty(input.gjlx), p => p.Gjlx.Equals(input.gjlx))
.WhereIF(!string.IsNullOrEmpty(input.hgjg), p => p.Hgjg.Equals(input.hgjg))
.WhereIF(!string.IsNullOrEmpty(input.zdyj), p => p.Zdyj.Equals(input.zdyj))
.WhereIF(!string.IsNullOrEmpty(input.sfyj), p => p.Sfyj.Equals(input.sfyj))
.WhereIF(!string.IsNullOrEmpty(input.qk), p => p.Qk.Equals(input.qk))
.WhereIF(!string.IsNullOrEmpty(input.ckfs), p => p.Ckfs.Equals(input.ckfs))
.WhereIF(!string.IsNullOrEmpty(input.ckmx), p => p.Ckmx.Contains(input.ckmx))
.WhereIF(!string.IsNullOrEmpty(input.fkfs), p => p.Fkfs.Equals(input.fkfs))
.WhereIF(!string.IsNullOrEmpty(input.fkyy), p => p.Fkyy.Equals(input.fkyy))
.WhereIF(!string.IsNullOrEmpty(input.fkpd), p => p.Fkpd.Contains(input.fkpd))
.WhereIF(!string.IsNullOrEmpty(input.khly), p => p.Khly.Equals(input.khly))
.WhereIF(!string.IsNullOrEmpty(input.tjr), p => p.Tjr.Contains(input.tjr))
.WhereIF(!string.IsNullOrEmpty(input.sfskdd), p => p.Sfskdd.Equals(input.sfskdd))
.WhereIF(!string.IsNullOrEmpty(input.jj), p => p.Jj.Contains(input.jj))
.WhereIF(!string.IsNullOrEmpty(input.bz), p => p.Bz.Contains(input.bz))
.WhereIF(!string.IsNullOrEmpty(input.kdhy), p => p.Kdhy.Equals(input.kdhy))
.WhereIF(!string.IsNullOrEmpty(input.kdhyc), p => p.Kdhyc.Contains(input.kdhyc))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
502
503
504
505
|
.WhereIF(
!string.IsNullOrEmpty(input.kdhysjh),
p => p.Kdhysjh.Contains(input.kdhysjh)
)
|
96009bc9
hexiaodong
hxd
|
506
|
.WhereIF(!string.IsNullOrEmpty(input.jksyj), p => p.Jksyj.Contains(input.jksyj))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
507
508
509
510
|
.WhereIF(
!string.IsNullOrEmpty(input.kjblsyj),
p => p.Kjblsyj.Contains(input.kjblsyj)
)
|
96009bc9
hexiaodong
hxd
|
511
|
.WhereIF(!string.IsNullOrEmpty(input.pxxx), p => p.Pxxx.Contains(input.pxxx))
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
512
513
514
515
|
.WhereIF(
!string.IsNullOrEmpty(input.F_FIleUrl),
p => p.F_FIleUrl.Contains(input.F_FIleUrl)
)
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
516
|
.Select(it => new LqKdKdjlbListOutput
|
96009bc9
hexiaodong
hxd
|
517
518
|
{
id = it.Id,
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
|
djmd = it.Djmd,
jsj = it.Jsj,
kdrq = it.Kdrq,
gjlx = it.Gjlx,
hgjg = it.Hgjg,
zdyj = it.Zdyj,
sfyj = it.Sfyj,
qk = it.Qk,
ckfs = it.Ckfs,
ckmx = it.Ckmx,
fkfs = it.Fkfs,
fkyy = it.Fkyy,
fkpd = it.Fkpd,
khly = it.Khly,
tjr = it.Tjr,
sfskdd = it.Sfskdd,
jj = it.Jj,
bz = it.Bz,
kdhy = it.Kdhy,
kdhyc = it.Kdhyc,
kdhysjh = it.Kdhysjh,
jksyj = it.Jksyj,
kjblsyj = it.Kjblsyj,
pxxx = it.Pxxx,
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
543
|
F_FIleUrl = it.F_FIleUrl,
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
544
545
546
547
|
})
.MergeTable()
.OrderBy(sidx + " " + input.sort)
.ToListAsync();
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
548
|
return data;
|
96009bc9
hexiaodong
hxd
|
549
|
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
550
|
#endregion
|
96009bc9
hexiaodong
hxd
|
551
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
552
|
#region 导出开单记录表
|
96009bc9
hexiaodong
hxd
|
553
|
/// <summary>
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
554
555
556
557
|
/// 导出开单记录表
/// </summary>
/// <param name="input">请求参数</param>
/// <returns></returns>
|
96009bc9
hexiaodong
hxd
|
558
559
560
561
562
563
564
565
566
567
568
569
570
571
|
[HttpGet("Actions/Export")]
public async Task<dynamic> Export([FromQuery] LqKdKdjlbListQueryInput input)
{
var userInfo = await _userManager.GetUserInfo();
var exportData = new List<LqKdKdjlbListOutput>();
if (input.dataType == 0)
{
var data = Clay.Object(await this.GetList(input));
exportData = data.Solidify<PageResult<LqKdKdjlbListOutput>>().list;
}
else
{
exportData = await this.GetNoPagingList(input);
}
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
572
573
|
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>();
|
96009bc9
hexiaodong
hxd
|
574
575
576
577
578
579
580
581
582
583
584
585
|
ExcelConfig excelconfig = new ExcelConfig();
excelconfig.FileName = "开单记录表.xls";
excelconfig.HeadFont = "微软雅黑";
excelconfig.HeadPoint = 10;
excelconfig.IsAllSizeColumn = true;
excelconfig.ColumnModel = new List<ExcelColumnModel>();
List<string> selectKeyList = input.selectKey.Split(',').ToList();
foreach (var item in selectKeyList)
{
var isExist = paramList.Find(p => p.field == item);
if (isExist != null)
{
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
586
587
588
589
590
591
592
|
excelconfig.ColumnModel.Add(
new ExcelColumnModel()
{
Column = isExist.field,
ExcelColumn = isExist.value,
}
);
|
96009bc9
hexiaodong
hxd
|
593
594
595
596
597
598
599
600
|
}
}
var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName;
ExcelExportHelper<LqKdKdjlbListOutput>.Export(exportData, excelconfig, addPath);
var fileName = _userManager.UserId + "|" + addPath + "|xls";
var output = new
{
name = excelconfig.FileName,
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
601
|
url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC"),
|
96009bc9
hexiaodong
hxd
|
602
603
604
|
};
return output;
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
605
|
#endregion
|
96009bc9
hexiaodong
hxd
|
606
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
607
|
#region 批量删除开单记录表
|
96009bc9
hexiaodong
hxd
|
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
|
/// <summary>
/// 批量删除开单记录表
/// </summary>
/// <param name="ids">主键数组</param>
/// <returns></returns>
[HttpPost("batchRemove")]
public async Task BatchRemove([FromBody] List<string> ids)
{
var entitys = await _db.Queryable<LqKdKdjlbEntity>().In(it => it.Id, ids).ToListAsync();
if (entitys.Count > 0)
{
try
{
//开启事务
_db.BeginTran();
//批量删除开单记录表
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
624
625
626
|
await _db.Deleteable<LqKdKdjlbEntity>()
.In(d => d.Id, ids)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
627
628
|
//清空子表数据
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
629
630
631
|
await _db.Deleteable<LqKdJksyjEntity>()
.In(u => u.Glkdbh, ids)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
632
633
|
//清空子表数据
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
634
635
636
|
await _db.Deleteable<LqKdKjbsyjEntity>()
.In(u => u.Glkdbh, ids)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
637
638
|
//清空子表数据
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
639
640
641
|
await _db.Deleteable<LqKdPxmxEntity>()
.In(u => u.Glkdbh, ids)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
642
643
644
645
646
647
648
649
650
651
652
|
//关闭事务
_db.CommitTran();
}
catch (Exception)
{
//回滚事务
_db.RollbackTran();
throw NCCException.Oh(ErrorCode.COM1002);
}
}
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
653
|
#endregion
|
96009bc9
hexiaodong
hxd
|
654
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
655
|
#region 更新开单记录表
|
96009bc9
hexiaodong
hxd
|
656
657
658
|
/// <summary>
/// 更新开单记录表
/// </summary>
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
659
660
|
/// <remarks>
/// 更新开单记录及其关联的品项明细、健康师业绩、科技部老师业绩信息
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
661
|
///
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
|
/// 示例请求:
/// ```json
/// {
/// "id": "开单编号",
/// "djmd": "单据门店",
/// "jsj": "金三角",
/// "kdrq": "2025-01-11",
/// "lqKdPxmxList": [
/// {
/// "px": "品项编号",
/// "pxmc": "品项名称",
/// "pxjg": 100.00,
/// "projectNumber": 1,
/// "sourceType": "购买",
/// "lqKdJksyjList": [
/// {
/// "jks": "健康师",
/// "jksxm": "健康师姓名",
/// "jksyj": "100"
/// }
/// ]
/// }
/// ]
/// }
/// ```
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
687
|
///
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
688
689
690
691
692
693
694
695
696
697
|
/// 参数说明:
/// - id: 开单记录主键ID
/// - input: 开单记录更新参数,包含品项明细和业绩信息
/// </remarks>
/// <param name="id">开单记录主键ID</param>
/// <param name="input">开单记录更新参数</param>
/// <returns>无返回值</returns>
/// <response code="200">更新成功</response>
/// <response code="400">参数错误或数据验证失败</response>
/// <response code="500">服务器内部错误</response>
|
96009bc9
hexiaodong
hxd
|
698
699
700
701
702
703
704
705
|
[HttpPut("{id}")]
public async Task Update(string id, [FromBody] LqKdKdjlbUpInput input)
{
var entity = input.Adapt<LqKdKdjlbEntity>();
try
{
//开启事务
_db.BeginTran();
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
706
|
|
96009bc9
hexiaodong
hxd
|
707
|
//更新开单记录表记录
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
708
709
710
|
await _db.Updateable(entity)
.IgnoreColumns(ignoreAllNullColumns: true)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
711
712
|
//清空原有数据
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
713
714
715
716
717
718
719
720
721
|
await _db.Deleteable<LqKdJksyjEntity>()
.Where(u => u.Glkdbh == id)
.ExecuteCommandAsync();
await _db.Deleteable<LqKdKjbsyjEntity>()
.Where(u => u.Glkdbh == id)
.ExecuteCommandAsync();
await _db.Deleteable<LqKdPxmxEntity>()
.Where(u => u.Glkdbh == id)
.ExecuteCommandAsync();
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
722
723
724
725
726
727
728
729
|
// 收集所有需要插入的实体,然后批量插入
var allPxmxEntities = new List<LqKdPxmxEntity>();
var allJksyjEntities = new List<LqKdJksyjEntity>();
var allKjbsyjEntities = new List<LqKdKjbsyjEntity>();
// 处理品项明细列表
if (input.lqKdPxmxList != null && input.lqKdPxmxList.Any())
|
96009bc9
hexiaodong
hxd
|
730
|
{
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
731
|
foreach (var item in input.lqKdPxmxList)
|
96009bc9
hexiaodong
hxd
|
732
|
{
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
|
// 创建品项明细实体
var lqKdPxmxEntity = new LqKdPxmxEntity
{
Id = YitIdHelper.NextId().ToString(),
Glkdbh = entity.Id,
CreateTIme = DateTime.Now,
MemberId = entity.Kdhy,
IsEnabled = 0,
ProjectNumber = item.projectNumber ?? 1,
TotalPrice = (decimal)(item.pxjg * (item.projectNumber ?? 1)),
Px = item.px,
Pxmc = item.pxmc,
Pxjg = item.pxjg,
SourceType = item.sourceType,
};
allPxmxEntities.Add(lqKdPxmxEntity);
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
749
|
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
750
751
752
753
754
|
// 收集该品项关联的健康师业绩
if (item.lqKdJksyjList != null && item.lqKdJksyjList.Any())
{
foreach (var ijks_tem in item.lqKdJksyjList)
{
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
755
756
757
758
759
760
761
762
763
764
765
766
767
768
|
allJksyjEntities.Add(
new LqKdJksyjEntity
{
Id = YitIdHelper.NextId().ToString(),
Glkdbh = entity.Id,
Jks = ijks_tem.jks,
Jksxm = ijks_tem.jksxm,
Jkszh = ijks_tem.jkszh,
Jksyj = ijks_tem.jksyj,
Yjsj = DateTime.Now,
Jsj_id = ijks_tem.jsj_id,
Kdpxid = lqKdPxmxEntity.Id,
}
);
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
769
770
|
}
}
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
771
|
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
772
773
774
775
776
|
// 收集该品项关联的科技部老师业绩
if (item.lqKdKjbsyjList != null && item.lqKdKjbsyjList.Any())
{
foreach (var ikjbs_tem in item.lqKdKjbsyjList)
{
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
777
778
779
780
781
782
783
784
785
786
787
788
789
|
allKjbsyjEntities.Add(
new LqKdKjbsyjEntity
{
Id = YitIdHelper.NextId().ToString(),
Glkdbh = entity.Id,
Kjbls = ikjbs_tem.kjbls,
Kjblsxm = ikjbs_tem.kjblsxm,
Kjblszh = ikjbs_tem.kjblszh,
Kjblsyj = ikjbs_tem.kjblsyj,
Yjsj = DateTime.Now,
Kdpxid = lqKdPxmxEntity.Id,
}
);
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
790
791
|
}
}
|
96009bc9
hexiaodong
hxd
|
792
|
}
|
96009bc9
hexiaodong
hxd
|
793
794
|
}
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
795
796
|
// 批量插入品项明细
if (allPxmxEntities.Any())
|
96009bc9
hexiaodong
hxd
|
797
|
{
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
798
|
await _db.Insertable(allPxmxEntities).ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
799
|
}
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
800
801
|
// 批量插入健康师业绩
if (allJksyjEntities.Any())
|
96009bc9
hexiaodong
hxd
|
802
|
{
|
35bb18d3
“wangming”
更新多个.DS_Store文件,删...
|
803
804
805
806
807
808
|
await _db.Insertable(allJksyjEntities).ExecuteCommandAsync();
}
// 批量插入科技部老师业绩
if (allKjbsyjEntities.Any())
{
await _db.Insertable(allKjbsyjEntities).ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
809
|
}
|
96009bc9
hexiaodong
hxd
|
810
811
812
813
814
815
816
817
818
819
|
//关闭事务
_db.CommitTran();
}
catch (Exception)
{
//回滚事务
_db.RollbackTran();
throw NCCException.Oh(ErrorCode.COM1001);
}
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
820
|
#endregion
|
96009bc9
hexiaodong
hxd
|
821
|
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
822
|
#region 删除开单记录表
|
96009bc9
hexiaodong
hxd
|
823
824
825
826
827
828
829
830
831
832
833
834
835
|
/// <summary>
/// 删除开单记录表
/// </summary>
/// <returns></returns>
[HttpDelete("{id}")]
public async Task Delete(string id)
{
var entity = await _db.Queryable<LqKdKdjlbEntity>().FirstAsync(p => p.Id == id);
_ = entity ?? throw NCCException.Oh(ErrorCode.COM1005);
try
{
//开启事务
_db.BeginTran();
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
836
|
|
96009bc9
hexiaodong
hxd
|
837
|
//删除开单记录表记录
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
838
839
840
|
await _db.Deleteable<LqKdKdjlbEntity>()
.Where(d => d.Id == id)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
841
842
|
//清空子表数据
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
843
844
845
|
await _db.Deleteable<LqKdJksyjEntity>()
.Where(u => u.Glkdbh == id)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
846
847
|
//清空子表数据
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
848
849
850
|
await _db.Deleteable<LqKdKjbsyjEntity>()
.Where(u => u.Glkdbh == id)
.ExecuteCommandAsync();
|
96009bc9
hexiaodong
hxd
|
851
852
|
//清空子表数据
|
00486d53
“wangming”
更新多个.DS_Store文件,优...
|
853
854
855
|
await _db.Deleteable<LqKdPxmxEntity>()
.Where(u => u.Glkdbh == id)
.ExecuteCommandAsync();
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
856
|
|
96009bc9
hexiaodong
hxd
|
857
858
859
860
861
862
863
864
865
866
|
//关闭事务
_db.CommitTran();
}
catch (Exception)
{
//回滚事务
_db.RollbackTran();
throw NCCException.Oh(ErrorCode.COM1002);
}
}
|
2ce7c3cb
“wangming”
更新门店目标设定相关功能,新增字段...
|
867
|
#endregion
|
96009bc9
hexiaodong
hxd
|
868
869
|
}
}
|