2023-06-28

This commit is contained in:
李鹏飞 2023-06-28 16:54:27 +08:00
parent 71d2baca54
commit f266afe56f
9 changed files with 128 additions and 23 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="06/26/2023 15:31:41" ReportInfo.CreatorVersion="2017.1.16.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="06/28/2023 09:22:56" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System; <ScriptText>using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@ -99,7 +99,7 @@ namespace FastReport
} }
</ScriptText> </ScriptText>
<Dictionary> <Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRGljdG+Vyp/4vwo6KXFJdHA"/> <MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRFaP4QmH3R+4iH+AADbdwUS"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true"> <TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="PrefabricatedComponents" DataType="System.String" PropName="CH_TrustCode"/> <Column Name="PrefabricatedComponents" DataType="System.String" PropName="CH_TrustCode"/>
<Column Name="PlanStartDate" DataType="System.String" PropName="CH_TrustMan"/> <Column Name="PlanStartDate" DataType="System.String" PropName="CH_TrustMan"/>

View File

@ -237,7 +237,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{ {
string strSql = @" SELECT distinct com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber, string strSql = @" SELECT distinct com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,
com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit, com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit,
com.QRCode,com.State,com.ProductionState,pipe.PlanStartDate,com.DrawingName,com.ReceiveDate, com.QRCode,com.State,com.ProductionState,pipe.PlanStartDate,pipe.FlowingSection,com.DrawingName,com.ReceiveDate,
person.PersonName person.PersonName
FROM HJGL_Pipeline_Component com FROM HJGL_Pipeline_Component com
LEFT JOIN HJGL_Pipeline pipe ON pipe.PipelineId =com.PipelineId LEFT JOIN HJGL_Pipeline pipe ON pipe.PipelineId =com.PipelineId

View File

@ -5,6 +5,12 @@
<head runat="server"> <head runat="server">
<title>二次焊口信息</title> <title>二次焊口信息</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" /> <link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style>
.customlabel span {
color: red;
font-weight: bold;
}
</style>
</head> </head>
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
@ -47,6 +53,8 @@
Width="240px" LabelWidth="80px" LabelAlign="Right"> Width="240px" LabelWidth="80px" LabelAlign="Right">
</f:TextBox> </f:TextBox>
<f:CheckBox ID="ckIsAudit" runat ="server" Label="未审核" AutoPostBack="true" OnCheckedChanged="ckIsAudit_CheckedChanged"></f:CheckBox> <f:CheckBox ID="ckIsAudit" runat ="server" Label="未审核" AutoPostBack="true" OnCheckedChanged="ckIsAudit_CheckedChanged"></f:CheckBox>
<f:Label ID="lbSize" CssClass="customlabel" runat="server" Label="达因"></f:Label>
<f:DropDownList runat="server" ID="DropTwoJointType" Label="二次新增类型" LabelAlign="Right" LabelWidth="140px" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"> <f:DropDownList runat="server" ID="DropTwoJointType" Label="二次新增类型" LabelAlign="Right" LabelWidth="140px" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
<f:ListItem Text="新增口" Value="新增口" /> <f:ListItem Text="新增口" Value="新增口" />
<f:ListItem Text="修改口" Value="修改口" /> <f:ListItem Text="修改口" Value="修改口" />

View File

@ -292,7 +292,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var SizeSum = tb.AsEnumerable().Select(x => x.Field<decimal>("Size")).Sum();
lbSize.Text=SizeSum.ToString();
// 2.获取当前分页数据 // 2.获取当前分页数据
Grid1.RecordCount = tb.Rows.Count; Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb); var table = this.GetPagedDataTable(Grid1, tb);
@ -334,7 +335,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var SizeSum = tb.AsEnumerable().Select(x => x.Field<decimal>("Size")).Sum();
lbSize.Text = SizeSum.ToString();
// 2.获取当前分页数据 // 2.获取当前分页数据
Grid1.RecordCount = tb.Rows.Count; Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb); var table = this.GetPagedDataTable(Grid1, tb);

