优化样品管理

This commit is contained in:
2026-05-08 15:08:20 +08:00
parent a28bfb9198
commit 06a5f9707d
9 changed files with 215 additions and 72 deletions

View File

@@ -12,6 +12,7 @@ using SamplePre.UIWpf.ParamManager.chirld;
using SamplePre.UIWpf.SampleManager.chirld;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
@@ -39,11 +40,11 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
}
private tube_input _tubeInput = new tube_input();
private sample_input _tubeInput = new sample_input();
/// <summary>
/// 样品录入实体
/// </summary>
public tube_input TubeInput
public sample_input TubeInput
{
get { return _tubeInput; }
set {
@@ -168,9 +169,9 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
return qrcode;
}
private List<tube_input> _tubeInputs = new List<tube_input>();
private List<sample_input> _tubeInputs = new List<sample_input>();
public List<tube_input> TubeInputs
public List<sample_input> TubeInputs
{
get { return _tubeInputs; }
set {
@@ -214,14 +215,14 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
/// </summary>
public bool SaveSample()
{
List<tube_input> tempList = new List<tube_input>();
List<sample_input> tempList = new List<sample_input>();
////二维码序号
int sqno = int.Parse(TubeInput.qrcode.Substring(8));// int.Parse(txtSampleSeqno2.Text);
string strDate = TubeInput.qrcode.Substring(0, 8);
for (int i = 0; i < TubeInput.tube_count; i++)
{
tube_input qRcode = new tube_input();
sample_input qRcode = new sample_input();
qRcode.qrcode = strDate + sqno.ToString(); //TubeInput.qrcode;
qRcode.item_name = TubeInput.item_name;
//qRcode.seqno = txtSampleSeqno.Text + txtSampleSeqno2.Text;
@@ -281,12 +282,12 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
}
private tube_input _selectSample;
private sample_input _selectSample;
/// <summary>
/// 选中的样品
/// </summary>
public tube_input SelectSample
public sample_input SelectSample
{
get { return _selectSample; }
set {
@@ -301,7 +302,7 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
public void DeleSelectSample()
{
tube_input[] tube_Inputs = new tube_input[TubeInputs.Count];
sample_input[] tube_Inputs = new sample_input[TubeInputs.Count];
TubeInputs.CopyTo(tube_Inputs);
@@ -323,9 +324,9 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
}
private List<sample_exec_ext> _cmdList = new List<sample_exec_ext>();
private ObservableCollection<sample_exec_ext> _cmdList = new ObservableCollection<sample_exec_ext>();
public List<sample_exec_ext> CmdList
public ObservableCollection<sample_exec_ext> CmdList
{
get { return _cmdList; }
set {
@@ -341,9 +342,9 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
/// </summary>
public void CreateCmdList()
{
List<sample_exec_ext> temp_CmdList = new List<sample_exec_ext>();
//List<sample_exec_ext> temp_CmdList = new List<sample_exec_ext>();
//this.tubes = gridSamples.DataSource as List<tube_input>;
CmdList.Clear();
var groups = TubeInputs.GroupBy(p => new { p.standrad_id, p.standrad });
@@ -365,10 +366,10 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
sampleCmdExec.sampleExecDetails = details;
sampleCmdExec.exec_state = "未执行";
temp_CmdList.Add(sampleCmdExec);
CmdList.Add(sampleCmdExec);
}
CmdList = temp_CmdList;
//CmdList = temp_CmdList;
//BadingSopData(cmds);
}
@@ -482,8 +483,7 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
{
if (!CmdExec()) return;
//保存下发记录
//保存下发记录
SelectItemCmd.exec_state = "执行中";
SelectItemCmd.cmd_content = sopStr;
SelectItemCmd.exec_date = DateTime.Now;
@@ -528,11 +528,11 @@ namespace SamplePreSystem.UI.ViewModel.SampleManager
sopStr = string.Join("-", sop.ToArray());
//写入PLC
bool val = communicationBll.WritePlcData(100, 0, sop.ToArray());
////写入PLC
//bool val = communicationBll.WritePlcData(100, 0, sop.ToArray());
//bool val = monitorBll.WritePlcData(1, 0, sop.ToArray());
return val;
return true;
}