20250929 人工时处理

This commit is contained in:
毕文静 2025-09-29 13:54:52 +08:00
parent a33a1ca50c
commit 56c9aa33ab
11 changed files with 129 additions and 51 deletions

View File

@ -342,42 +342,41 @@
/// <param name="e"></param> /// <param name="e"></param>
private void UpdateManHourDisabled(object sender, System.Timers.ElapsedEventArgs e) private void UpdateManHourDisabled(object sender, System.Timers.ElapsedEventArgs e)
{ {
//有资源的人工时 //有资源的人工时
var eprojects = (from x in Funs.DB.Resource_Plan select x).GroupBy(x => x.EProjectId).ToList(); //var eprojects = (from x in Funs.DB.Resource_Plan select x).GroupBy(x => x.EProjectId).ToList();
if (eprojects != null) //if (eprojects != null)
{ //{
foreach (var epr in eprojects) // foreach (var epr in eprojects)
{ // {
var planLists = (from x in Funs.DB.Resource_Plan // var planLists = (from x in Funs.DB.Resource_Plan
join y in Funs.DB.Editor_EProject on x.EProjectId equals y.EProjectId // join y in Funs.DB.Editor_EProject on x.EProjectId equals y.EProjectId
where x.EProjectId == epr.Key && (y.ProjectControl_JobType == "Projects" || y.ProjectControl_JobType == "MOC") // where x.EProjectId == epr.Key && (y.ProjectControl_JobType == "Projects" || y.ProjectControl_JobType == "MOC")
&& x.Phase == "Study/Concept Planning" // && x.Phase == "Study/Concept Planning"
orderby x.CreateDate ascending // orderby x.CreateDate ascending
select new { x.ResourcePlanId, y.PM_MA_ProjectApproval, x.WO }).ToList(); // select new { x.ResourcePlanId, y.PM_MA_ProjectApproval, x.WO }).ToList();
//if (planLists.Count == 2) // //if (planLists.Count == 2)
//{ // //{
if (planLists[0].PM_MA_ProjectApproval.HasValue && planLists[0].PM_MA_ProjectApproval.Value.AddMonths(1) <= DateTime.Now) // if (planLists[0].PM_MA_ProjectApproval.HasValue && planLists[0].PM_MA_ProjectApproval.Value.AddMonths(1) <= DateTime.Now)
{ // {
string resourcePlanId = planLists[0].ResourcePlanId.ToString(); // string resourcePlanId = planLists[0].ResourcePlanId.ToString();
List<ManHours_Plan> manHours_Plan = (from x in Funs.DB.ManHours_Plan where x.EProjectId == epr.Key && x.ResourcePlanId == resourcePlanId select x).ToList(); // List<ManHours_Plan> manHours_Plan = (from x in Funs.DB.ManHours_Plan where x.EProjectId == epr.Key && x.ResourcePlanId == resourcePlanId select x).ToList();
foreach (var item in manHours_Plan) // foreach (var item in manHours_Plan)
{ // {
item.AccountDisabled = 1; // item.AccountDisabled = 1;
Funs.DB.SubmitChanges(); // Funs.DB.SubmitChanges();
} // }
} // }
//} // //}
} // }
} //}
//Phase为Study/Concept Planning的人工时Disabled
//特殊处理的人工时
var eprojectLists = (from x in Funs.DB.Editor_EProject var eprojectLists = (from x in Funs.DB.Editor_EProject
where (x.ProjectControl_JobType == "Projects" || x.ProjectControl_JobType == "MOC") where (x.ProjectControl_JobType == "Projects" || x.ProjectControl_JobType == "MOC")
&& x.PM_MA_ProjectApproval.HasValue && x.PM_MA_ProjectApproval.Value.AddMonths(1) <= DateTime.Now && x.PM_MA_ProjectApproval.HasValue && x.PM_MA_ProjectApproval.Value.AddMonths(1) <= DateTime.Now
select x).ToList(); select x).ToList();
foreach (var pro in eprojectLists) foreach (var pro in eprojectLists)
{ {
List<ManHours_Plan> manHours_Plan = (from x in Funs.DB.ManHours_Plan where x.EProjectId == pro.EProjectId && x.Phase == "Study/Concept Planning" select x).ToList(); List<ManHours_Plan> manHours_Plan = (from x in Funs.DB.ManHours_Plan where x.EProjectId == pro.EProjectId && x.Phase.Contains("Study/Concept Planning") select x).ToList();
foreach (var item in manHours_Plan) foreach (var item in manHours_Plan)
{ {
item.AccountDisabled = 1; item.AccountDisabled = 1;

View File

@ -4,49 +4,62 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title> <title></title>
</head> </head>
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" /> <f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true" <f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right"> BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows> <Rows>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtJobNo" runat="server" Label="Job No" Readonly="true"> <f:TextBox ID="txtJobNo" runat="server" Label="Job No" Readonly="true" LabelWidth="120px">
</f:TextBox> </f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:DropDownList ID="drpDiscipline" runat="server" Label="Discipline" EnableGroup="true" EnableEdit="true" ShowRedStar="true" ></f:DropDownList> <f:DropDownList ID="drpDiscipline" runat="server" Label="Discipline" EnableGroup="true" EnableEdit="true" ShowRedStar="true" LabelWidth="120px"></f:DropDownList>
<%-- <f:TextBox ID="txtDiscipline" runat="server" Label="Discipline" Readonly="true"> <%-- <f:TextBox ID="txtDiscipline" runat="server" Label="Discipline" Readonly="true">
</f:TextBox>--%> </f:TextBox>--%>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtAccount" runat="server" Label="Account" > <f:TextBox ID="txtAccount" runat="server" Label="Account" LabelWidth="120px">
</f:TextBox> </f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtEngineerName" runat="server" Label="EngineerName" Readonly="true"> <f:TextBox ID="txtEngineerName" runat="server" Label="EngineerName" Readonly="true" LabelWidth="120px">
</f:TextBox> </f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtManHours" runat="server" Label="ManHours"> <f:TextBox ID="txtManHours" runat="server" Label="ManHours" LabelWidth="120px">
</f:TextBox> </f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow ColumnWidths="20% 80%"> <f:FormRow>
<Items>
<f:CheckBoxList ID="checkPhase" Label="Phase" runat="server" LabelWidth="120px">
<Items>
<f:CheckItem Text="Study/Concept Planning" Value="Study/Concept Planning" Selected="true" />
<f:CheckItem Text="Execution" Value="Execution" />
</Items>
<Listeners>
<f:Listener Event="change" Handler="onCheckBoxListChange" />
</Listeners>
</f:CheckBoxList>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="20% 80%">
<Items> <Items>
<f:Label ID="Label1" runat="server"></f:Label> <f:Label ID="Label1" runat="server"></f:Label>
<f:CheckBox ID="cbNotApplicable1" runat="server" AutoPostBack="true" Text="Account Disabled?"></f:CheckBox> <f:CheckBox ID="cbNotApplicable1" runat="server" AutoPostBack="true" Text="Account Disabled?"></f:CheckBox>
@ -67,5 +80,15 @@
</Toolbars> </Toolbars>
</f:Form> </f:Form>
</form> </form>
<script type="text/javascript">
// 同时只能选中一项
function onCheckBoxListChange(event, checkbox, isChecked) {
var me = this;
if (isChecked) {
me.setValue(checkbox.getInputValue());
}
__doPostBack('', 'CheckBoxList1Change');
}
</script>
</body> </body>
</html> </html>

View File

@ -60,13 +60,15 @@ namespace FineUIPro.Web.ManHours
if (p.AccountDisabled == 1) { if (p.AccountDisabled == 1) {
cbNotApplicable1.Checked = true; cbNotApplicable1.Checked = true;
} }
if (!string.IsNullOrEmpty(p.Phase))
{
checkPhase.SelectedValueArray = p.Phase.Split(',');
}
} }
} }
} }
} }
/// <summary> /// <summary>
/// 提交按钮 /// 提交按钮
/// </summary> /// </summary>

