Просмотр исходного кода

商标 釉料 在产成品后不许更改

姜永辉 6 дней назад
Родитель
Сommit
78b98dd82d

+ 19 - 1
DK.Client/PMModule/F_PM_2118.cs

@@ -197,7 +197,25 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                     this.txtBarcode.Text = "";
                     //this.DialogResult = DialogResult.OK;
                 }
-                else if (returnValue == 0)
+                else if (returnValue == -2)
+                {
+                    // 提示信息
+                    MessageBox.Show("条码不存在",
+                        this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                }
+                else if (returnValue == -3)
+                {
+                    // 提示信息
+                    MessageBox.Show("已交接的产品不能变更商标",
+                        this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                }
+                else if (returnValue == -5)
+                {
+                    // 提示信息
+                    MessageBox.Show("该商标已超过生产计划允许变更数量,不能变更商标",
+                        this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                }
+                else
                 {
                     // 提示信息
                     MessageBox.Show("保存失败",

+ 21 - 0
DK.Service/PMModuleLogic/PMModuleLogicDAL.cs

@@ -16759,6 +16759,17 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleLogic
                 object pid = null;
                 string sql = "";
 
+                sql = @"select f.barcode from   tp_pm_finishedproduct f  where f.barcode=:barcode";
+                DataTable dtt = oracleTrConn.GetSqlResultToDt(sql, new OracleParameter[]{
+                        new OracleParameter(":barcode",OracleDbType.Varchar2, barcode,ParameterDirection.Input)
+                    });
+                if (dtt != null && dtt.Rows.Count > 0)
+                {
+                    // "已交接的产品不能变更商标";
+                    return -3;
+                }
+
+
                 sql = @"select logoid from tp_pm_groutingdailydetail where barcode=:barcode";
                 oldLogoID = oracleTrConn.GetSqlResultToObj(sql, new OracleParameter[]{
                         new OracleParameter(":barcode",OracleDbType.Varchar2, barcode,ParameterDirection.Input)
@@ -16984,6 +16995,16 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleLogic
                     return -2;
                 }
 
+                sql = @"select f.barcode from   tp_pm_finishedproduct f  where f.barcode=:barcode";
+                DataTable dtt = oracleTrConn.GetSqlResultToDt(sql, new OracleParameter[]{
+                        new OracleParameter(":barcode",OracleDbType.Varchar2, barcode,ParameterDirection.Input)
+                    });
+                if (dtt != null && dtt.Rows.Count > 0)
+                {
+                    // "已交接的产品不能变更商标";
+                    return -3;
+                }
+
                 // 釉料变更履历
                 sql = "insert into TP_PM_GlazetypeRecord\n" +
                 //"values\n" + xuwei update 2020-01-02

+ 40 - 2
WCF.Service/WCF.Services/PDAModuleService.cs

@@ -6572,7 +6572,40 @@ namespace Dongke.IBOSS.PRD.WCF.Services
 				int returnValue = ServiceInvoker.Invoke<int>(this,
 				   () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
 				actionResult.Result = JsonHelper.ToJson(returnValue);
-				actionResult.Status = (int)Constant.PDAResult.Success;
+				// actionResult.Status = (int)Constant.PDAResult.Success; 
+				if (returnValue > 0)
+				{
+					actionResult.Status = (int)Constant.PDAResult.Success;
+				}
+				else if (returnValue == -2)
+				{
+					//lsq 20210723 已注浆非产成品没有商标可以变更商标
+					//begin
+					//actionResult.Message = "条码不存在";
+					actionResult.Message = "该条码未注浆";
+					//end
+					actionResult.Status = (int)Constant.PDAResult.Fail;
+				}
+				else if (returnValue == -3)
+				{
+					actionResult.Message = "产成品不能变更商标";
+					actionResult.Status = (int)Constant.PDAResult.Fail;
+				}
+				else if (returnValue == -5)
+				{
+					actionResult.Message = "该商标已超过生产计划允许变更数量,不能变更商标";
+					actionResult.Status = (int)Constant.PDAResult.Fail;
+				}
+				else if (returnValue == -6)
+				{
+					actionResult.Message = "该商标无计划,不允许变更商标";
+					actionResult.Status = (int)Constant.PDAResult.Fail;
+				}
+				else
+				{
+					actionResult.Message = "保存失败";
+					actionResult.Status = (int)Constant.PDAResult.Fail;
+				}
 			}
 			catch (Exception ex)
 			{
@@ -6611,7 +6644,12 @@ namespace Dongke.IBOSS.PRD.WCF.Services
                 {
                     actionResult.Status = (int)Constant.PDAResult.Success;
                 }
-                else
+				else if (returnValue == -3)
+				{
+					actionResult.Message = "产成品不能变更商标";
+					actionResult.Status = (int)Constant.PDAResult.Fail;
+				}
+				else
                 {
                     actionResult.Status = (int)Constant.PDAResult.Fail;
                     actionResult.Message = "条码不存在";