报表数据

master
1 year ago
parent dc71e71a94
commit 28fb8a0401

@ -608,9 +608,9 @@ VALUES
#region 生成报工数据 #region 生成报工数据
//获取子工单的信息 //获取子工单的信息
#region 订单不能是已经被删除的 #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"; 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 #endregion
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{selectRow["workorder_code"]}'"; //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 subOrder = "";
//string subProductCode = ""; //string subProductCode = "";
//string subProductName = ""; //string subProductName = "";
@ -783,9 +783,9 @@ VALUES
//获取子工单的信息 //获取子工单的信息
#region 子单不能是已经被删除的 #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"; 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 #endregion
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}' "; //string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}' ";
string subOrder = ""; string subOrder = "";
string subProductCode = ""; string subProductCode = "";
string subProductName = ""; string subProductName = "";

@ -107,7 +107,7 @@ namespace XGLFinishPro.Views
} }
private void Button_Click_1(object sender, RoutedEventArgs e) private void Button_Click_1(object sender, RoutedEventArgs e)
{ {
firstInspection firstInspection =new firstInspection(); firstInspection firstInspection = new firstInspection();
Window1.Content = new Frame Window1.Content = new Frame
{ {
Content = firstInspection Content = firstInspection
@ -307,8 +307,7 @@ namespace XGLFinishPro.Views
//modelWareHouse = new List<WorkOrder>(); //modelWareHouse = new List<WorkOrder>();
DataTable dt = userDbWareHouse.GetWetPlanInfo(deviceCode, LoginUser.WorkDate); DataTable dt = userDbWareHouse.GetWetPlanInfo(deviceCode, DateTime.Parse(LoginUser.WorkDate).ToString("yyyy-MM-dd"));
if (dt == null) return;
if (dt != null && dt.Rows.Count > 0) if (dt != null && dt.Rows.Count > 0)
{ {
foreach (DataRow row in dt.Rows) foreach (DataRow row in dt.Rows)
@ -319,9 +318,9 @@ namespace XGLFinishPro.Views
dt.AcceptChanges(); dt.AcceptChanges();
} }
} }
if (dt == null) return;
this.dgWorkOrderInfo.ItemsSource = null; this.dgWorkOrderInfo.ItemsSource = null;
if (dt != null && dt.Rows.Count > 0)
this.dgWorkOrderInfo.ItemsSource = dt.DefaultView; this.dgWorkOrderInfo.ItemsSource = dt.DefaultView;
} }
catch (Exception ex) catch (Exception ex)
@ -487,10 +486,10 @@ namespace XGLFinishPro.Views
} }
if (!selectedRow["status"].ToString().Equals("w2") && !selectedRow["status"].ToString().Equals("w4")) if (!selectedRow["status"].ToString().Equals("w2") && !selectedRow["status"].ToString().Equals("w4"))
{ {
LogHelper.instance.log.Info("当前选择的工单"+ (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_code"].ToString() + "状态为:"+ selectedRow["status"].ToString()); LogHelper.instance.log.Info("当前选择的工单" + (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_code"].ToString() + "状态为:" + selectedRow["status"].ToString());
string status = selectedRow["status"].ToString(); string status = selectedRow["status"].ToString();
string st = status.Equals("w1") ? "已派发" : status.Equals("w3") ? "已报工" : status.Equals("w0") ? "未派发" : "已暂停"; string st = status.Equals("w1") ? "已派发" : status.Equals("w3") ? "已报工" : status.Equals("w0") ? "未派发" : "已暂停";
CustomMessageBox.Show("你选择的工单不能报工,请检查工单状态,当前工单状态为:"+ st, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning); CustomMessageBox.Show("你选择的工单不能报工,请检查工单状态,当前工单状态为:" + st, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return; return;
} }
//20240424预报工功能不能限制批次报工次数 //20240424预报工功能不能限制批次报工次数
@ -643,7 +642,7 @@ namespace XGLFinishPro.Views
} }
string workorderID = (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_code"].ToString(); string workorderID = (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_code"].ToString();
string status = (dgWorkOrderInfo.SelectedItem as DataRowView)["status"].ToString(); string status = (dgWorkOrderInfo.SelectedItem as DataRowView)["status"].ToString();
LogHelper.instance.log.Info("记录开始工单状态:"+ status +", 开始工单号为:"+ workorderID); LogHelper.instance.log.Info("记录开始工单状态:" + status + ", 开始工单号为:" + workorderID);
if (!status.Equals("w1")) if (!status.Equals("w1"))
{ {
if (status != "") if (status != "")
@ -670,7 +669,7 @@ namespace XGLFinishPro.Views
LogHelper.instance.log.Info("开始工单:已有活动中的工单,请先报工再开始下一个工单!"); LogHelper.instance.log.Info("开始工单:已有活动中的工单,请先报工再开始下一个工单!");
return; return;
} }
LogHelper.instance.log.Info("查询到当前正在活动的工单数量为"+ orderCount); LogHelper.instance.log.Info("查询到当前正在活动的工单数量为" + orderCount);
//更新工单状态 //更新工单状态
if (!UpdateOrderStatus(workorderID)) if (!UpdateOrderStatus(workorderID))
{ {
@ -736,7 +735,7 @@ namespace XGLFinishPro.Views
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.instance.log.Info("开始工单异常" +ex.Message); LogHelper.instance.log.Info("开始工单异常" + ex.Message);
} }
return true; return true;
} }
@ -786,7 +785,7 @@ namespace XGLFinishPro.Views
if (status != "") if (status != "")
{ {
string st = status.Equals("w1") ? "未派发" : status.Equals("w3") ? "已报工" : status.Equals("w0") ? "未派发" : "已暂停"; string st = status.Equals("w1") ? "未派发" : status.Equals("w3") ? "已报工" : status.Equals("w0") ? "未派发" : "已暂停";
CustomMessageBox.Show("该工单不符合条件,请检查工单状态,当前工单状态为:"+ st, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning); CustomMessageBox.Show("该工单不符合条件,请检查工单状态,当前工单状态为:" + st, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return; return;
} }
} }
@ -823,7 +822,7 @@ namespace XGLFinishPro.Views
/// </summary> /// </summary>
/// <param name="checkType"></param> /// <param name="checkType"></param>
/// <returns></returns> /// <returns></returns>
private async Task CallCheckApi(string checkType,string batchCode) private async Task CallCheckApi(string checkType, string batchCode)
{ {
try try
{ {
@ -923,7 +922,7 @@ namespace XGLFinishPro.Views
private void btnMachineRepair_Click(object sender, RoutedEventArgs e) private void btnMachineRepair_Click(object sender, RoutedEventArgs e)
{ {
var selefuel= formingMachineService.ConvertToFaultModelList(); var selefuel = formingMachineService.ConvertToFaultModelList();
//调用首件检验接口 //调用首件检验接口
string apiUrl = formingMachineService.GetInterfaceUrl("machineRepair"); string apiUrl = formingMachineService.GetInterfaceUrl("machineRepair");
var eqment = formingMachineService.GetReportCodeeqment(Utils.GetAppSetting("DeviceCode")); var eqment = formingMachineService.GetReportCodeeqment(Utils.GetAppSetting("DeviceCode"));

@ -11,8 +11,6 @@
<!--本地的业务数据库--> <!--本地的业务数据库-->
<!--<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>--> <!--<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>-->
<!--榄菊业务数据库--> <!--榄菊业务数据库-->

Loading…
Cancel
Save