diff --git a/shangjian/XGL.Data/DBService/FormingMachineService.cs b/shangjian/XGL.Data/DBService/FormingMachineService.cs index 917e3eb..d2381e8 100644 --- a/shangjian/XGL.Data/DBService/FormingMachineService.cs +++ b/shangjian/XGL.Data/DBService/FormingMachineService.cs @@ -608,9 +608,9 @@ VALUES #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 - 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 subProductCode = ""; //string subProductName = ""; @@ -783,9 +783,9 @@ VALUES //获取子工单的信息 #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 - 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 subProductCode = ""; string subProductName = ""; diff --git a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs index 01ab725..584d588 100644 --- a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs +++ b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml.cs @@ -107,7 +107,7 @@ namespace XGLFinishPro.Views } private void Button_Click_1(object sender, RoutedEventArgs e) { - firstInspection firstInspection =new firstInspection(); + firstInspection firstInspection = new firstInspection(); Window1.Content = new Frame { Content = firstInspection @@ -307,8 +307,7 @@ namespace XGLFinishPro.Views //modelWareHouse = new List(); - DataTable dt = userDbWareHouse.GetWetPlanInfo(deviceCode, LoginUser.WorkDate); - if (dt == null) return; + DataTable dt = userDbWareHouse.GetWetPlanInfo(deviceCode, DateTime.Parse(LoginUser.WorkDate).ToString("yyyy-MM-dd")); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) @@ -319,9 +318,9 @@ namespace XGLFinishPro.Views dt.AcceptChanges(); } } - if (dt == null) return; this.dgWorkOrderInfo.ItemsSource = null; + if (dt != null && dt.Rows.Count > 0) this.dgWorkOrderInfo.ItemsSource = dt.DefaultView; } catch (Exception ex) @@ -487,10 +486,10 @@ namespace XGLFinishPro.Views } 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 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; } //20240424预报工功能,不能限制批次报工次数, @@ -552,23 +551,23 @@ namespace XGLFinishPro.Views // var jsonContent = JsonConvert.SerializeObject(reportWork); // LogHelper.instance.log.Info("开始报工>>" + jsonContent); // RestHelper restClient = new RestHelper(); - //var response =; + //var response =; - // Rootobjectresu result = Utils.DeJson(await restClient.PostAsync(apiUrl, jsonContent)); + // Rootobjectresu result = Utils.DeJson(await restClient.PostAsync(apiUrl, jsonContent)); - // if (result.code == 200) - // { - // GetWorkOrderInfo(); - // } - // else - // { - // CustomMessageBox.Show("调用报工接口失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning); - // } - //} - //else - //{ - // CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error); - //} + // if (result.code == 200) + // { + // GetWorkOrderInfo(); + // } + // else + // { + // CustomMessageBox.Show("调用报工接口失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning); + // } + //} + //else + //{ + // CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error); + //} GetWorkOrderInfo(); } } @@ -643,7 +642,7 @@ namespace XGLFinishPro.Views } string workorderID = (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_code"].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 != "") @@ -670,7 +669,7 @@ namespace XGLFinishPro.Views LogHelper.instance.log.Info("开始工单:已有活动中的工单,请先报工再开始下一个工单!"); return; } - LogHelper.instance.log.Info("查询到当前正在活动的工单数量为"+ orderCount); + LogHelper.instance.log.Info("查询到当前正在活动的工单数量为" + orderCount); //更新工单状态 if (!UpdateOrderStatus(workorderID)) { @@ -691,12 +690,12 @@ namespace XGLFinishPro.Views { LogHelper.instance.log.Error("开始工单异常:" + ex.Message); } - + } private int GetActivedOrdersCount(string deviceCode, string workDate) { - DataTable dtActivedOrdersQty = userDbWareHouse.GetActivedOrdersQty(deviceCode, workDate); + DataTable dtActivedOrdersQty = userDbWareHouse.GetActivedOrdersQty(deviceCode, workDate); if (dtActivedOrdersQty == null) return 0; int count = Convert.ToInt32(dtActivedOrdersQty.Rows[0][0]); @@ -736,7 +735,7 @@ namespace XGLFinishPro.Views } catch (Exception ex) { - LogHelper.instance.log.Info("开始工单异常" +ex.Message); + LogHelper.instance.log.Info("开始工单异常" + ex.Message); } return true; } @@ -786,7 +785,7 @@ namespace XGLFinishPro.Views if (status != "") { 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; } } @@ -806,7 +805,7 @@ namespace XGLFinishPro.Views // return; // } //} - + //首件检验 await CallCheckApi("checkTypeSC", batchCode); } @@ -823,7 +822,7 @@ namespace XGLFinishPro.Views /// /// /// - private async Task CallCheckApi(string checkType,string batchCode) + private async Task CallCheckApi(string checkType, string batchCode) { try { @@ -917,13 +916,13 @@ namespace XGLFinishPro.Views LogHelper.instance.log.Error("首检检验接口发生异常>>" + ex.Message); CustomMessageBox.Show("首检检验接口发生异常:" + ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error); } - + } private void btnMachineRepair_Click(object sender, RoutedEventArgs e) { - var selefuel= formingMachineService.ConvertToFaultModelList(); + var selefuel = formingMachineService.ConvertToFaultModelList(); //调用首件检验接口 string apiUrl = formingMachineService.GetInterfaceUrl("machineRepair"); var eqment = formingMachineService.GetReportCodeeqment(Utils.GetAppSetting("DeviceCode")); diff --git a/shangjian/XGLFinishPro/config/ConnectionConfig.Config b/shangjian/XGLFinishPro/config/ConnectionConfig.Config index 37d6a27..c9305d1 100644 --- a/shangjian/XGLFinishPro/config/ConnectionConfig.Config +++ b/shangjian/XGLFinishPro/config/ConnectionConfig.Config @@ -11,8 +11,6 @@ - -