成品报工

20260122
zhaoaomin 2 years ago
parent e39a220821
commit 4f9ec5720a

Binary file not shown.

@ -659,11 +659,11 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
string sql = $@"select wetDetail.id,wetDetail.factory_code,wetDetail.material_code as prod_code, wetDetail.sync_flag,wetDetail.plan_time,
wetDetail.workorder_id,bucket_id,bucket_code,material_code,material_name,
wetDetail.material_name as product_name,shifts.shift_desc,prod_line_code,workorder.status,workorder.workorder_code,route_code
from pro_wet_material_plan_detail wetDetail
left join pro_order_workorder workorder on workorder.workorder_id = wetDetail.workorder_id
left JOIN base_shifts_t shifts on wetDetail.shift_id = shifts.shift_id
from pro_wet_material_plan_detail wetDetail WITH (NOLOCK)
left join pro_order_workorder workorder WITH (NOLOCK) on workorder.workorder_id = wetDetail.workorder_id
left JOIN base_shifts_t shifts WITH (NOLOCK) on wetDetail.shift_id = shifts.shift_id
where 1=1 and
workorder.end_flag = '1' and CONVERT(VARCHAR(10), wetDetail.plan_time , 120)= CONVERT(VARCHAR(10), '{date}' , 120)";
workorder.end_flag = '1' and workorder.del_flag = '0' and CONVERT(VARCHAR(10), wetDetail.plan_time , 120)= CONVERT(VARCHAR(10), '{date}' , 120)";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{

