提交代码

This commit is contained in:
高飞 2025-05-19 15:18:00 +08:00
parent 9930aa01d0
commit 0fae631d6d
5 changed files with 119 additions and 18 deletions

View File

@ -11,6 +11,9 @@
using System.Threading; using System.Threading;
using System.Web; using System.Web;
using BLL; using BLL;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
public class Global : System.Web.HttpApplication public class Global : System.Web.HttpApplication
{ {
@ -464,6 +467,88 @@
BLL.HJGL_WelderQualifiedProjectService.UpdateWelderQualifiedProject(updateQue); BLL.HJGL_WelderQualifiedProjectService.UpdateWelderQualifiedProject(updateQue);
} }
} }
bool b = false;
string orderTime = string.Empty;
if (intHour == 8)
{
orderTime = "7:00 - 8:00";
}
else if (intHour == 9)
{
orderTime = "8:00 - 9:00";
}
else if (intHour == 10)
{
orderTime = "9:00 - 10:00";
}
else if (intHour == 11)
{
orderTime = "10:00 - 11:00";
}
else if (intHour == 12)
{
orderTime = "11:00 - 12:00";
}
else if (intHour == 13)
{
orderTime = "12:00 - 13:00";
}
else if (intHour == 14)
{
orderTime = "13:00 - 14:00";
}
else if (intHour == 15)
{
orderTime = "14:00 - 15:00";
}
else if (intHour == 16)
{
orderTime = "15:00 - 16:00";
}
else if (intHour == 17)
{
orderTime = "16:00 - 17:00";
}
else if (intHour == 18)
{
orderTime = "17:00 - 18:00";
}
else if (intHour == 19)
{
orderTime = "18:00 - 19:00";
}
else if (intHour == 20)
{
orderTime = "19:00 - 20:00";
}
else if (intHour == 21)
{
orderTime = "20:00 - 21:00";
}
if (!string.IsNullOrEmpty(orderTime))
{
b = true;
}
if (b)
{
string lastPlan = @"SELECT p.UsingPlanId FROM dbo.Weld_UsingPlan p
WHERE p.OrderDate<CONVERT(char(10),GetDate(),120)
AND p.IsCancel=0 AND OrderTime=@OrderTime
AND (SELECT COUNT(*) FROM dbo.Weld_UsingMat u WHERE u.UsingPlanId=p.UsingPlanId)=0";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@OrderTime", orderTime));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(lastPlan, parameter);
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, "超时未领用");
}
}
}
} }
protected void Session_Start(object sender, EventArgs e) protected void Session_Start(object sender, EventArgs e)

View File

@ -129,10 +129,13 @@
<f:RenderField Width="90px" ColumnID="InPutMan" DataField="InPutMan" <f:RenderField Width="90px" ColumnID="InPutMan" DataField="InPutMan"
FieldType="String" HeaderText="录入人" HeaderTextAlign="Center" TextAlign="Center"> FieldType="String" HeaderText="录入人" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="150px" ColumnID="InPutDate" DataField="InPutDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" <f:RenderField Width="150px" ColumnID="InPutDate" DataField="InPutDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd HH:mm:ss"
HeaderText="录入时间" HeaderTextAlign="Center" TextAlign="Center"> HeaderText="录入时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="80px" ColumnID="CancelDate" DataField="CancelDate" FieldType="Date" RendererArgument="yyyy-MM-dd" <f:RenderField Width="170px" ColumnID="OrderTime" DataField="OrderTime"
FieldType="String" HeaderText="预约时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="CancelDate" DataField="CancelDate" FieldType="Date" RendererArgument="yyyy-MM-dd HH:mm:ss"
Renderer="Date" HeaderText="作废时间" HeaderTextAlign="Center" TextAlign="Center"> Renderer="Date" HeaderText="作废时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="90px" ColumnID="IsCancel" DataField="IsCancel" FieldType="String" <f:RenderField Width="90px" ColumnID="IsCancel" DataField="IsCancel" FieldType="String"

View File

