报工添加效率原因,影响时间

master
zhaojian 1 year ago
parent a7a627ef40
commit d58ae4f823

@ -594,7 +594,7 @@ VALUES
/// <param name="edt"></param>
/// <returns></returns>
public List<string> GetExecuteReportWorkSql(DataRowView selectRow, string orderQuntity, string workCount, string reportCode, string workTime, string userCount, string costCenter, string batchCode,
string isEndReport, string deviceCode, Dictionary<int, string> workTimeDic, Dictionary<int, string> userCountDic)
string isEndReport, string deviceCode, Dictionary<int, string> workTimeDic, Dictionary<int, string> userCountDic,string xiaolv,string shijian)
{
string getReportCodeSql = $@"SELECT equipment_code,equipment_name FROM [dbo].[base_equipment] WHERE equipment_code='{deviceCode}'";
string lineName = "";
@ -641,7 +641,7 @@ VALUES
'{selectRow["product_spc"]}', '{selectRow["unit"]}', {selectRow["batch_quantity"]}, {workCount}, 0, 0,
'{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE',
'无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{xiaolv}', '{shijian}', NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', '0', NULL, 'prod',
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{0}','{LoginUser.CurrDeviceIP}','{LoginUser.Version}');";

@ -363,7 +363,22 @@ where detail.parent_work_order ='{workorder}' and detail.del_flag = '0'";
}
return null;
}
/// <summary>
/// 查询效率原因
/// </summary>
/// <param name="workorder"></param>
/// <returns></returns>
public DataTable GetBatcxiaolvCount()
{
//string sql = $" select count(*) from mes_report_work where workorder_code = '{workorder}' AND del_flag='0'";
string sql = $@" SELECT * FROM [dbo].[sys_dict_data] where dict_type='mes_efficiency_reasons'";
DataSet dtset = Utils.cloudDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
return dtset.Tables[0];
}
return null;
}
public bool IsLastBatchReport(string batchNo)
{
//string sql = $" select count(*) from mes_report_work where workorder_code = '{workorder}' AND del_flag='0'";

@ -333,8 +333,12 @@
<ScaleTransform ScaleX="2" ScaleY="2" />
</CheckBox.LayoutTransform>
</CheckBox>
<Label Grid.Row="2" FontSize="24" Content="效率原因:" Margin="230,20,313,0" ></Label>
<ComboBox x:Name="xiaolv" Grid.Row="2" FontSize="24" Margin="362,20,112,0" Style="{StaticResource ComboBoxStyle}"/>
<Label Grid.Row="2" FontSize="24" Content="影响时间:" Margin="10,20,545,0" Grid.Column="1"></Label>
<TextBox x:Name="txtWorkTime2" Grid.Row="2" FontSize="24" Margin="135,20,328,7" Grid.Column="1"/>
<Button x:Name="btnOK" Grid.Row="2" Grid.Column="1" Style="{StaticResource btnKey}" Content="确定" Margin="30,20,20,0" Click="btnOK_Click"/>
<Button x:Name="btnCancel" Grid.Row="2" Grid.Column="1" Style="{StaticResource btnCancelKey}" Background="Gray" Content="取消" Margin="30,20,170,0" Click="btnCancel_Click"/>
<Button x:Name="yingxiang" Grid.Row="2" Grid.Column="1" Style="{StaticResource btnCancelKey}" Background="Gray" Content="取消" Margin="30,20,170,0" Click="btnCancel_Click"/>
</Grid>
</Grid>
</Window>

@ -1,5 +1,6 @@
using CommonFunc;
using CommonFunc.Tools;
using HandyControl.Tools.Extension;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@ -98,6 +99,18 @@ namespace XGLFinishPro.Views
this.txtQuantity.Text = selectedRow["batch_quantity"].ToString();
this.comboBoxBatch.Text = selectedRow["batch_code"].ToString();
_siteCode = siteCode;
DataTable dtCount = userDbWareHouse.GetBatcxiaolvCount();
if (dtCount!=null&& dtCount.Rows.Count>0)
{
if (dtCount != null && dtCount.Rows.Count > 0)
{
foreach (System.Data.DataRow row in dtCount.Rows)
{
xiaolv.Items.Add(row["dict_label"].ToString());
}
}
}
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
@ -362,8 +375,26 @@ namespace XGLFinishPro.Views
string isEndReport = _isEndReport == true ? "1" : "0";
string xiaolv1 = "";
string shijian = "";
if (xiaolv.SelectedIndex==-1)
{
xiaolv1= null;
}
else
{
xiaolv1=xiaolv.SelectedItem.ToString();
}
if (txtWorkTime2.Text.IsNullOrEmpty())
{
shijian = null;
}
else
{
shijian = txtWorkTime2.Text;
}
//bool issucc = formingMachineService.ExecuteReportWork(selectedRow, _orderQuntity, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode);
List<string> reportWorkSqlList = formingMachineService.GetExecuteReportWorkSql(selectedRow, _orderQuntity, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode, dicWorkTime, dicUserCount);
List<string> reportWorkSqlList = formingMachineService.GetExecuteReportWorkSql(selectedRow, _orderQuntity, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode, dicWorkTime, dicUserCount, xiaolv1, shijian);
if (reportWorkSqlList.Count > 0)
{
if (AddConsumInfo(reportWorkSqlList, newReportCode))

Loading…
Cancel
Save