报工数量

master
1 year ago
parent ccb28b4903
commit 56cfc7cf9b

@ -607,7 +607,10 @@ VALUES
#region 生成报工数据
//获取子工单的信息
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{selectRow["workorder_code"]}'";
#region 订单不能是已经被删除的
string getSubOrderSql = $"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"]}'";
string subOrder = "";
//string subProductCode = "";
//string subProductName = "";
@ -779,7 +782,9 @@ VALUES
{
//获取子工单的信息
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}'";
#region 子单不能是已经被删除的
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}' and del_flag=0";
#endregion
string subOrder = "";
string subProductCode = "";
string subProductName = "";
@ -791,9 +796,9 @@ VALUES
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();
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 rate = Convert.ToDouble(workCount) / Convert.ToDouble(orderQuntity);//workCount是报工数量orderQuntity是母单数量
double subOrderQty = 0;
LogHelper.instance.log.Info("rate>>>" + rate);
//根据base_product_attach表里的报工比例计算子单数量又取消了
@ -1189,5 +1194,20 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
string sql = $@"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())";
return Utils.netClientDBHelper.executeUpdate(sql);
}
public bool GetProOrderWorkOrder(string workorderId)
{
string sql = "select del_flag from pro_order_workorder where workorder_id = '" + workorderId + "'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
object value = dtset.Tables[0].Rows[0]["del_flag"];
if (value != null && value.ToString() == "0")
{
return true;
}
}
return false;
}
}
}

@ -44,7 +44,7 @@ namespace XGLFinishPro
//this.Hide();
//Main mainWindow = new Main();
//mainWindow.Show();
//InitVersion();
InitVersion();
//InitTeamInfo();
InitShiftInfo();
}

@ -678,7 +678,7 @@ Background="#F2F3F5"
<Grid
Grid.Row="3"
Grid.ColumnSpan="10"
Grid.ColumnSpan="11"
Margin="-30,0,0,0"
Background="LightGray"
HorizontalAlignment="Center"

@ -499,8 +499,15 @@ namespace XGLFinishPro.Views
// CustomMessageBox.Show("你选择的该批次不能报工!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// return;
//}
#region 添加验证
string workorderId = selectedRow["workorder_id"].ToString();
if (!formingMachineService.GetProOrderWorkOrder(workorderId))
{
CustomMessageBox.Show("该工单已经被删除,请重新选择!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
GetWorkOrderInfo();
return;
}
#endregion
ExecReportWorkWin execReport = new ExecReportWorkWin(selectedRow, deviceCode, Utils.GetAppSetting("SiteCode"));
if (execReport.ShowDialog() == true)

Loading…
Cancel
Save