S6MdpSyncTransformService.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. using Admin.NET.Core.Service;
  2. using Microsoft.Extensions.Logging;
  3. using System.Text.Json;
  4. namespace Admin.NET.Plugin.AiDOP.Manufacturing;
  5. /// <summary>
  6. /// S6 生产执行 — T8 KPI 数据底座与刷新转换服务。
  7. /// 路径 A:方老师 v5.4 KPI 字段对照表 J 列 SQL 原逻辑直发 T8 SQL Server(ConfigId=t8_v5)。
  8. /// 包含 KPI:S6_L1_001 工单制造满足率 / S6_L1_002 工单制造人效。
  9. /// </summary>
  10. public class S6MdpSyncTransformService : ITransient
  11. {
  12. private readonly ISqlSugarClient _db;
  13. private readonly SysNoticeService _sysNoticeService;
  14. private readonly ILogger<S6MdpSyncTransformService> _logger;
  15. private const string JobCode = "S6_MDP_SYNC_TRANSFORM";
  16. private const string JobName = "S6 生产执行 MDP 同步与转换";
  17. private const string T8ConfigId = "t8_v5";
  18. private const string ModuleCode = "S6";
  19. // FAILURE-NOTIFICATION-1:超级管理员 superAdmin.NET(AccountType=999)
  20. private const long NoticeReceiverUserId = 1300000000101L;
  21. private const string NoticeReceiverUserName = "超级管理员";
  22. public S6MdpSyncTransformService(
  23. ISqlSugarClient db,
  24. SysNoticeService sysNoticeService,
  25. ILogger<S6MdpSyncTransformService> logger)
  26. {
  27. _db = db;
  28. _sysNoticeService = sysNoticeService;
  29. _logger = logger;
  30. }
  31. public async Task<S6MdpSyncTransformResult> RunFullAsync(
  32. CancellationToken cancellationToken = default,
  33. string triggerType = "AUTO",
  34. S6MdpRefreshOption? option = null)
  35. {
  36. cancellationToken.ThrowIfCancellationRequested();
  37. option ??= S6MdpRefreshOption.Default();
  38. // 目标租户由 T8 账套(ztid)映射决定,替代此前写死的 1300000000001(禁止固定默认/兜底)
  39. option.TenantId = AidopSourceTenantMap.ResolveTenantId(option.SourceZtid, option.TenantId);
  40. var now = DateTime.Now;
  41. var batchId = $"S6_MDP_FULL_{now:yyyyMMddHHmmss}";
  42. var normalizedTrigger = NormalizeTriggerType(triggerType);
  43. var runLogId = await InsertTransformRunLogAsync(batchId, now, normalizedTrigger, option.TenantId);
  44. var result = new S6MdpSyncTransformResult
  45. {
  46. BatchId = batchId,
  47. RunLogId = runLogId,
  48. TriggerType = normalizedTrigger,
  49. SourceZtid = option.SourceZtid,
  50. BizDate = option.BizDate,
  51. BizMonth = option.BizMonth,
  52. MonthlyPeriodStart = option.MonthlyPeriodStart,
  53. MonthlyPeriodEnd = option.MonthlyPeriodEnd
  54. };
  55. try
  56. {
  57. result.StageRows = 0;
  58. result.StandardRows = 0;
  59. var sub22 = await BuildS6L1001WorkOrderMfgFulfillmentAsync(batchId, now, option, cancellationToken);
  60. result.MergeSub("S6_L1_001", sub22);
  61. var sub23 = await BuildS6L1002WorkOrderMfgEfficiencyAsync(batchId, now, option, cancellationToken);
  62. result.MergeSub("S6_L1_002", sub23);
  63. await MarkTransformRunSuccessAsync(runLogId, now, result);
  64. return result;
  65. }
  66. catch (Exception ex)
  67. {
  68. await MarkTransformRunFailedAsync(runLogId, now, ex.Message, batchId);
  69. throw;
  70. }
  71. }
  72. // ─────────────────────────────────────────────────────────────────────────
  73. /// <summary>S6_L1_001 工单制造满足率 = 计划完工时间内累计报工 / 工单计划生产数量。</summary>
  74. private async Task<KpiBuildSubResult> BuildS6L1001WorkOrderMfgFulfillmentAsync(
  75. string batchId, DateTime now, S6MdpRefreshOption option, CancellationToken ct)
  76. {
  77. var sub = new KpiBuildSubResult();
  78. const string sql = @"
  79. select a.noid as noid, b.rwnoid as rwnoid, b.code as code, b.sl as sl, sum(d.slzx) as slzx
  80. from kc_dd_head a with(nolock)
  81. left join kc_dd_list b with(nolock) on a.Id=b.idid
  82. left join (
  83. select b.lynoid as lynoid, b.code as code,
  84. convert(varchar(10), a.shtime, 23) as shtime, b.slzx as slzx
  85. from kc_tz_head a with(nolock)
  86. inner join kc_tz_list b with(nolock) on a.Id=b.idid
  87. where a.ztid=@ztid and a.lbs='生产入库' and a.hzyn=0 and a.zfyn=0 and a.shyn=1
  88. ) d on b.rwnoid=d.lynoid and b.code=d.code
  89. where a.ztid=@ztid and a.lbs='生产任务' and a.zf=0 and a.shyn=1 and d.shtime<=b.jhdate
  90. group by a.noid, b.rwnoid, b.code, b.sl";
  91. var rows = await QueryT8Async<S6MfgFulfillmentRow>(sql, new[] { new SugarParameter("@ztid", option.SourceZtid) });
  92. sub.T8Rows = rows.Count;
  93. var dwdAffected = 0;
  94. var rateList = new List<decimal>();
  95. foreach (var r in rows)
  96. {
  97. ct.ThrowIfCancellationRequested();
  98. if (string.IsNullOrEmpty(r.noid)) continue;
  99. decimal? rate = (r.sl.HasValue && r.sl.Value > 0m && r.slzx.HasValue)
  100. ? Math.Round(r.slzx.Value / r.sl.Value, 4)
  101. : null;
  102. if (rate.HasValue) rateList.Add(rate.Value);
  103. dwdAffected += await _db.Ado.ExecuteCommandAsync(@"
  104. INSERT INTO dwd_t8_work_order_mfg_fulfillment
  105. (tenant_id, factory_id, biz_date, source_ztid, order_no, task_no, item_code,
  106. plan_qty, done_qty_in_window, fulfillment_rate, batch_id, create_time)
  107. VALUES
  108. (@TenantId, 1, @bizDate, @ztid, @orderNo, @taskNo, @itemCode,
  109. @planQty, @doneQty, @rate, @batchId, @now)
  110. ON DUPLICATE KEY UPDATE
  111. plan_qty=VALUES(plan_qty), done_qty_in_window=VALUES(done_qty_in_window),
  112. fulfillment_rate=VALUES(fulfillment_rate),
  113. batch_id=VALUES(batch_id), update_time=@now",
  114. new SugarParameter("@TenantId", option.TenantId),
  115. new SugarParameter("@bizDate", option.BizDate),
  116. new SugarParameter("@ztid", option.SourceZtid),
  117. new SugarParameter("@orderNo", r.noid),
  118. new SugarParameter("@taskNo", r.rwnoid ?? ""),
  119. new SugarParameter("@itemCode", r.code ?? ""),
  120. new SugarParameter("@planQty", r.sl),
  121. new SugarParameter("@doneQty", r.slzx),
  122. new SugarParameter("@rate", rate),
  123. new SugarParameter("@batchId", batchId),
  124. new SugarParameter("@now", now));
  125. }
  126. sub.DwdRows = dwdAffected;
  127. decimal? metricValue = rateList.Count > 0
  128. ? Math.Round(rateList.Average() * 100m, 4) // 百分号
  129. : null;
  130. sub.KpiRows = await UpsertKpiValueAsync("S6_L1_001", option.TenantId, option.BizDate, metricValue, now);
  131. sub.DenominatorStatus = rateList.Count > 0 ? "OK" : "NO_VALID_WORK_ORDER";
  132. return sub;
  133. }
  134. /// <summary>S6_L1_002 工单制造人效 = 完成制造工单数(lbs=生产入库 AND (slzx>=sl OR gdyn=1)) / count(gw=生产)。</summary>
  135. private async Task<KpiBuildSubResult> BuildS6L1002WorkOrderMfgEfficiencyAsync(
  136. string batchId, DateTime now, S6MdpRefreshOption option, CancellationToken ct)
  137. {
  138. var sub = new KpiBuildSubResult();
  139. const string sqlNumer = @"
  140. select count(*) as ddnum
  141. from kc_tz_head a with(nolock)
  142. inner join kc_tz_list b with(nolock) on a.Id=b.idid
  143. where a.ztid=@ztid and a.lbs='生产入库' and a.hzyn=0 and a.zfyn=0 and a.shyn=1
  144. and a.date0 between @startDate and @endDate
  145. and b.slzx>0 and (b.slzx>=b.sl or b.gdyn=1)";
  146. const string sqlDenom = @"
  147. select count(*) as penum
  148. from sys_pelist with(nolock)
  149. where ztid=@ztid and zzzt='在职' and gw='生产'";
  150. var pNumer = new[]
  151. {
  152. new SugarParameter("@ztid", option.SourceZtid),
  153. new SugarParameter("@startDate", option.MonthlyPeriodStart),
  154. new SugarParameter("@endDate", option.MonthlyPeriodEnd)
  155. };
  156. var pDenom = new[] { new SugarParameter("@ztid", option.SourceZtid) };
  157. var numerRows = await QueryT8Async<S6CountRow>(sqlNumer, pNumer);
  158. var denomRows = await QueryT8Async<S6PeNumRow>(sqlDenom, pDenom);
  159. sub.T8Rows = numerRows.Count + denomRows.Count;
  160. int? doneCount = numerRows.FirstOrDefault()?.ddnum;
  161. int? headcount = denomRows.FirstOrDefault()?.penum;
  162. decimal? efficiency = null;
  163. string denomStatus;
  164. if (!headcount.HasValue || headcount.Value <= 0)
  165. denomStatus = "NO_HEADCOUNT";
  166. else if (!doneCount.HasValue)
  167. denomStatus = "NO_NUMERATOR";
  168. else
  169. {
  170. efficiency = Math.Round((decimal)doneCount.Value / headcount.Value, 4);
  171. denomStatus = "OK";
  172. }
  173. sub.DenominatorStatus = denomStatus;
  174. var dwdAffected = await _db.Ado.ExecuteCommandAsync(@"
  175. INSERT INTO dwd_t8_work_order_mfg_efficiency
  176. (tenant_id, factory_id, biz_month, source_ztid, period_start, period_end,
  177. done_count, production_headcount, efficiency, denominator_status, batch_id, create_time)
  178. VALUES
  179. (@TenantId, 1, @bizMonth, @ztid, @periodStart, @periodEnd,
  180. @doneCount, @headcount, @efficiency, @denomStatus, @batchId, @now)
  181. ON DUPLICATE KEY UPDATE
  182. period_start=VALUES(period_start), period_end=VALUES(period_end),
  183. done_count=VALUES(done_count), production_headcount=VALUES(production_headcount),
  184. efficiency=VALUES(efficiency), denominator_status=VALUES(denominator_status),
  185. batch_id=VALUES(batch_id), update_time=@now",
  186. new SugarParameter("@TenantId", option.TenantId),
  187. new SugarParameter("@bizMonth", option.BizMonth),
  188. new SugarParameter("@ztid", option.SourceZtid),
  189. new SugarParameter("@periodStart", option.MonthlyPeriodStart),
  190. new SugarParameter("@periodEnd", option.MonthlyPeriodEnd),
  191. new SugarParameter("@doneCount", doneCount),
  192. new SugarParameter("@headcount", headcount),
  193. new SugarParameter("@efficiency", efficiency),
  194. new SugarParameter("@denomStatus", denomStatus),
  195. new SugarParameter("@batchId", batchId),
  196. new SugarParameter("@now", now));
  197. sub.DwdRows = dwdAffected;
  198. sub.KpiRows = await UpsertKpiValueAsync("S6_L1_002", option.TenantId, option.MonthlyPeriodEnd, efficiency, now);
  199. return sub;
  200. }
  201. // ─────────────────────────────────────────────────────────────────────────
  202. private async Task<List<T>> QueryT8Async<T>(string sql, SugarParameter[] parameters)
  203. {
  204. var t8 = _db.AsTenant().GetConnectionScope(T8ConfigId);
  205. return await t8.Ado.SqlQueryAsync<T>(sql, parameters);
  206. }
  207. private async Task<int> UpsertKpiValueAsync(string metricCode, long tenantId, DateTime bizDate, decimal? metricValue, DateTime now)
  208. {
  209. // 沿用 S3 UpsertS3KpiValueAsync 范式:先查现存行 → UPDATE;不存在 → SELECT MAX(id)+1 显式生成 id 后 INSERT。
  210. // ado_s9_kpi_value_l1_day.id 为手工分配主键(无 AUTO_INCREMENT),必须显式 set;
  211. // metric_value 允许 NULL(分母缺失不得伪装真实 0)。
  212. // FIX-2:截断时分秒(月度 KPI 入参可能为 YYYY-MM-DD 23:59:59),保证 SELECT WHERE biz_date=@BizDate 与 DB date 列匹配,避免重复 INSERT。
  213. bizDate = bizDate.Date;
  214. var existingId = await _db.Ado.GetLongAsync(
  215. "SELECT IFNULL((SELECT id FROM ado_s9_kpi_value_l1_day WHERE tenant_id=@TenantId AND factory_id=1 " +
  216. "AND module_code=@ModuleCode AND metric_code=@MetricCode AND biz_date=@BizDate AND is_deleted=0 " +
  217. "ORDER BY id LIMIT 1), 0)",
  218. new List<SugarParameter>
  219. {
  220. new("@TenantId", tenantId),
  221. new("@ModuleCode", ModuleCode),
  222. new("@MetricCode", metricCode),
  223. new("@BizDate", bizDate)
  224. });
  225. if (existingId > 0)
  226. {
  227. return await _db.Ado.ExecuteCommandAsync(
  228. "UPDATE ado_s9_kpi_value_l1_day SET metric_value=@MetricValue, calc_time=@Now, " +
  229. "update_time=@Now, is_deleted=0, is_active=1 WHERE id=@Id",
  230. new SugarParameter("@MetricValue", metricValue),
  231. new SugarParameter("@Now", now),
  232. new SugarParameter("@Id", existingId));
  233. }
  234. var nextId = await _db.Ado.GetLongAsync(
  235. "SELECT COALESCE(MAX(id), 0) + 1 FROM ado_s9_kpi_value_l1_day");
  236. return await _db.Ado.ExecuteCommandAsync(@"
  237. INSERT INTO ado_s9_kpi_value_l1_day
  238. (id, tenant_id, org_id, company_id, factory_id, status, biz_date,
  239. create_time, update_time, is_deleted, is_active,
  240. module_code, metric_code, metric_value, calc_time)
  241. VALUES
  242. (@Id, @TenantId, NULL, NULL, 1, NULL, @BizDate,
  243. @Now, @Now, 0, 1,
  244. @ModuleCode, @MetricCode, @MetricValue, @Now)",
  245. new SugarParameter("@Id", nextId),
  246. new SugarParameter("@TenantId", tenantId),
  247. new SugarParameter("@BizDate", bizDate),
  248. new SugarParameter("@Now", now),
  249. new SugarParameter("@ModuleCode", ModuleCode),
  250. new SugarParameter("@MetricCode", metricCode),
  251. new SugarParameter("@MetricValue", metricValue));
  252. }
  253. private async Task<long> InsertTransformRunLogAsync(string batchId, DateTime startedAt, string triggerType, long tenantId)
  254. {
  255. await _db.Ado.ExecuteCommandAsync(@"
  256. INSERT INTO mdp_transform_run_log
  257. (tenant_id, job_code, job_name, trigger_type, batch_id, status, start_time, stage_rows, standard_rows, dwd_rows, create_time, update_time)
  258. VALUES
  259. (@TenantId, @JobCode, @JobName, @TriggerType, @BatchId, 'RUNNING', @StartTime, 0, 0, 0, @StartTime, @StartTime)",
  260. new SugarParameter("@TenantId", tenantId),
  261. new SugarParameter("@JobCode", JobCode),
  262. new SugarParameter("@JobName", JobName),
  263. new SugarParameter("@TriggerType", triggerType),
  264. new SugarParameter("@BatchId", batchId),
  265. new SugarParameter("@StartTime", startedAt));
  266. return await _db.Ado.GetLongAsync(
  267. "SELECT id FROM mdp_transform_run_log WHERE batch_id=@BatchId ORDER BY id DESC LIMIT 1",
  268. new List<SugarParameter> { new("@BatchId", batchId) });
  269. }
  270. private async Task MarkTransformRunSuccessAsync(long runLogId, DateTime startedAt, S6MdpSyncTransformResult result)
  271. {
  272. var finishedAt = DateTime.Now;
  273. await _db.Ado.ExecuteCommandAsync(@"
  274. UPDATE mdp_transform_run_log
  275. SET status='SUCCESS', end_time=@EndTime, duration_ms=@DurationMs,
  276. stage_rows=@StageRows, standard_rows=@StandardRows, dwd_rows=@DwdRows,
  277. summary_json=@SummaryJson, update_time=CURRENT_TIMESTAMP
  278. WHERE id=@Id",
  279. new SugarParameter("@EndTime", finishedAt),
  280. new SugarParameter("@DurationMs", (int)(finishedAt - startedAt).TotalMilliseconds),
  281. new SugarParameter("@StageRows", result.StageRows),
  282. new SugarParameter("@StandardRows", result.StandardRows),
  283. new SugarParameter("@DwdRows", result.DwdRows),
  284. new SugarParameter("@SummaryJson", JsonSerializer.Serialize(new
  285. {
  286. batchId = result.BatchId,
  287. sourceZtid = result.SourceZtid,
  288. bizDate = result.BizDate.ToString("yyyy-MM-dd"),
  289. bizMonth = result.BizMonth,
  290. dwdRows = result.DwdRows,
  291. kpiRows = result.KpiRows,
  292. perKpiDwdRows = result.PerKpiDwdRows,
  293. perKpiKpiRows = result.PerKpiKpiRows,
  294. denominatorStatus = result.KpiDenominatorStatus
  295. })),
  296. new SugarParameter("@Id", runLogId));
  297. }
  298. private async Task MarkTransformRunFailedAsync(long runLogId, DateTime startedAt, string message, string batchId)
  299. {
  300. bool runLogUpdated = false;
  301. try
  302. {
  303. var finishedAt = DateTime.Now;
  304. await _db.Ado.ExecuteCommandAsync(@"
  305. UPDATE mdp_transform_run_log
  306. SET status='FAILED', end_time=@EndTime, duration_ms=@DurationMs,
  307. error_message=@ErrorMessage, update_time=CURRENT_TIMESTAMP
  308. WHERE id=@Id",
  309. new SugarParameter("@EndTime", finishedAt),
  310. new SugarParameter("@DurationMs", (int)(finishedAt - startedAt).TotalMilliseconds),
  311. new SugarParameter("@ErrorMessage", Truncate(message, 2000)),
  312. new SugarParameter("@Id", runLogId));
  313. runLogUpdated = true;
  314. }
  315. catch (Exception ex)
  316. {
  317. Console.Error.WriteLine($"[S6MdpSyncTransform] MarkTransformRunFailed write failed (runLogId={runLogId}): {ex.Message}");
  318. }
  319. // FAILURE-NOTIFICATION-1:写库 FAILED 成功后发通知给超级管理员;通知失败不影响主流程
  320. if (!runLogUpdated) return;
  321. try
  322. {
  323. await _sysNoticeService.AddNotice(new AddNoticeInput
  324. {
  325. Title = "S6 生产执行 T8 KPI 跑批失败",
  326. Content = $"模块:S6 生产执行\n批次ID:{batchId}\n失败时间:{DateTime.Now:yyyy-MM-dd HH:mm:ss}\n错误信息:{Truncate(message, 1000)}\n\n请查看 mdp_transform_run_log 获取完整错误与重试记录。",
  327. Type = NoticeTypeEnum.NOTICE,
  328. PublicTime = DateTime.Now,
  329. Status = NoticeStatusEnum.PUBLIC,
  330. PublicUserId = NoticeReceiverUserId,
  331. PublicUserName = NoticeReceiverUserName
  332. });
  333. }
  334. catch (Exception notifyEx)
  335. {
  336. _logger.LogError(notifyEx, "[S6MdpSyncTransform] SysNotice 发送失败 (runLogId={RunLogId}, batchId={BatchId})", runLogId, batchId);
  337. }
  338. }
  339. private static string NormalizeTriggerType(string s) =>
  340. string.IsNullOrWhiteSpace(s) ? "AUTO" : s.Trim().ToUpperInvariant();
  341. private static string Truncate(string s, int max) =>
  342. string.IsNullOrEmpty(s) ? "" : (s.Length <= max ? s : s.Substring(0, max));
  343. }
  344. // DTO ────────────────────────────────────────────────────────────────────────
  345. public sealed class S6MdpRefreshOption
  346. {
  347. public string SourceZtid { get; set; } = "pbxfxp";
  348. /// <summary>KPI 落库目标租户;0=由 SourceZtid 经 AidopSourceTenantMap 解析(禁止写死固定租户)。</summary>
  349. public long TenantId { get; set; }
  350. public DateTime BizDate { get; set; }
  351. public string BizMonth { get; set; } = "";
  352. public DateTime MonthlyPeriodStart { get; set; }
  353. public DateTime MonthlyPeriodEnd { get; set; }
  354. public static S6MdpRefreshOption Default()
  355. {
  356. var today = DateTime.Today;
  357. var yesterday = today.AddDays(-1);
  358. var lastMonth = today.AddMonths(-1);
  359. var monthStart = new DateTime(lastMonth.Year, lastMonth.Month, 1);
  360. var monthEnd = monthStart.AddMonths(1).AddDays(-1);
  361. return new S6MdpRefreshOption
  362. {
  363. SourceZtid = "pbxfxp",
  364. BizDate = yesterday,
  365. BizMonth = lastMonth.ToString("yyyy-MM"),
  366. MonthlyPeriodStart = monthStart,
  367. MonthlyPeriodEnd = monthEnd.AddDays(1).AddSeconds(-1)
  368. };
  369. }
  370. }
  371. public sealed class S6MdpSyncTransformResult
  372. {
  373. public string BatchId { get; set; } = "";
  374. public long RunLogId { get; set; }
  375. public string TriggerType { get; set; } = "AUTO";
  376. public string SourceZtid { get; set; } = "";
  377. public DateTime BizDate { get; set; }
  378. public string BizMonth { get; set; } = "";
  379. public DateTime MonthlyPeriodStart { get; set; }
  380. public DateTime MonthlyPeriodEnd { get; set; }
  381. public int StageRows { get; set; }
  382. public int StandardRows { get; set; }
  383. public int DwdRows { get; set; }
  384. public int KpiRows { get; set; }
  385. public Dictionary<string, int> PerKpiDwdRows { get; } = new();
  386. public Dictionary<string, int> PerKpiKpiRows { get; } = new();
  387. public List<string> KpiDenominatorStatus { get; } = new();
  388. public void MergeSub(string kpiCode, KpiBuildSubResult sub)
  389. {
  390. PerKpiDwdRows[kpiCode] = sub.DwdRows;
  391. PerKpiKpiRows[kpiCode] = sub.KpiRows;
  392. DwdRows += sub.DwdRows;
  393. KpiRows += sub.KpiRows;
  394. KpiDenominatorStatus.Add($"{kpiCode}:{sub.DenominatorStatus}");
  395. }
  396. }
  397. public sealed class KpiBuildSubResult
  398. {
  399. public int T8Rows { get; set; }
  400. public int DwdRows { get; set; }
  401. public int KpiRows { get; set; }
  402. public string DenominatorStatus { get; set; } = "OK";
  403. }
  404. // T8 result set 投影类型 ──────────────────────────────────────────────────────
  405. internal sealed class S6MfgFulfillmentRow
  406. {
  407. public string? noid { get; set; }
  408. public string? rwnoid { get; set; }
  409. public string? code { get; set; }
  410. public decimal? sl { get; set; }
  411. public decimal? slzx { get; set; }
  412. }
  413. internal sealed class S6CountRow
  414. {
  415. public int ddnum { get; set; }
  416. }
  417. internal sealed class S6PeNumRow
  418. {
  419. public int penum { get; set; }
  420. }