change-优化打印服务,禁止关闭及添加日志

dev
liuwf 3 weeks ago
parent a16bc8d39f
commit 021e89f0d9

@ -46,15 +46,16 @@
// //
// logList // logList
// //
logList.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
logList.BackColor = SystemColors.InactiveCaption; logList.BackColor = SystemColors.InactiveCaption;
logList.Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Bold, GraphicsUnit.Point); logList.Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Bold, GraphicsUnit.Point);
logList.ForeColor = Color.ForestGreen; logList.ForeColor = Color.ForestGreen;
logList.FormattingEnabled = true; logList.FormattingEnabled = true;
logList.HorizontalScrollbar = true; logList.HorizontalScrollbar = true;
logList.ItemHeight = 26; logList.ItemHeight = 26;
logList.Location = new Point(12, 123); logList.Location = new Point(0, 157);
logList.Name = "logList"; logList.Name = "logList";
logList.Size = new Size(1439, 654); logList.Size = new Size(1454, 654);
logList.TabIndex = 1; logList.TabIndex = 1;
// //
// label2 // label2
@ -74,12 +75,12 @@
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
BackColor = SystemColors.ActiveCaption; BackColor = SystemColors.ActiveCaption;
ClientSize = new Size(1454, 811); ClientSize = new Size(1454, 811);
ControlBox = false;
Controls.Add(label2); Controls.Add(label2);
Controls.Add(logList); Controls.Add(logList);
Controls.Add(label1); Controls.Add(label1);
FormBorderStyle = FormBorderStyle.FixedDialog; FormBorderStyle = FormBorderStyle.FixedDialog;
Name = "MainForm"; Name = "MainForm";
SizeGripStyle = SizeGripStyle.Hide;
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "打印条码服务"; Text = "打印条码服务";
ResumeLayout(false); ResumeLayout(false);

@ -43,5 +43,18 @@ namespace PrintBarCode
} }
} }
protected override void OnFormClosing(FormClosingEventArgs e)
{
// 取消关闭操作
e.Cancel = true;
// 将窗口状态设置为最小化
this.WindowState = FormWindowState.Minimized;
}
} }
} }

@ -88,8 +88,8 @@ namespace PrintBarCode
try try
{ {
string channelWork = $"print_{debugConfig.IP}"; string channelWork = $"print_{debugConfig.IP}";
// string jsonString = _redisHandler.ConsumeMessageFromWorker(channelWork); string jsonString = _redisHandler.ConsumeMessageFromWorker(channelWork);
string jsonString = "{\"template\":\"product\",\"printContent\":\"[{\\\"saleOrderCode\\\":\\\"\\\",\\\"materialName\\\":\\\"多功能自动剥线钳\\\",\\\"qrcode\\\":\\\"20241019112921CP001\\\",\\\"materialSpec\\\":\\\"\\\",\\\"qty\\\":\\\"1\\\",\\\"materialCode\\\":\\\"MES.MC.A00861\\\",\\\"barcode\\\":\\\"20241019112921CP001\\\",\\\"productPlanCode\\\":\\\"20241019111402JL012\\\"}]\"}"; // string jsonString = "{\"template\":\"product\",\"printContent\":\"[{\\\"saleOrderCode\\\":\\\"\\\",\\\"materialName\\\":\\\"多功能自动剥线钳\\\",\\\"qrcode\\\":\\\"20241019112921CP001\\\",\\\"materialSpec\\\":\\\"\\\",\\\"qty\\\":\\\"1\\\",\\\"materialCode\\\":\\\"MES.MC.A00861\\\",\\\"barcode\\\":\\\"20241019112921CP001\\\",\\\"productPlanCode\\\":\\\"20241019111402JL012\\\"}]\"}";
if (!string.IsNullOrEmpty(jsonString)) if (!string.IsNullOrEmpty(jsonString))
{ {
var result = JsonParser.ParseJson(jsonString); var result = JsonParser.ParseJson(jsonString);

Loading…
Cancel
Save