@ -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预报工功能, 不能限制批次报工次数,
@ -552,23 +551,23 @@ namespace XGLFinishPro.Views
// var jsonContent = JsonConvert.SerializeObject(reportWork);
// var jsonContent = JsonConvert.SerializeObject(reportWork);
// LogHelper.instance.log.Info("开始报工>>" + jsonContent);
// LogHelper.instance.log.Info("开始报工>>" + jsonContent);
// RestHelper restClient = new RestHelper();
// RestHelper restClient = new RestHelper();
//var response =;
//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)
// if (result.code == 200)
// {
// {
// GetWorkOrderInfo();
// GetWorkOrderInfo();
// }
// }
// else
// else
// {
// {
// CustomMessageBox.Show("调用报工接口失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// CustomMessageBox.Show("调用报工接口失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// }
// }
//}
//}
//else
//else
//{
//{
// CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
// CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
//}
//}
GetWorkOrderInfo ( ) ;
GetWorkOrderInfo ( ) ;
}
}
}
}
@ -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 ) )
{
{
@ -691,12 +690,12 @@ namespace XGLFinishPro.Views
{
{
LogHelper . instance . log . Error ( "开始工单异常:" + ex . Message ) ;
LogHelper . instance . log . Error ( "开始工单异常:" + ex . Message ) ;
}
}
}
}
private int GetActivedOrdersCount ( string deviceCode , string workDate )
private int GetActivedOrdersCount ( string deviceCode , string workDate )
{
{
DataTable dtActivedOrdersQty = userDbWareHouse . GetActivedOrdersQty ( deviceCode , workDate ) ;
DataTable dtActivedOrdersQty = userDbWareHouse . GetActivedOrdersQty ( deviceCode , workDate ) ;
if ( dtActivedOrdersQty = = null )
if ( dtActivedOrdersQty = = null )
return 0 ;
return 0 ;
int count = Convert . ToInt32 ( dtActivedOrdersQty . Rows [ 0 ] [ 0 ] ) ;
int count = Convert . ToInt32 ( dtActivedOrdersQty . Rows [ 0 ] [ 0 ] ) ;
@ -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 ;
}
}
}
}
@ -806,7 +805,7 @@ namespace XGLFinishPro.Views
// return;
// return;
// }
// }
//}
//}
//首件检验
//首件检验
await CallCheckApi ( "checkTypeSC" , batchCode ) ;
await CallCheckApi ( "checkTypeSC" , batchCode ) ;
}
}
@ -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
{
{
@ -917,13 +916,13 @@ namespace XGLFinishPro.Views
LogHelper . instance . log . Error ( "首检检验接口发生异常>>" + ex . Message ) ;
LogHelper . instance . log . Error ( "首检检验接口发生异常>>" + ex . Message ) ;
CustomMessageBox . Show ( "首检检验接口发生异常:" + ex . Message , CustomMessageBoxButton . OK , CustomMessageBoxIcon . Error ) ;
CustomMessageBox . Show ( "首检检验接口发生异常:" + ex . Message , CustomMessageBoxButton . OK , CustomMessageBoxIcon . Error ) ;
}
}
}
}
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" ) ) ;