提交代码

This commit is contained in:
高飞 2025-05-24 14:49:05 +08:00
parent debd6973a7
commit 3867399b7e
10 changed files with 165 additions and 25 deletions

View File

@ -205,6 +205,22 @@
select x).ToList();
return q;
}
/// <summary>
/// 根据单位id获取单位信息
/// </summary>
/// <param name="projectId"></param>
/// <param name="unitType">一个单位有可能多种类型</param>
/// <returns></returns>
public static List<Model.Base_Unit> GetAllUnits()
{
var q = (from x in Funs.DB.Base_Unit
join y in Funs.DB.Project_Unit on x.UnitId equals y.UnitId
orderby x.UnitCode
select x).Distinct().ToList();
return q;
}
/// <summary>
/// 根据分包本单位类型ID获取单位项
/// </summary>

View File

@ -115,7 +115,7 @@ namespace BLL
newStockIn.WeldId = stockIn.WeldId;
newStockIn.Amount = stockIn.Amount;
newStockIn.Weight = stockIn.Weight;
//newStockIn.RecycleAmount = stockIn.RecycleAmount;
newStockIn.RecycleAmount = stockIn.RecycleAmount;
//newStockIn.RecycleWeight = stockIn.RecycleWeight;
//newStockIn.Materialman = stockIn.Materialman;
//newStockIn.InStockDate = stockIn.InStockDate;

View File

@ -28,7 +28,7 @@
</f:DropDownList>
<f:DropDownList ID="drpIns" runat="server" LabelWidth="80px" Label="装置" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpUnit" runat="server" LabelWidth="80px" Label="单位名称" EnableEdit="true"
<f:DropDownList ID="drpUnit" runat="server" LabelWidth="80px" Label="部门" EnableEdit="true"
AutoPostBack="true" OnSelectedIndexChanged="drpUnit_OnSelectedIndexChanged">
</f:DropDownList>
<f:DropDownList ID="drpWloName" runat="server" LabelWidth="80px" Label="焊工" EnableEdit="true">
@ -45,6 +45,7 @@
</f:Label>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="BtnAnalyse3" Text="按部门统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse3_Click"></f:Button>
<f:Button ID="BtnAnalyse2" Text="按焊工统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse2_Click"></f:Button>
<f:Button ID="BtnAnalyse" Text="按项目统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse_Click"></f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" Icon="TableGo"

View File

