提交代码

This commit is contained in:
高飞 2025-03-20 10:44:01 +08:00
parent 4242a6af49
commit 34b53e8ebb
7 changed files with 1629 additions and 53 deletions

View File

@ -5,7 +5,7 @@ AS
select distinct C.BaseId,C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,case when a.DrawingNo is not null then a.DrawingNo else b.ChangeNo end as DrawingNo,
case when a.DrawingName is not null then a.DrawingName else b.ChangeName end as DrawingName,ba.State,
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major,ba.DrawingId
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major,ba.DrawingId,
Part,ProjectContent,Unit,Amount,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId
from QuantityManagement_DayInput C
left join QuantityManagement_Base ba on ba.BaseId=C.BaseId
@ -17,7 +17,7 @@ select distinct C.BaseId,C.ProjectId,case when a.DrawingNo is not null then a.Wo
union
select BaseId,C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,case when a.DrawingNo is not null then a.DrawingNo else b.ChangeNo end as DrawingNo,
case when a.DrawingName is not null then a.DrawingName else b.ChangeName end as DrawingName,C.State,
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major,C.DrawingId
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major,C.DrawingId,
Part,ProjectContent,Unit,Amount,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId
from QuantityManagement_Base C
left join QuantityManagement_Drawing a on a.DrawingId=C.DrawingId
@ -30,3 +30,34 @@ select BaseId,C.ProjectId,case when a.DrawingNo is not null then a.WorkSection e
GO
ALTER VIEW [dbo].[View_QuantityManagement_WorkTeamStatistics]
AS
/********工程量整体及分类汇总表********/
select distinct C.ProjectId+','+(case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end)+','+ProjectContent+','+t.TeamGroupName as Id, C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,ba.State,
ProjectContent,Unit,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId,
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major
from QuantityManagement_DayInput C
left join QuantityManagement_Base ba on ba.BaseId=C.BaseId
left join QuantityManagement_Drawing a on a.DrawingId=ba.DrawingId
left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major
left join QuantityManagement_Change b on b.ChangeId=ba.DrawingId
left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major
left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam
union
select C.ProjectId+','+(case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end)+','+ProjectContent+','+t.TeamGroupName as Id,C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,C.State,
ProjectContent,Unit,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId,
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major
from QuantityManagement_Base C
left join QuantityManagement_Drawing a on a.DrawingId=C.DrawingId
left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major
left join QuantityManagement_Change b on b.ChangeId=C.DrawingId
left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major
left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam
GO

View File

@ -121,6 +121,40 @@ namespace BLL
}
}
/// <summary>
/// 图纸登记下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitDrawingChangeDropDownList2(FineUIPro.DropDownList dropName, string projectId, string workSection, bool isShowPlease)
{
dropName.DataValueField = "Value";
dropName.DataTextField = "Text";
dropName.DataSource = GetDrawingChangeListByProjectId(projectId, workSection);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 图纸登记下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitWorkSectionDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{
dropName.DataValueField = "Value";
dropName.DataTextField = "Text";
dropName.DataSource = GetInitWorkSectionDropDownListListByProjectId(projectId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 根据项目Id获取图纸登记下拉选择项
/// </summary>
@ -167,5 +201,63 @@ namespace BLL
return list;
}
}
/// <summary>
/// 根据项目Id获取图纸登记下拉选择项
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static ListItem[] GetDrawingChangeListByProjectId(string projectId, string workSection)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q1 = (from x in db.QuantityManagement_Drawing
where x.ProjectId == projectId && x.WorkSection == workSection
orderby x.DrawingNo
select x).ToList();
var q2 = (from x in db.QuantityManagement_Change
where x.ProjectId == projectId && x.WorkSection == workSection
orderby x.ChangeNo
select x).ToList();
ListItem[] list = new ListItem[q1.Count() + q2.Count()];
for (int i = 0; i < q1.Count(); i++)
{
list[i] = new ListItem(q1[i].DrawingNo ?? "", q1[i].DrawingId.ToString());
}
for (int j = q1.Count(); j < q1.Count() + q2.Count(); j++)
{
list[j] = new ListItem(q2[j - q1.Count()].ChangeNo ?? "", q2[j - q1.Count()].ChangeId.ToString());
}
return list;
}
}
/// <summary>
/// 根据项目Id获取图纸登记下拉选择项
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static ListItem[] GetInitWorkSectionDropDownListListByProjectId(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q1 = (from x in db.QuantityManagement_Drawing
where x.ProjectId == projectId
orderby x.WorkSection
select x.WorkSection).ToList();
var q2 = (from x in db.QuantityManagement_Change
where x.ProjectId == projectId
orderby x.WorkSection
select x.WorkSection).ToList();
q1.AddRange(q2);
q1 = q1.Distinct().ToList();
ListItem[] list = new ListItem[q1.Count()];
for (int i = 0; i < q1.Count(); i++)
{
list[i] = new ListItem(q1[i], q1[i]);
}
return list;
}
}
}
}

