|
|
@@ -515,6 +515,61 @@ namespace PLC_S.ServerModel
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region 【可选】智能连体重烧写入,智能重烧253,连体重烧254,其他返回产品代码(官塘厂)
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_GOODSTYPEISREFIRE_CODE) && !string.IsNullOrEmpty(plc_s.PLC_GOODSTYPEISREFIRE_CODENUM))
|
|
|
+ {
|
|
|
+ //产品代码读取
|
|
|
+ string intCode = GetSeatCoverCode(barCode, e, logKeyE);
|
|
|
+ if (intCode == null)
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]此条码[{barCode}]不存在";
|
|
|
+ Logger.Warn(outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Warn(outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_IP)) SendCode(plc_s, e, logKeyT, logKeyE, plc, 2);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(intCode))
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]此条码[{barCode}]未设置型号代码";
|
|
|
+ Logger.Error(null, outputMessage, logKeyT, logger_t);
|
|
|
+ Logger.Error(null, outputMessage, logKeyE, logger_e);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_IP)) SendCode(plc_s, e, logKeyT, logKeyE, plc, 2);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //重烧识别读取
|
|
|
+ Int16 isRefire = Convert.ToInt16(GetAutoFireID(barCode, "1", "6", e, logKeyT));
|
|
|
+
|
|
|
+ //重烧产品返回 智能253,连体254
|
|
|
+ if (isRefire == 6)
|
|
|
+ {
|
|
|
+ //智能连体读取
|
|
|
+ Int16 goodsType = Convert.ToInt16(GetGoodsType(barCode, e, logKeyT));
|
|
|
+ if (goodsType == 1) intCode = "253";
|
|
|
+ if (goodsType == 2) intCode = "254";
|
|
|
+ }
|
|
|
+
|
|
|
+ //写入智能连体重烧标识
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_IP))
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]SET_GOODSTYPEISREFIRE=[{intCode}]{plc_s.PLC_GOODSTYPEISREFIRE_CODE + plc_s.PLC_GOODSTYPEISREFIRE_CODENUM}";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ p_r = plc.Write<short>(plc_s.PLC_GOODSTYPEISREFIRE_CODE, plc_s.PLC_GOODSTYPEISREFIRE_CODENUM, (short)(intCode.ToInt32()));
|
|
|
+ outputMessage = $"[{e.Content}]END_GOODSTYPEISREFIRE=[{p_r}]{plc_s.PLC_GOODSTYPEISREFIRE_CODE + plc_s.PLC_GOODSTYPEISREFIRE_CODENUM}";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outputMessage = $"[{e.Content}]智能连体重烧=[{intCode}]";
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 【可选】产品缺陷类别写入
|
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_GOODSDEFECTTYPE_CODE) && !string.IsNullOrEmpty(plc_s.PLC_GOODSDEFECTTYPE_CODENUM))
|
|
|
{
|