Compare commits

...

4 Commits

Author SHA1 Message Date
佘春生 22fa88f0b5 11 2024-07-03 17:12:32 +08:00
佘春生 32d04f78d9 11 2024-07-03 11:17:42 +08:00
佘春生 3b3f1934f2 Merge branch 'master' of http://47.104.102.122:3000/shecs/Basf_TCC11 2024-07-02 17:14:02 +08:00
佘春生 efdccd2a2a 11 2024-07-02 10:44:30 +08:00
10 changed files with 193 additions and 88 deletions

View File

@ -14,6 +14,7 @@
using System.Data;
using System.Data.SqlClient;
using BLL;
using FineUIPro.Web.WeldingProcess.WeldingManage;
public class Global : System.Web.HttpApplication
{
@ -44,11 +45,146 @@
AppDomain.Unload(AppDomain.CurrentDomain);
}
// 开启超焊信息提取
System.Threading.Thread LoadServiceSuperQue = new System.Threading.Thread(new System.Threading.ThreadStart(SuperQueWelding));
LoadServiceSuperQue.Start();
// 开启线程
System.Threading.Thread LoadServiceData = new System.Threading.Thread(new System.Threading.ThreadStart(ExpirePoint));
LoadServiceData.Start();
}
private void SuperQueWelding()
{
//定义一个定时器,并开启和配置相关属性
System.Timers.Timer ExpirePoint = new System.Timers.Timer();
//执行任务的周期 ,3小时
ExpirePoint.Interval = 1000 * 60 * 60 * 3;
ExpirePoint.Enabled = true;
ExpirePoint.Start();
ExpirePoint.Elapsed += new System.Timers.ElapsedEventHandler(SuperQueWelding_Elapsed);
}
void SuperQueWelding_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
var jotList = (from x in Funs.DB.Pipeline_WeldJoint where x.WeldingDailyId != null && x.WeldingMethodId != null select x).ToList();
foreach (var jot in jotList)
{
var wps = BLL.WPQListServiceService.GetWPQById(jot.WPQId);
string floorWelder = jot.BackingWelderId;
string cellWelder = jot.CoverWelderId;
bool canWPS = true;
if (wps != null)
{
// 验证焊工WPS资质
if (floorWelder == cellWelder)
{
if (!wps.WelderIds.Contains(floorWelder))
{
canWPS = false;
}
}
else
{
if (!wps.WelderIds.Contains(floorWelder))
{
canWPS = false;
}
if (!wps.WelderIds.Contains(cellWelder))
{
canWPS = false;
}
}
}
// 验证焊工合格项目资质
bool canSave = false;
var joty = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId);
var mat = BLL.Base_WeldingMethodService.GetWeldingMethodByWeldingMethodId(jot.WeldingMethodId);
var loc = BLL.Base_WeldingLocationServie.GetWeldingLocationById(jot.WeldingLocationId);
string weldTypeGroup = joty.Flag;
string weldTypeCode = joty.WeldTypeCode;
decimal? dia = jot.Dia;
decimal? sch = jot.Thickness;
string[] wmeCodes = mat.WeldingMethodCode.Split('+');
string location = string.Empty;
if (loc != null)
{
location = loc.WeldingLocationCode;
}
string ste = jot.Material1Id;
List<Model.Welder_WelderQualify> floorWelderQualifys = (from x in Funs.DB.Welder_WelderQualify
where x.WelderId == floorWelder && x.WeldingMethodId != null
&& x.WeldingLocationId != null && x.MaterialType != null
&& x.WeldType != null
&& x.ThicknessMax != null && x.SizesMin != null
select x).ToList();
List<Model.Welder_WelderQualify> cellWelderQualifys = (from x in Funs.DB.Welder_WelderQualify
where x.WelderId == cellWelder && x.WeldingMethodId != null
&& x.WeldingLocationId != null && x.MaterialType != null
&& x.WeldType != null
&& x.ThicknessMax != null && x.SizesMin != null
select x).ToList();
// 打底和盖面同一焊工
if (floorWelder == cellWelder)
{
if (floorWelderQualifys != null && floorWelderQualifys.Count() > 0)
{
if (wmeCodes.Count() <= 1) // 一种焊接方法
{
canSave = BLL.WelderQualifiedService.IsOK(floorWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
}
else // 大于一种焊接方法,如氩电联焊
{
canSave = BLL.WelderQualifiedService.TwoWmeIsOK(floorWelderQualifys, cellWelderQualifys, wmeCodes[0], wmeCodes[1], location, weldTypeGroup, ste, dia, sch);
}
}
}
// 打底和盖面焊工不同
else
{
bool isok1 = false;
bool isok2 = false;
if (wmeCodes.Count() <= 1) // 一种焊接方法
{
if (floorWelderQualifys != null && floorWelderQualifys.Count() > 0)
{
isok1 = BLL.WelderQualifiedService.IsOK(floorWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
}
if (cellWelderQualifys != null && cellWelderQualifys.Count() > 0)
{
isok2 = BLL.WelderQualifiedService.IsOK(cellWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
}
if (isok1 && isok2)
{
canSave = true;
}
}
else
{
canSave = BLL.WelderQualifiedService.TwoWmeIsOK(floorWelderQualifys, cellWelderQualifys, wmeCodes[0], wmeCodes[1], location, weldTypeGroup, ste, dia, sch);
}
}
if (canWPS == false || canSave == false)
{
jot.IsSuperQueWelding = true;
}
else
{
jot.IsSuperQueWelding = null;
}
}
Funs.DB.SubmitChanges();
}
private void ExpirePoint()
{
//定义一个定时器,并开启和配置相关属性

View File

@ -492,8 +492,8 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
ws.SetColumnWidth(7, 5 * 256);
ws.SetColumnWidth(8, 5 * 256);
ws.SetColumnWidth(9, 5 * 256);
ws.SetColumnWidth(10, 8 * 256);
ws.SetColumnWidth(11, 11 * 256);
ws.SetColumnWidth(10, 4 * 256);
ws.SetColumnWidth(11, 15 * 256);
ws.SetColumnWidth(12, 8 * 256);
#endregion
@ -629,8 +629,8 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 8, 10);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 8).GetCell(11).SetCellValue("检件规格");
ws.GetRow(rowIndex + 8).GetCell(8).SetCellValue("检件材质");
ws.GetRow(rowIndex + 8).GetCell(8).SetCellValue("焊口规格");
ws.GetRow(rowIndex + 8).GetCell(11).SetCellValue("焊口材质");
ws.GetRow(rowIndex + 8).GetCell(12).SetCellValue("备注");
@ -680,11 +680,11 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
//焊口号
ws.GetRow(dataIndex).GetCell(4).SetCellValue(pageTb.Rows[j]["WeldJointCode"].ToString());
//焊工代号
// 焊工代号
ws.GetRow(dataIndex).GetCell(6).SetCellValue(pageTb.Rows[j]["WelderCode"].ToString());
//检件材质
// 检件规格(mm)
ws.GetRow(dataIndex).GetCell(8).SetCellValue(pageTb.Rows[j]["Specification"].ToString());
//检件规格(mm)
// 检件材质
ws.GetRow(dataIndex).GetCell(11).SetCellValue(pageTb.Rows[j]["MaterialCode"].ToString());
//备注
ws.GetRow(dataIndex).GetCell(12).SetCellValue(pageTb.Rows[j]["Remark"].ToString());

