2022-10-12 组件二维码导入修改,三维界面修改。

This commit is contained in:
2022-10-12 18:36:04 +08:00
parent 0e42d35160
commit 6d0290896e
10 changed files with 67 additions and 32 deletions
@@ -169,17 +169,17 @@ namespace FineUIPro.Web.HJGL.PreDesign
Model.HJGL_Pipeline pipeline = new Model.HJGL_Pipeline();
Model.HJGL_Pipeline_Component hJGL_Pipeline_Component = new Model.HJGL_Pipeline_Component();
string pioelinecode = pds.Rows[i]["管线号"].ToString();
string pipelinecode = pds.Rows[i]["管线号"].ToString();
string PipelineComponentCode = pds.Rows[i]["预制组件"].ToString();
string QRCode = pds.Rows[i]["二维码信息"].ToString();
if (string.IsNullOrEmpty(pioelinecode))
if (string.IsNullOrEmpty(pipelinecode))
{
result += "第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|";
}
else
{
pipeline = getPipeline.FirstOrDefault(x => x.PipelineCode == pioelinecode);
pipeline = getPipeline.FirstOrDefault(x => x.PipelineCode == pipelinecode);
if (pipeline == null)
{
result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|";
@@ -194,9 +194,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
else
{
hJGL_Pipeline_Component = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(PipelineComponentCode, pipeline.PipelineId);
if (pipeline == null)
if (hJGL_Pipeline_Component == null)
{
result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件" + "|";
result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件 " + PipelineComponentCode + " |";
continue;
}
@@ -222,32 +222,35 @@ namespace FineUIPro.Web.HJGL.PreDesign
.GroupBy(x => new {
pipelinecode = x.Field<string>("管线号"),
PipelineComponentCode = x.Field<string>("预制组件"),
DrawingName = x.Field<string>("预制图纸名称"),
// DrawingName = x.Field<string>("预制图纸名称"),
})
.Select(x => new
{
pipelinecode = x.Key.pipelinecode,
PipelineComponentCode = x.Key.PipelineComponentCode,
DrawingName = x.Key.DrawingName,
// DrawingName = x.Key.DrawingName,
QRCode = String.Join("&", x.Select(z => z.Field<string>("二维码信息")))
});
foreach (var item in dt)
{
var pipeline = PipelineService.GetPipelineByPipelineCode(item.pipelinecode.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""));
var hJGL_Pipeline_Component = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(item.PipelineComponentCode.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""), pipeline.PipelineId);
model.Pipeline_ComponentQRCodeRootName rootName = new model.Pipeline_ComponentQRCodeRootName();
rootName.QRCode = new List<model.Pipeline_ComponentQRCodeQRCodeItem>();
var elementlist = item.QRCode.Split('&');
foreach (var element in elementlist)
if (hJGL_Pipeline_Component!=null)
{
model.Pipeline_ComponentQRCodeQRCodeItem qRCodeQRCodeItem = new model.Pipeline_ComponentQRCodeQRCodeItem();
qRCodeQRCodeItem.element = element;
rootName.QRCode.Add(qRCodeQRCodeItem);
model.Pipeline_ComponentQRCodeRootName rootName = new model.Pipeline_ComponentQRCodeRootName();
rootName.QRCode = new List<model.Pipeline_ComponentQRCodeQRCodeItem>();
var elementlist = item.QRCode.Split('&');
foreach (var element in elementlist)
{
model.Pipeline_ComponentQRCodeQRCodeItem qRCodeQRCodeItem = new model.Pipeline_ComponentQRCodeQRCodeItem();
qRCodeQRCodeItem.element = element;
rootName.QRCode.Add(qRCodeQRCodeItem);
}
hJGL_Pipeline_Component.QRCode = JsonConvert.SerializeObject(rootName);
//hJGL_Pipeline_Component.DrawingName = item.DrawingName;
Pipeline_ComponentList.Add(hJGL_Pipeline_Component);
}
hJGL_Pipeline_Component.QRCode = JsonConvert.SerializeObject(rootName);
hJGL_Pipeline_Component.DrawingName = item.DrawingName;
Pipeline_ComponentList.Add(hJGL_Pipeline_Component);
}
errorInfos = string.Empty;