Browse Source

调整天津770打印分组

master
张松男 11 months ago
parent
commit
d324a112bb
  1. 15
      APPQ5/QMAPP.FJC.BLL/TianJin/TJWorkOrderBLL.cs
  2. 106
      APPQ5/QMAPP.FJC.DAL/TianJin/TWorkOrderDAL.cs
  3. 9
      APPQ5/QMAPP.WinForm/App.config
  4. 43
      APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs
  5. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs
  6. 11
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

15
APPQ5/QMAPP.FJC.BLL/TianJin/TJWorkOrderBLL.cs

@ -96,11 +96,22 @@ namespace QMAPP.FJC.BLL.TianJin
} }
} }
public List<WorkOrder> GetOrderUnPrinted(string RouteCode, int filter, DataPage dataPage,string Direction,string SHIFTCODE, string BeginTime, string EndTime) public List<WorkOrder> GetOrderUnPrintedF(string RouteCode, int filter, DataPage dataPage,string Direction,string SHIFTCODE, string BeginTime, string EndTime)
{ {
try try
{ {
return new TWorkOrderDAL().GetOrderUnPrinted(RouteCode, Direction, SHIFTCODE, BeginTime, EndTime, filter, dataPage.PageSize); return new TWorkOrderDAL().GetOrderUnPrintedF(RouteCode, Direction, SHIFTCODE, BeginTime, EndTime, filter, dataPage.PageSize);
}
catch (Exception ex)
{
throw ex;
}
}
public List<WorkOrder> GetOrderUnPrintedR(string RouteCode, int filter, DataPage dataPage, string Direction, string SHIFTCODE, string BeginTime, string EndTime)
{
try
{
return new TWorkOrderDAL().GetOrderUnPrintedR(RouteCode, Direction, SHIFTCODE, BeginTime, EndTime, filter, dataPage.PageSize);
} }
catch (Exception ex) catch (Exception ex)
{ {

106
APPQ5/QMAPP.FJC.DAL/TianJin/TWorkOrderDAL.cs

@ -331,7 +331,7 @@ namespace QMAPP.FJC.DAL.TianJin
/// <param name="count">数量</param> /// <param name="count">数量</param>
/// <param name="filter">过滤选项:0全部;1隐藏挂起;2只看挂起</param> /// <param name="filter">过滤选项:0全部;1隐藏挂起;2只看挂起</param>
/// <returns></returns> /// <returns></returns>
public List<WorkOrder> GetOrderUnPrinted(string routecode, string Direction, string SHIFTCODE, string BeginTime, string EndTime, int filter = 0, int count = 20) public List<WorkOrder> GetOrderUnPrintedF(string routecode, string Direction, string SHIFTCODE, string BeginTime, string EndTime, int filter = 0, int count = 20)
{ {
try try
{ {
@ -371,9 +371,13 @@ namespace QMAPP.FJC.DAL.TianJin
sql.AppendFormat(" WHERE P.[ROUTE_CODE]=@routecode "); sql.AppendFormat(" WHERE P.[ROUTE_CODE]=@routecode ");
sql.AppendFormat(" AND W.[PRINTED]='0' "); sql.AppendFormat(" AND W.[PRINTED]='0' ");
//if (!string.IsNullOrEmpty(Direction))
//{
// sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}%' ");
//}
if (!string.IsNullOrEmpty(Direction)) if (!string.IsNullOrEmpty(Direction))
{ {
sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}%' "); sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}%' ");
} }
if (!string.IsNullOrEmpty(SHIFTCODE)) if (!string.IsNullOrEmpty(SHIFTCODE))
{ {
@ -401,7 +405,102 @@ namespace QMAPP.FJC.DAL.TianJin
break; break;
} }
} }
sql.AppendFormat(" ORDER BY W.[UPDATEDATE],W.[PRI],W.[PLAN_DATE],W.[ORDERPLAN_NO],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] "); sql.AppendFormat(" ORDER BY W.[PRI],W.[PLAN_DATE],W.[ORDERPLAN_NO],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] ");
List<DataParameter> parameters = new List<DataParameter>();
parameters.Add(new DataParameter("routecode", routecode));
using (var session = AppDataFactory.CreateMainSession())
{
return session.GetList<WorkOrder>(sql.ToString(), parameters.ToArray()).ToList();
}
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取指定工序的生产计划清单
/// </summary>
/// <param name="workcellcode">工序编码</param>
/// <param name="count">数量</param>
/// <param name="filter">过滤选项:0全部;1隐藏挂起;2只看挂起</param>
/// <returns></returns>
public List<WorkOrder> GetOrderUnPrintedR(string routecode, string Direction, string SHIFTCODE, string BeginTime, string EndTime, int filter = 0, int count = 20)
{
try
{
StringBuilder sql = new StringBuilder();
sql.AppendFormat("SELECT TOP {0} W.[PID]\r\n", count);
sql.AppendFormat(" ,W.[ORDERPLANID] ");
sql.AppendFormat(" ,W.[ORDERPLAN_NO] ");
sql.AppendFormat(" ,W.[ORDER_TYPE] ");
sql.AppendFormat(" ,W.[SEQ] ");
sql.AppendFormat(" ,W.[MATERIAL_CODE] ");
sql.AppendFormat(" ,M.[MATERIAL_NAME] ");
sql.AppendFormat(" ,W.[PBOM_CODE] ");
sql.AppendFormat(" ,W.[QTY] ");
sql.AppendFormat(" ,W.[COMPLETE_QTY] ");
sql.AppendFormat(" ,W.[PLAN_DATE] ");
sql.AppendFormat(" ,W.[SHIFT_CODE] ");
sql.AppendFormat(" ,W.[WORKCENTER_CODE] ");
sql.AppendFormat(" ,W.[WORKCENTER_NAME] ");
sql.AppendFormat(" ,W.[WORKCELL_CODE] ");
sql.AppendFormat(" ,W.[WORKCELL_NAME] ");
sql.AppendFormat(" ,W.[WORKLOC_CODE] ");
sql.AppendFormat(" ,W.[REMARK] ");
sql.AppendFormat(" ,W.[EQPT_NAME] ");
sql.AppendFormat(" ,W.[EQPT_CODE] ");
sql.AppendFormat(" ,W.[STATE] ");
sql.AppendFormat(" ,W.[MOULD_CODE] ");
sql.AppendFormat(" ,W.[PRI] ");
sql.AppendFormat(" ,W.[UPDATEDATE] ");
sql.AppendFormat(" ,W.[PRINTED] ");
sql.AppendFormat(" ,P.[IGNORE_FISBREAK] ");
sql.AppendFormat(" ,P.[FIS_ASMSETCODE] ");
sql.AppendFormat(" FROM [T_PP_WORKORDER] AS W WITH(NOLOCK) ");
sql.AppendFormat(" LEFT JOIN [T_PP_ORDERPLAN] AS P WITH(NOLOCK) ");
sql.AppendFormat(" ON P.[PID]=W.[ORDERPLANID] ");
sql.AppendFormat(" LEFT JOIN [T_MD_MATERIAL] AS M WITH(NOLOCK) ");
sql.AppendFormat(" ON W.[MATERIAL_CODE]=M.[MATERIAL_CODE] ");
sql.AppendFormat(" WHERE P.[ROUTE_CODE]=@routecode ");
sql.AppendFormat(" AND W.[PRINTED]='0' ");
//if (!string.IsNullOrEmpty(Direction))
//{
// sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}%' ");
//}
if (!string.IsNullOrEmpty(Direction))
{
sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}后%' ");
}
if (!string.IsNullOrEmpty(SHIFTCODE))
{
sql.AppendFormat($" AND W.[SHIFT_CODE] = '{SHIFTCODE}' ");
}
if (BeginTime != DateTime.MinValue.ToString())
{
sql.AppendFormat($" AND W.[PLAN_DATE] >= '{Convert.ToDateTime(BeginTime).ToString("yyyy-MM-dd")} 00:00:00' ");
}
if (EndTime != DateTime.MinValue.ToString())
{
sql.AppendFormat($" AND W.[PLAN_DATE] <= '{Convert.ToDateTime(EndTime).ToString("yyyy-MM-dd")} 23:59:59' ");
}
switch (filter)
{
case 1:
{
sql.AppendFormat(" AND W.[STATE]<>4 ");
break;
}
case 2:
{
sql.AppendFormat(" AND W.[STATE]=4 ");
break;
}
}
sql.AppendFormat(" ORDER BY W.[PRI],W.[PLAN_DATE],W.[ORDERPLAN_NO],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] ");
List<DataParameter> parameters = new List<DataParameter>(); List<DataParameter> parameters = new List<DataParameter>();
parameters.Add(new DataParameter("routecode", routecode)); parameters.Add(new DataParameter("routecode", routecode));
using (var session = AppDataFactory.CreateMainSession()) using (var session = AppDataFactory.CreateMainSession())
@ -415,6 +514,7 @@ namespace QMAPP.FJC.DAL.TianJin
} }
} }
/// <summary> /// <summary>
/// 获取指定工序的生产计划清单---018D前门 /// 获取指定工序的生产计划清单---018D前门
/// </summary> /// </summary>

9
APPQ5/QMAPP.WinForm/App.config

@ -2,18 +2,21 @@
<configuration> <configuration>
<connectionStrings> <connectionStrings>
<!--主数据库连接--> <!--主数据库连接-->
<!--
<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<!--
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>
<add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES_20230930;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES_20230930;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.99;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindbBZD" connectionString="Data Source=10.111.144.99;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
--> -->
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>
<!-- <!--
<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>

43
APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs

@ -146,8 +146,33 @@ namespace QMAPP.WinForm.Forms.TianJin
} }
else else
{ {
//770B
var count = Convert.ToInt32(cbListRowcount.Text) / 2;
var orderlist = new List<FJC.Entity.ProductionPlan.WorkOrder>();
var orderlistF = _agent.InvokeServiceFunction<List<FJC.Entity.ProductionPlan.WorkOrder>>("TJWorkOrderBLL_GetOrderUnPrintedF", cbRoutes.SelectedValue.ToString(), cbPlanFilter.SelectedIndex, dataPage, comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), this.dtpCREATEDATESTART.Value.ToString(), this.dtpCREATEDATEEND.Value.ToString());
var orderlistR = _agent.InvokeServiceFunction<List<FJC.Entity.ProductionPlan.WorkOrder>>("TJWorkOrderBLL_GetOrderUnPrintedR", cbRoutes.SelectedValue.ToString(), cbPlanFilter.SelectedIndex, dataPage, comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), this.dtpCREATEDATESTART.Value.ToString(), this.dtpCREATEDATEEND.Value.ToString());
for (var i = 0; i < count; i++)
{
if (string.IsNullOrEmpty(FR) || FR == "前")
{
if (i < orderlistF.Count)
orderlist.Add(orderlistF[i]);
if (i < orderlistR.Count)
orderlist.Add(orderlistR[i]);
}
else if (FR == "后")
{
if (i < orderlistR.Count)
orderlist.Add(orderlistR[i]);
if (i < orderlistF.Count)
orderlist.Add(orderlistF[i]);
}
}
this.dgvPlan.DataSource = orderlist;
#region 服务查询 #region 服务查询
var orderlist = _agent.InvokeServiceFunction<List<FJC.Entity.ProductionPlan.WorkOrder>>("TJWorkOrderBLL_GetOrderUnPrinted", cbRoutes.SelectedValue.ToString(), cbPlanFilter.SelectedIndex, dataPage, comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), this.dtpCREATEDATESTART.Value.ToString(), this.dtpCREATEDATEEND.Value.ToString()); //var orderlist = _agent.InvokeServiceFunction<List<FJC.Entity.ProductionPlan.WorkOrder>>("TJWorkOrderBLL_GetOrderUnPrintedF", cbRoutes.SelectedValue.ToString(), cbPlanFilter.SelectedIndex, dataPage, comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), this.dtpCREATEDATESTART.Value.ToString(), this.dtpCREATEDATEEND.Value.ToString());
#endregion #endregion
this.dgvPlan.DataSource = orderlist; this.dgvPlan.DataSource = orderlist;
} }
@ -538,23 +563,23 @@ namespace QMAPP.WinForm.Forms.TianJin
} }
labels.Add(labeldata); labels.Add(labeldata);
WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始打印" + labeldata.OrderNo); //WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始打印" + labeldata.OrderNo);
PrintLabel(labels); PrintLabel(labels);
WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始变成打印状态" + labeldata.OrderNo); //WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始变成打印状态" + labeldata.OrderNo);
//变更打印状态 0=>1 //变更打印状态 0=>1
_agent.InvokeServiceFunction<int>("WorkOrderBLL_SetOrderPrinted", orders[0].PID); _agent.InvokeServiceFunction<int>("WorkOrderBLL_SetOrderPrinted", orders[0].PID);
WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始插入记录" + labeldata.OrderNo); //WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始插入记录" + labeldata.OrderNo);
InsertProduct(labeldata.OrderNo, orders[0].MATERIAL_CODE, comboBox1.SelectedValue.ToString()); InsertProduct(labeldata.OrderNo, orders[0].MATERIAL_CODE, comboBox1.SelectedValue.ToString());
WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 插入结束" + labeldata.OrderNo); //WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 插入结束" + labeldata.OrderNo);
if ((orders[0].MATERIAL_CODE.Contains("018D") || orders[0].MATERIAL_CODE.Contains("278D")) && orders[0].MATERIAL_NAME.Contains("前")) if (orders[0].MATERIAL_NAME.Contains("前"))
FR = "后"; FR = "后";
else if ((orders[0].MATERIAL_CODE.Contains("018D") || orders[0].MATERIAL_CODE.Contains("278D")) && orders[0].MATERIAL_NAME.Contains("后")) else if (orders[0].MATERIAL_NAME.Contains("后"))
FR = "前"; FR = "前";
BindPlanView(); BindPlanView();
tsbPrint.Enabled = true; tsbPrint.Enabled = true;
@ -739,9 +764,9 @@ namespace QMAPP.WinForm.Forms.TianJin
//WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始插入记录" + labeldata.OrderNo); //WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 开始插入记录" + labeldata.OrderNo);
InsertProduct(labeldata.OrderNo, orders[0].MATERIAL_CODE, comboBox1.SelectedValue.ToString()); InsertProduct(labeldata.OrderNo, orders[0].MATERIAL_CODE, comboBox1.SelectedValue.ToString());
if ((orders[0].MATERIAL_CODE.Contains("018D") || orders[0].MATERIAL_CODE.Contains("278D")) && orders[0].MATERIAL_NAME.Contains("前")) if (orders[0].MATERIAL_NAME.Contains("前"))
FR = "后"; FR = "后";
else if ((orders[0].MATERIAL_CODE.Contains("018D") || orders[0].MATERIAL_CODE.Contains("278D")) && orders[0].MATERIAL_NAME.Contains("后")) else if (orders[0].MATERIAL_NAME.Contains("后"))
FR = "前"; FR = "前";
//WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 插入结束" + labeldata.OrderNo); //WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 插入结束" + labeldata.OrderNo);
} }

4
APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: // 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2023.10.21.01")] [assembly: AssemblyVersion("2023.12.23.01")]
[assembly: AssemblyFileVersion("2023.10.21.01")] [assembly: AssemblyFileVersion("2023.12.23.01")]

11
ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

@ -63,10 +63,10 @@
<connectionStrings> <connectionStrings>
<!--主数据库连接--> <!--主数据库连接-->
<!--
<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<!--
<add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES_20230930;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES_20230930;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
@ -77,15 +77,12 @@
<add name="maindbNCSYBB" connectionString="Data Source=10.111.144.72;Initial Catalog=scCFAACDYBDY;User Id=mesreaderdcs;Password=mesreaderdcs;" providerName="System.Data.SqlClient"/>--> <add name="maindbNCSYBB" connectionString="Data Source=10.111.144.72;Initial Catalog=scCFAACDYBDY;User Id=mesreaderdcs;Password=mesreaderdcs;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES;User Id=CDMESADM;Password=CDmes123;max pool size=10240;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES;User Id=CDMESADM;Password=CDmes123;max pool size=10240;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />-->
<!--
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>
<!--
<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>
--> -->
<!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>-->

Loading…
Cancel
Save