feiyue 3 年 前
コミット
71b97e21ac

+ 44 - 24
DK.Service/PDAModuleLogic/PDAModuleLogicEntrucking.cs

@@ -231,7 +231,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
         /// <param name="currentUserCode"></param>
         /// <param name="currentUserCode"></param>
         /// <param name="sUser"></param>
         /// <param name="sUser"></param>
         /// <returns></returns>
         /// <returns></returns>
-        public static ServiceResultEntity AddTruckBarCodes(string[] barcodes, string entruckingCode, string currentUserCode, SUserInfo sUser)
+        public static ServiceResultEntity AddTruckBarCodes(string barCodes, string entruckingCode, string currentUserCode, SUserInfo sUser)
         {
         {
             ServiceResultEntity sre = new ServiceResultEntity();
             ServiceResultEntity sre = new ServiceResultEntity();
             sre.Data = new DataSet();
             sre.Data = new DataSet();
@@ -259,11 +259,12 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
                     else if (dt.Rows[0]["STATUS"].ToString().Equals("0"))
                     else if (dt.Rows[0]["STATUS"].ToString().Equals("0"))
                     {
                     {
                         int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
                         int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
-                        for (int i = 0; i < barcodes.Length; i++)
+                        string[] barcodeStr = barCodes.Split(',');
+                        for (int i = 0; i < barcodeStr.Length; i++)
                         {
                         {
                             //获取产品条码当前工序
                             //获取产品条码当前工序
                             sqlStr = $@"
                             sqlStr = $@"
-                                select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barcodes[i]}'
+                                select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barcodeStr[i]}'
                             ";
                             ";
                             string procedureid = conn.GetSqlResultToStr(sqlStr);
                             string procedureid = conn.GetSqlResultToStr(sqlStr);
 
 
@@ -284,7 +285,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
                                     UPDATEUSERID )
                                     UPDATEUSERID )
                             SELECT
                             SELECT
 		                            '{entruckingCode}',
 		                            '{entruckingCode}',
-		                            '{barcodes[i]}',
+		                            '{barcodeStr[i]}',
 		                            '{batch}',
 		                            '{batch}',
 		                            1,
 		                            1,
 		                            {procedureid},
 		                            {procedureid},
@@ -298,8 +299,15 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
 	                          FROM TP_MST_USER WHERE USERCODE = '{currentUserCode}'
 	                          FROM TP_MST_USER WHERE USERCODE = '{currentUserCode}'
                             ";
                             ";
                             execute = conn.ExecuteNonQuery(sqlStr);
                             execute = conn.ExecuteNonQuery(sqlStr);
+                        }
+                        //修改装具状态
+                        if (execute > 0)
+                        {
+                            sqlStr = $@"UPDATE TP_PM_ENTRUCKING SET STATUS = 1,BATCH = '{batch}' WHERE ENTRUCKINGCODE = '{entruckingCode}' ";
+                            execute = conn.ExecuteNonQuery(sqlStr);
                             if (execute > 0)
                             if (execute > 0)
                             {
                             {
+                                conn.Commit();
                                 sre.Status = Constant.ServiceResultStatus.Success;
                                 sre.Status = Constant.ServiceResultStatus.Success;
                                 sre.Message = "操作完成!";
                                 sre.Message = "操作完成!";
                             }
                             }
@@ -309,13 +317,16 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
                                 sre.Message = "操作失败,没有更新任何数据!";
                                 sre.Message = "操作失败,没有更新任何数据!";
                             }
                             }
                         }
                         }
-
+                        else
+                        {
+                            sre.Status = Constant.ServiceResultStatus.NoModifyData;
+                            sre.Message = "操作失败,没有更新任何数据!";
+                        }
                     }
                     }
                     else {
                     else {
                         sre.Status = Constant.ServiceResultStatus.NoSearchResults;
                         sre.Status = Constant.ServiceResultStatus.NoSearchResults;
                         sre.Message = "装具不可用!";
                         sre.Message = "装具不可用!";
                     }
                     }