@ -25,7 +25,7 @@ namespace XGL.Data.DBService
where += $"'{str2}',";
}
where = "("+where.Trim(',')+")";
string sql = $@"select equipment_code as quipCode,equipment_name as quipName,equipment_type_code from base_equipment where equipment_type_code = 'equ_type_hf' and equipment_code in {where} order by create_time";
string sql = $@"select equipment_code as quipCode,equipment_name as quipName,equipment_type_code from base_equipment WITH (NOLOCK) where equipment_type_code = 'equ_type_hf' and equipment_code in {where} order by create_time";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
@ -45,7 +45,7 @@ namespace XGL.Data.DBService
/// <returns></returns>
public DataTable GetDringRoomData(string devicecode,int inout)
{
string sqlHF = $@"SELECT * FROM [dbo].[base_equipment_attached] where device_code='{devicecode}' and property='Intheoven' ;";
string sqlHF = $@"SELECT * FROM [dbo].[base_equipment_attached] WITH (NOLOCK) where device_code='{devicecode}' and property='Intheoven' ;";
////获取绑定中且RFID没有出烘房在烘房内的数据
//// string sql = $@"SELECT rfid,workorder_code,product_name,product_code,isnull(car_num,0) as car_num,isnull([begin],'1900-01-01 08:00:00') as [begin],ord.status FROM [dbo].[mes_material_transfer_result] res
////LEFT JOIN pro_order_workorder ord on res.OrderCode = ord.workorder_id where equipmentCode = '{devicecode}' and rfid_status = '1' and rfid not in(select rfid from mes_material_transfer_result where taskcode = '1' and rfid_status = '1')";
@ -55,8 +55,8 @@ namespace XGL.Data.DBService
DataSet dtsetresult = Utils.netClientDBHelper.getDataSet(sqlHF);
string adwdwad = dtsetresult.Tables[0].Rows[0][5].ToString();
//int number = Convert.ToInt32();
string sql = $@"SELECT TOP {adwdwad} ROW_NUMBER() OVER (ORDER BY dry.create_time desc) AS RowNumber,rfid_no,device_code,type,dry.create_time,dry.update_time,factory_no,dry.workorder_code,material_code,product_name FROM [dbo].[mes_dryinghouse_info] dry
LEFT JOIN pro_order_workorder workorder on dry.workorder_code = workorder.workorder_code where device_code = '{devicecode}' and type = '{inout}' and dry.del_flag='0' order by dry.create_time desc ;";
string sql = $@"SELECT TOP {adwdwad} ROW_NUMBER() OVER (ORDER BY dry.create_time desc) AS RowNumber,rfid_no,device_code,type,dry.create_time,dry.update_time,factory_no,dry.workorder_code,material_code,product_name FROM [dbo].[mes_dryinghouse_info] dry WITH (NOLOCK)
LEFT JOIN pro_order_workorder workorder WITH (NOLOCK) on dry.workorder_code = workorder.workorder_code where device_code = '{devicecode}' and type = '{inout}' and dry.del_flag='0' order by dry.create_time desc ;";
//获取绑定中且RFID没有出烘房在烘房内的数据
// string sql = $@"SELECT rfid,workorder_code,product_name,product_code,isnull(car_num,0) as car_num,isnull([begin],'1900-01-01 08:00:00') as [begin],ord.status FROM [dbo].[mes_material_transfer_result] res
//LEFT JOIN pro_order_workorder ord on res.OrderCode = ord.workorder_id where equipmentCode = '{devicecode}' and rfid_status = '1' and rfid not in(select rfid from mes_material_transfer_result where taskcode = '1' and rfid_status = '1')";
@ -80,7 +80,7 @@ LEFT JOIN pro_order_workorder workorder on dry.workorder_code = workorder.workor
public DataTable GetTemperAndHumilly(string devicecode)
{
string sql = $@"select isnull(isvalue,0) from base_equipment_attached where device_code = '{devicecode}' and (property='temperature' or property = 'humidity') ; ";
string sql = $@"select isnull(isvalue,0) from base_equipment_attached WITH (NOLOCK) where device_code = '{devicecode}' and (property='temperature' or property = 'humidity') ; ";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)

@ -33,15 +33,15 @@ namespace XGL.Data.DBService
ord.attr1,
ord.shift_id ,totalCount,shift.Shift_Desc
FROM
pro_order_workorder ord
LEFT JOIN mes_material_transfer_result res ON res.OrderCode = ord.workorder_id
LEFT JOIN pro_wet_material_plan_detail wet ON wet.workorder_id = res.OrderCode
LEFT JOIN pro_rfid_process_detail rfid ON rfid.workorder_code = ord.workorder_code
left join (select count(*) as totalCount,ordercode from mes_material_transfer_result
pro_order_workorder ord WITH (NOLOCK)
LEFT JOIN mes_material_transfer_result res WITH (NOLOCK) ON res.OrderCode = ord.workorder_id
LEFT JOIN pro_wet_material_plan_detail wet WITH (NOLOCK) ON wet.workorder_id = res.OrderCode
LEFT JOIN pro_rfid_process_detail rfid WITH (NOLOCK) ON rfid.workorder_code = ord.workorder_code
left join (select count(*) as totalCount,ordercode from mes_material_transfer_result WITH (NOLOCK)
where CONVERT(VARCHAR(10), update_time , 120) = CONVERT(VARCHAR(10),'{workDate}', 120) and equipmentCode = '{devicecode}' group by OrderCode) tt
on (tt.ordercode = wet.workorder_id )
AND rfid.rfid = res.rfid
LEFT JOIN base_shifts_t shift on ord.shift_id = shift.Shift_Id
LEFT JOIN base_shifts_t shift WITH (NOLOCK) on ord.shift_id = shift.Shift_Id
WHERE
CONVERT(VARCHAR(10), wet.plan_time , 120) = CONVERT(VARCHAR(10), '{workDate}', 120 )
And ord.prod_line_code like '%{devicecode}%' and totalCount is not null
@ -225,6 +225,8 @@ where res.taskcode = '0' and equipmentCode = 'C6' and res.OrderCode is not null
return issucc ;
}
/// <summary>
/// 更新工单
/// </summary>
@ -280,7 +282,7 @@ VALUES
/// <param name="bdt"></param>
/// <param name="edt"></param>
/// <returns></returns>
public bool ExecuteReportWork(DataRowView selectRow,string workCount, string reportCode, string workTime, string userCount, string costCenter, string batchCode, string isEndReport, string deviceCode)
public bool ExecuteReportWork(DataRowView selectRow,string orderQuntity,string workCount, string reportCode, string workTime, string userCount, string costCenter, string batchCode, string isEndReport, string deviceCode)
{
string getReportCodeSql = $@"SELECT equipment_code,equipment_name FROM [dbo].[base_equipment] WHERE equipment_code='{deviceCode}'";
string lineName = "";
@ -289,15 +291,38 @@ VALUES
{
lineName = dtset.Tables[0].Rows[0]["equipment_name"].ToString();
}
//获取子工单的信息
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{selectRow["workorder_code"]}'";
string subOrder = "";
string subProductCode = "";
string subProductName = "";
string subQuntity = "";
string subUnit = "";
DataSet dtSubOrder = Utils.netClientDBHelper.getDataSet(getSubOrderSql);
if (dtSubOrder != null && dtSubOrder.Tables.Count > 0 && dtSubOrder.Tables[0].Rows.Count > 0)
{
subOrder = dtSubOrder.Tables[0].Rows[0]["workorder_code"].ToString();
subProductCode = dtSubOrder.Tables[0].Rows[0]["product_code"].ToString();
subProductName = dtSubOrder.Tables[0].Rows[0]["product_name"].ToString();
subQuntity = dtSubOrder.Tables[0].Rows[0]["quantity_split"].ToString();
subUnit = dtSubOrder.Tables[0].Rows[0]["unit"].ToString();
}
double rate = Convert.ToDouble(workCount) / Convert.ToDouble(orderQuntity);
double subOrderQty = rate * Convert.ToDouble(subQuntity);
List<string> sqlList = new List<string>();
string sql = $@"INSERT INTO [dbo].[mes_report_work]
//有子单
if (subOrder != "")
{
string mainOrderSql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
[spec], [unit], [quantity], [quantity_feedback], [quantity_qualified], [quantity_unqualified],
[user_name], [nick_name], [feedback_channel], [feedback_time], [record_user], [status],
[remark], [work_time], [machine_code], [machine_name], [team_code], [shift_code],
[attr1], [attr2], [attr3], [attr4], [create_by], [create_time],
[update_time], [update_by], [upload_time], [upload_status], [upload_msg], [prod_type],
[use_man], [work_center],[del_flag],[batch],[end_report])
[use_man], [work_center],[del_flag],[batch],[end_report],[parent_order])
VALUES
('{Common.GetUUID()}', 'SELF', '{reportCode}', '{selectRow["workorder_code"]}', '{selectRow["product_code"]}', '{selectRow["product_name"]}',
'{selectRow["product_spc"]}', '{selectRow["unit"]}', {workCount}, {workCount}, 0, 0,
@ -305,10 +330,52 @@ VALUES
'无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod',
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}');";
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{0}');";
string subOrderSql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
[spec], [unit], [quantity], [quantity_feedback], [quantity_qualified], [quantity_unqualified],
[user_name], [nick_name], [feedback_channel], [feedback_time], [record_user], [status],
[remark], [work_time], [machine_code], [machine_name], [team_code], [shift_code],
[attr1], [attr2], [attr3], [attr4], [create_by], [create_time],
[update_time], [update_by], [upload_time], [upload_status], [upload_msg], [prod_type],
[use_man], [work_center],[del_flag],[batch],[end_report],[parent_order])
VALUES
('{Common.GetUUID()}', 'SELF', '{reportCode}', '{subOrder}', '{subProductCode}', '{subProductName}',
'{selectRow["product_spc"]}', '{subUnit}', {subOrderQty}, {subOrderQty}, 0, 0,
'{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE',
'无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod',
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{selectRow["workorder_code"]}');";
sqlList.Add(mainOrderSql);
sqlList.Add(subOrderSql);
}
else
{
//无子单
string mainOrderSql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
[spec], [unit], [quantity], [quantity_feedback], [quantity_qualified], [quantity_unqualified],
[user_name], [nick_name], [feedback_channel], [feedback_time], [record_user], [status],
[remark], [work_time], [machine_code], [machine_name], [team_code], [shift_code],
[attr1], [attr2], [attr3], [attr4], [create_by], [create_time],
[update_time], [update_by], [upload_time], [upload_status], [upload_msg], [prod_type],
[use_man], [work_center],[del_flag],[batch],[end_report],[parent_order])
VALUES
('{Common.GetUUID()}', 'SELF', '{reportCode}', '{selectRow["workorder_code"]}', '{selectRow["product_code"]}', '{selectRow["product_name"]}',
'{selectRow["product_spc"]}', '{selectRow["unit"]}', {workCount}, {workCount}, 0, 0,
'{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE',
'无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod',
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{selectRow["parent_order"]}');";
sqlList.Add(mainOrderSql);
}
//赵啸林说不用上位机更新报工标识
//string updateOrderSql = $@"update pro_order_workorder set status = 'w3', update_by = '{LoginUser.UserName}',update_time = GETDATE() where workorder_id = '{selectRow["workorder_id"]}' ";
sqlList.Add(sql);
//sqlList.Add(sql);
//sqlList.Add(updateOrderSql);
bool issucc = Utils.netClientDBHelper.executeBatchSql(sqlList);
@ -316,6 +383,121 @@ VALUES
return issucc;//> 0 ? true : false;
}
public bool GetExecuteReportWorkSql(List<string> reportWorkSqlList)
{
bool issucc = Utils.netClientDBHelper.executeBatchSql(reportWorkSqlList);
return issucc;
}
/// <summary>
/// 报工
/// </summary>
/// <param name="bdt"></param>
/// <param name="edt"></param>
/// <returns></returns>
public List<string> GetExecuteReportWorkSql(DataRowView selectRow, string orderQuntity, string workCount, string reportCode, string workTime, string userCount, string costCenter, string batchCode, string isEndReport, string deviceCode)
{
string getReportCodeSql = $@"SELECT equipment_code,equipment_name FROM [dbo].[base_equipment] WHERE equipment_code='{deviceCode}'";
string lineName = "";
DataSet dtset = Utils.netClientDBHelper.getDataSet(getReportCodeSql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
lineName = dtset.Tables[0].Rows[0]["equipment_name"].ToString();
}
//获取子工单的信息
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{selectRow["workorder_code"]}'";
string subOrder = "";
string subProductCode = "";
string subProductName = "";
string subQuntity = "";
string subUnit = "";
DataSet dtSubOrder = Utils.netClientDBHelper.getDataSet(getSubOrderSql);
if (dtSubOrder != null && dtSubOrder.Tables.Count > 0 && dtSubOrder.Tables[0].Rows.Count > 0)
{
subOrder = dtSubOrder.Tables[0].Rows[0]["workorder_code"].ToString();
subProductCode = dtSubOrder.Tables[0].Rows[0]["product_code"].ToString();
subProductName = dtSubOrder.Tables[0].Rows[0]["product_name"].ToString();
subQuntity = dtSubOrder.Tables[0].Rows[0]["quantity_split"].ToString();
subUnit = dtSubOrder.Tables[0].Rows[0]["unit"].ToString();
}
double rate = Convert.ToDouble(workCount) / Convert.ToDouble(orderQuntity);
double subOrderQty = rate * Convert.ToDouble(subQuntity);
List<string> sqlList = new List<string>();
//有子单
if (subOrder != "")
{
string mainOrderSql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
[spec], [unit], [quantity], [quantity_feedback], [quantity_qualified], [quantity_unqualified],
[user_name], [nick_name], [feedback_channel], [feedback_time], [record_user], [status],
[remark], [work_time], [machine_code], [machine_name], [team_code], [shift_code],
[attr1], [attr2], [attr3], [attr4], [create_by], [create_time],
[update_time], [update_by], [upload_time], [upload_status], [upload_msg], [prod_type],
[use_man], [work_center],[del_flag],[batch],[end_report],[parent_order])
VALUES
('{Common.GetUUID()}', 'SELF', '{reportCode}', '{selectRow["workorder_code"]}', '{selectRow["product_code"]}', '{selectRow["product_name"]}',
'{selectRow["product_spc"]}', '{selectRow["unit"]}', {workCount}, {workCount}, 0, 0,
'{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE',
'无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod',
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{0}');";
string subOrderSql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
[spec], [unit], [quantity], [quantity_feedback], [quantity_qualified], [quantity_unqualified],
[user_name], [nick_name], [feedback_channel], [feedback_time], [record_user], [status],
[remark], [work_time], [machine_code], [machine_name], [team_code], [shift_code],
[attr1], [attr2], [attr3], [attr4], [create_by], [create_time],
[update_time], [update_by], [upload_time], [upload_status], [upload_msg], [prod_type],
[use_man], [work_center],[del_flag],[batch],[end_report],[parent_order])
VALUES
('{Common.GetUUID()}', 'SELF', '{reportCode}', '{subOrder}', '{subProductCode}', '{subProductName}',
'{selectRow["product_spc"]}', '{subUnit}', {subOrderQty}, {subOrderQty}, 0, 0,
'{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE',
'无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod',
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{selectRow["workorder_code"]}');";
sqlList.Add(mainOrderSql);
sqlList.Add(subOrderSql);
}
else
{
//无子单
string mainOrderSql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
[spec], [unit], [quantity], [quantity_feedback], [quantity_qualified], [quantity_unqualified],
[user_name], [nick_name], [feedback_channel], [feedback_time], [record_user], [status],
[remark], [work_time], [machine_code], [machine_name], [team_code], [shift_code],
[attr1], [attr2], [attr3], [attr4], [create_by], [create_time],
[update_time], [update_by], [upload_time], [upload_status], [upload_msg], [prod_type],
[use_man], [work_center],[del_flag],[batch],[end_report],[parent_order])
VALUES
('{Common.GetUUID()}', 'SELF', '{reportCode}', '{selectRow["workorder_code"]}', '{selectRow["product_code"]}', '{selectRow["product_name"]}',
'{selectRow["product_spc"]}', '{selectRow["unit"]}', {workCount}, {workCount}, 0, 0,
'{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE',
'无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod',
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{selectRow["parent_order"]}');";
sqlList.Add(mainOrderSql);
}
//赵啸林说不用上位机更新报工标识
//string updateOrderSql = $@"update pro_order_workorder set status = 'w3', update_by = '{LoginUser.UserName}',update_time = GETDATE() where workorder_id = '{selectRow["workorder_id"]}' ";
//sqlList.Add(sql);
//sqlList.Add(updateOrderSql);
return sqlList;//> 0 ? true : false;
}
/// <summary>
/// 插入消耗表
/// </summary>
@ -324,22 +506,52 @@ VALUES
/// <param name="selectedRow"></param>
/// <param name="newReportCode"></param>
/// <param name="siteCode"></param>
public bool InsertConsumeInfo(string qty, string remark, DataRowView selectedRow, string newReportCode, string siteCode)
public bool InsertConsumeInfo(string qty, string remark, DataRowView selectedRow, string newReportCode, string siteCode,string recoil,string parentOrder)
{
string sql = $@" INSERT INTO [dbo].[mes_report_work_consume]
([record_id], [workorder_code], [material_code], [material_name], [material_spc],
[quantity], [unit], [remark], [attr1], [attr2],
[attr3], [attr4], [create_by], [create_time], [update_by],
[update_time], [factory_code], [report_code], [del_flag])
[update_time], [factory_code], [report_code], [del_flag],[parent_order],[recoil])
VALUES
('{Common.GetUUID()}', '{selectedRow["workorder_code"]}', '{selectedRow["product_code"]}', '{selectedRow["product_name"]}', '{selectedRow["product_spc"]}',
'{qty}','{selectedRow["unit"]}', '{remark}', NULL, NULL,
NULL, NULL, '{LoginUser.UserName}', GetDate(), '{LoginUser.UserName}',
GetDate(), '{siteCode}', '{newReportCode}', '0'); ";
GetDate(), '{siteCode}', '{newReportCode}', '0','{parentOrder}','{recoil}'); ";
int ret = Utils.netClientDBHelper.executeUpdate(sql);
return ret > 0 ? true : false;
}
public bool InsertConsumeInfo(DataRowView selectedConsumeRow,string newReportCode, string siteCode)
{
string sql = $@" INSERT INTO [dbo].[mes_report_work_consume]
([record_id], [workorder_code], [material_code], [material_name], [material_spc],
[quantity], [unit], [remark], [attr1], [attr2],
[attr3], [attr4], [create_by], [create_time], [update_by],
[update_time], [factory_code], [report_code], [del_flag],[parent_order],[recoil])
VALUES
('{Common.GetUUID()}', '{selectedConsumeRow["workorder_code"]}', '{selectedConsumeRow["material_code"]}', '{selectedConsumeRow["material_name"]}', '{selectedConsumeRow["material_spc"]}',
'{selectedConsumeRow["qty"]}','{selectedConsumeRow["unit"]}', '{selectedConsumeRow["remark"]}', NULL, NULL,
NULL, NULL, '{LoginUser.UserName}', GetDate(), '{LoginUser.UserName}',
GetDate(), '{siteCode}', '{newReportCode}', '0','{selectedConsumeRow["parent_work_order"]}','{selectedConsumeRow["recoil"]}'); ";
int ret = Utils.netClientDBHelper.executeUpdate(sql);
return ret > 0 ? true : false;
}
public string GetInsertConsumeInfoSql(DataRowView selectedConsumeRow, string newReportCode, string siteCode)
{
string sql = $@" INSERT INTO [dbo].[mes_report_work_consume]
([record_id], [workorder_code], [material_code], [material_name], [material_spc],
[quantity], [unit], [remark], [attr1], [attr2],
[attr3], [attr4], [create_by], [create_time], [update_by],
[update_time], [factory_code], [report_code], [del_flag],[parent_order],[recoil])
VALUES
('{Common.GetUUID()}', '{selectedConsumeRow["workorder_code"]}', '{selectedConsumeRow["material_code"]}', '{selectedConsumeRow["material_name"]}', '{selectedConsumeRow["material_spc"]}',
'{selectedConsumeRow["qty"]}','{selectedConsumeRow["unit"]}', '{selectedConsumeRow["remark"]}', NULL, NULL,
NULL, NULL, '{LoginUser.UserName}', GetDate(), '{LoginUser.UserName}',
GetDate(), '{siteCode}', '{newReportCode}', '0','{selectedConsumeRow["parent_work_order"]}','{selectedConsumeRow["recoil"]}'); ";
//int ret = Utils.netClientDBHelper.executeUpdate(sql);
return sql;
}
/// <summary>
/// 根据设备编码获取当前机台最新的吊满的RFID信息

