|
@@ -256,6 +256,39 @@ namespace PLC_S.ServerModel
|
|
|
#region 【可选】产品型号写入
|
|
#region 【可选】产品型号写入
|
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_GOODSCODE_CODE) && !string.IsNullOrEmpty(plc_s.PLC_GOODSCODE_CODENUM))
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_GOODSCODE_CODE) && !string.IsNullOrEmpty(plc_s.PLC_GOODSCODE_CODENUM))
|
|
|
{
|
|
{
|
|
|
|
|
+ string goodsCode = GetGoodsCode(barCode, e, logKeyE);
|
|
|
|
|
+ if (goodsCode == 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.IsNullOrEmpty(plc_s.PLC_IP))
|
|
|
|
|
+ {
|
|
|
|
|
+ outputMessage = $"[{e.Content}]SET_GOODSCODE=[{goodsCode}]{plc_s.PLC_GOODSCODE_CODE + plc_s.PLC_GOODSCODE_CODENUM}";
|
|
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
|
|
+ p_r = plc.Write<string>(plc_s.PLC_GOODSCODE_CODE, plc_s.PLC_GOODSCODE_CODENUM, goodsCode);
|
|
|
|
|
+ outputMessage = $"[{e.Content}]END_GOODSCODE=[{p_r}]{plc_s.PLC_GOODSCODE_CODE + plc_s.PLC_GOODSCODE_CODENUM}";
|
|
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ outputMessage = $"[{e.Content}]产品型号=[{goodsCode}]";
|
|
|
|
|
+ Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
|
|
+ FormLogShow?.ShowLog(outputMessage);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region 【可选】产品型号代码写入
|
|
|
|
|
+ if (!string.IsNullOrEmpty(plc_s.PLC_SEATCOVER_CODE) && !string.IsNullOrEmpty(plc_s.PLC_SEATCOVER_CODENUM))
|
|
|
|
|
+ {
|
|
|
string intCode = GetSeatCoverCode(barCode, e, logKeyE);
|
|
string intCode = GetSeatCoverCode(barCode, e, logKeyE);
|
|
|
if (intCode == null)
|
|
if (intCode == null)
|
|
|
{
|
|
{
|
|
@@ -277,11 +310,11 @@ namespace PLC_S.ServerModel
|
|
|
}
|
|
}
|
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_IP))
|
|
if (!string.IsNullOrEmpty(plc_s.PLC_IP))
|
|
|
{
|
|
{
|
|
|
- outputMessage = $"[{e.Content}]SET_GOODSCODE=[{intCode}]{plc_s.PLC_GOODSCODE_CODE + plc_s.PLC_GOODSCODE_CODENUM}";
|
|
|
|
|
|
|
+ outputMessage = $"[{e.Content}]SET_SEATCOVER=[{intCode}]{plc_s.PLC_SEATCOVER_CODE + plc_s.PLC_SEATCOVER_CODENUM}";
|
|
|
Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
FormLogShow?.ShowLog(outputMessage);
|
|
FormLogShow?.ShowLog(outputMessage);
|
|
|
- p_r = plc.Write<short>(plc_s.PLC_GOODSCODE_CODE, plc_s.PLC_GOODSCODE_CODENUM, (short)(intCode.ToInt32()));
|
|
|
|
|
- outputMessage = $"[{e.Content}]END_GOODSCODE=[{p_r}]{plc_s.PLC_GOODSCODE_CODE + plc_s.PLC_GOODSCODE_CODENUM}";
|
|
|
|
|
|
|
+ p_r = plc.Write<short>(plc_s.PLC_SEATCOVER_CODE, plc_s.PLC_SEATCOVER_CODENUM, (short)(intCode.ToInt32()));
|
|
|
|
|
+ outputMessage = $"[{e.Content}]END_SEATCOVER=[{p_r}]{plc_s.PLC_SEATCOVER_CODE + plc_s.PLC_SEATCOVER_CODENUM}";
|
|
|
Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
Logger.Trace(outputMessage, logKeyT, logger_t);
|
|
|
FormLogShow?.ShowLog(outputMessage);
|
|
FormLogShow?.ShowLog(outputMessage);
|
|
|
}
|
|
}
|
|
@@ -815,6 +848,9 @@ namespace PLC_S.ServerModel
|
|
|
plc_s.PLC_FLAG_CODE = ini.Read(flag, "PLC_FLAG_CODE");
|
|
plc_s.PLC_FLAG_CODE = ini.Read(flag, "PLC_FLAG_CODE");
|
|
|
plc_s.PLC_FLAG_CODENUM = ini.Read(flag, "PLC_FLAG_CODENUM");
|
|
plc_s.PLC_FLAG_CODENUM = ini.Read(flag, "PLC_FLAG_CODENUM");
|
|
|
|
|
|
|
|
|
|
+ plc_s.PLC_SEATCOVER_CODE = ini.Read(flag, "PLC_SEATCOVER_CODE");
|
|
|
|
|
+ plc_s.PLC_SEATCOVER_CODENUM = ini.Read(flag, "PLC_SEATCOVER_CODENUM");
|
|
|
|
|
+
|
|
|
plc_s.PLC_GOODSCODE_CODE = ini.Read(flag, "PLC_GOODSCODE_CODE");
|
|
plc_s.PLC_GOODSCODE_CODE = ini.Read(flag, "PLC_GOODSCODE_CODE");
|
|
|
plc_s.PLC_GOODSCODE_CODENUM = ini.Read(flag, "PLC_GOODSCODE_CODENUM");
|
|
plc_s.PLC_GOODSCODE_CODENUM = ini.Read(flag, "PLC_GOODSCODE_CODENUM");
|
|
|
|
|
|