成品报工优化

master
zhaoaomin 2 years ago
parent f9f2d65e33
commit 5864a69187

Binary file not shown.

@ -280,8 +280,15 @@ VALUES
/// <param name="bdt"></param> /// <param name="bdt"></param>
/// <param name="edt"></param> /// <param name="edt"></param>
/// <returns></returns> /// <returns></returns>
public bool ExecuteReportWork(DataRowView selectRow,string reportCode, string workTime, string userCount, string costCenter, string deviceCode) public bool ExecuteReportWork(DataRowView selectRow,string workCount, string reportCode, string workTime, string userCount, string costCenter, string deviceCode)
{ {
string getReportCodeSql = $@"SELECT equipment_code,equipment_name FROM [dbo].[base_equipment] WHERE equipment_code='{deviceCode}'";
string lineName = "";
DataSet dtset = Utils.netClientDBHelper.getDataSet(getReportCodeSql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
lineName = dtset.Tables[0].Rows[0]["equipment_name"].ToString();
}
List<string> sqlList = new List<string>(); List<string> sqlList = new List<string>();
string sql = $@"INSERT INTO [dbo].[mes_report_work] string sql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name], ([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
@ -293,9 +300,9 @@ VALUES
[use_man], [work_center]) [use_man], [work_center])
VALUES VALUES
('{Common.GetUUID()}', 'SELF', '{reportCode}', '{selectRow["workorder_code"]}', '{selectRow["product_code"]}', '{selectRow["product_name"]}', ('{Common.GetUUID()}', 'SELF', '{reportCode}', '{selectRow["workorder_code"]}', '{selectRow["product_code"]}', '{selectRow["product_name"]}',
'{selectRow["product_spc"]}', '{selectRow["unit"]}', {selectRow["quantity_split"]}, {selectRow["quantity_split"]}, 0, 0, '{selectRow["product_spc"]}', '{selectRow["unit"]}', {workCount}, {workCount}, 0, 0,
'{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE', '{LoginUser.UserCode}', '{LoginUser.UserName}', 'PC', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', 'PREPARE',
'无', '{workTime}', '{deviceCode}', N'线2', N'A01', '{selectRow["shift_id"]}', '无', '{workTime}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}',GetDate(), '0', NULL, 'prod',
{userCount}, '{costCenter}');"; {userCount}, '{costCenter}');";
@ -309,6 +316,7 @@ VALUES
return issucc;//> 0 ? true : false; return issucc;//> 0 ? true : false;
} }
/// <summary> /// <summary>
/// 根据设备编码获取当前机台最新的吊满的RFID信息 /// 根据设备编码获取当前机台最新的吊满的RFID信息
/// </summary> /// </summary>

@ -29,6 +29,7 @@ namespace XGLFinishPro.Views
public string _workTime = ""; public string _workTime = "";
public string _useMan = ""; public string _useMan = "";
public string _costCenter = ""; public string _costCenter = "";
public string _workQuntity = "";
public ExecReportWorkWin() public ExecReportWorkWin()
{ {
InitializeComponent(); InitializeComponent();
@ -103,6 +104,7 @@ namespace XGLFinishPro.Views
_useMan = this.txtUserCount.Text; _useMan = this.txtUserCount.Text;
_workTime = this.txtWorkTime.Text; _workTime = this.txtWorkTime.Text;
_costCenter = this.comboBoxCostCenter.SelectedValue.ToString(); _costCenter = this.comboBoxCostCenter.SelectedValue.ToString();
_workQuntity = this.txtQuantity.Text;
this.DialogResult = true; this.DialogResult = true;

@ -467,7 +467,8 @@ namespace XGLFinishPro.Views
string workTime = execReport._workTime; string workTime = execReport._workTime;
string costCenter = execReport._costCenter; string costCenter = execReport._costCenter;
string userCount = execReport._useMan; string userCount = execReport._useMan;
bool issucc = formingMachineService.ExecuteReportWork(selectedRow, newReportCode, workTime, userCount, costCenter, deviceCode); string workCount = execReport._workQuntity;
bool issucc = formingMachineService.ExecuteReportWork(selectedRow, workCount, newReportCode, workTime, userCount, costCenter, deviceCode);
if (issucc) if (issucc)
{ {
//调用报工接口 //调用报工接口

Loading…
Cancel
Save