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

Binary file not shown.

View File

@ -0,0 +1,6 @@
alter table [dbo].[HJGL_MaterialCodeLib] alter column [MaterialName] nvarchar(300)
alter table [dbo].[HJGL_MaterialCodeLib] alter column MaterialSpec nvarchar(300)
alter table [dbo].[HJGL_MaterialCodeLib] alter column MaterialMade nvarchar(300)
alter table [dbo].[HJGL_MaterialCodeLib] alter column [MaterialDef] nvarchar(3000)
alter table [dbo].[HJGL_MaterialCodeLib] alter column PipeGrade nvarchar(300)
alter table [dbo].[HJGL_MaterialCodeLib] alter column MaterialUnit nvarchar(300)

View File

@ -1,6 +1,7 @@
namespace BLL namespace BLL
{ {
using Model; using Model;
using System.Collections.Generic;
using System.Linq; using System.Linq;
public static class MaterialCodeLibService public static class MaterialCodeLibService
{ {
@ -12,7 +13,11 @@
{ {
return Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(e => e.MaterialCode == materialCode); return Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(e => e.MaterialCode == materialCode);
} }
public static List<Model.HJGL_MaterialCodeLib> GetMaterialCodeLibList()
{
var q = (from x in Funs.DB.HJGL_MaterialCodeLib select x).ToList();
return q;
}
/// <summary> /// <summary>
/// 增加材料库信息 /// 增加材料库信息
/// </summary> /// </summary>
@ -34,7 +39,12 @@
db.HJGL_MaterialCodeLib.InsertOnSubmit(newCodeLib); db.HJGL_MaterialCodeLib.InsertOnSubmit(newCodeLib);
db.SubmitChanges(); db.SubmitChanges();
} }
public static void AddBulkMaterialCodeLib(List<Model.HJGL_MaterialCodeLib> codeLib)
{
Model.SGGLDB db = Funs.DB;
db.HJGL_MaterialCodeLib.InsertAllOnSubmit(codeLib);
db.SubmitChanges();
}
/// <summary> /// <summary>
/// 修改材料库信息 /// 修改材料库信息
/// </summary> /// </summary>

View File

@ -60,7 +60,11 @@ namespace BLL
list[1] = new ListItem("现场安装", PipeArea_FIELD); list[1] = new ListItem("现场安装", PipeArea_FIELD);
return list; return list;
} }
public static void RestPipelineAndJoints(string projectid )
{
PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(projectid);
WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(projectid);
}
/// <summary> /// <summary>
/// 根据管线ID获取管线信息 /// 根据管线ID获取管线信息
/// </summary> /// </summary>
@ -71,11 +75,7 @@ namespace BLL
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId); return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
} }
public static void GetStateByPipelineId(string pipelineId) public static void GetStateByPipelineId(string pipelineId)
{//< f:ListItem Value = "0" Text = "未开始" /> {
// < f:ListItem Value = "1" Text = "未开始且延误" />
// < f:ListItem Value = "2" Text = "开始" />
// < f:ListItem Value = "3" Text = "已开始且延误" />
// < f:ListItem Value = "4" Text = "完成" />
var mdoel = GetPipelineByPipelineId(pipelineId); var mdoel = GetPipelineByPipelineId(pipelineId);
var PlanStartDate = mdoel.PlanStartDate; var PlanStartDate = mdoel.PlanStartDate;
var PlanEndDate = mdoel.PlanEndDate; var PlanEndDate = mdoel.PlanEndDate;

View File

@ -85,7 +85,8 @@ namespace FineUIPro.Web.HJGL.BaseInfo
string message = string.Empty; string message = string.Empty;
errorInfos = string.Empty; errorInfos = string.Empty;
List<HJGL_MaterialCodeLib> codeLib = new List<HJGL_MaterialCodeLib>(); 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) if (this.fuAttachUrl.HasFile == false)
{ {
ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning);
@ -155,7 +156,17 @@ namespace FineUIPro.Web.HJGL.BaseInfo
//= SQLHelper.GetNewID(typeof(Model.Editor_CostReport)); //= SQLHelper.GetNewID(typeof(Model.Editor_CostReport));
if (!codeLib.Select(x => x.MaterialCode).Contains(item.MaterialCode)) 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 #endregion
@ -173,8 +184,41 @@ namespace FineUIPro.Web.HJGL.BaseInfo
Alert.ShowInTop(errorInfos, MessageBoxIcon.Warning); Alert.ShowInTop(errorInfos, MessageBoxIcon.Warning);
return; 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); var mewCostReport = BLL.MaterialCodeLibService.GetMaterialCodeLib(item.MaterialCode);
if (mewCostReport == null) if (mewCostReport == null)
@ -186,7 +230,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
BLL.MaterialCodeLibService.UpdateMaterialCodeLib(item); BLL.MaterialCodeLibService.UpdateMaterialCodeLib(item);
} }
} }
MaterialCodeLibService.AddBulkMaterialCodeLib(codeLib);
ShowNotify("数据导入成功!", MessageBoxIcon.Success); ShowNotify("数据导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());

View File

@ -174,14 +174,14 @@ namespace FineUIPro.Web.HJGL.DataImport
e.Node.Nodes.Clear(); e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程") 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 where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
orderby x.PipelineCode orderby x.PipelineCode
select x).ToList(); select x).ToList();
foreach (var item in pipeline) 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(); //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(); TreeNode newNode = new TreeNode();
//if (jotCount > weldJotCount) //if (jotCount > weldJotCount)

