|
|
@@ -422,6 +422,21 @@ namespace PLC_S.ServerModel
|
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_GOODSLEVEL_CODE) && !string.IsNullOrEmpty(plc_s.PLC_GOODSLEVEL_CODENUM))
|
|
|
{
|
|
|
Int16 goodsLevel = Convert.ToInt16(GetGoodsLevel(barCode, e, logKeyT));
|
|
|
+ //如果有裸瓷标识,那么产品等级区分是否为裸瓷正品,裸瓷标识1+正品=91;裸瓷+副品=92 。非裸瓷为原逻辑
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_LUOCI) && plc_s.PLC_LUOCI == "1")
|
|
|
+ {
|
|
|
+ Int16 luoci = Convert.ToInt16(GetLuociFlag(barCode, e, logKeyT));
|
|
|
+ if (luoci == 1 && goodsLevel == 4)
|
|
|
+ {
|
|
|
+ goodsLevel = 91;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (luoci == 1 && goodsLevel == 5)
|
|
|
+ {
|
|
|
+ goodsLevel = 92;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_IP))
|
|
|
{
|
|
|
outputMessage = $"[{e.Content}]SET_GoodsLevel=[{goodsLevel}]{plc_s.PLC_GOODSLEVEL_CODE + plc_s.PLC_GOODSLEVEL_CODENUM}";
|
|
|
@@ -938,6 +953,35 @@ namespace PLC_S.ServerModel
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //产品等级
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_GOODSLEVEL_CODE_OTHER) && !string.IsNullOrEmpty(plc_s.PLC_GOODSLEVEL_CODENUM_OTHER))
|
|
|
+ {
|
|
|
+ Int16 goodsLevel = Convert.ToInt16(GetGoodsLevel(barCode, e, logKeyT));
|
|
|
+ //如果有裸瓷标识,那么产品等级区分是否为裸瓷正品,裸瓷标识1+正品=91;裸瓷+副品=92 。非裸瓷为原逻辑
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_LUOCI_OTHER) && plc_s.PLC_LUOCI_OTHER == "1")
|
|
|
+ {
|
|
|
+ Int16 luoci = Convert.ToInt16(GetLuociFlag(barCode, e, logKeyT));
|
|
|
+ if (luoci == 1 && goodsLevel == 4)
|
|
|
+ {
|
|
|
+ goodsLevel = 91;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (luoci == 1 && goodsLevel == 5)
|
|
|
+ {
|
|
|
+ goodsLevel = 92;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ outputMessage = $"[{e.Content}]SET_GoodsLevel_OTHER=[{goodsLevel}]{plc_s.PLC_GOODSLEVEL_CODE_OTHER + plc_s.PLC_GOODSLEVEL_CODENUM_OTHER}";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ p_r = plc?.Write<short>(plc_s.PLC_GOODSLEVEL_CODE_OTHER, plc_s.PLC_GOODSLEVEL_CODENUM_OTHER, goodsLevel);
|
|
|
+ outputMessage = $"[{e.Content}]END_GoodsLevel_OTHER=[{p_r.ToString()}]{plc_s.PLC_GOODSLEVEL_CODE_OTHER + plc_s.PLC_GOODSLEVEL_CODENUM_OTHER}";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ }
|
|
|
+
|
|
|
//扫码结果
|
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_FLAG_CODE_OTHER) && !string.IsNullOrEmpty(plc_s.PLC_FLAG_CODENUM_OTHER))
|
|
|
{
|
|
|
@@ -1255,6 +1299,30 @@ namespace PLC_S.ServerModel
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private string GetLuociFlag(string barCode, ReceiveSession e, string loggerName)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ using (IDataAccess conn = PLC_S_DataAccess.GetDataAccess())
|
|
|
+ {
|
|
|
+ string sqlStr = @"
|
|
|
+ SELECT TO_CHAR(DECODE(GDD.LUOCIFLAG , '1', '1','0')) LUOCIFLAG
|
|
|
+ FROM TP_PM_GROUTINGDAILYDETAIL GDD
|
|
|
+ WHERE GDD.BARCODE = :BARCODE
|
|
|
+ ";
|
|
|
+ object result = conn.ExecuteScalar(sqlStr, new CDAParameter(":BARCODE", barCode));
|
|
|
+ return result == null ? "0" : result.ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.Error(ex, $"[{e.Content}]ERROR-GetGoodsLevel", loggerName, logger_e);
|
|
|
+ FormLogShow?.ShowLog($"[{e.Content}]ERROR-GetGoodsLevel={ex.Message}");
|
|
|
+ return "0";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private string GetGoodsRepair(string barCode, ReceiveSession e, string loggerName)
|
|
|
{
|
|
|
try
|
|
|
@@ -1629,6 +1697,14 @@ namespace PLC_S.ServerModel
|
|
|
plc_s.PLC_GROUTINGUSER_CODE = ini.Read(flag, "PLC_GROUTINGUSER_CODE");
|
|
|
plc_s.PLC_GROUTINGUSER_CODENUM = ini.Read(flag, "PLC_GROUTINGUSER_CODENUM");
|
|
|
|
|
|
+ plc_s.PLC_LUOCI = ini.Read(flag, "PLC_LUOCI");
|
|
|
+
|
|
|
+ plc_s.PLC_GOODSLEVEL_CODE_OTHER = ini.Read(flag, "PLC_GOODSLEVEL_CODE_OTHER");
|
|
|
+ plc_s.PLC_GOODSLEVEL_CODENUM_OTHER = ini.Read(flag, "PLC_GOODSLEVEL_CODENUM_OTHER");
|
|
|
+
|
|
|
+ plc_s.PLC_LUOCI_OTHER = ini.Read(flag, "PLC_LUOCI_OTHER");
|
|
|
+
|
|
|
+
|
|
|
PLC_FLAGS.Add(flag, plc_s);
|
|
|
return plc_s;
|
|
|
}
|