Переглянути джерело

已交接不能注浆变更

qinqi 3 днів тому
батько
коміт
ff8cf40695
1 змінених файлів з 15 додано та 0 видалено
  1. 15 0
      DK.Service/PCModuleLogic/PCModuleLogicDAL.cs

+ 15 - 0
DK.Service/PCModuleLogic/PCModuleLogicDAL.cs

@@ -1875,6 +1875,21 @@ namespace Dongke.IBOSS.PRD.Service.PCModuleLogic
 
                 tran = ClsDbFactory.CreateDBTransaction(DataBaseType.ORACLE, DataManager.ConnectionString);
 
+                //产成品不能替换
+                string fhsql = @"select f.barcode from  tp_pm_finishedproduct f  where f.GROUTINGDAILYDETAILID in ( " + groutingDailyDetailIDs + ") AND (f.FHUserCode is not null or LCFHUserCode is not null)";
+                DataTable dtt = tran.GetSqlResultToDt(fhsql);
+                if (dtt != null && dtt.Rows.Count > 0)
+                {
+                    // 获取"Name"列的所有值并转换为数组
+                    string[] barcodes = dtt.AsEnumerable()
+                                         .Select(row => row.Field<string>("barcode"))
+                                         .ToArray();
+                    // "已交接的产品不能变更商标";
+                    sre.Status = Constant.ServiceResultStatus.Other;
+                    sre.OtherStatus = 5;
+                    sre.Message = string.Join(",", barcodes) + "已交接不能替换";
+                    return sre;
+                }
 
                 OracleParameter[] paras = new OracleParameter[]
                 {