View File

@ -86,6 +86,15 @@ namespace FineUIPro.Web.ManHours
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtManHours; protected global::FineUIPro.TextBox txtManHours;
/// <summary>
/// checkPhase 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBoxList checkPhase;
/// <summary> /// <summary>
/// Label1 控件。 /// Label1 控件。
/// </summary> /// </summary>

View File

@ -49,10 +49,10 @@
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:CheckBoxList ID="checkPhase" Label="Phase" runat="server" LabelWidth="120px"> <f:CheckBoxList ID="checkPhase" Label="Phase" runat="server" LabelWidth="120px">
<Items> <%--<Items>
<f:CheckItem Text="Study/Concept Planning" Value="Study/Concept Planning" Selected="true" /> <f:CheckItem Text="Study/Concept Planning" Value="Study/Concept Planning" Selected="true" />
<f:CheckItem Text="Execution" Value="Execution" /> <f:CheckItem Text="Execution" Value="Execution" />
</Items> </Items>--%>
<Listeners> <Listeners>
<f:Listener Event="change" Handler="onCheckBoxListChange" /> <f:Listener Event="change" Handler="onCheckBoxListChange" />
</Listeners> </Listeners>

View File

@ -37,6 +37,25 @@ namespace FineUIPro.Web.ManHours
this.txtAccount.Text = p.ProjectControl_Account; this.txtAccount.Text = p.ProjectControl_Account;
} }
var plans = BLL.ResourcePlanService.GetResourcePlanByEProjectId(eProjectId);
if (plans.Count < 2 && plans.FirstOrDefault().Phase == "Study/Concept Planning")
{
checkPhase.Items.Clear();
List<string> lists = new List<string>();
lists.Add("Study/Concept Planning");
checkPhase.DataSource = lists;
checkPhase.DataBind();
checkPhase.SelectedValueArray = lists[0].Split(',');
}
else
{
checkPhase.Items.Clear();
List<string> lists = new List<string>();
lists.Add("Study/Concept Planning");
lists.Add("Execution");
checkPhase.DataSource = lists;
checkPhase.DataBind();
}
} }
} }
else else