@ -181,12 +181,12 @@ where CONVERT(VARCHAR(10), upload_time , 120)= CONVERT(VARCHAR(10), GetDate() ,
public DataTable GetCosumeData(string workorder)
{
string sql = $@"select '0' as qty, workorder_code, material_code,material_name,detail.prod_type,material_spc,detail.unit,quantity,
string sql = $@"select '0' as qty,'' as remark, workorder_code, material_code,material_name,detail.prod_type,material_spc,detail.unit,quantity,
detail.create_by,detail.create_time,detail.update_by,detail.update_time,locator,need_date,
recoil,fund_quanlity,detail.del_flag
recoil,fund_quanlity,detail.del_flag,parent_work_order
from mes_prepare_detail detail
LEFT JOIN mes_prepare pre on detail.prepare_id = pre.prepare_id
where detail.parent_work_order ='{workorder}'";
where detail.parent_work_order ='{workorder}' and detail.del_flag = '0'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
@ -512,12 +512,13 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
public DataTable GetWetPlanInfo(string deviceCode, string date)
{
string sql = $@"select workorder.factory_code,workorder.product_date as plan_time, workorder.workorder_id,workorder.workorder_code, product_code,product_name,
product_spc,shifts.shift_desc,prod_line_code,workorder.status,route_code,quantity_split,unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no,product_spc
from pro_order_workorder workorder
left JOIN base_shifts_t shifts on workorder.shift_id = shifts.shift_id
left JOIN pro_order_workorder_batch batch on workorder.workorder_id = batch.workorder_id
product_spc,shifts.shift_desc,prod_line_code,workorder.status,route_code,quantity_split,unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no,product_spc, workorder.parent_order
from pro_order_workorder workorder WITH (NOLOCK)
left JOIN base_shifts_t shifts WITH (NOLOCK) on workorder.shift_id = shifts.shift_id
left JOIN pro_order_workorder_batch batch WITH (NOLOCK) on workorder.workorder_id = batch.workorder_id
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";
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";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{

@ -12,7 +12,7 @@
<!--设备编码-->
<add key="DeviceCode" value="C3" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录-->
<add key="ClientMode" value="2" />
<add key="ClientMode" value="0" />
<add key="SerialPort" value="COM5" />
<add key="DryingHouseList" value="H16,H17,H18"/>
<!--线体编码-->

@ -10,7 +10,7 @@
<!--车间编码-->
<add key="SiteCode" value="1000" />
<!--设备编码-->
<add key="DeviceCode" value="XL01" />
<add key="DeviceCode" value="XL02" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录-->
<add key="ClientMode" value="1" />

@ -18,12 +18,15 @@ namespace XGL
/// </summary>
public partial class App : Application
{
private System.Threading.Mutex mutex;
public App()
{
string name = Process.GetCurrentProcess().MainModule.ModuleName.Replace(".exe", "");
var processs = Process.GetProcessesByName(name);
if (processs.Length > 1)
//禁止多开
mutex = new System.Threading.Mutex(true, name, out bool ret);
if (!ret)
{
MessageBox.Show("已有一个程序实例运行","提示", MessageBoxButton.OK, MessageBoxImage.Warning);
Environment.Exit(0);
}

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace XGLFinishPro.Tools
{
public class ParentOrderConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!value.Equals("0"))
{
return "子单";
}
else
return "母单";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:XGLFinishPro.Views"
mc:Ignorable="d"
Title="CheckUserWin" Height="850" Width="1250" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
Title="CheckUserWin" Height="850" Width="1350" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
<Window.Resources>
<!--ComboBox下拉按钮-->
<Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
@ -189,17 +189,20 @@
</DataGridTemplateColumn>
<DataGridTextColumn Width="120" Header="用量" Binding="{Binding qty}" IsReadOnly="False">
</DataGridTextColumn>
<DataGridTextColumn Width="250" Header="备注" Binding="{Binding Remark}" IsReadOnly="False" />
<DataGridTextColumn Width="150" Header="备注" Binding="{Binding remark}" IsReadOnly="False" />
<DataGridTextColumn Width="120" Header="领取数" Binding="{Binding quantity}" IsReadOnly="True" />
<DataGridTextColumn Width="250" Header="组件编码" Binding="{Binding material_code}" IsReadOnly="True"/>
<DataGridTextColumn Width="300" Header="组件名称" Binding="{Binding material_name}" IsReadOnly="True"/>
<DataGridTextColumn Width="100" Header="单位" Binding="{Binding unit}" />
<DataGridTextColumn Width="350" Header="组件名称" Binding="{Binding material_name}" IsReadOnly="True"/>
<DataGridTextColumn Width="100" Header="单位" Binding="{Binding unit}" />
<DataGridTextColumn Width="100" Header="反冲标识" Binding="{Binding recoil}"/>
<DataGridTextColumn Width="100" Header="母单" Binding="{Binding parent_work_order}" />
<!--<DataGridTextColumn Width="250" Header="物料组" Binding="{Binding productGroup}" IsReadOnly="True"/>
<DataGridTextColumn Width="250" Header="组名称" Binding="{Binding productGroupName}" IsReadOnly="True"/>-->
</DataGrid.Columns>
</DataGrid>
<Label x:Name="tbMsg" Width="600" Height="60" Grid.Row="6" Grid.ColumnSpan="2" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" FontSize="24" Foreground="Red" FontWeight="Bold"></Label>
<CheckBox Content="最终报工" Height="auto" Margin="15,0,0,0" FontSize="10" ToolTip="选择后将结束该工单" Grid.Row="6" IsChecked="False" HorizontalAlignment="Left" VerticalContentAlignment="Center" Name="xuanze9" >
<CheckBox Content="最终报工" Height="auto" Margin="15,0,0,0" FontSize="10" ToolTip="选择后将结束该工单" Grid.Row="6" IsChecked="False" HorizontalAlignment="Left" VerticalContentAlignment="Center" Name="xuanze9" Checked="xuanze9_Checked">
<CheckBox.LayoutTransform >
<ScaleTransform ScaleX="2" ScaleY="2" />
</CheckBox.LayoutTransform>

@ -37,6 +37,7 @@ namespace XGLFinishPro.Views
public string _useMan = "";
public string _costCenter = "";
public string _workQuntity = "";
public string _orderQuntity = "";
public string _workOrdercode = "";
public string _workOrderId = "";
public string batchCode = "";
@ -62,18 +63,32 @@ namespace XGLFinishPro.Views
public ExecReportWorkWin(DataRowView _selectedRow,string deviceCode, string siteCode)
{
InitializeComponent();
//if (_selectedRow["parent_order"].ToString() == "0")
//{
// this.txtUserCount.Text = "0";
// this.txtUserCount.IsEnabled = false;
// this.txtWorkTime.Text = "0";
// this.txtWorkTime.IsEnabled = false;
//}
//else
//{
// this.txtUserCount.IsEnabled = true;
// this.txtWorkTime.IsEnabled = true;
//}
selectedRow = _selectedRow;
_deviceCode = deviceCode;
this._workOrdercode = selectedRow["workorder_code"].ToString();
this.lbCurrOrderNo.Content = selectedRow["workorder_code"].ToString();
this._workOrderId = selectedRow["workorder_id"].ToString();
this.txtQuantity.Text = selectedRow["quantity_split"].ToString();
_orderQuntity = selectedRow["quantity_split"].ToString();
this.comboBoxBatch.Text = selectedRow["batch_code"].ToString();
_siteCode = siteCode;
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
{
this.DialogResult = false;
this.Close();
}
@ -143,18 +158,58 @@ namespace XGLFinishPro.Views
CustomMessageBoxResult result = CustomMessageBox.Show("您确定要按整单报工么?最终报工:" + (_isEndReport == true ? "是" : "否"), CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Warning);
if (result == CustomMessageBoxResult.OK)
{
this.DialogResult = true;
try
{
bool isSuccess = ReportWork();
if (isSuccess)
{
CustomMessageBox.Show("报工成功", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success);
LogHelper.instance.log.Error("报工成功:" + selectedRow["workorder_code"]);
this.DialogResult = true;
}
else
{
CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
LogHelper.instance.log.Error("报工失败:" +selectedRow["workorder_code"]);
}
}
catch (Exception ex)
{
LogHelper.instance.log.Error("报工失败:" + ex.Message + selectedRow["workorder_code"]);
}
}
}
else
{
CustomMessageBoxResult result = CustomMessageBox.Show("您确定要按批次报工么?当前批次号:"+ batchCode + " 最终报工:" + (_isEndReport == true ? "是" : "否"), CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Warning);
CustomMessageBoxResult result = CustomMessageBox.Show("您确定要按批次报工么?当前批次号:" + batchCode + " 最终报工:" + (_isEndReport == true ? "是" : "否"), CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Warning);
if (result == CustomMessageBoxResult.OK)
{
this.DialogResult = true;
try
{
bool isSuccess = ReportWork();
if (isSuccess)
{
CustomMessageBox.Show("报工成功", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success);
this.DialogResult = true;
}
else
{
CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
}
}
catch (Exception ex)
{
LogHelper.instance.log.Error("报工失败:" + ex.Message);
}
}
}
}
private bool ReportWork()
{
//获取报工编码
string newReportCode = "";
DataTable dtNewReportCode = formingMachineService.GetReportCode();
@ -173,40 +228,43 @@ namespace XGLFinishPro.Views
newReportCode = (Convert.ToInt64(dtNewReportCode.Rows[0]["report_code"].ToString()) + 1).ToString();
}
}
string isEndReport = _isEndReport == true ? "1" : "0";
bool issucc = formingMachineService.ExecuteReportWork(selectedRow, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode);
if (issucc)
//bool issucc = formingMachineService.ExecuteReportWork(selectedRow, _orderQuntity, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode);
List<string> reportWorkSqlList = formingMachineService.GetExecuteReportWorkSql(selectedRow, _orderQuntity, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode);
if (reportWorkSqlList.Count > 0)
{
//调用报工接口
string apiUrl = formingMachineService.InterfaceUrl("reportWork");
ReportWork reportWork = new ReportWork();
reportWork.factoryCode = Utils.GetAppSetting("SiteCode");
reportWork.reportCode = newReportCode;
// 将要发送的数据序列化为JSON格式
var jsonContent = JsonConvert.SerializeObject(reportWork);
LogHelper.instance.log.Info("开始报工>>" + jsonContent);
RestHelper restClient = new RestHelper();
//var response =;
//报工接口不用调了
////调用报工接口
//string apiUrl = formingMachineService.InterfaceUrl("reportWork");
//ReportWork reportWork = new ReportWork();
//reportWork.factoryCode = Utils.GetAppSetting("SiteCode");
//reportWork.reportCode = newReportCode;
//// 将要发送的数据序列化为JSON格式
//var jsonContent = JsonConvert.SerializeObject(reportWork);
//LogHelper.instance.log.Info("开始报工>>" + jsonContent);
//RestHelper restClient = new RestHelper();
////var response =;
Rootobjectresu result = Utils.DeJson<Rootobjectresu>(await restClient.PostAsync(apiUrl, jsonContent));
//Rootobjectresu result = Utils.DeJson<Rootobjectresu>(await restClient.PostAsync(apiUrl, jsonContent));
if (result.code == 200)
{
AddConsumInfo(newReportCode);
}
else
{
CustomMessageBox.Show("调用报工接口失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
}
//if (result.code == 200)
//{
return AddConsumInfo(reportWorkSqlList, newReportCode);
//}
//else
//{
// CustomMessageBox.Show("调用报工接口失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
//}
}
else
{
CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
}
return false;
}
}
private void AddConsumInfo(string newReportCode)
private bool AddConsumInfo(List<string> reportWorkSqlList ,string newReportCode)
{
try
{
@ -214,36 +272,59 @@ namespace XGLFinishPro.Views
// 获取第二列的值
int columnIndex = 1; // 列索引,这里假设为第一列
foreach (var row in dgConsumeInfo.Items)
if (_isEndReport.Value == true)
{
// 获取 DataGridRow
var dataGridRow = dgConsumeInfo.ItemContainerGenerator.ContainerFromItem(row) as DataGridRow;
if (dataGridRow != null)
foreach (var row in dgConsumeInfo.Items)
{
// 获取该行的单元格内容
var cellQtyContent = dgConsumeInfo.Columns[columnIndex].GetCellContent(dataGridRow);
var cellRemarkContent = dgConsumeInfo.Columns[columnIndex+1].GetCellContent(dataGridRow);
if (cellQtyContent != null)
{
// 获取单元格的值
var qty = (cellQtyContent as TextBlock)?.Text;
var remark = (cellRemarkContent as TextBlock)?.Text;
// 插入表
if (qty != null)
{
// 处理 cellValue
formingMachineService.InsertConsumeInfo(qty,remark,selectedRow, newReportCode, _siteCode);
}
else
continue;
}
var selectedConsumeRow = (row as DataRowView);
var qty = selectedConsumeRow["qty"].ToString();
var remark = selectedConsumeRow["remark"].ToString();
//处理
formingMachineService.InsertConsumeInfo(selectedConsumeRow, newReportCode, _siteCode);
string insertConsumeSql = formingMachineService.GetInsertConsumeInfoSql(selectedConsumeRow, newReportCode, _siteCode);
reportWorkSqlList.Add(insertConsumeSql);
//// 获取 DataGridRow
//var dataGridRow = dgConsumeInfo.ItemContainerGenerator.ContainerFromItem(row) as DataGridRow;
//if (dataGridRow != null)
//{
// // 获取该行的单元格内容
// var cellQtyContent = dgConsumeInfo.Columns[columnIndex].GetCellContent(dataGridRow);
// var cellRemarkContent = dgConsumeInfo.Columns[columnIndex+1].GetCellContent(dataGridRow);
// var cellRecoilContent = dgConsumeInfo.Columns[columnIndex + 6].GetCellContent(dataGridRow);
// var cellparentOrderContent = dgConsumeInfo.Columns[columnIndex + 7].GetCellContent(dataGridRow);
// if (cellQtyContent != null)
// {
// // 获取单元格的值
// var qty = (cellQtyContent as TextBlock)?.Text;
// var remark = (cellRemarkContent as TextBlock)?.Text;
// var recoil = (cellRecoilContent as TextBlock)?.Text;
// var parentOrder = (cellparentOrderContent as TextBlock)?.Text;
// // 插入表
// if (qty != null)
// {
// // 处理 cellValue
// formingMachineService.InsertConsumeInfo(qty,remark,selectedRow, newReportCode, _siteCode, recoil,parentOrder);
// }
// else
// continue;
// }
//}
}
}
bool isReportSuccess = formingMachineService.GetExecuteReportWorkSql(reportWorkSqlList);
return isReportSuccess; ;
}
catch (Exception ex)
{
LogHelper.instance.log.Error("报工失败:生成消耗数据发生异常:" + ex.Message);
CustomMessageBox.Show("报工失败:生成消耗数据发生异常:"+ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
return false;
throw ex;
}
}
@ -375,6 +456,11 @@ namespace XGLFinishPro.Views
{
//dgConsumeInfo.CommitEdit();
}
private void xuanze9_Checked(object sender, RoutedEventArgs e)
{
_isEndReport = true;
}
}
public class CostCenter
{

@ -8,7 +8,7 @@
xmlns:convert="clr-namespace:XGLFinishPro.Tools"
xmlns:hc="https://handyorg.github.io/handycontrol"
Width="1920"
Height="330"
Height="260"
mc:Ignorable="d" Loaded="UserControl_Loaded">
<UserControl.Resources>
<ResourceDictionary>
@ -33,7 +33,7 @@
<Viewbox Stretch="Fill">
<Canvas
Width="1920"
Height="330"
Height="260"
Background="#F2F3F5">
<Grid
Width="1920"

@ -6,6 +6,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:convert="clr-namespace:XGLFinishPro.Tools"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
Width="1920"
Height="800"
mc:Ignorable="d" Loaded="UCOperator_Loaded">
@ -13,6 +15,8 @@
<convert:MyValueConverter x:Key="MyConverter"/>
<convert:OrderInOutConverter x:Key="TaskCodeConverter"/>
<convert:BtnBackGroundColorConverter x:Key="ButtonContentToBackgroundColorConverter"/>
<convert:ParentOrderConverter x:Key="ParentOrderConverter"/>
<Style x:Key="CustomCellStyle" TargetType="DataGridCell">
<Setter Property="Foreground" Value="Black" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
@ -362,22 +366,7 @@
Foreground="White"
Click="HFPlcvalue_Click" Content="查看烘房值"></Button>
</StackPanel>
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="7"
>
<Button
x:Name="btnRefresh"
Style="{StaticResource btnKey}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="#2B7EE6"
FontSize="20"
Foreground="White"
Click="btnRefresh_Click" Content="刷新"></Button>
</StackPanel>
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
@ -397,6 +386,43 @@
</Button.Content>
</Button>
</StackPanel>
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="8"
Height="90" Visibility="Collapsed">
<Button Style="{StaticResource btnKey}"
x:Name="btnCallMaterial"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="#2B7EE6" Click="btnCallMaterial_Click">
<Button.Content>
<TextBlock
VerticalAlignment="Center"
FontSize="20"
Foreground="White"
Text="叫料" />
</Button.Content>
</Button>
</StackPanel>
<StackPanel
Background="#F2F3F5"
Grid.Row="0"
Grid.Column="7"
>
<Button
x:Name="btnRefresh"
Style="{StaticResource btnKey}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="#2B7EE6"
FontSize="20"
Foreground="White"
Click="btnRefresh_Click" Content="刷新"></Button>
</StackPanel>
<DataGrid
x:Name="dgWorkOrderInfo"
Grid.Row="1"
@ -433,6 +459,7 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTextColumn Width="60" Header="母单" Binding="{Binding parent_order,Converter={StaticResource ParentOrderConverter}}"/>-->
<DataGridTextColumn Width="250" Header="工单/SFC" Binding="{Binding workorder_id}" Visibility="Collapsed"/>
<DataGridTextColumn Width="300" Header="工单/SFC" Binding="{Binding workorder_code}" />
<!--<DataGridTextColumn Width="120" Header="RFID" Binding="{Binding rfid}"/>-->
@ -456,12 +483,13 @@
<DataGridTextColumn Width="180" Header="工单code" Visibility="Hidden" Binding="{Binding workorder_id}" />
<DataGridTextColumn Width="100" Header="生产顺序" Binding="{Binding sort_no}" />
<DataGridTextColumn Width="250" Header="计划时间" Binding="{Binding plan_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />
<!--<DataGridTextColumn Width="340" Header="流转码" Binding="{Binding work_batch_code}" />-->
<!--<DataGridTextColumn Width="60" Header="出入" Binding="{Binding taskcode,Converter={StaticResource TaskCodeConverter}}"/>-->
</DataGrid.Columns>
</DataGrid>
<StackPanel
Grid.Row="2"
Grid.ColumnSpan="10"
@ -565,7 +593,9 @@
<ContentControl
x:Name="Window1"
Grid.ColumnSpan="2"
MinHeight="290"
Height="255"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Width="1920"
/>

@ -433,13 +433,14 @@ namespace XGLFinishPro.Views
var selectedRow = (dgWorkOrderInfo.SelectedItem as DataRowView); //dgWorkOrderInfo.SelectedItem as FoamingMacModel;
if (selectedRow == null)
{
MessageBox.Show("请选择你要报工的工单!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
//MessageBox.Show("请选择你要报工的工单!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("请选择你要报工的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
if (!selectedRow["status"].ToString().Equals("w2"))
{
MessageBox.Show("你选择的工单不能报工!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
CustomMessageBox.Show("你选择的工单不能报工!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
//return;
}
@ -614,6 +615,16 @@ namespace XGLFinishPro.Views
Content = lanJu_QitaoLv
};
}
private void btnCallMaterial_Click(object sender, RoutedEventArgs e)
{
string workorderID = (dgWorkOrderInfo.SelectedItem as DataRowView)["parent_order"].ToString();
if (!workorderID.Equals("0"))
{
CustomMessageBox.Show("请对母单使用叫料功能!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
}
}
public class ReportWork
{

@ -7,7 +7,7 @@
xmlns:convert="clr-namespace:XGLFinishPro.Tools"
xmlns:hc="https://handyorg.github.io/handycontrol"
Width="1920"
Height="330"
Height="260"
mc:Ignorable="d" Loaded="UserControl_Loaded">
<UserControl.Resources>
<ResourceDictionary>
@ -31,7 +31,7 @@
<Viewbox Stretch="Fill">
<Canvas
Width="1920"
Height="330"
Height="260"
Background="#F2F3F5">
<Grid
Width="1920"
@ -48,6 +48,7 @@
HorizontalAlignment="Center"
CellStyle="{StaticResource CustomCellStyle}"
VerticalAlignment="Top"
HeadersVisibility="Column"
AutoGenerateColumns="False">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:XGLFinishPro.Views"
mc:Ignorable="d"
Width="1920" Height="330" Loaded="UserControl_Loaded">
Width="1920" Height="260" Loaded="UserControl_Loaded">
<UserControl.Resources >
<Style x:Key="CustomCellStyle" TargetType="DataGridCell">
<Setter Property="Foreground" Value="Black" />
@ -21,7 +21,7 @@
Grid.Row="1"
Grid.Column="0"
Background="#F2F3F5"
MinHeight="309"
Height="260"
Margin="25,0,0,0"
BorderThickness="0"
CellStyle="{StaticResource CustomCellStyle}"
@ -59,6 +59,7 @@
<DataGridTextColumn Width="80" Header="库位" Binding="{Binding locator}" />
<DataGridTextColumn Width="150" Header="需求日期" Binding="{Binding need_date}"/>
<DataGridTextColumn Width="100" Header="缺料" Binding="{Binding fund_quanlity}"/>
<DataGridTextColumn Width="100" Header="反冲标识" Binding="{Binding recoil}"/>
</DataGrid.Columns>
<!--<DataGrid.Columns>
<DataGridTextColumn Width="300" Header="序号" />

@ -84,6 +84,72 @@
</Win32Resource>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Charts.v20.1.Core">
<HintPath>..\Libs\DevExpress.Charts.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Data.Desktop.v20.1">
<HintPath>..\Libs\DevExpress.Data.Desktop.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Data.v20.1">
<HintPath>..\Libs\DevExpress.Data.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Mvvm.v20.1">
<HintPath>..\Libs\DevExpress.Mvvm.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Office.v20.1.Core">
<HintPath>..\Libs\DevExpress.Office.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Pdf.v20.1.Core">
<HintPath>..\Libs\DevExpress.Pdf.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Pdf.v20.1.Drawing">
<HintPath>..\Libs\DevExpress.Pdf.v20.1.Drawing.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Printing.v20.1.Core">
<HintPath>..\Libs\DevExpress.Printing.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.RichEdit.v20.1.Core">
<HintPath>..\Libs\DevExpress.RichEdit.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Charts.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Charts.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Controls.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Controls.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Core.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Core.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Docking.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Docking.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.DocumentViewer.v20.1.Core">
<HintPath>..\Libs\DevExpress.Xpf.DocumentViewer.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Grid.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Grid.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Grid.v20.1.Core">
<HintPath>..\Libs\DevExpress.Xpf.Grid.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Layout.v20.1.Core">
<HintPath>..\Libs\DevExpress.Xpf.Layout.v20.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.LayoutControl.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.LayoutControl.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Printing.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Printing.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Ribbon.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Ribbon.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Themes.Office2019Colorful.v20.1">
<HintPath>..\Libs\DevExpress.Xpf.Themes.Office2019Colorful.v20.1.dll</HintPath>
</Reference>
<Reference Include="DevExpressCrack">
<HintPath>..\Libs\DevExpressCrack.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
@ -255,6 +321,7 @@
<DependentUpon>ModuleUC.xaml</DependentUpon>
</Compile>
<Compile Include="Tools\OrderInOutConverter.cs" />
<Compile Include="Tools\ParentOrderConverter.cs" />
<Compile Include="Tools\SerialHelper.cs" />
<Compile Include="Tools\SyncFlagColorConverter.cs" />
<Compile Include="Tools\NetStatusToColorConvert.cs" />

Loading…
Cancel
Save