View File

@ -1026,7 +1026,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
{
List<string> weldMot = new List<string>();
List<string> grooveType = new List<string>();
List<bool> IsFist = new List<bool>();
//List<bool> IsFist = new List<bool>();
string error = string.Empty;
foreach (string pointItemId in selectRow)
@ -1035,7 +1035,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(pointItem.WeldJointId);
weldMot.Add(jot.WeldingMethodId);
grooveType.Add(jot.GrooveTypeId);
IsFist.Add(pointItem.IsWelderFirst == true ? true : false);
//IsFist.Add(pointItem.IsWelderFirst == true ? true : false);
}
if (weldMot.Distinct().Count() > 1)
@ -1046,10 +1046,10 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
{
error = error + "勾选的焊口坡口类型不一至,";
}
if (IsFist.Distinct().Count() > 1)
{
error = error + "勾选的焊口是否首三不一至,";
}
//if (IsFist.Distinct().Count() > 1)
//{
// error = error + "勾选的焊口是否首三不一至,";
//}
if (error == string.Empty)
{
@ -1076,7 +1076,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
newBatchTrust.WorkAreaId = iso.WorkAreaId;
newBatchTrust.WeldingMethodId = weldMot[0];
newBatchTrust.GrooveTypeId = grooveType[0];
newBatchTrust.IsWelderFirst = IsFist[0];
//newBatchTrust.IsWelderFirst = IsFist[0];
newBatchTrust.DetectionTypeId = point.DetectionTypeId;
newBatchTrust.PipelineId = point.PipelineId;
@ -1182,7 +1182,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
newBatchTrust.WorkAreaId = trust.WorkAreaId;
newBatchTrust.WeldingMethodId = trust.WeldingMethodId;
newBatchTrust.GrooveTypeId = trust.GrooveTypeId;
newBatchTrust.IsWelderFirst = Convert.ToBoolean(trust.IsWelderFirst);
//newBatchTrust.IsWelderFirst = Convert.ToBoolean(trust.IsWelderFirst);
newBatchTrust.DetectionTypeId = trust.DetectionTypeId;
newBatchTrust.PipelineId = trust.PipelineId;
@ -1193,7 +1193,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
where x.ProjectId == trust.ProjectId && x.InstallationId == trust.InstallationId
&& x.WorkAreaId == trust.WorkAreaId && x.UnitId == trust.UnitId
&& x.WeldingMethodId==trust.WeldingMethodId && x.GrooveTypeId==trust.GrooveTypeId
&& x.IsWelderFirst==trust.IsWelderFirst && x.DetectionTypeId == trust.DetectionTypeId
&& x.DetectionTypeId == trust.DetectionTypeId
&& x.PipelineId == trust.PipelineId
select x;
string toPointBatch = string.Empty;

View File

@ -276,10 +276,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
{
result += "焊口已委托" + "|";
}
else
{
t.IsWelderFirst = pointBatchItem.IsWelderFirst;
}
}
if (!string.IsNullOrEmpty(col6))
@ -484,7 +481,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
t.DetectionTypeId = nde.DetectionTypeId;
var pointBatchItem = trustIn.FirstOrDefault(x => x.WorkAreaId == workArea.WorkAreaId && x.PipelineId == pipe.PipelineId && x.WeldJointId == jot.WeldJointId && x.DetectionTypeId == nde.DetectionTypeId);
t.IsWelderFirst = pointBatchItem.IsWelderFirst;
//t.IsWelderFirst = pointBatchItem.IsWelderFirst;
t.AcceptStandard = pointBatchItem.PointBatchItemId; // 作为点口明细ID
t.TopointBatch = pointBatchItem.PointBatchId;
@ -530,7 +527,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
newBatchTrust.WorkAreaId = t.First().WorkAreaId;
newBatchTrust.WeldingMethodId = t.First().WeldingMethodId;
newBatchTrust.GrooveTypeId = t.First().GrooveTypeId;
newBatchTrust.IsWelderFirst = t.First().IsWelderFirst;
//newBatchTrust.IsWelderFirst = t.First().IsWelderFirst;
newBatchTrust.DetectionTypeId = t.First().DetectionTypeId;
newBatchTrust.PipelineId = t.First().PipelineId;
newBatchTrust.TopointBatch = t.First().TopointBatch;

