|
|
@@ -264,6 +264,84 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
+ /// 自动扫描计件(3车间)_集中采集(包装)
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string AddWorkPieceByStatus3_packing(string accountCode, string userCode, string userPassword,
|
|
|
+ int procedureID, string[] barcodes, string remarks)
|
|
|
+ {
|
|
|
+ string inputCode = $" accountCode:{accountCode} userCode:{userCode} userPassword:{userPassword} procedureID:{procedureID} barcodes:{ JsonHelper.ToJson(barcodes)} 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");
|
|
|
+
|
|
|
+ for (int i = 0; i < barcodes.Length; i++)
|
|
|
+ {
|
|
|
+ if (i > 0)
|
|
|
+ {
|
|
|
+ barcodeTable.Rows.Add(barcodeTable.Rows[0].ItemArray);
|
|
|
+ }
|
|
|
+ barcodeTable.Rows[i]["BarCode"] = barcodes[i];
|
|
|
+ barcodeTable.Rows[i]["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>
|
|
|
@@ -599,227 +677,6 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
{
|
|
|
return $"OK:{barcode}#{"H0122L"}#{"ABCDEFG"}#{1}#{1}#{1}";
|
|
|
}
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 恒洁三水三车间对接乾润扫码
|
|
|
- /// </summary>
|
|
|
- /// <param name="barcode"></param>
|
|
|
- /// <param name="procedure_no">工序号</param>
|
|
|
- /// <param name="road_no">道口号</param>
|
|
|
- /// <param name="weight">重量</param>
|
|
|
- /// <returns></returns>
|
|
|
- public string AddWorkInfoHGS3_QR(string barcode, string procedure_no, int road_no, double weight)
|
|
|
- {
|
|
|
- /*
|
|
|
-工序号 工序名 道口号
|
|
|
-3_5_1 预干区(入) 1-6
|
|
|
-3_4_1 阴干区(入) 1
|
|
|
-3_4_2 烘干区(入) 1
|
|
|
-3_4_3 烘干区(出) 1
|
|
|
-3_3_1 毛坯库(入) 1-2
|
|
|
-3_3_2 毛坯库(出) 1
|
|
|
-3_3_3 精坯库(入) 1
|
|
|
-3_2_1 釉坯库(入) 1
|
|
|
-3_1_1 光瓷库(入) 1
|
|
|
-
|
|
|
- */
|
|
|
- string inputCode = $" barcode:{barcode} procedure_no:{procedure_no} road_no:{road_no} weight:{weight}";
|
|
|
- SUserInfo sUserInfo = new SUserInfo();
|
|
|
- sUserInfo.AccountID = 1;
|
|
|
- sUserInfo.AccountCode = "dongke";
|
|
|
- string returnMessage = "OK";
|
|
|
- try
|
|
|
- {
|
|
|
- DataTable gdata = SmartDeviceLogic.GetGroutingdailydetail(barcode);
|
|
|
-
|
|
|
- if (gdata == null || gdata.Rows.Count == 0)
|
|
|
- {
|
|
|
- return $"NG:条码[{barcode}]不存在";
|
|
|
- }
|
|
|
- DataRow dataRow = gdata.Rows[0];
|
|
|
- int goodstypeid = Convert.ToInt32(dataRow["goodstypeid"]);
|
|
|
- string zhineng = (goodstypeid == 18 || goodstypeid == 19) ? "1" : "2";
|
|
|
- int goods_line_type = Convert.ToInt32(dataRow["goods_line_type"]);
|
|
|
- string gaoya = (goods_line_type == 1) ? "1" : "2";
|
|
|
- int goodsleveltypeid = Convert.ToInt32(dataRow["goodsleveltypeid"]);
|
|
|
- string level = goodsleveltypeid.ToString();
|
|
|
- if (goodsleveltypeid == 4 || goodsleveltypeid == 5)
|
|
|
- {
|
|
|
- level = "1";
|
|
|
- }
|
|
|
- else if (goodsleveltypeid == 15)
|
|
|
- {
|
|
|
- level = "1";
|
|
|
- }
|
|
|
- else if (goodsleveltypeid == 8)
|
|
|
- {
|
|
|
- level = "3";
|
|
|
- }
|
|
|
-
|
|
|
- //OK: 返回字符串(条码#型号#SKU码#结果#智能:1\连体:2#高压:1\普通:2)
|
|
|
- returnMessage = $"OK:{barcode}#{dataRow["goodscode"]}#{dataRow["materialcode"]}#{level}#{zhineng}#{gaoya}";
|
|
|
-
|
|
|
- int procedureID = 0;
|
|
|
- if (procedure_no == "3_5_1")
|
|
|
- {
|
|
|
- // 预干区(入)
|
|
|
- // TODO
|
|
|
- procedureID = 5;
|
|
|
- switch (road_no)
|
|
|
- {
|
|
|
- case 1:
|
|
|
- sUserInfo.UserID = 1;
|
|
|
- sUserInfo.UserCode = "SC35_1";
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- sUserInfo.UserID = 2;
|
|
|
- sUserInfo.UserCode = "SC35_2";
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- sUserInfo.UserID = 3;
|
|
|
- sUserInfo.UserCode = "SC35_3";
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- sUserInfo.UserID = 5;
|
|
|
- sUserInfo.UserCode = "SC35_5";
|
|
|
- break;
|
|
|
- case 6:
|
|
|
- sUserInfo.UserID = 6;
|
|
|
- sUserInfo.UserCode = "SC35_6";
|
|
|
- break;
|
|
|
- default:
|
|
|
- returnMessage = $"NG:工序[5_1]预干区(入)不存在道口号[{road_no}]";
|
|
|
- return returnMessage;
|
|
|
- }
|
|
|
- }
|
|
|
- else if (procedure_no == "3_4_1")
|
|
|
- {
|
|
|
- // 阴干区(入)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
-
|
|
|
- }
|
|
|
- else if (procedure_no == "3_4_2")
|
|
|
- {
|
|
|
- // 烘干区(入)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
-
|
|
|
- }
|
|
|
- else if (procedure_no == "3_4_3")
|
|
|
- {
|
|
|
- // 烘干区(出)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
-
|
|
|
- }
|
|
|
- else if (procedure_no == "3_3_1")
|
|
|
- {
|
|
|
- // 毛坯库(入)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
- if (road_no == 2)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else if (procedure_no == "3_3_2")
|
|
|
- {
|
|
|
- // 毛坯库(出)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
-
|
|
|
- }
|
|
|
- else if (procedure_no == "3_3_3")
|
|
|
- {
|
|
|
- // 精坯库(入)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
-
|
|
|
- }
|
|
|
- else if (procedure_no == "3_2_1")
|
|
|
- {
|
|
|
- // 釉坯库(入)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
-
|
|
|
- }
|
|
|
- else if (procedure_no == "3_1_1")
|
|
|
- {
|
|
|
- // 光瓷库(入)
|
|
|
- // TODO
|
|
|
- procedureID = 0;
|
|
|
- sUserInfo.UserID = 4;
|
|
|
- sUserInfo.UserCode = "SC35_4";
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (procedureID > 0)
|
|
|
- {
|
|
|
- DataTable barcodeTable = new DataTable();
|
|
|
- barcodeTable.Columns.Add("LogoID");
|
|
|
- barcodeTable.Columns.Add("BarCode");
|
|
|
- barcodeTable.Columns.Add("Remarks");
|
|
|
-
|
|
|
- barcodeTable.Rows[0]["BarCode"] = barcode;
|
|
|
- barcodeTable.Rows[0]["Remarks"] = (weight > 0 ? weight+"KG" : null);
|
|
|
-
|
|
|
- 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 "NG:" + out_msg;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return returnMessage;
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- OutputLog.TraceLog(LogPriority.Error,
|
|
|
- this.ToString(),
|
|
|
- System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
- inputCode + ex.ToString(),
|
|
|
- LocalPath.LogExePath);
|
|
|
- return "NG:MES系统异常";
|
|
|
- }
|
|
|
- }
|
|
|
#endregion
|
|
|
}
|
|
|
}
|