Browse Source

调整时间验证

master
songnan.zhang 2 years ago
parent
commit
97f912989d
  1. 45
      APPQ5/QMAPP.FJC.Entity/CheckTime/ProductTime.cs
  2. 10
      APPQ5/QMAPP.FJC.TRACING/DataValidators/TimeValidator.cs
  3. 7
      APPQ5/QMAPP.FJC.Web/Controllers/ProductTimeController.cs
  4. 4
      APPQ5/QMAPP.FJC.Web/Models/CheckTime/ProductTimeModel.cs
  5. 2
      APPQ5/QMAPP.FJC.Web/Views/ProductTime/ProductTimeEdit.aspx
  6. 4
      APPQ5/QMAPP.FJC.Web/Views/ProductTime/ProductTimeList.aspx
  7. 4
      APPQ5/QMAPP.FJC.Web/Web.config
  8. 6
      APPQ5/QMAPP.WinForm/App.config
  9. 3
      APPQ5/QMAPP.WinForm/MainForm.cs
  10. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs
  11. 4
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

45
APPQ5/QMAPP.FJC.Entity/CheckTime/ProductTime.cs

@ -5,89 +5,128 @@ using System.Data;
namespace QMAPP.FJC.Entity.CheckTime
{
public class ProductTime
/// <summary>
/// 模块名称:工位时间验证
/// 作 者:张松男
/// 编写日期:2022年06月23日
/// </summary>
[DBTable(TableName = "T_MD_PRODUCT_TIMECHECK")]
public class ProductTime : BaseEntity
{
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)]
public string PID { get; set; }
/// <summary>
/// 当前工位编号
/// </summary>
[DBColumn(ColumnName = "CWorkLoc_Code", DataType = DbType.String)]
public string CWorkLoc_Code { get; set; }
/// <summary>
/// 产品码列名
/// </summary>
[DBColumn(ColumnName = "Product_Column", DataType = DbType.String)]
public string Product_Column { get; set; }
/// <summary>
/// 校验工位编号
/// </summary>
[DBColumn(ColumnName = "PWorkLoc_Code", DataType = DbType.String)]
public string PWorkLoc_Code { get; set; }
/// <summary>
/// 校验工位列名
/// </summary>
[DBColumn(ColumnName = "PWorkLoc_Column", DataType = DbType.String)]
public string PWorkLoc_Column { get; set; }
/// <summary>
/// 是否验证
/// </summary>
[DBColumn(ColumnName = "Check", DataType = DbType.String)]
public string Check { get; set; }
/// <summary>
/// 验证运算符
/// </summary>
[DBColumn(ColumnName = "Operator", DataType = DbType.String)]
public string Operator { get; set; }
/// <summary>
/// 验证类型
/// </summary>
[DBColumn(ColumnName = "Check_Type", DataType = DbType.String)]
public string Check_Type { get; set; }
/// <summary>
/// 验证值
/// </summary>
[DBColumn(ColumnName = "Check_Value", DataType = DbType.String)]
public string Check_Value { get; set; }
/// <summary>
/// 校验表
/// </summary>
[DBColumn(ColumnName = "Check_Table", DataType = DbType.String)]
public string Check_Table { get; set; }
/// <summary>
/// 校验字段
/// </summary>
[DBColumn(ColumnName = "Check_Column", DataType = DbType.String)]
public string Check_Column { get; set; }
/// <summary>
/// 描述
/// </summary>
[DBColumn(ColumnName = "Remark", DataType = DbType.String)]
public string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[DBColumn(ColumnName = "CREATEDATE", DataType = DbType.String)]
public DateTime? CREATEDATE { get; set; }
/// <summary>
/// 创建用户
/// </summary>
[DBColumn(ColumnName = "CREATEUSER", DataType = DbType.String)]
public string CREATEUSER { get; set; }
/// <summary>
/// 更新用户
/// </summary>
[DBColumn(ColumnName = "UPDATEUSER", DataType = DbType.String)]
public string UPDATEUSER { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[DBColumn(ColumnName = "UPDATEDATE", DataType = DbType.String)]
public DateTime? UPDATEDATE { get; set; }
/// <summary>
/// 备用字段1
/// </summary>
[DBColumn(ColumnName = "Column1", DataType = DbType.String)]
public string Column1 { get; set; }
/// <summary>
/// 备用字段2
/// </summary>
[DBColumn(ColumnName = "Column2", DataType = DbType.String)]
public string Column2 { get; set; }
[DBColumn(ColumnName = "PWhere", DataType = DbType.String)]
public string PWhere { get; set; }
/// <summary>
/// 采集点
/// </summary>
[DBColumn(ColumnName = "DAI_Code", DataType = DbType.String)]
public string DAI_Code { get; set; }
[DBColumn(ColumnName = "Check_ValueTo", DataType = DbType.String)]
public string Check_ValueTo { get; set; }
}
}

10
APPQ5/QMAPP.FJC.TRACING/DataValidators/TimeValidator.cs