View File

@ -185,7 +185,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </summary> /// </summary>
private void BindGrid() private void BindGrid()
{ {
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
Model.HJGL_Pipeline view_HJGL_Pipeline = new Model.HJGL_Pipeline(); Model.HJGL_Pipeline view_HJGL_Pipeline = new Model.HJGL_Pipeline();
view_HJGL_Pipeline.ProjectId = this.CurrUser.LoginProjectId; view_HJGL_Pipeline.ProjectId = this.CurrUser.LoginProjectId;
view_HJGL_Pipeline.UnitWorkId = this.tvControlItem.SelectedNodeID; view_HJGL_Pipeline.UnitWorkId = this.tvControlItem.SelectedNodeID;

View File

@ -70,7 +70,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
return; return;
} }
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls") if (IsXls != ".xlsx")
{ {
ShowNotify("只可以选择Excel文件", MessageBoxIcon.Warning); ShowNotify("只可以选择Excel文件", MessageBoxIcon.Warning);
return; return;
@ -108,37 +108,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="filename">Excel文件路径名</param> /// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName) private void ImportXlsToData(string fileName)
{ {
//支持.xls和.xlsx即包括office2010等版本的 HDR=Yes代表第一行是标题不是数据 try
//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
{ {
//打开连接 string oleDBConnString = String.Empty;
//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;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source="; oleDBConnString += "Data Source=";
oleDBConnString += fileName; oleDBConnString += fileName;

View File

@ -1381,8 +1381,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
ShowNotify("导入成功!", MessageBoxIcon.Success); ShowNotify("导入成功!", MessageBoxIcon.Success);
PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(this.CurrUser.LoginProjectId); PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
} }
else else
@ -1684,6 +1684,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, version, DataClassification); BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, version, DataClassification);
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
ShowNotify("恢复成功!"); ShowNotify("恢复成功!");

View File

@ -8,8 +8,8 @@ namespace FineUIPro.Web
{ {
ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId); ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId) + "item/IPE%7CVPD%7CArea-15A"; ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId) + "item/IPE%7CVPD%7CArea-15A";
PipelineService.hJGL_Pipelines= PipelineService.GetPipelinesByProjectId(this.CurrUser.LoginProjectId); PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
WeldJointService.hJGL_WeldJoints=WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId);
} }
} }
} }

View File

@ -665,7 +665,7 @@
// updateLocationHash: 切换Tab时是否更新地址栏Hash值 // updateLocationHash: 切换Tab时是否更新地址栏Hash值
// refreshWhenExist 添加选项卡时如果选项卡已经存在是否刷新内部IFrame // refreshWhenExist 添加选项卡时如果选项卡已经存在是否刷新内部IFrame
// refreshWhenTabChange: 切换选项卡时是否刷新内部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 themeTitle = F.cookie('Theme_Pro_Title');
//var themeName = F.cookie('Theme_Pro'); //var themeName = F.cookie('Theme_Pro');
//if (themeTitle) { //if (themeTitle) {