合并最新

This commit is contained in:
2022-12-20 09:32:32 +08:00
parent 844e9f1488
commit 1abdaa9476
654 changed files with 73563 additions and 9746 deletions
@@ -437,7 +437,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
}
else //不存在子单位工程,加载分部工程
{
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == e.Node.NodeID && x.SuperWbsSetId == null && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
if (wbsSet1s.Count() > 0)
{
foreach (var wbsSet1 in wbsSet1s)
@@ -470,7 +470,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
}
else //单位工程下直接是分项内容,如质量行为
{
var wbsSet3s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 3 && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
var wbsSet3s = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
if (wbsSet3s.Count() > 0)
{
foreach (var wbsSet3 in wbsSet3s)
@@ -506,7 +506,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
}
else if (e.Node.CommandName == "childUnitProject") //展开子单位工程节点
{
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
foreach (var wbsSet1 in wbsSet1s)
{
TreeNode newNode = new TreeNode();
@@ -586,7 +586,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
{
if (this.trWBS.SelectedNode.CommandName == "childUnitProject")
{
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == this.trWBS.SelectedNodeID && x.Flag == 1 select x;
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == this.trWBS.SelectedNodeID && x.SuperWbsSetId == null select x;
bool isShow = true; //子单位工程下只有一级子级时可以设置、分配权重
foreach (var wbsSet1 in wbsSet1s)
{
@@ -931,7 +931,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
{
var unit = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
var childUnit = from x in Funs.DB.Wbs_UnitProject where x.SuperUnitProjectId == id select x;
var wbs = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == id && (x.Flag == 1 || x.SuperWbsSetId == null) select x;
var wbs = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == id && x.SuperWbsSetId == null select x;
if (unit != null && unit.WeightsMoney != null)
{
weights = unit.WeightsMoney ?? 0;
@@ -992,7 +992,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
if (type == "childUnitProject")
{
var unit = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
var wbs = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == id && (x.Flag == 1 || x.SuperWbsSetId == null) select x;
var wbs = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == id && x.SuperWbsSetId == null select x;
if (unit != null && unit.WeightsMoney != null)
{
weights = unit.WeightsMoney ?? 0;
@@ -1325,26 +1325,32 @@ namespace FineUIPro.Web.JDGL.WBSWeights
BLL.Project_InstallationService.UpdateInstallation(installation);
//工序
Model.Project_Installation pInstallation = BLL.Project_InstallationService.GetInstallationByInstallationId(installation.SuperInstallationId);
if (pInstallation.WeightsMoney == null)
if (pInstallation != null)
{
pInstallation.WeightsMoney = money;
if (pInstallation.WeightsMoney == null)
{
pInstallation.WeightsMoney = money;
}
else
{
pInstallation.WeightsMoney += money;
}
BLL.Project_InstallationService.UpdateInstallation(pInstallation);
//装置
Model.Project_Installation ppInstallation = BLL.Project_InstallationService.GetInstallationByInstallationId(pInstallation.SuperInstallationId);
if (ppInstallation != null)
{
if (ppInstallation.WeightsMoney == null)
{
ppInstallation.WeightsMoney = money;
}
else
{
ppInstallation.WeightsMoney += money;
}
BLL.Project_InstallationService.UpdateInstallation(ppInstallation);
}
}
else
{
pInstallation.WeightsMoney += money;
}
BLL.Project_InstallationService.UpdateInstallation(pInstallation);
//装置
Model.Project_Installation ppInstallation = BLL.Project_InstallationService.GetInstallationByInstallationId(pInstallation.SuperInstallationId);
if (ppInstallation.WeightsMoney == null)
{
ppInstallation.WeightsMoney = money;
}
else
{
ppInstallation.WeightsMoney += money;
}
BLL.Project_InstallationService.UpdateInstallation(ppInstallation);
}
else //总图
{
@@ -1455,41 +1461,41 @@ namespace FineUIPro.Web.JDGL.WBSWeights
{
//if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JDGL_WeightsAuditMenuId, Const.BtnCancelAuditing))
//{
if (IsChildAudit(Grid1.SelectedRow))
if (IsChildAudit(Grid1.SelectedRow))
{
Alert.ShowInTop("该项的子项权重已设置审核,不能取消审核!", MessageBoxIcon.Warning);
return;
}
else
{
if (Grid1.SelectedRow.Values[14].ToString() == "cnProfession")
{
Alert.ShowInTop("该项的子项权重已设置审核,不能取消审核!", MessageBoxIcon.Warning);
return;
var cn = BLL.CnProfessionService.GetCnProfessionByCnProfessionId(Grid1.SelectedRow.RowID);
if (cn != null)
{
cn.IsWeightsApprove = false;
}
}
else
if (Grid1.SelectedRow.Values[14].ToString() == "unitProject" || Grid1.SelectedRow.Values[14].ToString() == "childUnitProject")
{
if (Grid1.SelectedRow.Values[14].ToString() == "cnProfession")
var unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(Grid1.SelectedRow.RowID);
if (unitProject != null)
{
var cn = BLL.CnProfessionService.GetCnProfessionByCnProfessionId(Grid1.SelectedRow.RowID);
if (cn != null)
{
cn.IsWeightsApprove = false;
}
unitProject.IsWeightsApprove = false;
}
if (Grid1.SelectedRow.Values[14].ToString() == "unitProject" || Grid1.SelectedRow.Values[14].ToString() == "childUnitProject")
{
var unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(Grid1.SelectedRow.RowID);
if (unitProject != null)
{
unitProject.IsWeightsApprove = false;
}
}
if (Grid1.SelectedRow.Values[14].ToString() == "wbsSet")
{
var wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(Grid1.SelectedRow.RowID);
if (wbsSet != null)
{
wbsSet.IsWeightsApprove = false;
}
}
Funs.DB.SubmitChanges();
BindGrid();
Alert.ShowInTop("已取消该项审核!", MessageBoxIcon.Warning);
}
if (Grid1.SelectedRow.Values[14].ToString() == "wbsSet")
{
var wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(Grid1.SelectedRow.RowID);
if (wbsSet != null)
{
wbsSet.IsWeightsApprove = false;
}
}
Funs.DB.SubmitChanges();
BindGrid();
Alert.ShowInTop("已取消该项审核!", MessageBoxIcon.Warning);
}
//}
//else
//{
@@ -1620,7 +1626,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
budgetUnitPrice = pWbsSet.BudgetUnitPrice;
this.Grid2.Columns[4].Hidden = true;
this.Grid2.Columns[5].Hidden = true;
}
}
if (pWbsSet.CostUnivalent != null)
{
costUnivalent = pWbsSet.CostUnivalent;
@@ -1793,7 +1799,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
else
{
this.Grid1.Columns[1].HeaderText = "分部工程";
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == this.trWBS.SelectedNode.NodeID && x.IsApprove == true orderby x.SortIndex, x.WbsSetCode select x;
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == null && x.UnitProjectId == this.trWBS.SelectedNode.NodeID && x.IsApprove == true orderby x.SortIndex, x.WbsSetCode select x;
if (wbsSet1s.Count() > 0)
{
foreach (var wbsSet1 in wbsSet1s)
@@ -1817,7 +1823,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
}
else //单位工程下直接是分项内容,如质量行为
{
var wbsSet3s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 3 && x.UnitProjectId == this.trWBS.SelectedNode.NodeID && x.IsApprove == true orderby x.SortIndex, x.WbsSetCode select x;
var wbsSet3s = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == null && x.UnitProjectId == this.trWBS.SelectedNode.NodeID && x.IsApprove == true orderby x.SortIndex, x.WbsSetCode select x;
if (wbsSet3s.Count() > 0)
{
foreach (var wbsSet3 in wbsSet3s)
@@ -1861,7 +1867,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
parentItem.WeightsMoneyStr = decimal.Round(Convert.ToDecimal(parentItem.WeightsMoney), 2).ToString();
items.Add(parentItem);
}
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == this.trWBS.SelectedNode.NodeID && x.IsApprove == true orderby x.SortIndex, x.WbsSetCode select x;
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == null && x.UnitProjectId == this.trWBS.SelectedNode.NodeID && x.IsApprove == true orderby x.SortIndex, x.WbsSetCode select x;
foreach (var wbsSet1 in wbsSet1s)
{
Model.WBSSetItem item = new Model.WBSSetItem();
@@ -2207,7 +2213,7 @@ namespace FineUIPro.Web.JDGL.WBSWeights
/// <param name="unitProject"></param>
private void SetWbsSetWeights(Model.Wbs_UnitProject unitProject)
{
var wbsSet1s = (from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == unitProject.UnitProjectId && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x).ToList();
var wbsSet1s = (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == null && x.UnitProjectId == unitProject.UnitProjectId && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x).ToList();
decimal wbsSet1TotalMoney = unitProject.WeightsMoney ?? 0;
decimal totalWbsSet1Weights = 0;
for (int a = 0; a < wbsSet1s.Count(); a++)