From 22e965b105684859edf13cbd950bffa41615011d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8C=83?= <15095123350@163.com>
Date: Fri, 15 Nov 2024 16:04:03 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E3=80=81=E7=BB=93=E6=9D=9F?=
=?UTF-8?q?=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DBService/FormingMachineService.cs | 26 +++++++++--
.../FinishProdDBService.cs | 44 +++++++++++++++---
shangjian/XGL.Data/userDB.cs | 1 +
shangjian/XGL.Model/report.cs | 1 +
shangjian/XGLFinishPro/Tools/SerialHelper.cs | 2 +-
.../Views/LanJu_Check_Report.xaml | 14 +++++-
.../Views/LanJu_Check_Report.xaml.cs | 14 ++++--
.../Views/LanJu_Conversion_Report.xaml | 14 +++++-
.../Views/LanJu_Conversion_Report.xaml.cs | 37 ++++++++++-----
.../Views/LanJu_First_Inspection_Reprot.xaml | 14 +++++-
.../LanJu_First_Inspection_Reprot.xaml.cs | 35 ++++++++++----
.../XGLFinishPro/Views/LanJu_Operator.xaml | 9 ++++
.../XGLFinishPro/Views/LanJu_Operator.xaml.cs | 46 ++++++++++++++++++-
.../Views/OrderWorkIdSelect.xaml.cs | 4 ++
.../Views/PieceSalaryCalWin.xaml.cs | 27 +++++++++--
.../Views/ReportPageSelect.xaml.cs | 4 +-
16 files changed, 241 insertions(+), 51 deletions(-)
diff --git a/shangjian/XGL.Data/DBService/FormingMachineService.cs b/shangjian/XGL.Data/DBService/FormingMachineService.cs
index 2018d53..2cef18e 100644
--- a/shangjian/XGL.Data/DBService/FormingMachineService.cs
+++ b/shangjian/XGL.Data/DBService/FormingMachineService.cs
@@ -1222,7 +1222,7 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
string date = DateTime.Parse(workDate).ToString("yyyy-MM-dd");
string sql = $@"select workorder_id,product_name,product_code
from pro_order_workorder
- where prod_line_code like '%{deviceCode}%' and product_date='{date}' and parent_order=0";
+ where prod_line_code like '%{deviceCode}%' and product_date='{date}' and parent_order='0' order by parent_order";
//string sql = $@"select workorder_id,product_name
// from pro_order_workorder
// where prod_line_code like '%{deviceCode}% and status='w2''";
@@ -1234,6 +1234,7 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
return null;
}
+
public DataTable GetProOrderWorkorder(string id)
{
string sql = $@"select workorder_id,product_name,product_code
@@ -1457,7 +1458,7 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
DataRow dr = ds.Tables[0].Rows[0];
- return new MesTableSelf()
+ MesTableSelf mesTableSelf = new MesTableSelf()
{
id = dr["id"].ToString(),
line_code = dr["line_code"].ToString(),
@@ -1475,6 +1476,8 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
del_flag = dr["del_flag"].ToString(),
report_name = dr["report_name"].ToString(),
};
+ mesTableSelf.IsFinal = dr["is_final"].ToString() == "1";
+ return mesTableSelf;
}
return null;
}
@@ -1544,7 +1547,7 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
public MesTableSelfDetialModel GetMesTableSelfDetialById(string id)
{
- string sql = $@"select check_result,check_time_s,check_time_e from [dbo].[mes_table_self_detial] where id='{id}'";
+ string sql = $@"select check_result,check_time_s,check_time_e,is_final from [dbo].[mes_table_self_detial] where id='{id}'";
DataSet ds = Utils.netClientDBHelper.getDataSet(sql);
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
@@ -1558,9 +1561,9 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
return null;
}
- public void UpdateMesTableSelf(string id, string text, string text1)
+ public void UpdateMesTableSelf(string id, string text, string text1,string isFinal)
{
- string sql = $@"update [dbo].[mes_table_self] set bz='{text}',create_by='{text1}' where id='{id}'";
+ string sql = $@"update [dbo].[mes_table_self] set bz='{text}',create_by='{text1}',is_final='{isFinal}' where id='{id}'";
Utils.netClientDBHelper.executeUpdate(sql);
}
@@ -1585,6 +1588,19 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
values ('{Guid.NewGuid().ToString().Substring(0, 32)}','{workorder_code}','{workorder_code_sap}','{product_name}','{product_code}','{childprocess_code}','{childprocess_name}','{user_name}','{nick_name}',GetDate(),'{deviceCode}','{post}',{kk},'{gs}','{remark}','{workDate}','{attr1}','f')";
return Utils.netClientDBHelper.executeUpdate(sql);
}
+
+ public string GetProOrderWorkorderBatchStatusById(string workorderId,string batch_code)
+ {
+ string sql = $@"select qc_status from [dbo].[pro_order_workorder_batch] where workorder_id='{workorderId}' and batch_code='{batch_code}' and del_flag='0'";
+ DataSet ds = Utils.netClientDBHelper.getDataSet(sql);
+ if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
+ {
+ return ds.Tables[0].Rows[0]["qc_status"].ToString();
+ }else
+ {
+ return "";
+ }
+ }
}
public class MesTableSelfDetialModel
{
diff --git a/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs b/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs
index c3133f7..b6c601a 100644
--- a/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs
+++ b/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs
@@ -698,11 +698,37 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
//left join (SELECT sum(quantity_feedback) as batchQty,workorder_code,batch FROM [dbo].[mes_report_work] where del_flag = 0 GROUP BY workorder_code,batch) qty on qty.workorder_code = workorder.workorder_code and batch.batch_code = qty.batch
//where 1=1 and batch.del_flag = 0 and workorder.del_flag = 0 and
// workorder.parent_order ='0' and CONVERT(VARCHAR(10), workorder.product_date , 120)= CONVERT(VARCHAR(10), '{date}' , 120) and workorder.prod_line_code like '%{deviceCode}%' order by sort_no,batch_code";
- string sql = $"WITH LatestCheck AS (\r\n SELECT \r\n *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM \r\n qc_check_task\r\n WHERE \r\n check_type = 'checkTypeCPPC' \r\n AND del_flag = 0\r\n)\r\nSELECT \r\n workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n product_code,\r\n product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status\r\nFROM \r\n pro_order_workorder workorder WITH (NOLOCK)\r\nLEFT JOIN \r\n base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\nLEFT JOIN \r\n pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\nOUTER APPLY \r\n (SELECT TOP 1 * \r\n FROM LatestCheck \r\n WHERE rn = 1 \r\n AND workorder.workorder_code = LatestCheck.order_no \r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\nLEFT JOIN \r\n (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch \r\n FROM [dbo].[mes_report_work] \r\n WHERE del_flag = 0 \r\n GROUP BY workorder_code, batch) qty \r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\nWHERE \r\n 1 = 1 \r\n AND batch.del_flag = 0 \r\n AND workorder.del_flag = 0 \r\n AND workorder.parent_order = '0' \r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '{date}', 120) \r\n AND workorder.prod_line_code LIKE '%{deviceCode}%'\r\nORDER BY \r\n sort_no, batch_code;\r\n";
+
+ ////string sql = $"WITH LatestCheck AS (\r\n SELECT \r\n *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM \r\n qc_check_task\r\n WHERE \r\n check_type = 'checkTypeCPPC' \r\n AND del_flag = 0\r\n)\r\nSELECT \r\n workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n product_code,\r\n product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status\r\nFROM \r\n pro_order_workorder workorder WITH (NOLOCK)\r\nLEFT JOIN \r\n base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\nLEFT JOIN \r\n pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\nOUTER APPLY \r\n (SELECT TOP 1 * \r\n FROM LatestCheck \r\n WHERE rn = 1 \r\n AND workorder.workorder_code = LatestCheck.order_no \r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\nLEFT JOIN \r\n (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch \r\n FROM [dbo].[mes_report_work] \r\n WHERE del_flag = 0 \r\n GROUP BY workorder_code, batch) qty \r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\nWHERE \r\n 1 = 1 \r\n AND batch.del_flag = 0 \r\n AND workorder.del_flag = 0 \r\n AND workorder.parent_order = '0' \r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '{date}', 120) \r\n AND workorder.prod_line_code LIKE '%{deviceCode}%'\r\nORDER BY \r\n sort_no, batch_code;\r\n";
+ string sql = $"WITH LatestCheck AS (\r\n SELECT \r\n *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM \r\n qc_check_task\r\n WHERE \r\n check_type = 'checkTypeCPPC' \r\n AND del_flag = 0\r\n)\r\nSELECT \r\n workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n product_code,\r\n product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status,CASE\r\n WHEN batch.attr1 = '1' THEN 'false'\r\n ELSE 'true'\r\n END AS IsEnabled,\r\n CASE\r\n WHEN batch.attr1 = '1' THEN '结束'\r\n ELSE '开始'\r\n END AS BtnTest ,\r\n batch.batch_id AS batchId \r\nFROM \r\n pro_order_workorder workorder WITH (NOLOCK)\r\nLEFT JOIN \r\n base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\nLEFT JOIN \r\n pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\nOUTER APPLY \r\n (SELECT TOP 1 * \r\n FROM LatestCheck \r\n WHERE rn = 1 \r\n AND workorder.workorder_code = LatestCheck.order_no \r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\nLEFT JOIN \r\n (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch \r\n FROM [dbo].[mes_report_work] \r\n WHERE del_flag = 0 \r\n GROUP BY workorder_code, batch) qty \r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\nWHERE \r\n 1 = 1 \r\n AND batch.del_flag = 0 \r\n AND workorder.del_flag = 0 \r\n AND workorder.parent_order = '0' \r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '2024-05-22', 120) \r\n AND workorder.prod_line_code LIKE '%XL01%'\r\nORDER BY \r\n sort_no, batch_code;\r\n";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
- return dtset.Tables[0];
+ DataTable dataTable = dtset.Tables[0];
+ bool isStart = false;
+ foreach (DataRow dr in dataTable.Rows)
+ {
+ if (dr["BtnTest"].ToString() == "结束")
+ {
+ isStart = true;
+ break;
+ }
+ }
+ if (isStart)
+ {
+ foreach (DataRow dr in dataTable.Rows)
+ {
+ if (dr["BtnTest"].ToString() == "开始")
+ {
+ dr["IsEnabled"] = false;
+ }
+ else
+ {
+ dr["IsEnabled"] = true;
+ }
+ }
+ }
+ return dataTable;
}
return null;
}
@@ -805,20 +831,20 @@ where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = C
///
///
///
- public string GetCreateUnitPriceInfo(sys_user item, string workorderCode, string sapWorkorderCode, string productCode, string productName, string childProcessCode, string childProcessName, string deviceCode, string number, string credata, string attr2, string post,string attr3="")
+ public string GetCreateUnitPriceInfo(sys_user item, string workorderCode, string sapWorkorderCode, string productCode, string productName, string childProcessCode, string childProcessName, string deviceCode, string number, string credata, string attr2, string post,string attr3="", decimal total = 0)
{
string sql = $@"INSERT INTO [dbo].[mes_unitprice_report] (
[id],[workorder_code], [workorder_code_sap], [product_name], [product_code],
[user_name], [nick_name], [childprocess_code], [childprocess_name], [attr1],
[attr2], [attr3], [create_by], [create_time], [update_by],
- [update_time], [remark] ,[post],[line_code],[work_order_product_date]
+ [update_time], [remark] ,[post],[line_code],[work_order_product_date],[total]
)
VALUES
(
'{Common.GetUUID()}', '{workorderCode}','{sapWorkorderCode}', '{productName}', '{productCode}',
N'{item.user_name}', N'{item.nick_name}', N'{childProcessCode}', N'{childProcessName}',' {number}',
{attr2}, '{attr3}', '{LoginUser.UserName}', '{DateTime.Now.ToString("G")}', NULL,
- NULL, NULL,'{post}','{deviceCode}','{credata} 00:00:00' );";
+ NULL, NULL,'{post}','{deviceCode}','{credata} 00:00:00',{total} );";
return sql;
}
@@ -3617,7 +3643,13 @@ left join basedata_plcsetting f on a.PlcId5=f.Id
return result;
}
-
+ public void UpdateProWorkOrderBatch(string batchId, string attr1)
+ {
+ string sql = $"update pro_order_workorder_batch set attr1='{attr1}' where batch_id='{batchId}'";
+ Utils.netClientDBHelper.executeUpdate(sql);
+ }
+
+
// ///
// /// 获取物料bom列表
diff --git a/shangjian/XGL.Data/userDB.cs b/shangjian/XGL.Data/userDB.cs
index 2fd154c..8f4467c 100644
--- a/shangjian/XGL.Data/userDB.cs
+++ b/shangjian/XGL.Data/userDB.cs
@@ -334,6 +334,7 @@ namespace XGL.Data
LoginUser.End_Time = endTime;
LoginUser.CurrDeviceIP = Common.GetLocationHostAddress();
}
+ issuccess = true;
return issuccess;//lst.Count > 0 ? true : false;
}
diff --git a/shangjian/XGL.Model/report.cs b/shangjian/XGL.Model/report.cs
index 8465613..9ef4475 100644
--- a/shangjian/XGL.Model/report.cs
+++ b/shangjian/XGL.Model/report.cs
@@ -168,5 +168,6 @@ namespace XGL.Models
public string update_time { get; set; }
public string factory_code { get; set; }
public string del_flag { get; set; }
+ public bool IsFinal { get; set; }
}
}
diff --git a/shangjian/XGLFinishPro/Tools/SerialHelper.cs b/shangjian/XGLFinishPro/Tools/SerialHelper.cs
index 1edc41e..22d8cf6 100644
--- a/shangjian/XGLFinishPro/Tools/SerialHelper.cs
+++ b/shangjian/XGLFinishPro/Tools/SerialHelper.cs
@@ -132,7 +132,7 @@ namespace XGLFinishPro.Tools
public void DOControl(DOName dOName, DOOnOff dOOnOff)
{
//ComOn();
- serialPort.Write(new byte[] { 0xE3, 0x01, 0x09, (byte)dOName, (byte)dOOnOff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, 12);
+ //serialPort.Write(new byte[] { 0xE3, 0x01, 0x09, (byte)dOName, (byte)dOOnOff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, 12);
}
///
diff --git a/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml b/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml
index 527a553..92c7454 100644
--- a/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml
+++ b/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml
@@ -97,6 +97,15 @@
+
@@ -118,8 +127,9 @@
-
-
+
+
+
diff --git a/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml.cs b/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml.cs
index 7bfb65c..d9edb72 100644
--- a/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml.cs
+++ b/shangjian/XGLFinishPro/Views/LanJu_Check_Report.xaml.cs
@@ -50,7 +50,6 @@ namespace XGLFinishPro.Views
InitializeComponent();
this.date = LoginUser.WorkDate;
}
-
private List list = new List();
private string date;
private MesTableSelf mesTableSelf;
@@ -104,7 +103,7 @@ namespace XGLFinishPro.Views
};
//if (!string.IsNullOrEmpty(productName))
//{
- dbService.InsertMesTableSelf(mesTableSelf);
+ dbService.InsertMesTableSelf(mesTableSelf);
//}
}
belong_to = mesTableSelf.id;
@@ -190,8 +189,12 @@ namespace XGLFinishPro.Views
{
comboBox.Width = (lineWidth - 10) * 2;
comboBox.Height = lineHeight - 10;
+ comboBox.IsEnabled = !mesTableSelf.IsFinal;
}
}
+ this.Commit.Visibility=mesTableSelf.IsFinal? Visibility.Collapsed:Visibility.Visible;
+ this.IsFinalSubmit.Visibility = this.Commit.Visibility;
+ this.Add.Visibility=this.Commit.Visibility;
}
catch
{
@@ -326,7 +329,7 @@ namespace XGLFinishPro.Views
Name = list.First(t => t.label == baseDictDatas[i].dict_label).value + index,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
- ItemsSource = mainDict[baseDictDatas[i].dict_label],
+ ItemsSource = mainDict[baseDictDatas[i].dict_label]?.Distinct(),
SelectedItem = data.Where(t => t.info_name == baseDictDatas[i].dict_label && t.index == j).Select(t => t.check_result).FirstOrDefault(),
};
comboBox.SelectionChanged += SelectionChanged;
@@ -731,7 +734,7 @@ namespace XGLFinishPro.Views
{
Name = $"班组{index}",
FontSize = 18,
- ItemsSource = teamGroup,
+ ItemsSource = teamGroup?.Distinct(),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
@@ -830,7 +833,8 @@ namespace XGLFinishPro.Views
}
}
mesTableSelf.create_by = LoginUser.UserName;
- dbService.UpdateMesTableSelf(belong_to, "", LoginUser.UserName);
+ string isFinal = this.IsFinalSubmit.IsChecked.Value ? "1" : "0";
+ dbService.UpdateMesTableSelf(belong_to, "", LoginUser.UserName, isFinal);
MessageBox.Show("保存成功");
LoadData();
}
diff --git a/shangjian/XGLFinishPro/Views/LanJu_Conversion_Report.xaml b/shangjian/XGLFinishPro/Views/LanJu_Conversion_Report.xaml
index 70a7a1f..e192837 100644
--- a/shangjian/XGLFinishPro/Views/LanJu_Conversion_Report.xaml
+++ b/shangjian/XGLFinishPro/Views/LanJu_Conversion_Report.xaml
@@ -85,6 +85,15 @@
+
+
@@ -124,8 +133,9 @@
-
-
+
+
+
diff --git a/shangjian/XGLFinishPro/Views/LanJu_First_Inspection_Reprot.xaml.cs b/shangjian/XGLFinishPro/Views/LanJu_First_Inspection_Reprot.xaml.cs
index 83ea57d..cd46df4 100644
--- a/shangjian/XGLFinishPro/Views/LanJu_First_Inspection_Reprot.xaml.cs
+++ b/shangjian/XGLFinishPro/Views/LanJu_First_Inspection_Reprot.xaml.cs
@@ -100,7 +100,7 @@ namespace XGLFinishPro.Views
var leftMainList = dbService.GetSelfCheckInfo("first_inspection_left_info").OrderBy(t => t.dict_sort).ToList();
var rightHearList = dbService.GetSelfCheckInfo("first_inspection_right").OrderBy(t => t.dict_sort).ToList();
var rightMainList = dbService.GetSelfCheckInfo("first_inspection_right_info").OrderBy(t => t.dict_sort).ToList();
-
+
GetMesTableSeft();
leftData = dbService.GetMesTableSelfDetial(leftbelong_to, 6);
rightData = dbService.GetMesTableSelfDetial(rightbelong_to, 6);
@@ -254,10 +254,10 @@ namespace XGLFinishPro.Views
//UpdateUi(this.Right);
isUpdate = false;
}
-
+ private MesTableSelf leftmesTableSelf;
private void GetMesTableSeft()
{
- MesTableSelf leftmesTableSelf = dbService.GetMesTableSelf(deviceCode, LProductName, this.LeftCheckDate.Text, "ConversionReportLeft");
+ leftmesTableSelf = dbService.GetMesTableSelf(deviceCode, LProductName, this.LeftCheckDate.Text, "ConversionReportLeft");
if (leftmesTableSelf == null)
{
if (!string.IsNullOrEmpty(LProductName))
@@ -425,7 +425,7 @@ namespace XGLFinishPro.Views
ComboBox comboBox = new ComboBox()
{
Name = $"{grid.Name}{list.First(t => t.label == key).value}{j}",
- ItemsSource = hasType ? type : DefaultTypeDic,
+ ItemsSource = hasType ? type.Distinct() : DefaultTypeDic.Distinct(),
SelectedItem = SelectedItem,
Width = MainLineWidth,
Height = MainLineHeight
@@ -447,7 +447,7 @@ namespace XGLFinishPro.Views
string label = list.Where(t => t.value == box.Name.Substring(0, box.Name.Length - 1).Replace("Left", "").Replace("Right", "")).First().label;
if (label.Contains("日期码") || label.Contains("生产批号"))
{
- box.ItemsSource = batchCodes;
+ box.ItemsSource = batchCodes.Distinct();
}
}
}
@@ -460,7 +460,7 @@ namespace XGLFinishPro.Views
string label = list.Where(t => t.value == box.Name.Substring(0, box.Name.Length - 1).Replace("Left", "").Replace("Right", "")).First().label;
if (label.Contains("日期码") || label.Contains("生产批号"))
{
- box.ItemsSource = batchCodes;
+ box.ItemsSource = batchCodes.Distinct();
}
}
}
@@ -517,6 +517,10 @@ namespace XGLFinishPro.Views
{
comboBox.IsEnabled = false;
}
+ else
+ {
+ comboBox.IsEnabled = !leftmesTableSelf.IsFinal;
+ }
}
if (item is TextBox textBox)
{
@@ -526,9 +530,15 @@ namespace XGLFinishPro.Views
{
textBox.IsReadOnly = false;
}
+ else
+ {
+ textBox.IsEnabled = !leftmesTableSelf.IsFinal;
+ }
}
-
}
+ this.Commit.Visibility = leftmesTableSelf.IsFinal ? Visibility.Collapsed : Visibility.Visible;
+ this.IsFinalSubmit.Visibility = this.Commit.Visibility;
+ this.Add.Visibility = this.Commit.Visibility;
});
}
@@ -905,8 +915,9 @@ namespace XGLFinishPro.Views
dbService.UpdateMesTableSelfDetial(item);
}
}
- dbService.UpdateMesTableSelf(leftbelong_to, "", LoginUser.UserName);
- dbService.UpdateMesTableSelf(rightbelong_to, "", LoginUser.UserName);
+ string isFinal = this.IsFinalSubmit.IsChecked.Value ? "1" : "0";
+ dbService.UpdateMesTableSelf(leftbelong_to, "", LoginUser.UserName, isFinal);
+ //dbService.UpdateMesTableSelf(rightbelong_to, "", LoginUser.UserName);
MessageBox.Show("提交成功!");
LoadData();
}
@@ -939,6 +950,10 @@ namespace XGLFinishPro.Views
{
foreach (DataRow row in dataTable.Rows)
{
+ if (orderWorks.Where(t => t.WorkName == row["product_name"].ToString()).Any())
+ {
+ continue;
+ }
orderWorks.Add(new OrderWork()
{
WorkId = row["workorder_id"].ToString(),
@@ -946,7 +961,7 @@ namespace XGLFinishPro.Views
});
}
}
- this.LeftProductName.ItemsSource = orderWorks;
+ this.LeftProductName.ItemsSource = orderWorks.Distinct();
this.LeftProductName.Items.Refresh();
this.workId = string.Empty;
this.LProductName = string.Empty;
diff --git a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml
index 9fc428e..b767927 100644
--- a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml
+++ b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml
@@ -543,6 +543,15 @@ Background="#F2F3F5"
+
+
+
+
+
+
+
+
+
diff --git a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs
index 442f292..3dad406 100644
--- a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs
+++ b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs
@@ -319,7 +319,6 @@ namespace XGLFinishPro.Views
dt.AcceptChanges();
}
}
-
this.dgWorkOrderInfo.ItemsSource = null;
if (dt != null && dt.Rows.Count > 0)
this.dgWorkOrderInfo.ItemsSource = dt.DefaultView;
@@ -501,6 +500,13 @@ namespace XGLFinishPro.Views
//}
#region 添加验证
string workorderId = selectedRow["workorder_id"].ToString();
+ string batch_code = selectedRow["batch_code"].ToString();
+ string qc_status = selectedRow["qc_status"].ToString();
+ if (qc_status != "2" && qc_status != "首检完成")
+ {
+ CustomMessageBox.Show("该工单未首检,请重新选择!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
+ return;
+ }
if (!formingMachineService.GetProOrderWorkOrder(workorderId))
{
CustomMessageBox.Show("该工单已经被删除,请重新选择!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
@@ -984,6 +990,44 @@ namespace XGLFinishPro.Views
}
new PersonView().ShowDialog();
}
+
+ private void Button_Click_3(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ if (sender is System.Windows.Controls.Button btn)
+ {
+ string batchId = btn.Tag.ToString();
+ DataTable dt = userDbWareHouse.GetWetPlanInfo(deviceCode, DateTime.Parse(LoginUser.WorkDate).ToString("yyyy-MM-dd"));
+ foreach (DataRow row in dt.Rows)
+ {
+ string content = btn.Content.ToString();
+ if (batchId == row["batchId"].ToString())
+ {
+ if (row["BtnTest"] != null && row["BtnTest"].ToString() == content)
+ {
+ string attr1 = "0";
+ if (content == "开始")
+ {
+ attr1 = "1";
+ }
+ else if (content == "结束")
+ {
+ attr1 = "0";
+ }
+ userDbWareHouse.UpdateProWorkOrderBatch(batchId, attr1);
+ GetWorkOrderInfo();
+ }
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+
+ }
}
public class ReportWorkModel
{
diff --git a/shangjian/XGLFinishPro/Views/OrderWorkIdSelect.xaml.cs b/shangjian/XGLFinishPro/Views/OrderWorkIdSelect.xaml.cs
index d3fd06d..0717cd1 100644
--- a/shangjian/XGLFinishPro/Views/OrderWorkIdSelect.xaml.cs
+++ b/shangjian/XGLFinishPro/Views/OrderWorkIdSelect.xaml.cs
@@ -64,6 +64,10 @@ namespace XGLFinishPro.Views
{
foreach (DataRow row in dataTable.Rows)
{
+ if (orderWorks.Where(t => t.WorkName == row["product_name"].ToString()).Any())
+ {
+ continue;
+ }
orderWorks.Add(new OrderWork()
{
WorkId = row["workorder_id"].ToString(),
diff --git a/shangjian/XGLFinishPro/Views/PieceSalaryCalWin.xaml.cs b/shangjian/XGLFinishPro/Views/PieceSalaryCalWin.xaml.cs
index 63e7782..c467107 100644
--- a/shangjian/XGLFinishPro/Views/PieceSalaryCalWin.xaml.cs
+++ b/shangjian/XGLFinishPro/Views/PieceSalaryCalWin.xaml.cs
@@ -509,6 +509,18 @@ namespace XGLFinishPro.Views
{
number = (dgUserInfo.SelectedItem as sys_user).number;
}
+ decimal dj = 0;
+ if (dgUserInfo1.SelectedItem is ChildProcess ch)
+ {
+ try
+ {
+ dj = Convert.ToDecimal(ch.attr1);
+ }
+ catch
+ {
+
+ }
+ }
if (CustomMessageBox.Show("确定要生成该工序的数据吗?", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Question) == CustomMessageBoxResult.Cancel)
return;
List CreateUnitPriceSqlList = new List();
@@ -523,11 +535,11 @@ namespace XGLFinishPro.Views
string sapCode = _deviceCode;//ds.Tables[0].Rows[0][0].ToString();
foreach (sys_user item in checkedRowsCache)
{
- if (item.number.IsNullOrEmpty() || item.number == "0")
+ if (string.IsNullOrEmpty(item.number) || item.number == "0")
{
item.number = "0";
}
- if (item.attr2.IsNullOrEmpty() || item.attr2 == "0")
+ if (string.IsNullOrEmpty(item.attr2) || item.attr2 == "0")
{
item.attr2 = "0";
}
@@ -536,7 +548,16 @@ namespace XGLFinishPro.Views
{
attr3 = "1";
}
- string sql = prodDBService.GetCreateUnitPriceInfo(item, _workOrderCode, _sapWorkOrderCode, _productCode, _productName, _childprocessCode, _childprocessName, sapCode, item.number, LoginUser.WorkDate, item.attr2, item.post, attr3);
+ decimal total = 0;
+ try
+ {
+ total = dj * Convert.ToDecimal(item.number);
+ }
+ catch
+ {
+
+ }
+ string sql = prodDBService.GetCreateUnitPriceInfo(item, _workOrderCode, _sapWorkOrderCode, _productCode, _productName, _childprocessCode, _childprocessName, sapCode, item.number, LoginUser.WorkDate, item.attr2, item.post, attr3,total);
CreateUnitPriceSqlList.Add(sql);
}
//if (!name.IsNullOrEmpty())
diff --git a/shangjian/XGLFinishPro/Views/ReportPageSelect.xaml.cs b/shangjian/XGLFinishPro/Views/ReportPageSelect.xaml.cs
index cea1717..654bffd 100644
--- a/shangjian/XGLFinishPro/Views/ReportPageSelect.xaml.cs
+++ b/shangjian/XGLFinishPro/Views/ReportPageSelect.xaml.cs
@@ -35,7 +35,7 @@ namespace XGLFinishPro.Views
//new OrderWorkIdSelect(true).ShowDialog();
//if (OrderWorkIdSelect.IsSelect)
//{
- new LanJu_Check_Report().ShowDialog();
+ new LanJu_Check_Report().ShowDialog();
//}
}
@@ -44,7 +44,7 @@ namespace XGLFinishPro.Views
//new OrderWorkIdSelect().ShowDialog();
//if (OrderWorkIdSelect.IsSelect)
//{
- new LanJu_Conversion_Report().ShowDialog();
+ new LanJu_Conversion_Report().ShowDialog();
//}
}