View File

@ -25,10 +25,18 @@
<f:DropDownList ID="drpProject" runat="server" Label="项目" Width="300px" LabelWidth="60px" EmptyText="请选择项目"
EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpDrawingNo" OnSelectedIndexChanged="drpDrawingNo_SelectedIndexChanged" AutoPostBack="true" ShowRedStar="true" runat="server" LabelWidth="120px" Required="true" Label="图号" LabelAlign="Right" EnableEdit="true">
<f:DropDownList ID="drpWorkSection" OnSelectedIndexChanged="drpWorkSection_SelectedIndexChanged" AutoPostBack="true" runat="server" LabelWidth="120px" Required="true" Label="工段" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:TextBox runat="server" ID="txtPart" Label="部位" LabelWidth="60px" LabelAlign="Right" Width="200px"></f:TextBox>
<f:TextBox runat="server" ID="txtProjectContent" Label="项目内容" LabelWidth="100px" LabelAlign="Right" Width="240px"></f:TextBox>
<f:DropDownList ID="drpDrawingNo" OnSelectedIndexChanged="drpDrawingNo_SelectedIndexChanged" AutoPostBack="true" runat="server" LabelWidth="120px" Required="true" Label="图号" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpMajor" runat="server" LabelWidth="140px" Required="true" Label="专业" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpPart" OnSelectedIndexChanged="drpPart_SelectedIndexChanged" AutoPostBack="true" runat="server" LabelWidth="120px" Required="true" Label="部位" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpProjectContent" runat="server" LabelWidth="120px" Required="true" Label="项目内容" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpWorkTeam" runat="server" LabelWidth="140px" Required="true" Label="作业队" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:DatePicker runat="server" DateFormatString="yyyy-MM" DisplayType="Month" Label="选择月份" ID="txtMonths" LabelAlign="right" LabelWidth="110px">
</f:DatePicker>
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">

View File