View File

@ -125,7 +125,7 @@
</f:Window> </f:Window>
<f:Window ID="Window3" Title="ManHours(Plan)" Hidden="true" EnableIFrame="true" EnableMaximize="false" <f:Window ID="Window3" Title="ManHours(Plan)" Hidden="true" EnableIFrame="true" EnableMaximize="false"
Target="Parent" EnableResize="false" runat="server" OnClose="Window3_Close" IsModal="true" Target="Parent" EnableResize="false" runat="server" OnClose="Window3_Close" IsModal="true"
Width="500px" Height="350px"> Width="600px" Height="400px">
</f:Window> </f:Window>
<f:Window ID="Window4" Title="AddManHours(Plan)" Hidden="true" EnableIFrame="true" EnableMaximize="false" <f:Window ID="Window4" Title="AddManHours(Plan)" Hidden="true" EnableIFrame="true" EnableMaximize="false"
Target="Parent" EnableResize="false" runat="server" OnClose="Window3_Close" IsModal="true" Target="Parent" EnableResize="false" runat="server" OnClose="Window3_Close" IsModal="true"

View File

@ -723,6 +723,7 @@ namespace FineUIPro.Web.ResourcePlan
PM.ManHours = Convert.ToInt32(NumberBox15.Text); PM.ManHours = Convert.ToInt32(NumberBox15.Text);
PM.IsClose = 0; PM.IsClose = 0;
PM.AccountDisabled = 0; PM.AccountDisabled = 0;
PM.Phase = checkPhase.SelectedValueArray[0];
ManHourList.Add(PM); ManHourList.Add(PM);
} }
} }
@ -1175,6 +1176,7 @@ namespace FineUIPro.Web.ResourcePlan
} }
ManHoursPlan.IsClose = 0; ManHoursPlan.IsClose = 0;
ManHoursPlan.AccountDisabled = 0; ManHoursPlan.AccountDisabled = 0;
ManHoursPlan.Phase= checkPhase.SelectedValueArray[0];
ManHourList.Add(ManHoursPlan); ManHourList.Add(ManHoursPlan);
} }
} }
@ -1311,6 +1313,7 @@ namespace FineUIPro.Web.ResourcePlan
ManHoursPlan.IsClose = 0; ManHoursPlan.IsClose = 0;
ManHoursPlan.AccountDisabled = 0; ManHoursPlan.AccountDisabled = 0;
ManHoursPlan.Phase = checkPhase.SelectedValueArray[0];
ManHourList.Add(ManHoursPlan); ManHourList.Add(ManHoursPlan);
} }
} }
@ -1438,6 +1441,7 @@ namespace FineUIPro.Web.ResourcePlan
ManHoursPlan.IsClose = 0; ManHoursPlan.IsClose = 0;
ManHoursPlan.AccountDisabled = 0; ManHoursPlan.AccountDisabled = 0;
ManHoursPlan.Phase= checkPhase.SelectedValueArray[0];
ManHourList.Add(ManHoursPlan); ManHourList.Add(ManHoursPlan);
} }
} }

View File

@ -1187,6 +1187,7 @@ namespace FineUIPro.Web.ResourcePlan
PM.ManHours = Convert.ToInt32(NumberBox15.Text); PM.ManHours = Convert.ToInt32(NumberBox15.Text);
PM.IsClose = 0; PM.IsClose = 0;
PM.AccountDisabled = 0; PM.AccountDisabled = 0;
PM.Phase= checkPhase.SelectedValueArray[0];
ManHourList.Add(PM); ManHourList.Add(PM);
} }
} }
@ -1734,6 +1735,7 @@ namespace FineUIPro.Web.ResourcePlan
ManHoursPlan.IsClose = 0; ManHoursPlan.IsClose = 0;
ManHoursPlan.AccountDisabled = 0; ManHoursPlan.AccountDisabled = 0;
ManHoursPlan.Phase= checkPhase.SelectedValueArray[0];
ManHourList.Add(ManHoursPlan); ManHourList.Add(ManHoursPlan);
} }
} }
@ -1870,6 +1872,7 @@ namespace FineUIPro.Web.ResourcePlan
ManHoursPlan.IsClose = 0; ManHoursPlan.IsClose = 0;
ManHoursPlan.AccountDisabled = 0; ManHoursPlan.AccountDisabled = 0;
ManHoursPlan.Phase= checkPhase.SelectedValueArray[0];
ManHourList.Add(ManHoursPlan); ManHourList.Add(ManHoursPlan);
} }
} }
@ -1996,6 +1999,7 @@ namespace FineUIPro.Web.ResourcePlan
ManHoursPlan.IsClose = 0; ManHoursPlan.IsClose = 0;
ManHoursPlan.AccountDisabled = 0; ManHoursPlan.AccountDisabled = 0;
ManHoursPlan.Phase= checkPhase.SelectedValueArray[0];
ManHourList.Add(ManHoursPlan); ManHourList.Add(ManHoursPlan);
} }
} }