View File

@ -122,6 +122,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks> /// </remarks>
protected global::FineUIPro.CheckBox ckIsAudit; protected global::FineUIPro.CheckBox ckIsAudit;
/// <summary>
/// lbSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbSize;
/// <summary> /// <summary>
/// DropTwoJointType 控件。 /// DropTwoJointType 控件。
/// </summary> /// </summary>

View File

@ -95,9 +95,10 @@
</f:Toolbar> </f:Toolbar>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left"> <f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items> <Items>
<f:Label ID="lbSinglePreRate" CssClass="customlabel" runat="server" Label="主项预制率"></f:Label> <f:Label ID="lbSinglePreRate" CssClass="customlabel" runat="server" Label="主项预制率(达因)" LabelWidth="140"></f:Label>
<f:Label ID="lbShopSize" CssClass="customlabel" runat="server" Label="预制口达因"></f:Label> <f:Label ID="lbSinglePreRateByWeldJoint" CssClass="customlabel" runat="server" Label="主项预制率(焊口)" LabelWidth="140"></f:Label>
<f:Label ID="lbFiledSize" CssClass="customlabel" runat="server" Label="安装口达因"></f:Label> <f:Label ID="lbShopSize" CssClass="customlabel" runat="server" Label="预制口达因" LabelWidth="100"></f:Label>
<f:Label ID="lbFiledSize" CssClass="customlabel" runat="server" Label="安装口达因" LabelWidth="100"></f:Label>
</Items> </Items>
</f:Toolbar> </f:Toolbar>

View File

@ -234,16 +234,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.BindGrid1(this.tvControlItem.SelectedNodeID); this.BindGrid1(this.tvControlItem.SelectedNodeID);
this.BindGrid2(this.tvControlItem.SelectedNodeID); this.BindGrid2(this.tvControlItem.SelectedNodeID);
this.BindGrid3(this.tvControlItem.SelectedNodeID); this.BindGrid3(this.tvControlItem.SelectedNodeID);
this.lbSinglePreRate.Label = "图纸预制率"; this.lbSinglePreRate.Label = "图纸预制率(达因)";
this.lbSinglePreRate.Text = GetRateByPipelineid(this.tvControlItem.SelectedNodeID); this.lbSinglePreRate.Text = GetRateByPipelineid(this.tvControlItem.SelectedNodeID);
this.lbSinglePreRateByWeldJoint.Label = "图纸预制率(焊口)";
this.lbSinglePreRateByWeldJoint.Text = GetWeldJointRateByPipelineid(this.tvControlItem.SelectedNodeID);
} }
else else
{ {
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
this.lbSinglePreRate.Label = "主项预制率"; this.lbSinglePreRate.Label = "主项预制率(达因)";
this.lbSinglePreRate.Text = GetRateByUnitWork(this.tvControlItem.SelectedNodeID); this.lbSinglePreRate.Text = GetRateByUnitWork(this.tvControlItem.SelectedNodeID);
this.lbSinglePreRateByWeldJoint.Label = "主项预制率(焊口)";
this.lbSinglePreRateByWeldJoint.Text = GetWeldJointRateByUnitWork(this.tvControlItem.SelectedNodeID);
} }
this.lbShopSize.Text = ShopSumSize; this.lbShopSize.Text = ShopSumSize;
this.lbFiledSize.Text = FieldSumSize; this.lbFiledSize.Text = FieldSumSize;
@ -437,6 +443,37 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
return "0%"; return "0%";
} }
private string GetWeldJointRateByUnitWork(string unitworkid)
{
string rate = "";
int ShopNum = 0;
int FieldNum = 0;
int AllNum = 0;
var db = Funs.DB;
var q = from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x;
if (q != null && q.Count() > 0)
{
ShopNum = (from x in q
where x.JointAttribute == "预制口"
select x
).Count();
FieldNum = (from x in q
where x.JointAttribute == "安装口"
select x
).Count();
AllNum = ShopNum + FieldNum;
if (AllNum > 0)
{
var a = (decimal)100 * ShopNum / AllNum;
rate = Math.Round((decimal)a, 1).ToString() + "%";
}
return rate;
}
return "0%";
}
private string GetRateByPipelineid(string pipelineid) private string GetRateByPipelineid(string pipelineid)
{ {
string rate = ""; string rate = "";
@ -484,8 +521,41 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
return "0%"; return "0%";
} }
/// <summary>
/// 获取预制率(焊口) 预制口数量/总焊口数量
/// </summary>
/// <param name="pipelineid"></param>
/// <returns></returns>
private string GetWeldJointRateByPipelineid(string pipelineid)
{
string rate = "";
int ShopNum = 0;
int FieldNum = 0;
int AllNum = 0;
var db = Funs.DB;
var q = from x in db.View_HJGL_WeldJoint where x.PipelineId == pipelineid select x;
if (q != null && q.Count() > 0)
{
ShopNum = (from x in q
where x.JointAttribute == "预制口" select x
).Count();
FieldNum = (from x in q
where x.JointAttribute == "安装口"
select x
).Count();
AllNum = ShopNum + FieldNum;
if (AllNum > 0)
{
var a = (decimal)100 * ShopNum / AllNum;
rate = Math.Round((decimal)a, 1).ToString() + "%";
}
return rate;
}
return "0%";
}
#endregion #endregion
#region #region