@ -29,19 +29,19 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
this.drpProjectId.DataBind(); this.drpProjectId.DataBind();
Funs.FineUIPleaseSelect(this.drpProjectId); Funs.FineUIPleaseSelect(this.drpProjectId);
string lastPlan = @"SELECT p.UsingPlanId FROM dbo.Weld_UsingPlan p //string lastPlan = @"SELECT p.UsingPlanId FROM dbo.Weld_UsingPlan p
WHERE p.OrderDate<CONVERT(char(10),GetDate(),120) // WHERE p.OrderDate<CONVERT(char(10),GetDate(),120)
AND p.IsCancel=0 // AND p.IsCancel=0
AND (SELECT COUNT(*) FROM dbo.Weld_UsingMat u WHERE u.UsingPlanId=p.UsingPlanId)=0"; // AND (SELECT COUNT(*) FROM dbo.Weld_UsingMat u WHERE u.UsingPlanId=p.UsingPlanId)=0";
DataTable dt = SQLHelper.GetDataTableRunText(lastPlan, null); //DataTable dt = SQLHelper.GetDataTableRunText(lastPlan, null);
if (dt.Rows.Count > 0) //if (dt.Rows.Count > 0)
{ //{
for (int i = 0; i < dt.Rows.Count; i++) // for (int i = 0; i < dt.Rows.Count; i++)
{ // {
string usingPlanId = dt.Rows[i]["UsingPlanId"].ToString(); // string usingPlanId = dt.Rows[i]["UsingPlanId"].ToString();
BLL.UsingPlanService.UpdateIsCancel(usingPlanId, "超时未领用"); // BLL.UsingPlanService.UpdateIsCancel(usingPlanId, "超时未领用");
} // }
} //}
// 绑定表格 // 绑定表格
BindGrid(); BindGrid();
@ -56,7 +56,7 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
string projectIds = BLL.Project_UserService.GetStrProjectIds(this.CurrUser.UserId); string projectIds = BLL.Project_UserService.GetStrProjectIds(this.CurrUser.UserId);
string strSql = @"SELECT UsingPlan.UsingPlanId, UsingPlan.WeldId, UsingPlan.ProjectId, UsingPlan.UsePosition,TeamGroupId,UsingPlan.STE_Name, string strSql = @"SELECT UsingPlan.UsingPlanId, UsingPlan.WeldId, UsingPlan.ProjectId, UsingPlan.UsePosition,TeamGroupId,UsingPlan.STE_Name,
unit.UnitName AS UsingUnit,UsingPlan.Amount, UsingPlan.UsingManOne, UsingPlan.InPutDate, unit.UnitName AS UsingUnit,UsingPlan.Amount, UsingPlan.UsingManOne, UsingPlan.InPutDate,
UsingPlan.OrderDate,UsingPlan.OrderTime, UsingPlan.CancelDate,UsingPlan.IsNeedConfirm, CONVERT(varchar(100), UsingPlan.OrderDate, 23)+' '+UsingPlan.OrderTime as OrderTime, UsingPlan.CancelDate,UsingPlan.IsNeedConfirm,
(CASE UsingPlan.IsSteelStru WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsSteelStru, (CASE UsingPlan.IsSteelStru WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsSteelStru,
(CASE UsingPlan.IsSubmit WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsSubmit, (CASE UsingPlan.IsSubmit WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsSubmit,
(CASE UsingPlan.IsCancel WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsCancel, (CASE UsingPlan.IsCancel WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsCancel,
@ -335,6 +335,12 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
var usedMat = BLL.UsingMatService.GetUsingMatByPlanId(id); var usedMat = BLL.UsingMatService.GetUsingMatByPlanId(id);
if (usedMat == null) if (usedMat == null)
{ {
Model.Weld_UsingPlan usingPlan = BLL.UsingPlanService.GetUsingPlanById(id);
if (usingPlan != null && usingPlan.IsCancel == true)
{
Alert.ShowInTop("记录已作废,不能修改!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("UsingPlanEdit.aspx?UsingPlanId={0}", id, "编辑 - "))); PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("UsingPlanEdit.aspx?UsingPlanId={0}", id, "编辑 - ")));
} }
else else

View File

@ -61,6 +61,12 @@
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label> <asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</f:TemplateField> </f:TemplateField>
<f:RenderField Width="150px" ColumnID="InPutDate" DataField="InPutDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd HH:mm:ss"
HeaderText="录入时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="170px" ColumnID="OrderTime" DataField="OrderTime"
FieldType="String" HeaderText="预约时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="UsingDate" DataField="UsingDate" FieldType="String" <f:RenderField Width="150px" ColumnID="UsingDate" DataField="UsingDate" FieldType="String"
HeaderText="领用时间" HeaderTextAlign="Center" TextAlign="Center"> HeaderText="领用时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField> </f:RenderField>

View File

@ -37,6 +37,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat
string strSql = @"SELECT UsingMat.UsingMatId, UsingMat.ProjectId, UsingMat.UsePosition, string strSql = @"SELECT UsingMat.UsingMatId, UsingMat.ProjectId, UsingMat.UsePosition,
UsingMat.WeldId,UsingMat.UsingPlanId,ISNULL(UsingMat.Amount,0) AS Amount, UsingMat.WeldId,UsingMat.UsingPlanId,ISNULL(UsingMat.Amount,0) AS Amount,
ISNULL(UsingMat.TwoAmount,0) AS TwoAmount,UsingMat.UsingMan, UsingMat.UsingDate, ISNULL(UsingMat.TwoAmount,0) AS TwoAmount,UsingMat.UsingMan, UsingMat.UsingDate,
CONVERT(varchar(100), UsingPlan.OrderDate, 23)+' '+UsingPlan.OrderTime as OrderTime,
(CASE WHEN stockIn.Warrantybook IS NOT NULL THEN stockIn.Warrantybook (CASE WHEN stockIn.Warrantybook IS NOT NULL THEN stockIn.Warrantybook
ELSE UsingMat.Warrantybook END) AS Warrantybook,UsingPlan.STE_Name, ELSE UsingMat.Warrantybook END) AS Warrantybook,UsingPlan.STE_Name,
UsingMat.Number,Project.ProjectCode,Project.ProjectName,WeldInfo.WeldCode, UsingMat.Number,Project.ProjectCode,Project.ProjectName,WeldInfo.WeldCode,
@ -340,7 +341,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat
BindGrid(); BindGrid();
foreach (GridColumn column in grid.Columns) foreach (GridColumn column in grid.Columns)
{ {
if (column.ColumnIndex < 18) if (column.ColumnIndex < 20)
{ {
sb.AppendFormat("<td>{0}</td>", column.HeaderText); sb.AppendFormat("<td>{0}</td>", column.HeaderText);
} }
@ -352,7 +353,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat
sb.Append("<tr>"); sb.Append("<tr>");
foreach (GridColumn column in grid.Columns) foreach (GridColumn column in grid.Columns)
{ {
if (column.ColumnIndex < 18) if (column.ColumnIndex < 20)
{ {
string html = row.Values[column.ColumnIndex].ToString(); string html = row.Values[column.ColumnIndex].ToString();
if (column.ColumnID == "tfNumber") if (column.ColumnID == "tfNumber")