2022-11-23 焊接导入修改
This commit is contained in:
parent
0759a36121
commit
7994db8452
Binary file not shown.
|
|
@ -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)
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
namespace BLL
|
||||
{
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
public static class MaterialCodeLibService
|
||||
{
|
||||
|
|
@ -12,7 +13,11 @@
|
|||
{
|
||||
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>
|
||||
|
|
@ -34,7 +39,12 @@
|
|||
db.HJGL_MaterialCodeLib.InsertOnSubmit(newCodeLib);
|
||||
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>
|
||||
|
|
|
|||
|
|
@ -60,7 +60,11 @@ namespace BLL
|
|||
list[1] = new ListItem("现场安装", PipeArea_FIELD);
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void RestPipelineAndJoints(string projectid )
|
||||
{
|
||||
PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(projectid);
|
||||
WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(projectid);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据管线ID获取管线信息
|
||||
/// </summary>
|
||||
|
|
@ -71,11 +75,7 @@ namespace BLL
|
|||
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == 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 PlanStartDate = mdoel.PlanStartDate;
|
||||
var PlanEndDate = mdoel.PlanEndDate;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -154,8 +155,18 @@ namespace FineUIPro.Web.HJGL.BaseInfo
|
|||
//item.ProjectId = CurrUser.LoginProjectId;
|
||||
//= SQLHelper.GetNewID(typeof(Model.Editor_CostReport));
|
||||
if (!codeLib.Select(x => x.MaterialCode).Contains(item.MaterialCode))
|
||||
{
|
||||
|
||||
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,36 +108,8 @@ 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
|
||||
{
|
||||
//打开连接
|
||||
//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 += "Data Source=";
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue