From b52018589bf6c7ec1d51ce8ad000a7aa993b0ab5 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 13 四月 2026 16:06:15 +0800
Subject: [PATCH] 优化组盘表获取成品编号、流水号、供方代码
---
代码管理/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/BoxingDetailService.cs | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/BoxingDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/BoxingDetailService.cs"
index a0ef361..8c3a935 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/BoxingDetailService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/BoxingDetailService.cs"
@@ -161,24 +161,31 @@
if (!string.IsNullOrWhiteSpace(productCode))
{
+ string[] parts = productCode.Split(new char[] { ' ', '|' }, StringSplitOptions.RemoveEmptyEntries);
+ if (parts.Length < 3) return WebResponseContent.Instance.Error("缂栫爜瑙勫垯鏈夎锛�");
+ proCode = parts[0];
+ proOther = parts[1];
+ supplierCode = parts[2];
- var proCodeMatch = Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", RegexOptions.IgnoreCase);
- if (proCodeMatch.Success)
- {
- proCode = $"TX{proCodeMatch.Groups[1].Value.Trim()}";
- }
+ #region 鑾峰彇鎴愬搧缂栧彿銆佹祦姘村彿銆佷緵鏂逛唬鐮�
+ //var proCodeMatch = Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", RegexOptions.IgnoreCase);
+ //if (proCodeMatch.Success)
+ //{
+ // proCode = $"TX{proCodeMatch.Groups[1].Value.Trim()}";
+ //}
- // 姝e垯2锛氬尮閰嶈繛缁殑10浣嶇函鏁板瓧锛堝叏灞�鍖归厤锛屽彇绗竴涓鍚堢殑鍗冲彲锛�
- var proOtherMatch = Regex.Match(productCode, @"\d{10}");
- if (proOtherMatch.Success)
- {
- proOther = proOtherMatch.Value.Trim();
- }
- var supplierCodeMatch = Regex.Match(productCode, @"[A-Z]+$", RegexOptions.IgnoreCase);
- if (supplierCodeMatch.Success)
- {
- supplierCode = supplierCodeMatch.Value.Trim();
- }
+ //// 姝e垯2锛氬尮閰嶈繛缁殑10浣嶇函鏁板瓧锛堝叏灞�鍖归厤锛屽彇绗竴涓鍚堢殑鍗冲彲锛�
+ //var proOtherMatch = Regex.Match(productCode, @"\d{10}");
+ //if (proOtherMatch.Success)
+ //{
+ // proOther = proOtherMatch.Value.Trim();
+ //}
+ //var supplierCodeMatch = Regex.Match(productCode, @"[A-Z]+$", RegexOptions.IgnoreCase);
+ //if (supplierCodeMatch.Success)
+ //{
+ // supplierCode = supplierCodeMatch.Value.Trim();
+ //}
+ #endregion
toolingBoardSubmitDto.PartsList = toolingBoardSubmitDto.PartsList.Where(code => !string.IsNullOrEmpty(code)).ToList();
// 2. 鏌ヨ鎴愬搧閰嶆柟淇℃伅
Dt_Formula formulaModel = _formulaService.Repository.QueryFirst(x => x.ProductCode == proCode);
@@ -228,6 +235,7 @@
Dt_Boxing existBoxinModel = new Dt_Boxing();
existBoxinModel.PalletCode = PalletCode;
existBoxinModel.ProductCode = proCode;
+ existBoxinModel.ProductName = formulaModel.ProductName;
existBoxinModel.BoxingNo = proOther;
existBoxinModel.SupplierCode = supplierCode;
--
Gitblit v1.9.3