View File

@ -195,8 +195,8 @@
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtJobTitle" runat="server" Label="Job Title" LabelWidth="120px"></f:TextBox> <f:TextBox ID="txtJobTitle" runat="server" Label="Job Title" LabelWidth="120px"></f:TextBox>
<f:TextBox ID="txtPVIPredition" runat="server" Label="PVI Predition" LabelWidth="170px"></f:TextBox> <f:TextBox ID="txtPVIPredition" runat="server" Label="Predition" LabelWidth="170px"></f:TextBox>
<f:TextBox ID="txtElectrialEng" runat="server" Label="Electrial Eng." LabelWidth="120px"></f:TextBox> <f:TextBox ID="txtElectrialEng" runat="server" Label="Electrical" LabelWidth="120px"></f:TextBox>
<f:NumberBox ID="txtPendingCost" runat="server" Label="-Pending Cost(RMB)" LabelWidth="160px" EnableCommas="true" Readonly="true"></f:NumberBox> <f:NumberBox ID="txtPendingCost" runat="server" Label="-Pending Cost(RMB)" LabelWidth="160px" EnableCommas="true" Readonly="true"></f:NumberBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
@ -220,7 +220,7 @@
<Items> <Items>
<f:TextBox ID="txtCategory" runat="server" Label="Category" LabelWidth="120px"></f:TextBox> <f:TextBox ID="txtCategory" runat="server" Label="Category" LabelWidth="120px"></f:TextBox>
<f:TextBox ID="txtEngManager" runat="server" Label="Eng.Manager" LabelWidth="170px"></f:TextBox> <f:TextBox ID="txtEngManager" runat="server" Label="Eng.Manager" LabelWidth="170px"></f:TextBox>
<f:TextBox ID="txtOutSourceType" runat="server" Label="OutSource Type" LabelWidth="120px"></f:TextBox> <f:TextBox ID="txtOutSourceType" runat="server" Label="Outsource Type" LabelWidth="120px"></f:TextBox>
<f:TextBox ID="txtCAPEXPlanNo" runat="server" Label="CAPEX Plan No." LabelWidth="160px"></f:TextBox> <f:TextBox ID="txtCAPEXPlanNo" runat="server" Label="CAPEX Plan No." LabelWidth="160px"></f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
@ -625,10 +625,10 @@
FieldType="String" HeaderText="Sch.(Days)" HeaderTextAlign="Center"> FieldType="String" HeaderText="Sch.(Days)" HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="120px" ColumnID="Initiator" DataField="Initiator" <f:RenderField Width="120px" ColumnID="Initiator" DataField="Initiator"
FieldType="String" HeaderText="Initator" HeaderTextAlign="Center"> FieldType="String" HeaderText="Initiator" HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="150px" ColumnID="CategoryName" DataField="CategoryName" <f:RenderField Width="150px" ColumnID="CategoryName" DataField="CategoryName"
FieldType="String" HeaderText="Catetory" HeaderTextAlign="Center"> FieldType="String" HeaderText="category" HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
<f:RenderField Width="110px" ColumnID="TDCRecDate" DataField="TDCRecDate" <f:RenderField Width="110px" ColumnID="TDCRecDate" DataField="TDCRecDate"
FieldType="Date" Renderer="Date" HeaderText="Receive Date" HeaderTextAlign="Center"> FieldType="Date" Renderer="Date" HeaderText="Receive Date" HeaderTextAlign="Center">

View File

@ -27681,6 +27681,8 @@ namespace Model
private System.Nullable<double> _ActHours; private System.Nullable<double> _ActHours;
private string _Phase;
public View_NewManHours_Plan() public View_NewManHours_Plan()
{ {
} }
@ -28116,6 +28118,22 @@ namespace Model
} }
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Phase", DbType="NVarChar(50)")]
public string Phase
{
get
{
return this._Phase;
}
set
{
if ((this._Phase != value))
{
this._Phase = value;
}
}
}
} }
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_Project_Closure_Report")] [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_Project_Closure_Report")]