|
|
@@ -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;
|
|
|
@@ -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");
|
|
|
@@ -203,28 +190,128 @@ 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,
|
|
|
+ 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)
|
|
|
{
|
|
|
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";
|
|
|
}
|
|
|
@@ -240,6 +327,7 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
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
|
|
|
@@ -249,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} kilnCarCode:{kilnCarCode} barCodeAndPosition:{barCodeAndPosition}",
|
|
|
+ " userInfo is null " + inputCode,
|
|
|
LocalPath.LogExePath + "SmartDevice\\");
|
|
|
return "EU-01";
|
|
|
}
|
|
|
@@ -267,7 +355,7 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
OutputLog.TraceLog(LogPriority.Warning,
|
|
|
this.ToString(),
|
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
- $" accountCode:{accountCode} userCode:{userCode} procedureID:{procedureID} kilnCarCode:{kilnCarCode} barCodeAndPosition:{barCodeAndPosition}",
|
|
|
+ "窑车不存在" + inputCode,
|
|
|
LocalPath.LogExePath + "SmartDevice\\");
|
|
|
return "EP-01";
|
|
|
}
|
|
|
@@ -365,19 +453,18 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
{
|
|
|
OutputLog.TraceLog(LogPriority.Warning,
|
|
|
this.ToString(),
|
|
|
- System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
|
|
|
- $" accountCode:{accountCode} userCode:{userCode} procedureID:{procedureID} kilnCarCode:{kilnCarCode} barCodeAndPosition:{barCodeAndPosition}",
|
|
|
- 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.Contains("不能到达该工序"))
|
|
|
- {
|
|
|
- return "EP-02";
|
|
|
- }
|
|
|
- return "EP-00";
|
|
|
+ //if (out_msg.Contains("不能到达该工序"))
|
|
|
+ //{
|
|
|
+ // return "EP-02=" + out_msg;
|
|
|
+ //}
|
|
|
+ return "EP-00=" + out_msg;
|
|
|
}
|
|
|
}
|
|
|
return "OK";
|
|
|
@@ -387,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} kilnCarCode:{kilnCarCode} barCodeAndPosition:{barCodeAndPosition}",
|
|
|
- ex.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + ex.ToString(),
|
|
|
LocalPath.LogExePath);
|
|
|
return "EE";
|
|
|
}
|