瀏覽代碼

复烧限制2次

姜永辉 6 月之前
父節點
當前提交
415ca4dbca
共有 1 個文件被更改,包括 26 次插入1 次删除
  1. 26 1
      DK.Service/PMModuleLogic/PMModuleLogicDAL.cs

+ 26 - 1
DK.Service/PMModuleLogic/PMModuleLogicDAL.cs

@@ -5310,10 +5310,16 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleLogic
             };
                 //删除在产表前,在产表生产数据ID更新下,如不更新这样就不准了,例如,次品到次品  第一次不会影响,因为第一次TP_PM_InProductionTrash表里没有
                 // 如果第二次走次品到次品,才有效,下面的sqlInsert则没有效,因为在产表里没有数据插入不到回收表
-                string sqlupdate = "update  TP_PM_InProductionTrash set ProductionDataID=:ProductionDataID where barcode=:barcode";
+                // 250808 将质量登记当前的等级更新到TP_PM_InProductionTrash里
+                // 250808 例如 如果第一次废品 第二次次品时候 TP_PM_InProductionTrash还保留 第一次的废品 ,这样 在回收的时候 存入的还是废品
+                // 和石磊打电话沟通更新为最新的等级
+                string sqlupdate = "update  TP_PM_InProductionTrash set ProductionDataID=:ProductionDataID,GoodsLevelID=:GoodsLevelID,GoodsLevelTypeID=:GoodsLevelTypeID where barcode=:barcode";
                 OracleParameter[] parasupdate = new OracleParameter[] { 
                 new OracleParameter(":barcode",delInProductionEntity.BarCode),
                 new OracleParameter(":ProductionDataID",delInProductionEntity.ProductionDataID),
+                // 250808增加
+                new OracleParameter(":GoodsLevelID",OracleDbType.Int32,delInProductionEntity.GoodsLevelID,ParameterDirection.Input),
+                new OracleParameter(":GoodsLevelTypeID",OracleDbType.Int32,delInProductionEntity.GoodsLevelTypeID,ParameterDirection.Input),
             };
                 oracleTrConn.ExecuteNonQuery(sqlupdate, parasupdate);
 
@@ -9248,6 +9254,25 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleLogic
                         return errMsg;
                 }
                 #endregion
+
+                #region 重烧卸窑的次数 不能超过3次 
+                // 重烧 
+                if (productionData.GoodsLevelTypeID == (int)Constant.GoodsLevelType.ReFire)
+                {
+                    // 重烧卸窑 procedureid = 18
+                    string sqls = "select count(1) from tp_pm_productiondata p where p.barcode = '" + productionData.Barcode +
+                           "'   and  p.procedureid = 18  " +
+                           "    and  p.accountid = " + sUserInfo.AccountID;
+                    string strV = oracleTrConn.GetSqlResultToStr(sqls);
+                    if (int.Parse(strV) >= 2)
+                    {
+                        return "条码【" + productionData.Barcode + "】复烧限制2次,不能保存";
+                    }
+
+                }
+
+                #endregion
+
                 int isInProduction = 1;
                 #region 修改条码
                 if (productionData.ProductionDataID > 0) //表示编辑条码