-                    conn.Commit();
                 }
                 }
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -483,19 +494,28 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
 	                                    AND T.STATUS = '1'
 	                                    AND T.STATUS = '1'
                             ";
                             ";
                         int execute = conn.ExecuteNonQuery(sqlStr);
                         int execute = conn.ExecuteNonQuery(sqlStr);
-                        dt = conn.GetSqlResultToDt(sqlStr);
-                        sre.Data.Tables.Add(dt);
-                        if (dt.Rows.Count == 0)
-                        {
-                            sre.Status = Constant.ServiceResultStatus.NoSearchResults;
-                            sre.Message = "装具上无产品!";
-                        }
-                        else
-                        {
-                            sre.Status = Constant.ServiceResultStatus.Success;
-                            sre.Message = "操作成功!";
+                        //修改装具状态
+                        if (execute > 0) {
+                            sqlStr = $@"UPDATE TP_PM_ENTRUCKING SET STATUS = '0' WHERE ENTRUCKINGCODE = '{entruckingCode}' ";
+                            execute = conn.ExecuteNonQuery(sqlStr);
+                            if (execute > 0)
+                            {
+                                conn.Commit();
+                                sre.Status = Constant.ServiceResultStatus.Success;
+                                sre.Message = "操作完成!";
+                            }
+                            else
+                            {
+                                sre.Status = Constant.ServiceResultStatus.NoModifyData;
+                                sre.Message = "操作失败,没有更新任何数据!";
+                            }
+                            }
+                            else
+                            {
+                                sre.Status = Constant.ServiceResultStatus.NoModifyData;
+                                sre.Message = "操作失败,没有更新任何数据!";
+                            }
                         }
                         }
-                    }
                     else
                     else
                     {
                     {
                         sre.Status = Constant.ServiceResultStatus.NoSearchResults;
                         sre.Status = Constant.ServiceResultStatus.NoSearchResults;
@@ -523,7 +543,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
         /// <param name="currentUserCode"></param>
         /// <param name="currentUserCode"></param>
         /// <param name="sUser"></param>
         /// <param name="sUser"></param>
         /// <returns></returns>
         /// <returns></returns>
-        public static ServiceResultEntity AddTruckBarCode(string barcode, string entruckingCode, string currentUserCode, SUserInfo sUser)
+        public static ServiceResultEntity AddTruckBarCode(string barCode, string entruckingCode, string currentUserCode, SUserInfo sUser)
         {
         {
             ServiceResultEntity sre = new ServiceResultEntity();
             ServiceResultEntity sre = new ServiceResultEntity();
             sre.Data = new DataSet();
             sre.Data = new DataSet();
@@ -553,7 +573,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
                         int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
                         int batch = Convert.ToInt32(dt.Rows[0]["BATCH"]) + 1;
                         //获取产品条码当前工序
                         //获取产品条码当前工序
                         sqlStr = $@"
                         sqlStr = $@"
-                                select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barcode}'
+                                select PROCEDUREID from TP_PM_INPRODUCTION where barcode = '{barCode}'
                             ";
                             ";
                         string procedureid = conn.GetSqlResultToStr(sqlStr);
                         string procedureid = conn.GetSqlResultToStr(sqlStr);
 
 
@@ -574,7 +594,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
                                     UPDATEUSERID )
                                     UPDATEUSERID )
                             SELECT
                             SELECT
 		                            '{entruckingCode}',
 		                            '{entruckingCode}',
-		                            '{barcode}',
+		                            '{barCode}',
 		                            '{batch}',
 		                            '{batch}',
 		                            1,
 		                            1,
 		                            {procedureid},
 		                            {procedureid},
@@ -626,7 +646,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
         /// <param name="entruckingCode"></param>
         /// <param name="entruckingCode"></param>
         /// <param name="sUser"></param>
         /// <param name="sUser"></param>
         /// <returns></returns>
         /// <returns></returns>
-        public static ServiceResultEntity UnbindTruckBarCode(string barcode,string entruckingCode, string currentUserCode, SUserInfo sUser)
+        public static ServiceResultEntity UnbindTruckBarCode(string barCode, string entruckingCode, string currentUserCode, SUserInfo sUser)
         {
         {
             ServiceResultEntity sre = new ServiceResultEntity();
             ServiceResultEntity sre = new ServiceResultEntity();
             sre.Data = new DataSet();
             sre.Data = new DataSet();
@@ -689,7 +709,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
 	                                    INNER JOIN TP_MST_USER CU ON CU.USERCODE = '{currentUserCode}' AND CU.VALUEFLAG = '1'
 	                                    INNER JOIN TP_MST_USER CU ON CU.USERCODE = '{currentUserCode}' AND CU.VALUEFLAG = '1'
                                     WHERE
                                     WHERE
 	                                    TD.ENTRUCKINGCODE = '{entruckingCode}' 
 	                                    TD.ENTRUCKINGCODE = '{entruckingCode}' 
-                                        AND TD.BARCODE = '{barcode}' 
+                                        AND TD.BARCODE = '{barCode}' 
 	                                    AND T.STATUS = '1'
 	                                    AND T.STATUS = '1'
                             ";
                             ";
                         int execute = conn.ExecuteNonQuery(sqlStr);
                         int execute = conn.ExecuteNonQuery(sqlStr);
@@ -709,7 +729,7 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
                     else
                     else
                     {
                     {
                         sre.Status = Constant.ServiceResultStatus.NoSearchResults;
                         sre.Status = Constant.ServiceResultStatus.NoSearchResults;
-                        sre.Message = "装具未使用";
+                        sre.Message = "装具未使用,不可进行拆减";
                     }
                     }
                 }
                 }
             }
             }