@ -23,7 +23,7 @@
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
var pUnit = BLL.Base_UnitService.GetUnitsByProjectUnitType(this.drpProject.SelectedValue, BLL.Const.UnitType_4);
var pUnit = BLL.Base_UnitService.GetAllUnits();
///单位
this.drpUnit.DataTextField = "UnitName";
this.drpUnit.DataValueField = "UnitId";
@ -355,6 +355,85 @@
Grid1.DataSource = table;
Grid1.DataBind();
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid3()
{
string projectIds = String.Join(",", drpProject.SelectedValueArray);
List<SqlParameter> listStr = new List<SqlParameter>();
if (this.drpIns.SelectedValue != BLL.Const._Null)
{
listStr.Add(new SqlParameter("@installationId", this.drpIns.SelectedValue));
}
else
{
listStr.Add(new SqlParameter("@installationId", null));
}
if (this.drpUnit.SelectedValue != BLL.Const._Null)
{
listStr.Add(new SqlParameter("@unitcode", this.drpUnit.SelectedValue));
}
else
{
listStr.Add(new SqlParameter("@unitcode", null));
}
if (this.drpSteel.SelectedValue != BLL.Const._Null)
{
listStr.Add(new SqlParameter("@steel", this.drpSteel.SelectedValue));
}
else
{
listStr.Add(new SqlParameter("@steel", null));
}
if (this.drpWloName.SelectedValue != BLL.Const._Null)
{
listStr.Add(new SqlParameter("@WED_ID", this.drpWloName.SelectedValue));
}
else
{
listStr.Add(new SqlParameter("@WED_ID", null));
}
if (!string.IsNullOrEmpty(this.txtStarTime.Text))
{
listStr.Add(new SqlParameter("@date1", Convert.ToDateTime(this.txtStarTime.Text)));
}
else
{
listStr.Add(new SqlParameter("@date1", null));
}
if (!string.IsNullOrEmpty(this.txtEndTime.Text))
{
listStr.Add(new SqlParameter("@date2", Convert.ToDateTime(this.txtEndTime.Text).AddDays(1)));
}
else
{
listStr.Add(new SqlParameter("@date2", null));
}
if (this.drpProject.SelectedValueArray.Length > 0 && this.drpProject.SelectedValueArray[0] != BLL.Const._Null)
{
listStr.Add(new SqlParameter("@projectId", projectIds));
}
else
{
listStr.Add(new SqlParameter("@projectId", null));
}
SqlParameter[] parameter = listStr.ToArray();
tb = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_welderPerformance3", parameter);
this.Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
@ -415,6 +494,19 @@
this.Grid1.SummaryData = null;
//OutputSummaryData();
}
/// <summary>
/// 统计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse3_Click(object sender, EventArgs e)
{
this.Grid1.Columns[1].Hidden = true;
BindGrid3();
this.Grid1.SummaryData = null;
//OutputSummaryData();
}
#endregion
#region
@ -482,7 +574,7 @@
protected void drpProject_OnSelectedIndexChanged(object sender, EventArgs e)
{
drpIns.Items.Clear();
this.drpUnit.Items.Clear(); ///单位
//this.drpUnit.Items.Clear(); ///单位
this.drpWloName.Items.Clear(); ///焊工
if (drpProject.SelectedValueArray.Length > 1)
{
@ -494,9 +586,9 @@
}
if (drpProject.SelectedValueArray.Length == 1 && this.drpProject.SelectedValueArray[0] != BLL.Const._Null)
{
var pUnit = BLL.Base_UnitService.GetUnitsByProjectUnitType(drpProject.SelectedValueArray[0], BLL.Const.UnitType_4);
this.drpUnit.DataSource = pUnit;
this.drpUnit.DataBind();
//var pUnit = BLL.Base_UnitService.GetUnitsByProjectUnitType(drpProject.SelectedValueArray[0], BLL.Const.UnitType_4);
//this.drpUnit.DataSource = pUnit;
//this.drpUnit.DataBind();
this.drpIns.Items.Clear();
this.drpIns.DataTextField = "Text";
@ -507,8 +599,8 @@
}
Funs.FineUIPleaseSelect(this.drpIns);
this.drpIns.SelectedValue = BLL.Const._Null;
Funs.FineUIPleaseSelect(this.drpUnit);
this.drpUnit.SelectedValue = BLL.Const._Null;
//Funs.FineUIPleaseSelect(this.drpUnit);
//this.drpUnit.SelectedValue = BLL.Const._Null;
this.drpWloName.DataTextField = "Text";
this.drpWloName.DataValueField = "Value";
if (drpProject.SelectedValueArray.Length == 1 && this.drpProject.SelectedValueArray[0] == BLL.Const._Null)

View File

@ -147,6 +147,15 @@ namespace FineUIPro.Web.HJGL.WeldingReport {
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// BtnAnalyse3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse3;
/// <summary>
/// BtnAnalyse2 控件。
/// </summary>

View File

@ -59,10 +59,12 @@
</f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow Hidden="true" runat="server" ID="trRemainingAmount">
<f:FormRow Hidden="true" runat="server" ID="trRemainingAmount" ColumnWidths="25% 25% 50%">
<Items>
<f:Label runat="server" ID="lbRemainingAmount" Text="库存重量(公斤)" CssClass="customlabel"></f:Label>
<f:Label runat="server" ID="lbReAmount" Label="库存数量(根)" CssClass="customlabel" LabelAlign="Right"></f:Label>
<f:NumberBox ID="txtRecycleAmount" runat="server" Label="回收数量(根)" LabelAlign="Right" NoNegative="true">
</f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>

View File

@ -129,6 +129,10 @@ namespace FineUIPro.Web.WeldMat.Stock
{
this.lbRemainingAmount.Text = stockIn.Weight.ToString();
}
if (stockIn.RecycleAmount != null)
{
this.txtRecycleAmount.Text = stockIn.RecycleAmount.Value.ToString("0.####");
}
}
}
}
@ -207,6 +211,7 @@ namespace FineUIPro.Web.WeldMat.Stock
{
if (!string.IsNullOrEmpty(Request.Params["RemainingAmount"]))
{
stockIn.RecycleAmount = Funs.GetNewDecimal(this.txtRecycleAmount.Text.Trim());
BLL.StockInService.UpdateStockIn2(stockIn);
}
else

View File

@ -156,6 +156,15 @@ namespace FineUIPro.Web.WeldMat.Stock {
/// </remarks>
protected global::FineUIPro.Label lbReAmount;
/// <summary>
/// txtRecycleAmount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtRecycleAmount;
/// <summary>
/// drpUnitStore 控件。
/// </summary>

View File

@ -21,19 +21,19 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
{
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
string lastPlan = @"SELECT p.UsingPlanId FROM dbo.Weld_UsingPlan p
WHERE p.OrderDate<CONVERT(char(10),GetDate(),120)
AND p.IsCancel=0
AND (SELECT COUNT(*) FROM dbo.Weld_UsingMat u WHERE u.UsingPlanId=p.UsingPlanId)=0";
DataTable dt = SQLHelper.GetDataTableRunText(lastPlan, null);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
string usingPlanId = dt.Rows[i]["UsingPlanId"].ToString();
BLL.UsingPlanService.UpdateIsCancel(usingPlanId, "超时未领用");
}
}
//string lastPlan = @"SELECT p.UsingPlanId FROM dbo.Weld_UsingPlan p
// WHERE p.OrderDate<CONVERT(char(10),GetDate(),120)
// AND p.IsCancel=0
// AND (SELECT COUNT(*) FROM dbo.Weld_UsingMat u WHERE u.UsingPlanId=p.UsingPlanId)=0";
//DataTable dt = SQLHelper.GetDataTableRunText(lastPlan, null);
//if (dt.Rows.Count > 0)
//{
// for (int i = 0; i < dt.Rows.Count; i++)
// {
// string usingPlanId = dt.Rows[i]["UsingPlanId"].ToString();
// BLL.UsingPlanService.UpdateIsCancel(usingPlanId, "超时未领用");
// }
//}
// 绑定表格
BindGrid();

View File

@ -373,8 +373,14 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
{
usingPlan.TeamGroupId = this.drpTeamGroup.SelectedValue;
}
usingPlan.CancelDate = Funs.GetNewDateTime(this.txtCancelDate.Text.Trim());
if (!string.IsNullOrEmpty(this.txtCancelDate.Text.Trim()))
{
usingPlan.CancelDate = DateTime.Now;
}
else
{
usingPlan.CancelDate = null;
}
usingPlan.IsCancel = Convert.ToBoolean(this.rblIsCancel.SelectedValue);
usingPlan.CancelResult = this.txtCancelResult.Text.Trim();
usingPlan.IsSubmit = isSubmit;