stringtotalsql=$"SELECT count(*) FROM mes_material_transfer_result result WHERE result.equipmentCode ="+
$" '{devicecode}' AND result.update_time >= ( SELECT TOP 1 create_time FROM mes_changeshift_info WHERE device_code"+
$" = '{devicecode}' ORDER BY create_time DESC ) AND result.rfid_status='1' ;";
// string totalcountSql = $@" select count(*) as totalCount from mes_material_transfer_result WITH (NOLOCK)
//where CONVERT(VARCHAR(10), work_date , 120) = CONVERT(VARCHAR(10),'{workDate}', 120) and equipmentCode = '{devicecode}' and OrderCode = '{work0rderID}' group by OrderCode ";
// string totalcountSql = $@" select count(*) as totalCount from mes_material_transfer_result WITH (NOLOCK)
//where CONVERT(VARCHAR(10), work_date , 120) = CONVERT(VARCHAR(10),'{workDate}', 120) and equipmentCode = '{devicecode}' and OrderCode = '{work0rderID}' group by OrderCode ";
stringgetReportCodeSql=$@"SELECT equipment_code,equipment_name FROM [dbo].[base_equipment] WHERE equipment_code='{deviceCode}'";
stringlineName="";
@ -607,7 +607,10 @@ VALUES
#region 生成报工数据
//获取子工单的信息
stringgetSubOrderSql=$"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{selectRow["workorder_code"]}'";
#region 订单不能是已经被删除的
stringgetSubOrderSql=$"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{selectRow["workorder_code"]}' and del_flag=0";
#endregion
//string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{selectRow["workorder_code"]}'";
stringsubOrder="";
//string subProductCode = "";
//string subProductName = "";
@ -747,7 +750,7 @@ VALUES
//添加批次报工状态更新--2023-12-26
stringupdateBatchOrderStatusSql=$@"update pro_order_workorder_batch set status = '0', update_by = '{LoginUser.UserName}',update_time = GETDATE() where workorder_id = '{selectRow["workorder_id"]}' and batch_code = '{batchCode}' ";
sqlList.Add(updateBatchOrderStatusSql);
}
}
#endregion
@ -779,7 +782,9 @@ VALUES
{
//获取子工单的信息
stringgetSubOrderSql=$"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}'";
#region 子单不能是已经被删除的
stringgetSubOrderSql=$"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}' and del_flag=0";
stringsql=$@"UPDATE mes_changeshift_info SET last_update=GetDate( ) WHERE device_code='{deviceCode}' AND CONVERT(VARCHAR, create_time, 23) = '{data}' AND shift_code='{shift}';";
@ -1171,7 +1176,7 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
{
}
for(inti=reportList.Count;i<6;i++)
for(inti=reportList.Count;i<6;i++)
{
reportList.Add(newreport());
}
@ -1180,7 +1185,7 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
publicintEditReport(reportreport)
{
stringsql=$@"update [dbo].[report] set team='{report.team}',OpenLineCheckBox='{report.OpenLineCheckBox}',ReplaceLineCheckBox='{report.ReplaceLineCheckBox}',unqualified='{report.unqualified}',clear='{report.clear}',residue='{report.residue}',lineClear='{report.lineClear}',UserKnow='{report.UserKnow}',qualified='{report.qualified}',equipStatus='{report.equipStatus}',StampCorrect='{report.StampCorrect}',isClear='{report.isClear}',positionCorrect='{report.positionCorrect}',isLineClear='{report.isLineClear}',create_time=GETDATE() where Id='{report.Id}'";
stringsql=$@"update [dbo].[report] set team='{report.team}',OpenLineCheckBox='{report.OpenLineCheckBox}',ReplaceLineCheckBox='{report.ReplaceLineCheckBox}',unqualified='{report.unqualified}',clear='{report.clear}',residue='{report.residue}',lineClear='{report.lineClear}',UserKnow='{report.UserKnow}',qualified='{report.qualified}',equipStatus='{report.equipStatus}',StampCorrect='{report.StampCorrect}',isClear='{report.isClear}',positionCorrect='{report.positionCorrect}',isLineClear='{report.isLineClear}',create_time=GETDATE() where Id='{report.Id}'";
returnUtils.netClientDBHelper.executeUpdate(sql);
}
@ -1189,5 +1194,20 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
stringsql=$@"insert into [dbo].[report] (Id,team,OpenLineCheckBox,ReplaceLineCheckBox,unqualified,clear,residue,lineClear,UserKnow,qualified,equipStatus,StampCorrect,isClear,positionCorrect,isLineClear,create_time) values ('{report.Id}','{report.team}','{report.OpenLineCheckBox}','{report.ReplaceLineCheckBox}','{report.unqualified}','{report.clear}','{report.residue}','{report.lineClear}','{report.UserKnow}','{report.qualified}','{report.equipStatus}','{report.StampCorrect}','{report.isClear}','{report.positionCorrect}','{report.isLineClear}',GETDATE())";
returnUtils.netClientDBHelper.executeUpdate(sql);
}
publicboolGetProOrderWorkOrder(stringworkorderId)
{
stringsql="select del_flag from pro_order_workorder where workorder_id = '"+workorderId+"'";