|
|
@@ -12,13 +12,16 @@
|
|
|
using System;
|
|
|
using System.Collections;
|
|
|
using System.Data;
|
|
|
-using System.Net;
|
|
|
using System.ServiceModel;
|
|
|
using System.ServiceModel.Activation;
|
|
|
+
|
|
|
using Curtain.DataAccess;
|
|
|
+
|
|
|
+using Dongke.IBOSS.PRD.Basics.BaseResources;
|
|
|
using Dongke.IBOSS.PRD.Basics.DataAccess;
|
|
|
using Dongke.IBOSS.PRD.Basics.Library;
|
|
|
using Dongke.IBOSS.PRD.Service.DataModels;
|
|
|
+using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
|
|
|
using Dongke.IBOSS.PRD.Service.PMModuleLogic;
|
|
|
using Dongke.IBOSS.PRD.Service.SmartDeviceService;
|
|
|
using Dongke.IBOSS.PRD.WCF.DataModels;
|
|
|
@@ -182,6 +185,141 @@ namespace Dongke.IBOSS.PRD.WCF.ExHGS3QRS
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 恒洁三水三车间对接乾润扫码(增加防伪码参数用于釉坯库(入)节点进行验证)2021-08-26 xuwei add
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="barcode"></param>
|
|
|
+ /// <param name="securitycode"></param>
|
|
|
+ /// <param name="procedure_no"></param>
|
|
|
+ /// <param name="road_no"></param>
|
|
|
+ /// <param name="weight"></param>
|
|
|
+ /// <param name="procedure_in"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string AddWorkInfoHGS3_QR2(string barcode, string securitycode, string procedure_no, string road_no, double weight, int procedure_in = 1)
|
|
|
+ {
|
|
|
+ //修正参数,去掉多余的特殊字符
|
|
|
+ barcode = barCodeFix(barcode);
|
|
|
+ road_no = roadNoFix(road_no);
|
|
|
+
|
|
|
+ string inputCode = $" barcode:{barcode} procedure_no:{procedure_no} road_no:{road_no} weight:{weight}";
|
|
|
+ string returnMessage = "OK";
|
|
|
+ string[] barCodes = barcode.Split(',');
|
|
|
+ Hashtable goodsInfo = new Hashtable();
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ #region 必须:定义一个条码和多条码的返回值
|
|
|
+ if (barCodes.Length > 1)
|
|
|
+ {
|
|
|
+ //多个条码时只返回OK和barcode
|
|
|
+ returnMessage = $"OK:{barcode}";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //一个条码时,获取注浆信息
|
|
|
+ goodsInfo = getGroutingDailyDetail(barCodes[0]);
|
|
|
+ if (goodsInfo.Count == 0)
|
|
|
+ {
|
|
|
+ return $"NG:条码[{barCodes[0]}]不存在";
|
|
|
+ }
|
|
|
+
|
|
|
+ //定义返回信息 OK: 返回字符串(条码#型号#SKU码#结果#智能:1\连体:2#高压:1\普通:2)
|
|
|
+ returnMessage = $"OK:{goodsInfo["barcode"]}#{goodsInfo["goodscode"]}#{goodsInfo["materialcode"]}#{goodsInfo["level"]}#{goodsInfo["zhineng"]}#{goodsInfo["gaoya"]}#{goodsInfo["lineno"]}";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 必须:读取设备对接点配置信息 TP_SYS_SMARTDEVICEPOINT
|
|
|
+ DataTable smartDevicePoint = getSmartDevicePoint(procedure_no, road_no);
|
|
|
+ if (smartDevicePoint.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + "NG:设备对接工序点未配置",
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ return "NG:设备对接工序点未配置";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 特定:二车间卸窑库,不验证,不计件,只支持一个条码=====================
|
|
|
+ //2021-01-14 要求二车间验证此工序,有漏扫的停止在这里 xuwei modify
|
|
|
+ //if (barCodes.Length == 1 && procedure_no == "2_1_1")
|
|
|
+ //{
|
|
|
+ // return $"OK:{goodsInfo["barcode"]}#{goodsInfo["goodscode"]}#{goodsInfo["mudstoretype"]}#{goodsInfo["level"]}#{goodsInfo["zhineng"]}#{goodsInfo["gaoya"]}#{goodsInfo["lineno"]}";
|
|
|
+ //}
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 特定:光瓷库入前分流,只验证正品和副品,只支持一个条码=================
|
|
|
+ if (barCodes.Length == 1 && (procedure_no == "3_1_0" || (procedure_no == "3_1_1" && procedure_in == 0)))
|
|
|
+ {
|
|
|
+ if (goodsInfo["goodsleveltypeid"].ToString() == "4" || goodsInfo["goodsleveltypeid"].ToString() == "5")
|
|
|
+ {
|
|
|
+ string msg = checkBarcode(Convert.ToInt32(smartDevicePoint.Rows[0]["PROCEDUREID"]), barCodes);
|
|
|
+ if (msg != "")
|
|
|
+ return $"NG:{msg}";
|
|
|
+ else
|
|
|
+ return returnMessage;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return returnMessage;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 特定:三车间 釉坯库(入)节点 验证防伪码 xuwei add 2021-08-30
|
|
|
+ if (procedure_no == "3_2_1")
|
|
|
+ {
|
|
|
+ ServiceResultEntity result = PDAModuleLogic.CheckSecurityCodeByBarcode(barcode, securitycode, null);
|
|
|
+ if (result.Status != Constant.ServiceResultStatus.Success) return $"NG:{result.Message}";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 通用:procedure_in = 0 验证处理,支持多条码
|
|
|
+ if (procedure_in == 0)
|
|
|
+ {
|
|
|
+ string msg = "";
|
|
|
+ //标准验证是否可到达,支持多条码
|
|
|
+ msg = checkBarcode(Convert.ToInt32(smartDevicePoint.Rows[0]["PROCEDUREID"]), barCodes);
|
|
|
+ if (msg != "")
|
|
|
+ return $"NG:{msg}";
|
|
|
+ else
|
|
|
+ return returnMessage;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 通用:procedure_in = 1 计件处理,支持多条码
|
|
|
+ //二车间这个节点不计件处理
|
|
|
+ if (procedure_in == 1 && procedure_no != "2_1_1")
|
|
|
+ {
|
|
|
+ DataTable addWorkPiece = doAddWorkPiece(barCodes, smartDevicePoint);
|
|
|
+ string out_msg = addWorkPiece?.Rows[0]["out_errMsg"].ToString();
|
|
|
+ if (!string.IsNullOrWhiteSpace(out_msg))
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Warning,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + JsonHelper.ToJson(addWorkPiece),
|
|
|
+ LocalPath.LogExePath + "SmartDevice\\");
|
|
|
+ return "NG:" + out_msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ //返回正常拼合串
|
|
|
+ return returnMessage;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ OutputLog.TraceLog(LogPriority.Error,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ inputCode + ex.ToString(),
|
|
|
+ LocalPath.LogExePath);
|
|
|
+ return "NG:MES系统异常";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#region 通用私有方法
|
|
|
|
|
|
/// <summary>
|