View File

@ -1714,8 +1714,8 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
ws.SetColumnWidth(7, 5 * 256);
ws.SetColumnWidth(8, 5 * 256);
ws.SetColumnWidth(9, 5 * 256);
ws.SetColumnWidth(10, 8 * 256);
ws.SetColumnWidth(11, 11 * 256);
ws.SetColumnWidth(10, 4 * 256);
ws.SetColumnWidth(11, 15 * 256);
ws.SetColumnWidth(12, 8 * 256);
#endregion
@ -1853,8 +1853,8 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 8, 10);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 8).GetCell(11).SetCellValue("检件规格");
ws.GetRow(rowIndex + 8).GetCell(8).SetCellValue("检件材质");
ws.GetRow(rowIndex + 8).GetCell(8).SetCellValue("焊口规格");
ws.GetRow(rowIndex + 8).GetCell(11).SetCellValue("焊口材质");
ws.GetRow(rowIndex + 8).GetCell(12).SetCellValue("备注");
#endregion

View File

@ -24,6 +24,9 @@
<Items>
<f:TextBox ID="txtCoode" runat="server" Label="物料码"
EmptyText="<%$ Resources:Lan,EnterQueryConditions %>" Width="250px" LabelWidth="120px" LabelAlign="Right">
</f:TextBox>
<f:TextBox ID="txtHeartNo" runat="server" Label="炉批号"
EmptyText="<%$ Resources:Lan,EnterQueryConditions %>" Width="250px" LabelWidth="120px" LabelAlign="Right">
</f:TextBox>
<f:Button ID="btnQuery" ToolTip="<%$ Resources:Lan,Inquiry %>" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnQuery_Click" runat="server">

View File

