|
|
@@ -12,6 +12,7 @@ using System;
|
|
|
using System.Data;
|
|
|
using System.ServiceModel;
|
|
|
using System.ServiceModel.Activation;
|
|
|
+using Dongke.IBOSS.PRD.Basics.BaseResources;
|
|
|
using Dongke.IBOSS.PRD.Basics.Library;
|
|
|
using Dongke.IBOSS.PRD.Service.DataModels;
|
|
|
using Dongke.IBOSS.PRD.Service.PMModuleLogic;
|
|
|
@@ -57,7 +58,7 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
OutputLog.TraceLog(LogPriority.Warning,
|
|
|
this.ToString(),
|
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
- " userInfo is null " + userPassword + System.Environment.NewLine +
|
|
|
+ " userInfo is null " + userPassword + System.Environment.NewLine +
|
|
|
" accountCode:" + accountCode + " userCode:" + userCode + " procedureID:" + procedureID + " barcode:" + barcode,
|
|
|
LocalPath.LogExePath + "SmartDevice\\");
|
|
|
return;
|
|
|
@@ -98,7 +99,7 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
userPassword + System.Environment.NewLine +
|
|
|
" accountCode:" + accountCode + " userCode:" + userCode + " procedureID:" + procedureID + " barcode:" + barcode,
|
|
|
JsonHelper.ToJson(dt),
|
|
|
- LocalPath.LogExePath+ "SmartDevice\\");
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
@@ -139,20 +140,6 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
sUserInfo.UserID = Convert.ToInt32(userInfo.Rows[0]["userid"]);
|
|
|
sUserInfo.UserCode = userCode;
|
|
|
|
|
|
- //DataTable barcodeTable = new DataTable();
|
|
|
- //barcodeTable.TableName = "barcodeTable";
|
|
|
- //barcodeTable.Columns.Add("BarCode");
|
|
|
- //barcodeTable.Columns.Add("UserID");
|
|
|
- //barcodeTable.Columns.Add("UserCode");
|
|
|
- //barcodeTable.Columns.Add("UserName");
|
|
|
- //barcodeTable.Columns.Add("LogoID");
|
|
|
-
|
|
|
- //DataRow drCollectType = barcodeTable.NewRow();
|
|
|
- //drCollectType["BarCode"] = barcode;
|
|
|
- //drCollectType["UserID"] = sUserInfo.UserID;
|
|
|
- //drCollectType["UserCode"] = sUserInfo.UserCode;
|
|
|
- //drCollectType["UserName"] = userInfo.Rows[0]["UserName"].ToString();
|
|
|
- //barcodeTable.Rows.Add(drCollectType);
|
|
|
DataTable barcodeTable = userInfo;
|
|
|
barcodeTable.Columns.Add("LogoID");
|
|
|
barcodeTable.Columns.Add("BarCode");
|
|
|
@@ -164,25 +151,28 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
ProcedureEntity procedureInfo = null;
|
|
|
DataTable dt = PMModuleLogicDAL.AddWorkPiece(procedureID, barcodeTable, sUserInfo, out procedureInfo);
|
|
|
|
|
|
- string out_msg = dt.Rows[0]["out_errMsg"].ToString();
|
|
|
- if (dt != null && dt.Rows.Count > 0 && !string.IsNullOrWhiteSpace(out_msg))
|
|
|
+ if (dt != null && dt.Rows.Count > 0)
|
|
|
{
|
|
|
- OutputLog.TraceLog(LogPriority.Warning,
|
|
|
- this.ToString(),
|
|
|
- System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
|
|
|
- userPassword + System.Environment.NewLine +
|
|
|
- " accountCode:" + accountCode + " userCode:" + userCode + " procedureID:" + procedureID + " barcode:" + barcode,
|
|
|
- JsonHelper.ToJson(dt),
|
|
|
- LocalPath.LogExePath + "SmartDevice\\");
|
|
|
- if (out_msg.StartsWith("无效条码"))
|
|
|
- {
|
|
|
- return "EP-01";
|
|
|
- }
|
|
|
- if (out_msg.Contains("不能到达该工序"))
|
|
|
+ string out_msg = dt.Rows[0]["out_errMsg"].ToString();
|
|
|
+ if (!string.IsNullOrWhiteSpace(out_msg))
|
|
|
{
|
|
|
- return "EP-02";
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
|
|
|
+ userPassword + System.Environment.NewLine +
|
|
|
+ " accountCode:" + accountCode + " userCode:" + userCode + " procedureID:" + procedureID + " barcode:" + barcode,
|
|
|
+ JsonHelper.ToJson(dt),
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ if (out_msg.StartsWith("无效条码"))
|
|
|
+ {
|
|
|
+ return "EP-01";
|
|
|
+ }
|
|
|
+ if (out_msg.Contains("不能到达该工序"))
|
|
|
+ {
|
|
|
+ return "EP-02";
|
|
|
+ }
|
|
|
+ return "EP-00";
|
|
|
}
|
|
|
- return "EP-00";
|
|
|
}
|
|
|
return "OK";
|
|
|
}
|
|
|
@@ -200,33 +190,133 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
+ /// 自动扫描计件(3车间)
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string AddWorkPieceByStatus3(string accountCode, string userCode, string userPassword,
|
|
|
+ int procedureID, string barcode, string remarks)
|
|
|
+ {
|
|
|
+ string inputCode = $" accountCode:{accountCode} userCode:{userCode} userPassword:{userPassword} procedureID:{procedureID} barcode:{barcode} remarks:{remarks}";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ DataTable userInfo = SmartDeviceLogic.CheckUserCode(accountCode, userCode);
|
|
|
+ if (userInfo == null)
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ " userInfo is null " + inputCode,
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ return "EU-01";
|
|
|
+ }
|
|
|
+ SUserInfo sUserInfo = new SUserInfo();
|
|
|
+ sUserInfo.AccountID = Convert.ToInt32(userInfo.Rows[0]["AccountID"]);
|
|
|
+ sUserInfo.AccountCode = accountCode;
|
|
|
+ sUserInfo.UserID = Convert.ToInt32(userInfo.Rows[0]["userid"]);
|
|
|
+ sUserInfo.UserCode = userCode;
|
|
|
+
|
|
|
+ DataTable barcodeTable = userInfo;
|
|
|
+ barcodeTable.Columns.Add("LogoID");
|
|
|
+ barcodeTable.Columns.Add("BarCode");
|
|
|
+ barcodeTable.Columns.Add("Remarks");
|
|
|
+
|
|
|
+ barcodeTable.Rows[0]["BarCode"] = barcode;
|
|
|
+ barcodeTable.Rows[0]["Remarks"] = remarks;
|
|
|
+
|
|
|
+ ProcedureEntity procedureInfo = null;
|
|
|
+ DataTable dt = PMModuleLogicDAL.AddWorkPiece(procedureID, barcodeTable, sUserInfo, out procedureInfo);
|
|
|
+
|
|
|
+ if (dt != null && dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ string out_msg = dt.Rows[0]["out_errMsg"].ToString();
|
|
|
+ if (!string.IsNullOrWhiteSpace(out_msg))
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + JsonHelper.ToJson(dt),
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ //if (out_msg.StartsWith("无效条码"))
|
|
|
+ //{
|
|
|
+ // return "EP-01=" + out_msg;
|
|
|
+ //}
|
|
|
+ //if (out_msg.Contains("不能到达该工序"))
|
|
|
+ //{
|
|
|
+ // return "EP-02=" + out_msg;
|
|
|
+ //}
|
|
|
+ return "EP-00=" + out_msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Error,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode+ex.ToString(),
|
|
|
+ LocalPath.LogExePath);
|
|
|
+ return "EE";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
/// 注浆接口 xuwei add 2019-11-19
|
|
|
/// </summary>
|
|
|
/// <param name="accountCode"></param>
|
|
|
/// <param name="userCode"></param>
|
|
|
/// <param name="groutingData"></param>
|
|
|
/// <returns></returns>
|
|
|
- public string SetGroutingLineDetail(string accountCode, string userCode, string groutingData)
|
|
|
+ public string SetGroutingLineDetail(string accountCode, string userCode, string lineCode,
|
|
|
+ string groutingData, string remarks)
|
|
|
{
|
|
|
+ string inputCode = $" accountCode:{accountCode} userCode:{userCode} lineCode:{lineCode} groutingData:{groutingData} remarks:{remarks}";
|
|
|
try
|
|
|
{
|
|
|
- ServiceResultEntity sre = SmartDeviceLogic.SetGroutingLineDetail(accountCode, userCode, groutingData);
|
|
|
- DataTable dt = sre.Data.Tables[0];
|
|
|
- return dt.Rows[0]["out_errMsg"].ToString();
|
|
|
+ #region 验证用户 并配置参数 sUserInfo
|
|
|
+ DataTable userInfo = SmartDeviceLogic.CheckUserCode(accountCode, userCode);
|
|
|
+ if (userInfo == null)
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ " userInfo is null " + inputCode,
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ return "EU-01";
|
|
|
+ }
|
|
|
+ SUserInfo sUserInfo = new SUserInfo();
|
|
|
+ sUserInfo.AccountID = Convert.ToInt32(userInfo.Rows[0]["AccountID"]);
|
|
|
+ sUserInfo.AccountCode = accountCode;
|
|
|
+ sUserInfo.UserID = Convert.ToInt32(userInfo.Rows[0]["userid"]);
|
|
|
+ sUserInfo.UserCode = userCode;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ ServiceResultEntity sre = SmartDeviceLogic.SetGroutingLineDetail(lineCode, groutingData, sUserInfo);
|
|
|
+ if (sre.Status == Constant.ServiceResultStatus.Success)
|
|
|
+ {
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + sre.Message,
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ return $"EG={sre.Message}";
|
|
|
+ }
|
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
OutputLog.TraceLog(LogPriority.Error,
|
|
|
this.ToString(),
|
|
|
- System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
|
|
|
- " accountCode:" + accountCode + " userCode:" + userCode ,
|
|
|
- ex.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode+ex.ToString(),
|
|
|
LocalPath.LogExePath);
|
|
|
return "EE";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 登窑、入窑、出窑 接口 xuwei add 2019-11-19
|
|
|
/// </summary>
|
|
|
@@ -234,8 +324,10 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
/// <param name="userCode"></param>
|
|
|
/// <param name="groutingData"></param>
|
|
|
/// <returns></returns>
|
|
|
- public string AddWorkPieceKiln(string accountCode, string userCode, int procedureID,string kilnCarCode, string barCodeAndPosition="")
|
|
|
+ public string AddWorkPieceKiln(string accountCode, string userCode, int procedureID,
|
|
|
+ string kilnCarCode, string barCodeAndPosition, string remarks)
|
|
|
{
|
|
|
+ string inputCode = $" accountCode:{accountCode} userCode:{userCode} procedureID:{procedureID} kilnCarCode:{kilnCarCode} barCodeAndPosition:{barCodeAndPosition} remarks:{remarks}";
|
|
|
try
|
|
|
{
|
|
|
#region 验证用户 并配置参数 sUserInfo
|
|
|
@@ -245,7 +337,7 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
OutputLog.TraceLog(LogPriority.Warning,
|
|
|
this.ToString(),
|
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
- " accountCode:" + accountCode + " userCode:" + userCode + " procedureID:" + procedureID ,
|
|
|
+ " userInfo is null " + inputCode,
|
|
|
LocalPath.LogExePath + "SmartDevice\\");
|
|
|
return "EU-01";
|
|
|
}
|
|
|
@@ -258,6 +350,15 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
|
|
|
#region 按窑车号取窑车信息
|
|
|
DataTable carInfo = SmartDeviceLogic.getKilnCarByCode(kilnCarCode);
|
|
|
+ if (carInfo == null || carInfo.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ "窑车不存在" + inputCode,
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ return "EP-01";
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 配置参数 barcodeTable
|
|
|
@@ -277,24 +378,35 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
DataTable barcodeTable = new DataTable();
|
|
|
|
|
|
//入窑 卸窑 配置参数 barcodeTable
|
|
|
- if (barCodeAndPosition == "")
|
|
|
+ if (string.IsNullOrWhiteSpace(barCodeAndPosition))
|
|
|
{
|
|
|
barcodeTable.TableName = "barcodeTable";
|
|
|
barcodeTable.Columns.Add("UserID");
|
|
|
barcodeTable.Columns.Add("UserCode");
|
|
|
barcodeTable.Columns.Add("UserName");
|
|
|
+ barcodeTable.Columns.Add("KilnID");
|
|
|
barcodeTable.Columns.Add("KilnCode");
|
|
|
+ barcodeTable.Columns.Add("KilnName");
|
|
|
+ barcodeTable.Columns.Add("KilnCarCode");
|
|
|
+ barcodeTable.Columns.Add("KilnCarID");
|
|
|
+ barcodeTable.Columns.Add("KilnCarName");
|
|
|
+ barcodeTable.Columns.Add("Remarks");
|
|
|
DataRow drCollectType = barcodeTable.NewRow();
|
|
|
drCollectType["UserID"] = userInfo.Rows[0]["UserID"].ToString();
|
|
|
drCollectType["UserCode"] = userInfo.Rows[0]["UserCode"].ToString();
|
|
|
drCollectType["UserName"] = userInfo.Rows[0]["UserName"].ToString();
|
|
|
+ drCollectType["KilnID"] = carInfo.Rows[0]["KilnID"].ToString();
|
|
|
drCollectType["KilnCode"] = carInfo.Rows[0]["KilnCode"].ToString();
|
|
|
+ drCollectType["KilnName"] = carInfo.Rows[0]["KilnName"].ToString();
|
|
|
+ drCollectType["KilnCarID"] = carInfo.Rows[0]["KilnCarID"].ToString();
|
|
|
+ drCollectType["KilnCarCode"] = carInfo.Rows[0]["KilnCarCode"].ToString();
|
|
|
+ drCollectType["KilnCarName"] = carInfo.Rows[0]["KilnCarName"].ToString();
|
|
|
+ drCollectType["Remarks"] = remarks;
|
|
|
barcodeTable.Rows.Add(drCollectType);
|
|
|
}
|
|
|
-
|
|
|
- //登窑 添加数据 配置参数 barcodeTable
|
|
|
- if (barCodeAndPosition != "")
|
|
|
+ else
|
|
|
{
|
|
|
+ //登窑 添加数据 配置参数 barcodeTable
|
|
|
barcodeTable.TableName = "barcodeTable";
|
|
|
barcodeTable.Columns.Add("UserID");
|
|
|
barcodeTable.Columns.Add("UserCode");
|
|
|
@@ -303,12 +415,13 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
barcodeTable.Columns.Add("KilnID");
|
|
|
barcodeTable.Columns.Add("KilnCode");
|
|
|
barcodeTable.Columns.Add("KilnName");
|
|
|
- barcodeTable.Columns.Add("KilnCarCode");
|
|
|
barcodeTable.Columns.Add("KilnCarID");
|
|
|
+ barcodeTable.Columns.Add("KilnCarCode");
|
|
|
barcodeTable.Columns.Add("KilnCarName");
|
|
|
barcodeTable.Columns.Add("KilnCarPosition");
|
|
|
+ barcodeTable.Columns.Add("Remarks");
|
|
|
JArray barCodeArray = JArray.Parse(barCodeAndPosition);
|
|
|
- for(int i=0;i< barCodeArray.Count;i++)
|
|
|
+ for (int i = 0; i < barCodeArray.Count; i++)
|
|
|
{
|
|
|
DataRow drCollectType = barcodeTable.NewRow();
|
|
|
drCollectType["BarCode"] = barCodeArray[i]["barCode"].ToString();
|
|
|
@@ -319,39 +432,40 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
drCollectType["KilnCode"] = carInfo.Rows[0]["KilnCode"].ToString();
|
|
|
drCollectType["KilnName"] = carInfo.Rows[0]["KilnName"].ToString();
|
|
|
drCollectType["KilnCarID"] = carInfo.Rows[0]["KilnCarID"].ToString();
|
|
|
+ drCollectType["KilnCarCode"] = carInfo.Rows[0]["KilnCarCode"].ToString();
|
|
|
drCollectType["KilnCarName"] = carInfo.Rows[0]["KilnCarName"].ToString();
|
|
|
drCollectType["KilnCarPosition"] = barCodeArray[i]["kilnCarPosition"].ToString();
|
|
|
+ drCollectType["Remarks"] = remarks;
|
|
|
barcodeTable.Rows.Add(drCollectType);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
#endregion
|
|
|
|
|
|
#region 调用原始业务逻辑
|
|
|
- ProcedureEntity procedureInfo = null;
|
|
|
- ServiceResultEntity sre = SmartDeviceLogic.AddWorkPieceKiln(accountCode, userCode, procedureID, barcodeTable, out procedureInfo);
|
|
|
- DataTable dt = sre.Data.Tables[0];
|
|
|
+ DataTable dt = SmartDeviceLogic.AddWorkPieceKiln(procedureID, barcodeTable, sUserInfo);
|
|
|
#endregion
|
|
|
|
|
|
#region 输出结果
|
|
|
- string out_msg = dt.Rows[0]["out_errMsg"].ToString();
|
|
|
- if (dt != null && dt.Rows.Count > 0 && !string.IsNullOrWhiteSpace(out_msg))
|
|
|
+ if (dt != null && dt.Rows.Count > 0)
|
|
|
{
|
|
|
- OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ string out_msg = dt.Rows[0]["out_errMsg"].ToString();
|
|
|
+ if (!string.IsNullOrWhiteSpace(out_msg))
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
this.ToString(),
|
|
|
- System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
|
|
|
- " accountCode:" + accountCode + " userCode:" + userCode + " procedureID:" + procedureID ,
|
|
|
- JsonHelper.ToJson(dt),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + JsonHelper.ToJson(dt),
|
|
|
LocalPath.LogExePath + "SmartDevice\\");
|
|
|
- if (out_msg.StartsWith("无效条码"))
|
|
|
- {
|
|
|
- return "EP-01";
|
|
|
+ //if (out_msg.StartsWith("无效条码"))
|
|
|
+ //{
|
|
|
+ // return "EP-01";
|
|
|
+ //}
|
|
|
+ //if (out_msg.Contains("不能到达该工序"))
|
|
|
+ //{
|
|
|
+ // return "EP-02=" + out_msg;
|
|
|
+ //}
|
|
|
+ return "EP-00=" + out_msg;
|
|
|
}
|
|
|
- if (out_msg.Contains("不能到达该工序"))
|
|
|
- {
|
|
|
- return "EP-02";
|
|
|
- }
|
|
|
- return "EP-00";
|
|
|
}
|
|
|
return "OK";
|
|
|
#endregion
|
|
|
@@ -360,9 +474,8 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
{
|
|
|
OutputLog.TraceLog(LogPriority.Error,
|
|
|
this.ToString(),
|
|
|
- System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
|
|
|
- " accountCode:" + accountCode + " userCode:" + userCode + "procedureID:"+ procedureID ,
|
|
|
- ex.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + ex.ToString(),
|
|
|
LocalPath.LogExePath);
|
|
|
return "EE";
|
|
|
}
|