+ 3 - 3
WCF.Service/WCF.Contracts/IPDAModuleEntrucking.cs

@@ -54,7 +54,7 @@ namespace Dongke.IBOSS.PRD.WCF.Contracts
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
             , ResponseFormat = WebMessageFormat.Json
             , ResponseFormat = WebMessageFormat.Json
             , RequestFormat = WebMessageFormat.Json)]
             , RequestFormat = WebMessageFormat.Json)]
-        ActionResult AddTruckBarCodes(string accountCode, string userCode, string userPassword, string sessionKey, string[] barcodes, string entruckingCode, string currentUserCode);
+        ActionResult AddTruckBarCodes(string accountCode, string userCode, string userPassword, string sessionKey, string barCodes, string entruckingCode, string currentUserCode);
 
 
         [OperationContract]
         [OperationContract]
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
@@ -72,13 +72,13 @@ namespace Dongke.IBOSS.PRD.WCF.Contracts
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
             , ResponseFormat = WebMessageFormat.Json
             , ResponseFormat = WebMessageFormat.Json
             , RequestFormat = WebMessageFormat.Json)]
             , RequestFormat = WebMessageFormat.Json)]
-        ActionResult AddTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string entruckingCode, string currentUserCode);
+        ActionResult AddTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, string entruckingCode, string currentUserCode);
 
 
         [OperationContract]
         [OperationContract]
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
         [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
             , ResponseFormat = WebMessageFormat.Json
             , ResponseFormat = WebMessageFormat.Json
             , RequestFormat = WebMessageFormat.Json)]
             , RequestFormat = WebMessageFormat.Json)]
-        ActionResult UnbindTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string entruckingCode, string currentUserCode);
+        ActionResult UnbindTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, string entruckingCode, string currentUserCode);
         #endregion
         #endregion
     }
     }
 }
 }

+ 6 - 32
WCF.Service/WCF.Services/PDAModuleServiceEntrucking.cs

@@ -8,34 +8,8 @@
  *      徐伟            2019/10/23          1.00            新建
  *      徐伟            2019/10/23          1.00            新建
  *******************************************************************************/
  *******************************************************************************/
 
 