View File

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

View File

@ -145,25 +145,25 @@ namespace WebAPI.Controllers
/// <param name="toDoItem"></param> /// <param name="toDoItem"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<Model.ResponeData> DownloadDocument([FromBody] Model.SaveOnlineFileItem toDoItem) public async Task<Model.ResponeData> DownloadDocument([FromBody] Model.SaveOnlineFileItem toDoItem)
//public async Task<Model.ResponeData> DownloadDocument( string UrlStr, string PCUrl)
{ {
var responeData = new Model.ResponeData(); var responeData = new Model.ResponeData();
HttpClient _httpClient = new HttpClient(); HttpClient _httpClient = new HttpClient();
try try
{ {
// System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
// 发送 GET 请求以获取文件内容 // 发送 GET 请求以获取文件内容
var response = await _httpClient.GetAsync(toDoItem.UrlStr); var response = await _httpClient.GetAsync(toDoItem.UrlStr);
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
string savePath = ""; string savePath = "";
if (!string.IsNullOrEmpty(toDoItem.PCUrl)) if (!string.IsNullOrEmpty(toDoItem.PCUrl))
{ {
savePath = ConfigurationManager.AppSettings["localRoot"]+toDoItem.PCUrl; savePath = ConfigurationManager.AppSettings["localRoot"] + toDoItem.PCUrl;
} }
if (savePath != null) if (savePath != null)
{ {
// 将文件内容保存到本地 // 将文件内容保存到本地
@ -171,19 +171,25 @@ namespace WebAPI.Controllers
{ {
await response.Content.CopyToAsync(fileStream); await response.Content.CopyToAsync(fileStream);
} }
responeData.data = "文件已成功下载并保存到本地";
// Console.WriteLine("文件已成功下载并保存到本地。");
responeData.code = 1;
responeData.data = "文件已成功下载并保存到本地";
}
else
{
responeData.code = 0;
responeData.message = "保存路径为空";
} }
return responeData;
} }
catch (Exception ex) catch (Exception ex)
{ {
responeData.code=0; responeData.code = 0;
responeData.message = $"下载文件时出现错误:{ex.Message}"; responeData.message = $"下载文件时出现错误:{ex.Message}";
return responeData;
} }
return responeData;
} }
#region #region
/// <summary> /// <summary>
/// 附件上传 /// 附件上传