@ -55,6 +55,12 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
listStr.Add(new SqlParameter("@Coode", "%" + this.txtCoode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtHeartNo.Text.Trim()))
{
strSql += " AND HeartNo LIKE @HeartNo";
listStr.Add(new SqlParameter("@HeartNo", "%" + this.txtHeartNo.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@ -368,12 +374,20 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
coodeList.Add(d);
}
var coodeGroup = coodeList.GroupBy(x => new { x.Coode, x.HeartNo }).Select(g => new { Coode = g.Key.Coode, HeartNo = g.Key.HeartNo });
if (coodeList.Count() != coodeGroup.Count())
var coodeGroup = coodeList.GroupBy(x => new { x.Coode, x.HeartNo }).Select(g => new { Coode = g.Key.Coode, HeartNo = g.Key.HeartNo }).Distinct();
foreach (var c in coodeGroup)
{
errorInfos += "Coode对应的炉批号有重复";
var coodeNum=from x in coodeList where x.Coode==c.Coode && x.HeartNo==c.HeartNo select x;
if (coodeNum.Count() > 1)
{
errorInfos += "coode码"+c.Coode+"炉批号:"+c.HeartNo+"有重复!";
}
}
//if (coodeList.Count() != coodeGroup.Count())
//{
// errorInfos += "Coode对应的炉批号有重复";
//}
// 数据验证错误,返回
if (!string.IsNullOrEmpty(errorInfos))

View File

@ -68,6 +68,15 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
/// </remarks>
protected global::FineUIPro.TextBox txtCoode;
/// <summary>
/// txtHeartNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtHeartNo;
/// <summary>
/// btnQuery 控件。
/// </summary>

View File

@ -1042,7 +1042,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
var cood = coodeList.FirstOrDefault(x =>x.IsUse==true && x.Coode == d.Coode1 && x.HeartNo == ds.Tables[0].Rows[i]["炉批号1"].ToString());
if (cood == null)
{
errorInfos += "炉批号1:[" + ds.Tables[0].Rows[i]["炉批号1"].ToString() + "]或对应的Coode1不存在;";
errorInfos += "炉批号1:[" + ds.Tables[0].Rows[i]["炉批号1"].ToString() + "]或对应的Coode1:"+d.Coode1+"不存在;";
}
else
{
@ -1059,7 +1059,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
var cood = coodeList.FirstOrDefault(x => x.IsUse == true && x.Coode == d.Coode2 && x.HeartNo == ds.Tables[0].Rows[i]["炉批号2"].ToString());
if (cood == null)
{
errorInfos += "炉批号2:[" + ds.Tables[0].Rows[i]["炉批号2"].ToString() + "]或对应的Coode2不存在;";
errorInfos += "炉批号2:[" + ds.Tables[0].Rows[i]["炉批号2"].ToString() + "]或对应的Coode2:"+ d.Coode2 + "不存在;";
}
else
{

View File

@ -37501,8 +37501,6 @@ namespace Model
private string _GrooveTypeId;
private int _IsWelderFirst;
public View_GenerateTrust_FJ()
{
}
@ -37650,22 +37648,6 @@ namespace Model
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsWelderFirst", DbType="Int NOT NULL")]
public int IsWelderFirst
{
get
{
return this._IsWelderFirst;
}
set
{
if ((this._IsWelderFirst != value))
{
this._IsWelderFirst = value;
}
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_GenerateTrustItem")]
@ -37841,8 +37823,6 @@ namespace Model
private string _GrooveTypeId;
private int _IsWelderFirst;
private System.Nullable<int> _DetectionRateValue;
private string _PointBatchItemId;
@ -37985,22 +37965,6 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsWelderFirst", DbType="Int NOT NULL")]
public int IsWelderFirst
{
get
{
return this._IsWelderFirst;
}
set
{
if ((this._IsWelderFirst != value))
{
this._IsWelderFirst = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DetectionRateValue", DbType="Int")]
public System.Nullable<int> DetectionRateValue
{
@ -43368,8 +43332,6 @@ namespace Model
private string _DetectionTypeCode;
private System.Nullable<bool> _IsWelderFirst;
private string _TrustBatchItemId;
public View_TrustBathcIn()
@ -43584,22 +43546,6 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsWelderFirst", DbType="Bit")]
public System.Nullable<bool> IsWelderFirst
{
get
{
return this._IsWelderFirst;
}
set
{
if ((this._IsWelderFirst != value))
{
this._IsWelderFirst = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TrustBatchItemId", DbType="NVarChar(50)")]
public string TrustBatchItemId
{