@ -110,19 +110,38 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
{
if (!IsPostBack)
{
BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, this.CurrUser.LoginProjectId, true);
//BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, this.CurrUser.LoginProjectId, true);
if (!string.IsNullOrEmpty(Request.Params["DrawingNo"]))
BLL.DrawingService.InitWorkSectionDropDownList(drpWorkSection, this.CurrUser.LoginProjectId, true);
BLL.CNProfessionalService.InitCNProfessionalDownList(drpMajor, true);
BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, this.CurrUser.LoginProjectId, true);
Funs.FineUIPleaseSelect(this.drpDrawingNo);
Funs.FineUIPleaseSelect(this.drpPart);
Funs.FineUIPleaseSelect(this.drpProjectContent);
if (!string.IsNullOrEmpty(Request.Params["WorkSection"]))
{
this.drpDrawingNo.SelectedValue = Request.Params["DrawingNo"];
this.drpWorkSection.SelectedValue = Request.Params["WorkSection"];
BLL.DrawingService.InitDrawingChangeDropDownList2(drpDrawingNo, this.CurrUser.LoginProjectId, Request.Params["WorkSection"], true);
}
if (!string.IsNullOrEmpty(Request.Params["DrawingId"]))
{
this.drpDrawingNo.SelectedValue = Request.Params["DrawingId"];
BLL.BaseService.InitPartDropDownList(this.drpPart, Request.Params["DrawingId"], true);
}
if (!string.IsNullOrEmpty(Request.Params["Major"]))
{
this.drpMajor.SelectedValue = Request.Params["Major"];
}
if (!string.IsNullOrEmpty(Request.Params["Part"]))
{
this.txtPart.Text = Request.Params["Part"];
this.drpPart.SelectedValue = Request.Params["Part"];
BLL.BaseService.InitProjectContentDropDownList(this.drpProjectContent, this.drpDrawingNo.SelectedValue, this.drpPart.SelectedValue, true);
}
if (!string.IsNullOrEmpty(Request.Params["ProjectContent"]))
{
this.txtProjectContent.Text = Request.Params["ProjectContent"];
this.drpProjectContent.SelectedValue = Request.Params["ProjectContent"];
}
if (!string.IsNullOrEmpty(Request.Params["WorkTeam"]))
{
this.drpWorkTeam.SelectedValue = Request.Params["WorkTeam"];
}
ProjectService.InitAllProjectDropDownList(this.drpProject, false);
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
@ -149,20 +168,35 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
where C.ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue));
if (this.drpWorkSection.SelectedValue != BLL.Const._Null)
{
strSql += " AND WorkSection = @WorkSection";
listStr.Add(new SqlParameter("@WorkSection", this.drpWorkSection.SelectedItem.Text));
}
if (this.drpDrawingNo.SelectedValue != BLL.Const._Null)
{
strSql += " AND DrawingNo = @DrawingNo";
listStr.Add(new SqlParameter("@DrawingNo", this.drpDrawingNo.SelectedItem.Text));
strSql += " AND DrawingId = @DrawingId";
listStr.Add(new SqlParameter("@DrawingId", this.drpDrawingNo.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtPart.Text.Trim()))
if (this.drpMajor.SelectedValue != BLL.Const._Null)
{
strSql += " AND Part like @Part";
listStr.Add(new SqlParameter("@Part", "%" + this.txtPart.Text.Trim() + "%"));
strSql += " AND Major = @Major";
listStr.Add(new SqlParameter("@Major", this.drpMajor.SelectedItem.Text));
}
if (!string.IsNullOrEmpty(this.txtProjectContent.Text.Trim()))
if (this.drpPart.SelectedValue != BLL.Const._Null)
{
strSql += " AND ProjectContent like @ProjectContent";
listStr.Add(new SqlParameter("@ProjectContent", "%" + this.txtProjectContent.Text.Trim() + "%"));
strSql += " AND Part = @Part";
listStr.Add(new SqlParameter("@Part", this.drpPart.SelectedItem.Text));
}
if (this.drpProjectContent.SelectedValue != BLL.Const._Null)
{
strSql += " AND ProjectContent = @ProjectContent";
listStr.Add(new SqlParameter("@ProjectContent", this.drpProjectContent.SelectedItem.Text));
}
if (this.drpWorkTeam.SelectedValue != BLL.Const._Null)
{
strSql += " AND WorkTeam = @WorkTeam";
listStr.Add(new SqlParameter("@WorkTeam", this.drpWorkTeam.SelectedItem.Text));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@ -339,8 +373,9 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
string url = "~/CQMS/QuantityManagement/DayInputStatistics.aspx?Date=" + this.txtMonths.Text.Trim() + "&DrawingId=" + this.drpDrawingNo.SelectedValue
+ "&Part=" + this.txtPart.Text.Trim() + "&ProjectContent=" + this.txtProjectContent.Text.Trim() + "&ProjectId=" + this.drpProject.SelectedValue;
string url = "~/CQMS/QuantityManagement/DayInputStatistics.aspx?Date=" + this.txtMonths.Text.Trim() + "&WorkSection=" + this.drpWorkSection.SelectedValue
+ "&DrawingId=" + this.drpDrawingNo.SelectedValue + "&Major=" + this.drpMajor.SelectedValue + "&Part=" + this.drpPart.SelectedValue
+ "&ProjectContent=" + this.drpProjectContent.SelectedValue+ "&WorkTeam=" + this.drpWorkTeam.SelectedValue + "&ProjectId=" + this.drpProject.SelectedValue;
PageContext.Redirect(url, "_self");
}
#endregion
@ -616,38 +651,58 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
}
#endregion
protected void drpDrawingNo_SelectedIndexChanged(object sender, EventArgs e)
protected void drpWorkSection_SelectedIndexChanged(object sender, EventArgs e)
{
Model.QuantityManagement_Drawing drawing = BLL.DrawingService.GetDrawingById(this.drpDrawingNo.SelectedValue);
Model.QuantityManagement_Change change = BLL.ChangeService.GetChangeById(this.drpDrawingNo.SelectedValue);
if (drawing != null)
if (this.drpWorkSection.SelectedValue != BLL.Const._Null)
{
//this.txtWorkSection.Text = drawing.WorkSection;
//this.txtDrawingName.Text = drawing.DrawingName;
//BLL.BaseService.InitPartDropDownList(this.drpPart, drawing.DrawingId, true);
//this.drpPart.SelectedValue = BLL.Const._Null;
}
else if (change != null)
{
//this.txtWorkSection.Text = change.WorkSection;
//this.txtDrawingName.Text = change.ChangeName;
//BLL.BaseService.InitPartDropDownList(this.drpPart, change.ChangeId, true);
//this.drpPart.SelectedValue = BLL.Const._Null;
BLL.DrawingService.InitDrawingChangeDropDownList2(drpDrawingNo, this.CurrUser.LoginProjectId, this.drpWorkSection.SelectedValue, true);
this.drpDrawingNo.SelectedValue = BLL.Const._Null;
}
else
{
//this.txtWorkSection.Text = string.Empty;
//this.txtDrawingName.Text = string.Empty;
//this.drpPart.Items.Clear();
//Funs.FineUIPleaseSelect(this.drpPart);
//this.drpPart.SelectedValue = BLL.Const._Null;
drpDrawingNo.Items.Clear();
Funs.FineUIPleaseSelect(drpDrawingNo);
this.drpDrawingNo.SelectedValue = BLL.Const._Null;
}
drpPart.Items.Clear();
Funs.FineUIPleaseSelect(drpPart);
this.drpPart.SelectedValue = BLL.Const._Null;
drpProjectContent.Items.Clear();
Funs.FineUIPleaseSelect(drpProjectContent);
this.drpProjectContent.SelectedValue = BLL.Const._Null;
}
protected void drpDrawingNo_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.drpDrawingNo.SelectedValue != BLL.Const._Null)
{
BLL.BaseService.InitPartDropDownList(this.drpPart, this.drpDrawingNo.SelectedValue, true);
this.drpPart.SelectedValue = BLL.Const._Null;
}
else
{
drpPart.Items.Clear();
Funs.FineUIPleaseSelect(drpPart);
this.drpPart.SelectedValue = BLL.Const._Null;
}
drpProjectContent.Items.Clear();
Funs.FineUIPleaseSelect(drpProjectContent);
this.drpProjectContent.SelectedValue = BLL.Const._Null;
}
protected void drpPart_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.drpPart.SelectedValue != BLL.Const._Null)
{
BLL.BaseService.InitProjectContentDropDownList(this.drpProjectContent, this.drpDrawingNo.SelectedValue, this.drpPart.SelectedValue, true);
this.drpProjectContent.SelectedValue = BLL.Const._Null;
}
else
{
drpProjectContent.Items.Clear();
Funs.FineUIPleaseSelect(drpProjectContent);
this.drpProjectContent.SelectedValue = BLL.Const._Null;
}
//this.drpProjectContent.Items.Clear();
//Funs.FineUIPleaseSelect(this.drpProjectContent);
//this.drpProjectContent.SelectedValue = BLL.Const._Null;
//this.txtUnit.Text = string.Empty;
//this.txtAmount.Text = string.Empty;
//this.drpWorkTeam.SelectedValue = BLL.Const._Null;
}
}
}