-using System;
-using System.Reflection;
-using System.Collections.Generic;
-using System.Data;
-using System.IO;
-using System.ServiceModel;
-using System.ServiceModel.Activation;
-using Dongke.IBOSS.PRD.Basics.BaseResources;
-using Dongke.IBOSS.PRD.Basics.DataAccess;
-using Dongke.IBOSS.PRD.Basics.Library;
-using Dongke.IBOSS.PRD.Service.BarcodePrintService;
-using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
-using Dongke.IBOSS.PRD.Service.DataModels;
-using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
-using Dongke.IBOSS.PRD.Service.HRModuleLogic;
-using Dongke.IBOSS.PRD.Service.PCModuleLogic;
-using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
-using Dongke.IBOSS.PRD.Service.PMModuleLogic;
-using Dongke.IBOSS.PRD.Service.PublicModuleService;
-using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
-using Dongke.IBOSS.PRD.Service.SmartDeviceService;
-using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
 using Dongke.IBOSS.PRD.WCF.Contracts;
 using Dongke.IBOSS.PRD.WCF.Contracts;
 using Dongke.IBOSS.PRD.WCF.DataModels;
 using Dongke.IBOSS.PRD.WCF.DataModels;
-using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
-using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
-using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
-using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
 
 
 namespace Dongke.IBOSS.PRD.WCF.Services
 namespace Dongke.IBOSS.PRD.WCF.Services
 {
 {
@@ -96,14 +70,14 @@ namespace Dongke.IBOSS.PRD.WCF.Services
                 );
                 );
         }
         }
 
 
-        public ActionResult AddTruckBarCodes(string accountCode, string userCode, string userPassword, string sessionKey, string[] barcodes, string entruckingCode, string currentUserCode)
+        public ActionResult AddTruckBarCodes(string accountCode, string userCode, string userPassword, string sessionKey, string barCodes, string entruckingCode, string currentUserCode)
         {
         {
             return CallActionResult("PDAModuleLogic.PDAModuleLogic.AddTruckBarCodes",
             return CallActionResult("PDAModuleLogic.PDAModuleLogic.AddTruckBarCodes",
                 accountCode,
                 accountCode,
                 userCode,
                 userCode,
                 userPassword,
                 userPassword,
                 sessionKey,
                 sessionKey,
-                barcodes,
+                barCodes,
                 entruckingCode,
                 entruckingCode,
                 currentUserCode
                 currentUserCode
                 );
                 );
@@ -132,27 +106,27 @@ namespace Dongke.IBOSS.PRD.WCF.Services
                 );
                 );
         }
         }
 
 
-        public ActionResult AddTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey,string barcode, string entruckingCode, string currentUserCode)
+        public ActionResult AddTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey,string barCode, string entruckingCode, string currentUserCode)
         {
         {
             return CallActionResult("PDAModuleLogic.PDAModuleLogic.AddTruckBarCode",
             return CallActionResult("PDAModuleLogic.PDAModuleLogic.AddTruckBarCode",
                 accountCode,
                 accountCode,
                 userCode,
                 userCode,
                 userPassword,
                 userPassword,
                 sessionKey,
                 sessionKey,
-                barcode,
+                barCode,
                 entruckingCode,
                 entruckingCode,
                 currentUserCode
                 currentUserCode
                 );
                 );
         }
         }
 
 
-        public ActionResult UnbindTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string entruckingCode, string currentUserCode)
+        public ActionResult UnbindTruckBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, string entruckingCode, string currentUserCode)
         {
         {
             return CallActionResult("PDAModuleLogic.PDAModuleLogic.UnbindTruckBarCode",
             return CallActionResult("PDAModuleLogic.PDAModuleLogic.UnbindTruckBarCode",
                 accountCode,
                 accountCode,
                 userCode,
                 userCode,
                 userPassword,
                 userPassword,
                 sessionKey,
                 sessionKey,
-                barcode,
+                barCode,
                 entruckingCode,
                 entruckingCode,
                 currentUserCode
                 currentUserCode
                 );
                 );