@ -28,7 +28,15 @@ namespace QMAPP.FJC.TRACING.DataValidators
var ispass = TimeOutCompare(dataRow["CheckColumnValue"].ToString(), timeCheck.Operator, timeCheck.Check_Value, timeCheck.Check_ValueTo, timeCheck.Check_Type);
if (ispass) return new ValidateResult(true, "");
else return new ValidateResult(false, "未达到时间验证标准!");
else
{
var preStatTime = DateTime.Now;
DateTime serviceTime = dal.GetServiceDateTime();
TimeSpan ts = serviceTime.Subtract(preStatTime);
return new ValidateResult(false, $"未达到{timeCheck.Operator}{(Convert.ToDecimal(timeCheck.Check_Value) / 3600).ToString("#0.0")}小时验证标准,当前时间{(Convert.ToDecimal(ts.TotalSeconds) / 3600).ToString("#0.0")}小时");
}
}

7
APPQ5/QMAPP.FJC.Web/Controllers/ProductTimeController.cs

@ -13,6 +13,7 @@ using QMAPP.Entity;
using QMAPP.MD.Entity;
using QMAPP.FJC.Web;
using QMAPP.FJC.Entity.CheckTime;
using QMAPP.FJC.Web.Models.CheckTime;
namespace QMAPP.FJC.Web.Controllers
{
@ -80,6 +81,10 @@ namespace QMAPP.FJC.Web.Controllers
DateGridResult<ProductTime> result = new DateGridResult<ProductTime>();
result.Total = pageResult.Result.RecordCount;
result.Rows = JsonConvertHelper.GetDeserialize<List<ProductTime>>(pageResult.Result.Result.ToString());
foreach (var r in result.Rows)
{
r.Check_Value = (Convert.ToDecimal(r.Check_Value) / 3600).ToString("#0.0");
}
#endregion
string tempstr = "";
@ -113,6 +118,7 @@ namespace QMAPP.FJC.Web.Controllers
//修改获取原数据
Entity.PID = ID;
result = wcfAgent.InvokeServiceFunction<DataResult<ProductTime>>(QMAPP.ServicesAgent.B9BasicService.ProductTimeBLL_Get.ToString(), Entity);
result.Result.Check_Value = (Convert.ToDecimal(result.Result.Check_Value) / 3600).ToString("#0.0");
if (result.IsSuccess == false)
{
SetMessage(result.Msg);
@ -148,6 +154,7 @@ namespace QMAPP.FJC.Web.Controllers
try
{
Entity = CopyToModel<ProductTime, ProductTimeModel>(saveModel);
Entity.Check_Value = (Convert.ToDouble(Entity.Check_Value) * 3600).ToString();
if (string.IsNullOrEmpty(Entity.PID) == true)
{
//新增

4
APPQ5/QMAPP.FJC.Web/Models/CheckTime/ProductTimeModel.cs

@ -6,7 +6,7 @@ using System.Web.Mvc.Html;
using QMFrameWork.WebUI.Attribute;
using QMFrameWork.WebUI;
namespace QMAPP.FJC.Web.Models
namespace QMAPP.FJC.Web.Models.CheckTime
{
/// <summary>
/// 模块名称:工位时间验证
@ -90,7 +90,7 @@ namespace QMAPP.FJC.Web.Models
/// <summary>
/// 验证值
/// </summary>
[Description("验证值")]
[Description("验证值(h)")]
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
[InputType(inputType.text)]
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)]

2
APPQ5/QMAPP.FJC.Web/Views/ProductTime/ProductTimeEdit.aspx

@ -1,5 +1,5 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.MD.Web.Models.AWProductModel>" %>
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.CheckTime.ProductTimeModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
设备信息编辑

4
APPQ5/QMAPP.FJC.Web/Views/ProductTime/ProductTimeList.aspx

@ -1,5 +1,5 @@
 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.ProductTimeModel>" %>
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.CheckTime.ProductTimeModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
工位时间校验列表
</asp:Content>
@ -47,7 +47,7 @@
<%=Html.QPEnd()%>
<%=Html.QPList() %>
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.ProductTimeModel>(Model)%>
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.CheckTime.ProductTimeModel>(Model)%>
<%=Html.QPEnd() %>
<%=Html.Hidden("PID")%>
<%=Html.Hidden("selectKey")%>

4
APPQ5/QMAPP.FJC.Web/Web.config

@ -29,9 +29,9 @@
<!--主数据库连接-->
<!--<add name="maindb" connectionString="Data Source=.;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=qm;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=119.3.213.202.13315;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=ChangkeTec@2020;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=119.3.213.202.13315;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=ChangkeTec@2020;" 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=119.3.213.202,13315;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=ChangkeTec@2020;" providerName="System.Data.SqlClient"/>-->

6
APPQ5/QMAPP.WinForm/App.config

@ -4,13 +4,13 @@
<!--主数据库连接-->
<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="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="maindb" connectionString="Data Source=.;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=.;Initial Catalog=BZD;User Id=sa;Password=Microsoft2008;" 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=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" providerName="System.Data.SqlClient" />

3
APPQ5/QMAPP.WinForm/MainForm.cs

@ -737,7 +737,8 @@ namespace QMAPP.WinForm
loginInfo += ClientContext.produceShift.PRODUCESHIFTNAME + " ";
}
this.toolStripStatusLabel1.Text = loginInfo;
tsslblIps.Text = "本机IP:" + string.Join(",", System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()).Where(p => p.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).Select(p => p.ToString()));
//var sss = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
tsslblIps.Text = "本机IP:" + string.Join(",", System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()).Where(p => p.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).Select(p => p.ToString()))+" 版本:"+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
if (ClientContext.OpcState > 0)
{

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

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

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

@ -68,6 +68,10 @@
<!--<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.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;max pool size=10240;" 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"/>

Loading…
Cancel
Save