View File

@ -66,6 +66,15 @@ namespace FineUIPro.Web.CQMS.QuantityManagement {
/// </remarks>
protected global::FineUIPro.DropDownList drpProject;
/// <summary>
/// drpWorkSection 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWorkSection;
/// <summary>
/// drpDrawingNo 控件。
/// </summary>
@ -76,22 +85,40 @@ namespace FineUIPro.Web.CQMS.QuantityManagement {
protected global::FineUIPro.DropDownList drpDrawingNo;
/// <summary>
/// txtPart 控件。
/// drpMajor 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPart;
protected global::FineUIPro.DropDownList drpMajor;
/// <summary>
/// txtProjectContent 控件。
/// drpPart 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtProjectContent;
protected global::FineUIPro.DropDownList drpPart;
/// <summary>
/// drpProjectContent 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpProjectContent;
/// <summary>
/// drpWorkTeam 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWorkTeam;
/// <summary>
/// txtMonths 控件。

View File

@ -48,6 +48,9 @@
<f:RenderField ColumnID="WorkSection" DataField="WorkSection" FieldType="String" HeaderText="工段" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Major" DataField="Major" FieldType="String" HeaderText="专业" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="ProjectContent" DataField="ProjectContent" FieldType="String" HeaderText="项目内容" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
@ -79,7 +82,7 @@
</form>
<script type="text/javascript">
function onGridDataLoad(event) {
this.mergeColumns(['WorkSection', 'ProjectContent','Amount','Remain'], {
this.mergeColumns(['WorkSection', 'Major', 'ProjectContent','Amount','Remain'], {
depends: true
});
}

File diff suppressed because it is too large Load Diff