2022-11-23 焊接导入修改

This commit is contained in:
2022-11-23 15:38:28 +08:00
parent 0759a36121
commit 7994db8452
11 changed files with 84 additions and 51 deletions
@@ -85,7 +85,8 @@ namespace FineUIPro.Web.HJGL.BaseInfo
string message = string.Empty;
errorInfos = string.Empty;
List<HJGL_MaterialCodeLib> codeLib = new List<HJGL_MaterialCodeLib>();
List<HJGL_MaterialCodeLib> codeLib_update = new List<HJGL_MaterialCodeLib>();
var materialcodelist =MaterialCodeLibService.GetMaterialCodeLibList();
if (this.fuAttachUrl.HasFile == false)
{
ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning);
@@ -155,7 +156,17 @@ namespace FineUIPro.Web.HJGL.BaseInfo
//= SQLHelper.GetNewID(typeof(Model.Editor_CostReport));
if (!codeLib.Select(x => x.MaterialCode).Contains(item.MaterialCode))
{
codeLib.Add(item);
if (materialcodelist.Select(x => x.MaterialCode).Contains(item.MaterialCode))
{
codeLib_update.Add(item);
}
else
{
codeLib.Add(item);
}
}
#endregion
@@ -173,8 +184,41 @@ namespace FineUIPro.Web.HJGL.BaseInfo
Alert.ShowInTop(errorInfos, MessageBoxIcon.Warning);
return;
}
codeLib = (from x in codeLib
select new HJGL_MaterialCodeLib
{
MaterialCode=x.MaterialCode,
MaterialDef=x.MaterialDef,
MaterialSpec=x.MaterialSpec,
MaterialUnit=x.MaterialUnit,
MaterialName=x.MaterialName,
foreach (var item in codeLib)
}).DistinctBy(temp=> new
{
temp.MaterialCode,
temp.MaterialDef,
temp.MaterialSpec,
temp.MaterialUnit,
temp.MaterialName
}).ToList();
codeLib_update = (from x in codeLib_update
select new HJGL_MaterialCodeLib
{
MaterialCode = x.MaterialCode,
MaterialDef = x.MaterialDef,
MaterialSpec = x.MaterialSpec,
MaterialUnit = x.MaterialUnit,
MaterialName = x.MaterialName,
}).DistinctBy(temp => new
{
temp.MaterialCode,
temp.MaterialDef,
temp.MaterialSpec,
temp.MaterialUnit,
temp.MaterialName
}).ToList();
foreach (var item in codeLib_update)
{
var mewCostReport = BLL.MaterialCodeLibService.GetMaterialCodeLib(item.MaterialCode);
if (mewCostReport == null)
@@ -186,7 +230,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
BLL.MaterialCodeLibService.UpdateMaterialCodeLib(item);
}
}
MaterialCodeLibService.AddBulkMaterialCodeLib(codeLib);
ShowNotify("数据导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
@@ -174,14 +174,14 @@ namespace FineUIPro.Web.HJGL.DataImport
e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程")
{
var pipeline = (from x in Funs.DB.HJGL_Pipeline
var pipeline = (from x in PipelineService.hJGL_Pipelines
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
orderby x.PipelineCode
select x).ToList();
foreach (var item in pipeline)
{
var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count();
var jotCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count();
//var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count();
TreeNode newNode = new TreeNode();
//if (jotCount > weldJotCount)
@@ -185,7 +185,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </summary>
private void BindGrid()
{
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
Model.HJGL_Pipeline view_HJGL_Pipeline = new Model.HJGL_Pipeline();
view_HJGL_Pipeline.ProjectId = this.CurrUser.LoginProjectId;
view_HJGL_Pipeline.UnitWorkId = this.tvControlItem.SelectedNodeID;
@@ -70,7 +70,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
return;
}
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls")
if (IsXls != ".xlsx")
{
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
return;
@@ -108,37 +108,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
//支持.xls和.xlsx,即包括office2010等版本的 HDR=Yes代表第一行是标题,不是数据;
//string cmdText = "Provider=Microsoft.ACE.OLEDB.4.0;Data Source={0};Extended Properties='Excel 8.0; HDR=Yes; IMEX=1'";
////建立连接
//OleDbConnection conn = new OleDbConnection(string.Format(cmdText, fileName));
try
try
{
//打开连接
//if (conn.State == ConnectionState.Broken || conn.State == ConnectionState.Closed)
//{
// conn.Open();
//}
//OleDbDataAdapter oleAdMaster = null;
//DataTable m_tableName = new DataTable();
//DataSet ds = new DataSet();
//m_tableName = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
//if (m_tableName != null && m_tableName.Rows.Count > 0)
//{
// m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
//}
//string sqlMaster;
//sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
//oleAdMaster = new OleDbDataAdapter(sqlMaster, conn);
//oleAdMaster.Fill(ds, "m_tableName");
//oleAdMaster.Dispose();
//conn.Close();
//conn.Dispose();
string oleDBConnString = String.Empty;
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
@@ -1381,8 +1381,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
ShowNotify("导入成功!", MessageBoxIcon.Success);
PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(this.CurrUser.LoginProjectId);
WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId);
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
@@ -1684,6 +1684,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, version, DataClassification);
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
ShowNotify("恢复成功!");
@@ -8,8 +8,8 @@ namespace FineUIPro.Web
{
ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId) + "item/IPE%7CVPD%7CArea-15A";
PipelineService.hJGL_Pipelines= PipelineService.GetPipelinesByProjectId(this.CurrUser.LoginProjectId);
WeldJointService.hJGL_WeldJoints=WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId);
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
}
}
}
+1 -1
View File
@@ -665,7 +665,7 @@
// updateLocationHash: 切换Tab时,是否更新地址栏Hash值
// refreshWhenExist: 添加选项卡时,如果选项卡已经存在,是否刷新内部IFrame
// refreshWhenTabChange: 切换选项卡时,是否刷新内部IFrame
//F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false);
F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false);
//var themeTitle = F.cookie('Theme_Pro_Title');
//var themeName = F.cookie('Theme_Pro');
//if (themeTitle) {