重做打卡界面,优化计件薪酬界面

master
zhaojian 2 years ago
parent b996f8388a
commit 1db6c5c627

@ -13,6 +13,7 @@ using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace CommonFunc
{
@ -52,12 +53,26 @@ namespace CommonFunc
/// </summary>
public CustomMessageBoxResult Result { get; set; }
private DispatcherTimer _closeTimer;
#endregion
public HMessageBox()
{
InitializeComponent();
}
public HMessageBox(int closeAfterMilliseconds)
{
InitializeComponent();
if (closeAfterMilliseconds > 0)
{
_closeTimer = new DispatcherTimer();
_closeTimer.Interval = TimeSpan.FromMilliseconds(closeAfterMilliseconds);
_closeTimer.Tick += CloseTimer_Tick;
_closeTimer.Start();
}
}
public void SetControl()
{
OkButton.Visibility = OkButtonVisibility;
@ -72,6 +87,12 @@ namespace CommonFunc
}
private void CloseTimer_Tick(object sender, EventArgs e)
{
_closeTimer.Stop();
this.Close();
}
private void Window_Closed(object sender, EventArgs e)
{
this.Close();

@ -71,6 +71,64 @@ namespace CommonFunc.Tools
}
public static CustomMessageBoxResult Show(string messageBoxText, CustomMessageBoxButton messageBoxButton, CustomMessageBoxIcon messageBoxImage, int closeAfterMilliseconds = 0)
{
HMessageBox window = new HMessageBox(closeAfterMilliseconds);
try
{
window.MessageBoxText = messageBoxText;
window.OkButtonVisibility = Visibility.Hidden;
window.CancelButtonVisibility = Visibility.Hidden;
window.YesButtonVisibility = Visibility.Hidden;
window.NoButtonVisibility = Visibility.Hidden;
switch (messageBoxImage)
{
case CustomMessageBoxIcon.Question:
window.ImagePath = @"Resources/alert.png";
break;
case CustomMessageBoxIcon.Error:
window.ImagePath = @"Resources/Error.png";
break;
case CustomMessageBoxIcon.Warning:
window.ImagePath = @"Resources/alert.png";
break;
case CustomMessageBoxIcon.Success:
window.ImagePath = @"Resources/Success.png";
break;
}
switch (messageBoxButton)
{
case CustomMessageBoxButton.OK:
window.OkButtonVisibility = Visibility.Visible;
break;
case CustomMessageBoxButton.OKCancel:
window.OkButtonVisibility = Visibility.Visible;
window.CancelButtonVisibility = Visibility.Visible;
break;
case CustomMessageBoxButton.YesNo:
window.YesButtonVisibility = Visibility.Visible;
window.NoButtonVisibility = Visibility.Visible;
break;
case CustomMessageBoxButton.YesNoCancel:
window.YesButtonVisibility = Visibility.Visible;
window.NoButtonVisibility = Visibility.Visible;
window.CancelButtonVisibility = Visibility.Visible;
break;
default:
window.OkButtonVisibility = Visibility.Visible;
break;
}
window.SetControl();
window.ShowDialog();
}
catch (Exception ex)
{
LogHelper.instance.log.Error("调用弹出消息 异常:" + ex.Message);
}
return window.Result;
}
public static CustomMessageBoxResult Show(string messageBoxText)
{
HMessageBox window = new HMessageBox();

@ -20,7 +20,7 @@ namespace XGL.Data.DBService
/// <param name="edt"></param>
/// <returns></returns>
public DataTable GetFormingMachineInfo(string devicecode, string workDate)
{
{
//过于复杂,给数据库造成了压力,经常死锁
// string sql = $@"SELECT DISTINCT
// ord.workorder_id,
@ -67,16 +67,19 @@ namespace XGL.Data.DBService
LEFT JOIN base_shifts_t shift WITH (NOLOCK) on ord.shift_id = shift.Shift_Id
WHERE
CONVERT(VARCHAR(10), ord.product_date , 120) = CONVERT(VARCHAR(10), '{workDate}', 120 )
And ord.prod_line_code like '%{devicecode}%' ";
And ord.prod_line_code like '%{devicecode}%' AND ord.del_flag='0'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
foreach (DataRow item in dtset.Tables[0].Rows)
{
string work0rderID = item["workorder_id"].ToString();
string totalcountSql = $@" select count(*) as totalCount from mes_material_transfer_result WITH (NOLOCK)
where CONVERT(VARCHAR(10), work_date , 120) = CONVERT(VARCHAR(10),'{workDate}', 120) and equipmentCode = '{devicecode}' and OrderCode = '{work0rderID}' group by OrderCode ";
DataSet dtsetTotalCount = Utils.netClientDBHelper.getDataSet(totalcountSql);
string totalsql = $"SELECT count(*) FROM mes_material_transfer_result result WHERE result.equipmentCode =" +
$" '{devicecode}' AND result.update_time >= ( SELECT TOP 1 create_time FROM mes_changeshift_info WHERE device_code" +
$" = '{devicecode}' ORDER BY create_time DESC ) AND result.rfid_status='1' ;";
// string totalcountSql = $@" select count(*) as totalCount from mes_material_transfer_result WITH (NOLOCK)
//where CONVERT(VARCHAR(10), work_date , 120) = CONVERT(VARCHAR(10),'{workDate}', 120) and equipmentCode = '{devicecode}' and OrderCode = '{work0rderID}' group by OrderCode ";
DataSet dtsetTotalCount = Utils.netClientDBHelper.getDataSet(totalsql);
if (dtsetTotalCount != null && dtsetTotalCount.Tables.Count > 0 && dtsetTotalCount.Tables[0].Rows.Count > 0)
{
item["totalCount"] = dtsetTotalCount.Tables[0].Rows[0][0];
@ -133,6 +136,25 @@ namespace XGL.Data.DBService
return null;
}
/// <summary>
/// 获取接口URL
/// </summary>
/// <param name="bdt"></param>
/// <param name="edt"></param>
/// <returns></returns>
public string InterfaceUrl( string url_type)
{
string sql = $@"select url FROM mes_interface_url WHERE url_type='{url_type}'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0)
{
// 获取查询结果中的计数值并转换为字符串
string countAsString = dtset.Tables[0].Rows[0][0].ToString();
return countAsString;
}
return null;
}
/// <summary>
/// 获取成型机状态
@ -929,6 +951,39 @@ VALUES
return null;
}
/// <summary>
/// 获取工单
/// </summary>
/// <param name="orderCode"></param>
/// <returns></returns>
public DataTable Getorderworkorder(string orderCode)
{
string sql = $@"select * from pro_order_workorder WHERE workorder_code='{orderCode}' AND del_flag='0'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
return dtset.Tables[0];
}
return null;
}
/// <summary>
/// 获取所在车间
/// </summary>
/// <param name="orderCode"></param>
/// <returns></returns>
public DataTable GetWorkShop(string eqment)
{
string sql = $@"select * from base_equipment WHERE equipment_code='{eqment}' AND del_flag='0'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
return dtset.Tables[0];
}
return null;
}
/// <summary>
/// 获取报工总数量
/// </summary>

@ -93,7 +93,7 @@ namespace XGL.Dats.DBServiceFinishProd
/// <returns></returns>
public DataTable GetUserInfoFromCloudServer(string userID)
{
string sql = $@"SELECT user_name,nick_name,sex FROM [dbo].[sys_user] where del_flag = '0' and (user_name = '{userID}' or pe_snr = '{userID}')";
string sql = $@"SELECT user_name,nick_name,sex FROM [dbo].[sys_user] where del_flag = '0' and pe_snr = '{userID}'";
DataSet dtset = Utils.cloudDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
@ -137,12 +137,37 @@ WHERE user_id = '{userID}'
return ret > 0 ? true : false;
}
public DataTable GetAttendanceRecord(string v)
public DataTable GetAttendanceRecord(string v,string data)
{
string sql = $@" select id, user_id, user_name, attendance_status, sex, age,
id_number, start_time, start_addr, end_time, end_addr, attendance_time,
attendance_date, work_hours, create_time,Convert(DECIMAL(12,2),DATEDIFF((MINUTE), start_time, GetDate()) / 60.00) as diff
from mes_attendance_records where start_addr = '{v}' and attendance_date = CONVERT(VARCHAR(10), GetDate() , 120) order by create_time desc";
string sql = $@"SELECT
id,
user_id,
user_name,
attendance_status,
sex,
age,
id_number,
start_time,
start_addr,
end_time,
end_addr,
attendance_time,
attendance_date,
work_hours,
create_time,
CONVERT(DECIMAL(12, 2),
CASE
WHEN end_time IS NOT NULL THEN DATEDIFF(MINUTE, start_time, end_time) / 60.00
ELSE DATEDIFF(MINUTE, start_time, GetDate()) / 60.00
END) AS diff
FROM
mes_attendance_records
WHERE
start_addr = '{v}'
AND create_time BETWEEN '{data} 00:00:00' AND '{data} 23:59:59'
ORDER BY
create_time DESC;
";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
@ -578,9 +603,11 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
{
string sql = $@"select workorder.factory_code,workorder.product_date as plan_time, workorder.workorder_id,workorder.workorder_code, product_code,product_name,
product_spc,shifts.shift_desc,prod_line_code,workorder.status,route_code,quantity_split,
unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no, workorder.parent_order,batch.qc_status,isnull(batch.qc_result,'') qc_result,batch.status as batchStatus,workorder_code_sap,salary_flag,qty.batchQty,batch.batch_quantity - qty.batchQty as diffQty
unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no, workorder.parent_order,batch.qc_status,isnull(batch.qc_result,'') qc_result,batch.status as batchStatus,workorder_code_sap,salary_flag,qty.batchQty,batch.batch_quantity - qty.batchQty as diffQty, chack.create_time,
chack.check_status
from pro_order_workorder workorder WITH (NOLOCK)
left JOIN base_shifts_t shifts WITH (NOLOCK) on workorder.shift_id = shifts.shift_id
LEFT JOIN (SELECT create_time,check_status,order_no FROM qc_check_task WHERE check_type='checkTypeCP' ) chack ON workorder.workorder_code = chack.order_no
left JOIN pro_order_workorder_batch batch WITH (NOLOCK) on workorder.workorder_id = batch.workorder_id
left join (SELECT sum(quantity_feedback) as batchQty,workorder_code,batch FROM [dbo].[mes_report_work] where del_flag = 0 GROUP BY workorder_code,batch) qty on qty.workorder_code = workorder.workorder_code and batch.batch_code = qty.batch
where 1=1 and batch.del_flag = 0 and workorder.del_flag = 0 and
@ -638,7 +665,7 @@ where 1=1 and
/// <returns></returns>
public DataTable GetUnitPriceData(string deviceCode)
{
string sql = $@"select [workorder_code], [workorder_code_sap], [product_name], SUBSTRING([product_code], 8, LEN(product_code)) as product_code, [user_name], [nick_name], [childprocess_code], [childprocess_name] ,[create_by], [create_time], [line_code]
string sql = $@"select [workorder_code], [workorder_code_sap], [product_name], SUBSTRING([product_code], 8, LEN(product_code)) as product_code, [user_name], [nick_name], [childprocess_code], [childprocess_name] ,[create_by], [create_time], [line_code] ,[attr1]
from mes_unitprice_report
where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = CONVERT(VARCHAR(10),GETDATE(), 120) ORDER BY childprocess_code,create_time";
@ -651,6 +678,20 @@ where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = C
}
public string GetUsernumbereData(string deviceCode)
{
string sql = $@"SELECT SUM(quantity_feedback) as total_quantity FROM mes_report_work WHERE workorder_code='{deviceCode}'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
DataTable dt = dtset.Tables[0];
return dt.Rows[0]["total_quantity"].ToString();
}
return null;
}
/// <summary>
/// 根据线体、产品获取工序列表
/// </summary>
@ -676,7 +717,7 @@ where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = C
/// </summary>
/// <param name="item"></param>
/// <exception cref="NotImplementedException"></exception>
public string GetCreateUnitPriceInfo(sys_user item,string workorderCode, string sapWorkorderCode,string productCode,string productName,string childProcessCode,string childProcessName,string deviceCode)
public string GetCreateUnitPriceInfo(sys_user item,string workorderCode, string sapWorkorderCode,string productCode,string productName,string childProcessCode,string childProcessName,string deviceCode,string number)
{
string sql = $@"INSERT INTO [dbo].[mes_unitprice_report] (
[id],[workorder_code], [workorder_code_sap], [product_name], [product_code],
@ -687,7 +728,7 @@ where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = C
VALUES
(
'{Common.GetUUID()}', '{workorderCode}','{sapWorkorderCode}', '{productName}', '{productCode}',
N'{item.user_name}', N'{item.nick_name}', N'{childProcessCode}', N'{childProcessName}', NULL,
N'{item.user_name}', N'{item.nick_name}', N'{childProcessCode}', N'{childProcessName}',' {number}',
NULL, NULL, '{LoginUser.UserName}', getdate(), NULL,
NULL, NULL,'{deviceCode}' );";
@ -709,7 +750,7 @@ where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = C
public List<sys_user> GetOnWorkUserList(string deviceCode)
{
string sql = $"SELECT user_id as user_name,user_name as nick_name,sex,age FROM [dbo].[mes_attendance_records] where start_addr = '{deviceCode}' and CONVERT(VARCHAR(10), create_time , 120) = CONVERT(VARCHAR(10), GETDATE() , 120) ;";
string sql = $"SELECT user_id as user_name,user_name as nick_name,sex,age FROM [dbo].[mes_attendance_records] where start_addr = '{deviceCode}' and CONVERT(VARCHAR(10), create_time , 120) = CONVERT(VARCHAR(10), GETDATE() , 120) order by create_time desc ;";
DataTable dt = Utils.netClientDBHelper.getDataSet(sql).Tables[0];
@ -958,6 +999,18 @@ where detail.parent_work_order = '{processid}'"; //where CONVERT(VARCHAR(10), w
}
/// <summary>
/// 删除薪酬录入
/// </summary>
/// <returns></returns>
public bool Updateremuneration(string workOrdercode, string nickName,string attr1,string childprocess_code)
{
string sql1 = $@"DELETE FROM mes_unitprice_report WHERE workorder_code_sap='{workOrdercode}' AND nick_name='{nickName}' AND attr1='{attr1}' and childprocess_code='{childprocess_code}' ";
return Utils.netClientDBHelper.executeUpdate(sql1) > 0 ? true : false;
}
/// <summary>
/// 写入开始、报工状态
/// </summary>

@ -11,6 +11,10 @@ namespace XGL.Models.Model
/// </summary>
public class sys_user
{
/// <summary>
/// 报工数量
/// </summary>
public string number { get; set; }
/// <summary>
/// 选中状态
/// </summary>

@ -10,9 +10,9 @@
<!--车间编码-->
<add key="SiteCode" value="999" />
<!--设备编码-->
<add key="DeviceCode" value="C3" />
<add key="DeviceCode" value="C7" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录-->
<add key="ClientMode" value="2" />
<add key="ClientMode" value="1" />
<add key="SerialPort" value="COM5" />
<add key="DryingHouseList" value="H16,H17,H18"/>
<!--线体编码-->

@ -1,10 +1,10 @@
<?xml version="1.0" standalone="yes"?>
<ConnectionConfig>
<Recommand>强烈建议:对数据库以及本软件的参数更改,不要在此页进行.可以通过系统配置页进行更新.</Recommand>
<!--服务器上的业务数据库-->
<!--<MESNetClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THmyUqdarOD4hLgFIvnCg0Z5JcMnCcII6fP2O7usaxD2yxms2iG3eLDUbqRzra4aRVWyptaS06VoI5ijFvcRfLsDJTcpjMhCY6BLuczFcXp04=</MESNetClientConnectionString>-->
<!--云数据库-->
<!--<CloudConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1SeyBo9i02eVJXgQThZLtJ4i8onuEvQtnfNObn1j0jgO</CloudConnectionString>-->
<!--服务器上的业务数据库--><!--
--><!--<MESNetClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THmyUqdarOD4hLgFIvnCg0Z5JcMnCcII6fP2O7usaxD2yxms2iG3eLDUbqRzra4aRVWyptaS06VoI5ijFvcRfLsDJTcpjMhCY6BLuczFcXp04=</MESNetClientConnectionString>--><!--
--><!--云数据库--><!--
--><!--<CloudConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1SeyBo9i02eVJXgQThZLtJ4i8onuEvQtnfNObn1j0jgO</CloudConnectionString>-->
<!--本地的业务数据库-->
<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>
<!--榄菊业务数据库-->

@ -10,7 +10,7 @@
<!--车间编码-->
<add key="SiteCode" value="1000" />
<!--设备编码-->
<add key="DeviceCode" value="XL01" />
<add key="DeviceCode" value="XL03" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录,4:称重系统-->
<add key="ClientMode" value="1" />

@ -259,7 +259,7 @@
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="13" Grid.Column="1" Grid.ColumnSpan="2">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="批 次 号:"></Label>
<ComboBox x:Name="comboBoxBatch" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Margin="2,5,0,0" Width="360" Height="50" Style="{StaticResource ComboBoxStyle}"></ComboBox>
<Label Content="* 不选批次号则默认为该工单报工" Foreground="Red" VerticalAlignment="Center"></Label>
<TextBlock Text="* 不选批次号则默认为该工单报工&#x0a;* 不选批次号则无法创建批次成品检验任务" Foreground="Red" VerticalAlignment="Center" TextWrapping="Wrap" />
</StackPanel>
@ -333,7 +333,7 @@
<ScaleTransform ScaleX="2" ScaleY="2" />
</CheckBox.LayoutTransform>
</CheckBox>
<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="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"/>
</Grid>
</Grid>

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@ -100,6 +101,7 @@ namespace XGLFinishPro.Views
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
btnOK.IsEnabled = true;
this.DialogResult = false;
this.Close();
}
@ -108,7 +110,6 @@ namespace XGLFinishPro.Views
{
try
{
if (string.IsNullOrEmpty(this.txtQuantity.Text))
{
this.tbMsg.Content = "报工数量不能为空";
@ -213,9 +214,11 @@ namespace XGLFinishPro.Views
{
CustomMessageBox.Show("报工检验数据有效性时发生了异常:" + ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
LogHelper.instance.log.Error("报工检验数据有效性时发生了异常:" + ex.Message);
btnOK.IsEnabled = true;
return;
}
btnOK.IsEnabled = false;
_useMan = this.txtUserCount.Text;
_workTime = this.txtWorkTime.Text;
_costCenter = this.comboBoxCostCenter.SelectedValue.ToString();
@ -275,7 +278,7 @@ namespace XGLFinishPro.Views
}
}
btnOK.IsEnabled = true;
}
@ -364,7 +367,7 @@ namespace XGLFinishPro.Views
{
//报工接口不用调了
////调用报工接口
//string apiUrl = formingMachineService.InterfaceUrl("reportWork");
//ReportWork reportWork = new ReportWork();
//reportWork.factoryCode = Utils.GetAppSetting("SiteCode");
//reportWork.reportCode = newReportCode;
@ -375,9 +378,68 @@ namespace XGLFinishPro.Views
////var response =;
//Rootobjectresu result = Utils.DeJson<Rootobjectresu>(await restClient.PostAsync(apiUrl, jsonContent));
//批次成品入库检验任务创建
//createCheckProductTask createCheckProductTask = new createCheckProductTask();
//createCheckProductTask.checkLoc = deviceCode;
//createCheckProductTask.factoryCode = Utils.GetAppSetting("SiteCode");
//if (comboBoxBatch.SelectedIndex != 0)
//{
// try
// {
// var getorder = formingMachineService.Getorderworkorder(lbCurrOrderNo.Content.ToString());
// var eqment = formingMachineService.GetWorkShop(Utils.GetAppSetting("DeviceCode"));
// createCheckProductTask createCheckProductTask = new createCheckProductTask();
// createCheckProductTask.factoryCode = Utils.GetAppSetting("SiteCode");//工厂编码
// createCheckProductTask.incomeBatchNo = comboBoxBatch.Text.ToString();//批次号
// createCheckProductTask.orderNo = lbCurrOrderNo.Content.ToString();//订单号
// if (getorder != null && getorder.Rows.Count > 0)
// {
// createCheckProductTask.materialCode = getorder.Rows[0]["product_code"].ToString(); ;//物料编码
// createCheckProductTask.materialName = getorder.Rows[0]["product_name"].ToString();//物料名称
// createCheckProductTask.unit = getorder.Rows[0]["unit"].ToString();//单位,(字典表)
// }
// createCheckProductTask.checkType = "checkTypeCPPC";//批次成品检验固定值
// createCheckProductTask.typeCode = "product";//product
// createCheckProductTask.quality = txtQuantity.Text;//数量
// if (eqment != null && eqment.Rows.Count > 0)
// {
// createCheckProductTask.carName = eqment.Rows[0]["workshop_name"].ToString();//车间名称
// createCheckProductTask.carName = eqment.Rows[0]["workshop_code"].ToString();//车间编码
// }
// createCheckProductTask.produceDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");//生产时间格式yyyy-MM-dd HH:mm:ss
// createCheckProductTask.checkLoc = Utils.GetAppSetting("DeviceCode");//检测地点
// // 接口地址
// string apiUrl = formingMachineService.InterfaceUrl("BatcInspection");
// // 将请求参数序列化为 JSON 格式
// string requestBodyJson = Newtonsoft.Json.JsonConvert.SerializeObject(createCheckProductTask);
// // 发送 HTTP POST 请求
// using (var httpClient = new HttpClient())
// {
// var content = new StringContent(requestBodyJson, Encoding.UTF8, "application/json");
// var response = httpClient.PostAsync(apiUrl, content).Result; // 或者 .Wait();
// // 判断响应状态码是否为成功
// if (response.IsSuccessStatusCode)
// {
// // 获取响应内容
// string responseBody = response.Content.ReadAsStringAsync().Result; // 或者 .Wait();
// }
// else
// {
// // 输出失败信息
// CustomMessageBox.Show("批次成品入库检验任务创建接口调用失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning, 3000);
// }
// }
// }
// catch (Exception ex)
// {
// LogHelper.instance.log.Error("批次成品入库检验任务创建接口调用失败>>" + ex.Message);
// CustomMessageBox.Show("批次成品入库检验任务创建接口调用失败:" + ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
// }
//}
//if (result.code == 200)
//{
//{
return AddConsumInfo(reportWorkSqlList, newReportCode);
//}
//else
@ -913,4 +975,59 @@ namespace XGLFinishPro.Views
public string factory_code { get; set; }
public string factory_name { get; set; }
}
}
public class createCheckProductTask
{
/// <summary>
/// 工厂编码
/// </summary>
public string factoryCode { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string incomeBatchNo { get; set; }
/// <summary>
/// orderNo订单号
/// </summary>
public string orderNo { get; set; }
/// <summary>
/// 物料名称
/// </summary>
public string materialName { get; set; }
/// <summary>
/// 物料编码
/// </summary>
public string materialCode { get; set; }
/// <summary>
/// 检测类型固定 checkTypeSC首次检验 checkTypeHF烘房检验
/// </summary>
public string checkType { get; set; }
/// <summary>
/// product
/// </summary>
public string typeCode { get; set; }
/// <summary>
/// 收货数量
/// </summary>
public string quality { get; set; }
/// <summary>
/// 单位
/// </summary>
public string unit { get; set; }
/// <summary>
/// 车间名称
/// </summary>
public string carName { get; set; }
/// <summary>
/// 车间编码
/// </summary>
public string carCode { get; set; }
/// <summary>
/// 生产时间 格式yyyy-MM-dd HH:mm:ss
/// </summary>
public string produceDate { get; set; }
/// <summary>
/// 检测地点
/// </summary>
public string checkLoc { get; set; }
}
}

@ -1,4 +1,5 @@
using CommonFunc.Tools;
using CommonFunc;
using CommonFunc.Tools;
using System;
using System.Collections.Generic;
using System.Data;
@ -44,7 +45,7 @@ namespace XGLFinishPro.Views
{
try
{
DataTable dt = userDbWareHouse.GetAttendanceRecord(deviceCode);
DataTable dt = userDbWareHouse.GetAttendanceRecord(deviceCode, LoginUser.WorkDate);
if (dt == null)
{
dgUserInfo.ItemsSource = null;

@ -543,6 +543,8 @@ Background="#F2F3F5"
<DataGridTextColumn Width="100" Header="生产顺序" Binding="{Binding sort_no}" />
<DataGridTextColumn Width="250" Header="计划时间" Binding="{Binding plan_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />
<DataGridTextColumn Width="250" Header="单位" Binding="{Binding unit}" />
<!--<DataGridTextColumn Width="200" Header="创建批次成品检验时间" Binding="{Binding create_time}" />
<DataGridTextColumn Width="200" Header="批次成品检验结果" Binding="{Binding check_status}" />-->
<!--<DataGridTextColumn Width="340" Header="流转码" Binding="{Binding work_batch_code}" />-->
<!--<DataGridTextColumn Width="60" Header="出入" Binding="{Binding taskcode,Converter={StaticResource TaskCodeConverter}}"/>-->

@ -4,6 +4,8 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
@ -184,6 +186,32 @@ namespace XGLFinishPro.Views
DataTable dt = userDbWareHouse.GetWetPlanInfo(deviceCode, LoginUser.WorkDate);//formingMachineService.GetFormingMachineInfo(deviceCode, currShiftDate.ToString());
if (dt == null) return;
//if (dt != null && dt.Rows.Count > 0)
//{
// foreach (DataRow row in dt.Rows)
// {
// // 获取当前行的 check_status 字段的值
// string checkStatus = row["check_status"] as string;
// // 根据不同的情况修改值
// if (checkStatus == "Y")
// {
// row["check_status"] = "合格";
// }
// else if (checkStatus == "N")
// {
// row["check_status"] = "不合格";
// }
// else if (string.IsNullOrEmpty(checkStatus))
// {
// row["check_status"] = "无";
// }
// // 如果还有其他情况需要处理,可以继续添加 elseif 分支
// // 更新当前行的值
// dt.AcceptChanges();
// }
//}
if (orderList != null)
{
@ -281,6 +309,33 @@ namespace XGLFinishPro.Views
//modelWareHouse = new List<WorkOrder>();
DataTable dt = userDbWareHouse.GetWetPlanInfo(deviceCode, LoginUser.WorkDate);
if (dt == null) return;
//if (dt != null && dt.Rows.Count > 0)
//{
// foreach (DataRow row in dt.Rows)
// {
// // 获取当前行的 check_status 字段的值
// string checkStatus = row["check_status"] as string;
// // 根据不同的情况修改值
// if (checkStatus == "Y")
// {
// row["check_status"] = "合格";
// }
// else if (checkStatus == "N")
// {
// row["check_status"] = "不合格";
// }
// else if (string.IsNullOrEmpty(checkStatus))
// {
// row["check_status"] = "无";
// }
// // 如果还有其他情况需要处理,可以继续添加 elseif 分支
// // 更新当前行的值
// dt.AcceptChanges();
// }
//}
if (dt == null) return;
this.dgWorkOrderInfo.ItemsSource = null;
@ -497,9 +552,9 @@ namespace XGLFinishPro.Views
//string isEndReport = execReport._isEndReport == true ? "1" : "0";
//bool issucc = formingMachineService.ExecuteReportWork(selectedRow, workCount, newReportCode, workTime, userCount, costCenter, batchCode, isEndReport, deviceCode);
//if (issucc)
//{
//{
// //调用报工接口
// string apiUrl = formingMachineService.InterfaceUrl("reportWork");
// //string apiUrl = formingMachineService.InterfaceUrl("reportWork");
// ReportWork reportWork = new ReportWork();
// reportWork.factoryCode = Utils.GetAppSetting("SiteCode");
// reportWork.reportCode = newReportCode;
@ -507,23 +562,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<Rootobjectresu>(await restClient.PostAsync(apiUrl, jsonContent));
// Rootobjectresu result = Utils.DeJson<Rootobjectresu>(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();
}
}
@ -836,11 +891,11 @@ namespace XGLFinishPro.Views
CustomMessageBox.Show("请选择你要操作的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
if (!selectedRow["status"].ToString().Equals("w2"))
{
CustomMessageBox.Show("你选择的工单不符合条件!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
//if (!selectedRow["status"].ToString().Equals("w2"))
//{
// CustomMessageBox.Show("你选择的工单不符合条件!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// return;
//}
if (selectedRow["salary_flag"].ToString().Equals("1"))
{
@ -928,4 +983,6 @@ namespace XGLFinishPro.Views
/// </summary>
public string checkLoc { get; set; }
}
}

@ -74,7 +74,7 @@
Text=" 打卡:" />
</Label>
<TextBox Name="txtOnWorkUserID" KeyDown="txtOnWorkUserID_KeyDown"/>
</StackPanel>

@ -68,23 +68,27 @@ namespace XGLFinishPro.Views
{
try
{
string userID = txtOnWorkUserID.Text;
userID = userID.TrimStart('0');
DataTable dtUserInfo = finishProdDBService.GetUserInfoFromCloudServer(userID);
if (dtUserInfo == null || dtUserInfo.Rows.Count <= 0)
{
CustomMessageBox.Show("找不到该账户,请重试!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
CustomMessageBox.Show("找不到该账户,请重试!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning,1500);
txtOnWorkUserID.Text = "";
txtOnWorkUserID.Focus();
return;
}
string userCode = dtUserInfo.Rows[0]["user_name"].ToString();
string userName = dtUserInfo.Rows[0]["nick_name"].ToString();
string sex = dtUserInfo.Rows[0]["sex"].ToString();
DataTable dt = finishProdDBService.GetExistAttendanceRecord(deviceCode);
if (dt != null && dt.Select("user_id = '" + userID + "' AND end_time IS NULL").Length > 0)
if (dt != null && dt.Select("user_id = '" + userCode + "' AND end_time IS NULL").Length > 0)
{
bool isSucc = finishProdDBService.UpdateAttendanceRecord(userCode, deviceCode);
if (isSucc)
{
CustomMessageBox.Show("打卡成功,再见!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success);
CustomMessageBox.Show("打卡成功,再见!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success,1500);
Now_Click(null, null);
txtOnWorkUserID.Text = "";
txtOnWorkUserID.Focus();
@ -96,15 +100,16 @@ namespace XGLFinishPro.Views
bool isSucc = finishProdDBService.InsertAttendanceRecord(userCode, userName, sex, deviceCode);
if (isSucc)
{
CustomMessageBox.Show("打卡成功,祝您工作愉快!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success);
CustomMessageBox.Show("打卡成功,祝您工作愉快!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success,1500);
txtOnWorkUserID.Text = "";
txtOnWorkUserID.Focus();
Now_Click(null, null);
}
else
{
CustomMessageBox.Show("打卡失败,请重试!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
CustomMessageBox.Show("打卡失败,请重试!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error,1500);
txtOnWorkUserID.Text = "";
txtOnWorkUserID.Focus();
}
}
}

@ -1,4 +1,5 @@
using CommonFunc.Tools;
using CommonFunc;
using CommonFunc.Tools;
using System;
using System.Collections.Generic;
using System.Data;
@ -15,7 +16,6 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using XGL.Dats.DBServiceFinishProd;
namespace XGLFinishPro.Views
{
/// <summary>
@ -45,7 +45,7 @@ namespace XGLFinishPro.Views
private void GetRecordInfo()
{
DataTable dt = userDbWareHouse.GetAttendanceRecord(deviceCode);
DataTable dt = userDbWareHouse.GetAttendanceRecord(deviceCode, LoginUser.WorkDate);
if (dt == null)
{
dgUserInfo.ItemsSource = null;

@ -78,8 +78,8 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" BorderThickness="3"
Width="120"
Height="40"
Width="125"
Height="80"
Margin="2,0,0,0"
Style="{DynamicResource ListBoxItemNormalBackground_Border_Style}">
<Grid >
@ -93,7 +93,7 @@
VerticalAlignment="Center"
Margin="55,0,0,0" FontWeight="Bold" Foreground="Black"
Style="{DynamicResource ListBoxItemContent_TextBlock_Style}"/>
<Grid
Margin="-15,12,0,0"
Width="90"
@ -267,14 +267,14 @@
Opacity="1" />
</Setter.Value>
</Setter>
</Style>
</Style>
</Window.Resources>
<Grid Background="#F2F3F5">
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.45*"></RowDefinition>
<RowDefinition Height="0.45*"></RowDefinition>
<RowDefinition Height="19*"/>
<RowDefinition Height="421*"></RowDefinition>
<RowDefinition Height="360*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@ -286,52 +286,65 @@
<TextBlock Text="确认" VerticalAlignment="Center" Margin="15,0,0,0"/>
</StackPanel>
</Button>-->
<CheckBox x:Name="btnSelectStep" Visibility="Collapsed" Grid.Row="0" Content="选择工序" FontSize="16" HorizontalAlignment="Left" Width="100" Height="30" Margin="10,0,0,0" FontWeight="Bold" Background="#2B7EE6"
Click="btnSelectStep_Click">
</CheckBox>
<CheckBox x:Name="btnSelectStep" Visibility="Collapsed" Grid.Row="0" Content="选择工序" FontSize="16" HorizontalAlignment="Left" Width="100" Margin="10,0,0,9" FontWeight="Bold" Background="#2B7EE6"
Click="btnSelectStep_Click"/>
<Popup Grid.Row="1" Grid.RowSpan="2" IsOpen="{Binding ElementName=btnSelectStep,Path=IsChecked,UpdateSourceTrigger=PropertyChanged}" PlacementTarget="{Binding ElementName=btnSelectStep}">
<StackPanel Orientation="Vertical">
<ListBox x:Name="lstBoxStep" Style="{DynamicResource ApplicantList_ListBox_Style}" ItemContainerStyle="{DynamicResource ApplicantList_ListBoxItem_Style}" SelectionMode="Multiple">
<ListBox x:Name="lstBoxStep" Style="{DynamicResource ApplicantList_ListBox_Style}" ItemContainerStyle="{DynamicResource ApplicantList_ListBoxItem_Style}" SelectionMode="Multiple">
</ListBox>
<Button x:Name="btnStepConfirm" Style="{StaticResource btnKey}" Background="#2B7EE6" Content="确认" Width="100" Height="30" Click="btnConfirm_Click"/>
</StackPanel>
</StackPanel>
</Popup>
<ListBox x:Name="lstSelectedStep" Grid.Row="1" Grid.Column="0" Background="#F2F3F5" Style="{DynamicResource ApplicantList_ListBox_Style}"
<ListBox x:Name="lstSelectedStep" Grid.Row="1" Grid.Column="0" Background="#F2F3F5" Style="{DynamicResource ApplicantList_ListBox_Style}"
ItemContainerStyle="{DynamicResource ApplicantList_ListBoxItem_Style}" SelectionMode="Single" SelectionChanged="lstSelectedStep_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<!-- 这里放置你的数据绑定内容 -->
<TextBlock Text="{Binding childprocess_name}" />
</Grid>
<DataTemplate.Triggers>
<Trigger Property="ListBoxItem.IsMouseOver" Value="True">
<Setter Value="True" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Row="0" Grid.RowSpan="2" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.15*"/>
<RowDefinition Height="0.85*"/>
<RowDefinition Height="73*"/>
<!--<RowDefinition Height="46*"/>-->
<RowDefinition Height="367*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column ="0" Orientation="Horizontal" Margin="5">
<StackPanel Grid.Row="0" Grid.Column ="0" Orientation="Horizontal" Margin="5,5,5,5">
<TextBlock Text="请输入用户名或者ID" VerticalAlignment="Center"/>
<TextBox x:Name="txtP" Width="120" Height="30" FontSize="18" VerticalAlignment="Center" VerticalContentAlignment="Center" TextChanged="txtP_TextChanged"/>
<Button x:Name="btnQueryUser" Content="查询" FontWeight="Bold" Width="100" Height="40" Style="{StaticResource btnKey}" Click="btnQueryUser_Click" Visibility="Collapsed"/>
<Button x:Name="btnUserConfirm" Content="确认" FontWeight="Bold" Width="100" Height="40" Style="{StaticResource btnKey}" Click="btnUserConfirm_Click"/>
<Button x:Name="btnCloseWin" Content="关闭" FontWeight="Bold" Width="100" Height="40" Style="{StaticResource btnKey}" Click="btnCloseWin_Click"/>
</StackPanel>
<DataGrid
Grid.Row="1" Grid.Column ="0" Grid.ColumnSpan="2"
Grid.Row="1" Grid.Column ="0"
x:Name="dgUserInfo"
MinWidth="200"
MinHeight="260"
Width="560"
Height="340"
RowStyle="{StaticResource DataGridRowStyle}"
Margin="10,10,0,5"
Margin="10,0,0,0"
MaxHeight="400"
AlternationCount="2"
FontSize="18"
LoadingRow="dgWorkOrderInfo_LoadingRow"
HeadersVisibility="Column"
HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalContentAlignment="Center" IsReadOnly="True"
VerticalAlignment="Top" VerticalContentAlignment="Center"
AutoGenerateColumns="False" CanUserAddRows="False" SelectionMode="Extended" SelectionUnit="FullRow" SelectionChanged="dgUserInfo_SelectionChanged">
<DataGrid.ColumnHeaderStyle >
<Style TargetType="DataGridColumnHeader">
@ -341,28 +354,30 @@
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#2B7EE6" />
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<!-- 添加选择列 , RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}IsChecked="{Binding IsSelected ,Mode=TwoWay,RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"-->
<DataGridTemplateColumn Width="50">
<DataGridTemplateColumn.Header>
<CheckBox x:Name="cb_all" Click="cb_all_Click" HorizontalAlignment="Center" VerticalAlignment="Center" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox x:Name="cb_child" Click="cb_child_Click" IsChecked="{Binding IsChecked}" HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center"/>
<CheckBox x:Name="cb_child" Click="cb_child_Click" IsChecked="{Binding IsChecked}" HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="15,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header=" 序号" Width="80" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn Header="序号" Width="80" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Width="130" Header="用户编码" Binding="{Binding user_name}"/>
<DataGridTextColumn Width="190" Header="用户名称" Binding="{Binding nick_name}"/>
<DataGridTextColumn Width="130*" Header="用户编码" IsReadOnly="true" Binding="{Binding user_name}"/>
<DataGridTextColumn Width="190*" Header="用户名称" IsReadOnly="true" Binding="{Binding nick_name}"/>
<DataGridTextColumn Width="190*" Header="报工总数" Binding="{Binding number}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<GroupBox Grid.Row="2" Grid.Column ="0" Grid.ColumnSpan ="2" Header="已分配的数据">
@ -390,7 +405,7 @@
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<!-- 添加选择列 , RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}IsChecked="{Binding IsSelected ,Mode=TwoWay,RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"-->
<!-- 添加选择列 , RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}IsChecked="{Binding IsSelected ,Mode=TwoWay,RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"-->
<DataGridTemplateColumn Header=" 序号" Width="80" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
@ -406,13 +421,23 @@
<DataGridTextColumn Width="80" Header="工序编码" Binding="{Binding childprocess_code}"/>
<DataGridTextColumn Width="80" Header="工序名称" Binding="{Binding childprocess_name}"/>
<DataGridTextColumn Width="80" Header="线体" Binding="{Binding line_code}"/>
<DataGridTextColumn Width="80" Header="报工数量" Binding="{Binding attr1}"/>
<DataGridTextColumn Width="185" Header="创建时间" Binding="{Binding create_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"/>
<DataGridTemplateColumn Width="80" Header="操作">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border BorderThickness="1" BorderBrush="Gray" CornerRadius="4" Height="35" Width="60">
<Button Content="删除" Click="Button_Click" Margin="1" Background="Aqua"/>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<StackPanel Grid.Row="3" Grid.Column ="0" Grid.ColumnSpan ="2" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Margin="5">
<StackPanel Grid.Row="2" Grid.Column ="1" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Height="22" Width="0">
<TextBlock x:Name="msgBox" Text="" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Foreground="Red"/>
</StackPanel>
</Grid>
</Window>

@ -30,6 +30,7 @@ namespace XGLFinishPro.Views
FinishProdDBService prodDBService = new FinishProdDBService();
string _deviceCode = "", _productCode= "",_workOrderCode="",_sapWorkOrderCode="",_productName="", _childprocessCode="", _childprocessName = "";
string _LineCode = "";
string number= "0";
public PieceSalaryCalWin()
{
InitializeComponent();
@ -104,7 +105,20 @@ namespace XGLFinishPro.Views
//Utils.userList.ForEach(t => t.IsChecked = false);
OnWorkUserList.ForEach(t => t.IsChecked = false);
dataSource = OnWorkUserList;// Utils.userList;
this.dgUserInfo.ItemsSource = dataSource;
List<sys_user> usernumbers = new List< sys_user >();
if (dataSource.Count!=0)
{
string num= prodDBService.GetUsernumbereData(_workOrderCode);
foreach (var item in dataSource)
{
sys_user usernumber = new sys_user();
usernumber.user_name = item.user_name;
usernumber.nick_name = item.nick_name;
usernumber.number = num;
usernumbers.Add(usernumber);
}
}
this.dgUserInfo.ItemsSource = usernumbers;
}
private void dgUserInfo_SelectionChanged(object sender, SelectionChangedEventArgs e)
@ -209,6 +223,66 @@ namespace XGLFinishPro.Views
}
List<sys_user> dataSource = new List<sys_user>();
private void Button_Click(object sender, RoutedEventArgs e)
{
if (dgCreatedUserInfo.SelectedItem != null)
{
DataRowView selectedItem = dgCreatedUserInfo.SelectedItem as DataRowView;
var bol = prodDBService.Updateremuneration(selectedItem["workorder_code_sap"].ToString(), selectedItem["nick_name"].ToString(), selectedItem["attr1"].ToString(), selectedItem["childprocess_code"].ToString());
GetData();
}
else
{
Console.WriteLine("未选择任何项。");
}
}
private void cb_selectAll_Click(object sender, RoutedEventArgs e)
{
try
{
// 获取点击的 CheckBox
CheckBox checkBox = sender as CheckBox;
// 检查是否成功获取到 CheckBox
if (checkBox != null)
{
// 遍历 DataGrid 的所有行
foreach (sys_user item in dgUserInfo.ItemsSource)
{
// 设置每行的 IsChecked 属性为全选 CheckBox 的 IsChecked 属性的值
item.IsChecked = checkBox.IsChecked ?? false;
}
}
}
catch (Exception ex)
{
}
}
private void cb_all_Click(object sender, RoutedEventArgs e)
{
CheckBox cb = sender as CheckBox;
bool isChecked = cb.IsChecked == true;
foreach (var item in dgUserInfo.Items)
{
sys_user curRow = item as sys_user;
curRow.IsChecked = isChecked;
if (isChecked)
{
checkedRowsCache.Add(curRow);
}
else
{
checkedRowsCache.Remove(curRow);
}
}
dgUserInfo.Items.Refresh();
}
private void cb_child_Click(object sender, RoutedEventArgs e)
{
@ -267,13 +341,18 @@ namespace XGLFinishPro.Views
{
try
{
if (CustomMessageBox.Show("确定要生成该工序的数据吗?", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Question) == CustomMessageBoxResult.Cancel)
return;
if (checkedRowsCache.Count == 0)
{
CustomMessageBox.Show("请选择人员", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
if (dgUserInfo.SelectedIndex != -1)
{
number = (dgUserInfo.SelectedItem as sys_user).number;
}
if (CustomMessageBox.Show("确定要生成该工序的数据吗?", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Question) == CustomMessageBoxResult.Cancel)
return;
List<string> CreateUnitPriceSqlList = new List<string>();
if (prodDBService.IsExistData(_workOrderCode, _childprocessCode, _deviceCode))
{
@ -285,7 +364,7 @@ namespace XGLFinishPro.Views
string sapCode = _deviceCode;//ds.Tables[0].Rows[0][0].ToString();
foreach (sys_user item in checkedRowsCache)
{
string sql = prodDBService.GetCreateUnitPriceInfo(item, _workOrderCode, _sapWorkOrderCode, _productCode, _productName, _childprocessCode, _childprocessName, sapCode);
string sql = prodDBService.GetCreateUnitPriceInfo(item, _workOrderCode, _sapWorkOrderCode, _productCode, _productName, _childprocessCode, _childprocessName, sapCode, item.number);
CreateUnitPriceSqlList.Add(sql);
}
//之前如果已经插入了,先删除,
@ -379,4 +458,12 @@ namespace XGLFinishPro.Views
public string childprocess_code { get; set; }
public string childprocess_name { get; set; }
}
public class remuneration
{
public string workorder_code_sap { get; set; }
public string nick_name { get; set; }
public DateTime create_time { get; set; }
}
}

@ -215,6 +215,7 @@
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>

@ -2,11 +2,11 @@
<ConnectionConfig>
<Recommand>强烈建议:对数据库以及本软件的参数更改,不要在此页进行.可以通过系统配置页进行更新.</Recommand>
<!--本地的业务数据库-->
<!--<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>-->
<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>
<!--榄菊业务数据库-->
<!--<MESNetClientConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlHbduXNDkc8suJwqe10me6ktk8XD3QU91A7V9zSnfhmhLWUQKZQdqof6chkC37l6QElb57z876mZdo9764iNmLGULHBiQyMu6PXowBdyaQVt17BPsWFn4EUs7Z7zTZwBP+2iJBVXitA3OF6EZXxAztmeZk/1iCwni+JzeWNpXqeOoGzkmSSzmVQH2Yf9m/mlqag2TbldSCcnUQl6lE7tcGg==</MESNetClientConnectionString>-->
<MESNetClientConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlHbduXNDkc8suJwqe10me6ktk8XD3QU91A7V9zSnfhmhLWUQKZQdqof6chkC37l6QElb57z876mZdo9764iNmLGULHBiQyMu6PXowBdyaQVt17BPsWFn4EUs7Z7zTZwBP+2iJBVXitA3OF6EZXxAztmeZk/1iCwni+JzeWNpXqeOoGzkmSSzmVQH2Yf9m/mlqag2TbldSCcnUQl6lE7tcGg==</MESNetClientConnectionString>
<!--榄菊云数据库-->
<!--<CloudConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlHbduXNDkc8suJwqe10me6ktk8XD3QU91ML11cYCqHcHmTXJFsNQamIbW3UEpkjgNPUcBwRfgP6AWftvk9YFyv7y7/6nzX/c+6z6xMDIdcjYVvfteU+7YtOQhJXTfF5ScosAA0GliBfD8dWAunW+ZCos5LemAj2xb2wvvCxlbnrof8IunWslCaBEAGrdC/KhE0qEfNbxydwc=</CloudConnectionString>-->
<CloudConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlHbduXNDkc8suJwqe10me6ktk8XD3QU91ML11cYCqHcHmTXJFsNQamIbW3UEpkjgNPUcBwRfgP6AWftvk9YFyv7y7/6nzX/c+6z6xMDIdcjYVvfteU+7YtOQhJXTfF5ScosAA0GliBfD8dWAunW+ZCos5LemAj2xb2wvvCxlbnrof8IunWslCaBEAGrdC/KhE0qEfNbxydwc=</CloudConnectionString>
@ -14,10 +14,10 @@
<!--本地的业务数据库-->
<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>
<!--<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>-->
<!--榄菊业务数据库-->
<MESNetClientConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlF0tM4FO8qPh090fSbocpFrq1jWXNjwNntlKCeRLc6CBQNAw+bzYK+yDKBny3FzdffaiQ/9ohZ/iFw6P/06Dz1d7Q8OX2fGT3YK8v2yeiGlLhRHNGlkzN6Okv9SEccNYXDHZKQND/31n9bbXRhaFERnPoCp+evwBwpKq0nDcp4lLRNDrJpG2b6nw1popy2st0u+eYfbIYddNpj2jZcnrJXg==</MESNetClientConnectionString>
<!--<MESNetClientConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlF0tM4FO8qPh090fSbocpFrq1jWXNjwNntlKCeRLc6CBQNAw+bzYK+yDKBny3FzdffaiQ/9ohZ/iFw6P/06Dz1d7Q8OX2fGT3YK8v2yeiGlLhRHNGlkzN6Okv9SEccNYXDHZKQND/31n9bbXRhaFERnPoCp+evwBwpKq0nDcp4lLRNDrJpG2b6nw1popy2st0u+eYfbIYddNpj2jZcnrJXg==</MESNetClientConnectionString>-->
<!--榄菊云数据库-->
<CloudConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlF0tM4FO8qPh090fSbocpFrq1jWXNjwNnXgKYRJ9zN5r4cTE3Hh+JS6lnhIJQCLO5Tn/1DUIbZe8kwpCPuiyxdQS9ApxjjxU3xmhgbAR3NfwaZV2/zLMECLZyTqYXOHwTHdkzxa9RyCzNcbpiSjkFFOVT9SrfkzeVUA+7kogOazAQ7II0ms/Pnls5vU+gUjP9JcI1Q6esb8M=</CloudConnectionString>
<!--<CloudConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlF0tM4FO8qPh090fSbocpFrq1jWXNjwNnXgKYRJ9zN5r4cTE3Hh+JS6lnhIJQCLO5Tn/1DUIbZe8kwpCPuiyxdQS9ApxjjxU3xmhgbAR3NfwaZV2/zLMECLZyTqYXOHwTHdkzxa9RyCzNcbpiSjkFFOVT9SrfkzeVUA+7kogOazAQ7II0ms/Pnls5vU+gUjP9JcI1Q6esb8M=</CloudConnectionString>-->
</ConnectionConfig>
Loading…
Cancel
Save