0423-001
This commit is contained in:
parent
da4ee22341
commit
2bfaab2157
|
@ -0,0 +1,31 @@
|
|||
alter table [dbo].[JDGL_QuantityList] add SortIndex int null
|
||||
GO
|
||||
|
||||
|
||||
ALTER VIEW [dbo].[View_JDGL_QuantityCompletion]
|
||||
AS
|
||||
select qc.*,ql.DesignNum,ql.Name,ql.Unit,ql.SortIndex,
|
||||
CONVERT(FLOAT,(select sum(ISNULL(PlanNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and EndDate<=getdate())) as TotalPlanNum,
|
||||
CONVERT(FLOAT,(select sum(ISNULL(RealNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and EndDate<=getdate())) as TotalRealNum,
|
||||
CONVERT(NVARCHAR(10),((CAST(CASE ISNULL(qc.PlanNum,0) WHEN 0 THEN 0
|
||||
ELSE 100*ISNULL(qc.RealNum,0) / (1.0 *qc.PlanNum) END AS DECIMAL(9,2)))))+'%'
|
||||
AS Rate,
|
||||
CONVERT(NVARCHAR(10),((CAST(CASE (select sum(ISNULL(PlanNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and EndDate<=getdate()) WHEN 0 THEN 0
|
||||
ELSE 100*(select sum(ISNULL(RealNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and EndDate<=getdate()) / (1.0 *(select sum(ISNULL(PlanNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and EndDate<=getdate())) END AS DECIMAL(9,2)))))+'%'
|
||||
AS TotalRate,
|
||||
CONVERT(NVARCHAR(10),((CAST(CASE ISNULL(ql.DesignNum,0) WHEN 0 THEN 0
|
||||
ELSE 100*(select sum(ISNULL(RealNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and EndDate<=getdate()) / (1.0 *ql.DesignNum) END AS DECIMAL(9,2)))))+'%'
|
||||
AS SumRate,
|
||||
CONVERT(FLOAT,(select sum(ISNULL(PlanNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and Months<qc.Months)) as LastTotalPlanNum,
|
||||
CONVERT(FLOAT,(select sum(ISNULL(RealNum,0)) from JDGL_QuantityCompletion where ProjectId=ql.ProjectId and QuantityListId=qc.QuantityListId and Months<qc.Months)) as LastTotalRealNum
|
||||
from [dbo].JDGL_QuantityList ql
|
||||
left join dbo.[JDGL_QuantityCompletion] qc on ql.QuantityListId=qc.QuantityListId
|
||||
where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from [JDGL_QuantityCompletion] q where q.QuantityListId=qc.QuantityListId order by q.EndDate desc)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ namespace FineUIPro.Web.JDGL.Check
|
|||
//GetQuantityCompletion();
|
||||
string strSql = @"select *
|
||||
from dbo.View_JDGL_QuantityCompletion qc
|
||||
where qc.ProjectId=@ProjectId order by qc.Name";
|
||||
where qc.ProjectId=@ProjectId order by qc.SortIndex, qc.Name";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@ namespace FineUIPro.Web.common
|
|||
if (!IsPostBack)
|
||||
{
|
||||
string roleCNs = Request.Params["roleCNs"];
|
||||
List<string> cns = Funs.GetStrListByStr(roleCNs,',');
|
||||
List<string> cns = Funs.GetStrListByStr(roleCNs, ',');
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
//未遂事故
|
||||
//var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
|
@ -63,70 +63,93 @@ namespace FineUIPro.Web.common
|
|||
//签证
|
||||
var siteVisas = from x in db.Comprehensive_SiteVisaManagement where x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalId) select x;
|
||||
this.divQZ.InnerHtml = siteVisas.Count().ToString();
|
||||
//工程量完成情况
|
||||
string date = string.Empty;
|
||||
var quantityCompletions = from x in Funs.DB.View_JDGL_QuantityCompletion where x.ProjectId == this.CurrUser.LoginProjectId orderby x.Name select x;
|
||||
if (quantityCompletions.Count() > 0)
|
||||
//材料到货情况
|
||||
string contractQuantitySheetsStr = string.Empty;
|
||||
long projectId = BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId);
|
||||
var contractQuantitySheets = from x in Funs.DB.CLGL_ContractQuantitySheet where x.ProjectId == projectId.ToString() select x;
|
||||
if (contractQuantitySheets.Count() > 0)
|
||||
{
|
||||
string quantityCompletionStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>类型</div><div class='item jd-title'>单位</div><div class='item jd-title'>设计数量</div><div class='item jd-title'>计划完成</div><div class='item jd-title'>实际完成</div><div class='item jd-title'>计划完成率</div><div class='item jd-title'>累计计划完成</div><div class='item jd-title'>累计实际完成</div><div class='item jd-title'>累计计划完成率</div><div class='item jd-title'>总完成率</div></div>";
|
||||
contractQuantitySheetsStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>材料用途</div><div class='item jd-title'>合同号</div><div class='item jd-title'>专业</div><div class='item jd-title'>材料编码</div><div class='item jd-title'>位号</div><div class='item jd-title'>采购量</div><div class='item jd-title'>装置号</div><div class='item jd-title'>主项号</div><div class='item jd-title'>企业中文名称</div><div class='item jd-title'>备注</div></div>";
|
||||
int i = 1;
|
||||
foreach (var item in quantityCompletions)
|
||||
foreach (var item in contractQuantitySheets)
|
||||
{
|
||||
quantityCompletionStr += "<div class='jd-item'><div class='item'>"
|
||||
contractQuantitySheetsStr += "<div class='jd-item'><div class='item'>"
|
||||
+ i + "</div><div class='item'>"
|
||||
+ item.Name + "</div><div class='item'>"
|
||||
+ item.Unit + "</div><div class='item'>"
|
||||
+ (item.DesignNum != null ? item.DesignNum.Value.ToString("F0") : "0") + "</div><div class='item'>"
|
||||
+ (item.PlanNum != null ? item.PlanNum.Value.ToString("F0") : "0") + "</div><div class='item'>"
|
||||
+ (item.RealNum != null ? item.RealNum.Value.ToString("F0") : "0") + "</div><div class='item'>"
|
||||
+ item.Rate + "</div><div class='item'>"
|
||||
+ item.TotalPlanNum + "</div><div class='item'>"
|
||||
+ item.TotalRealNum + "</div><div class='item'>"
|
||||
+ item.TotalRate + "</div><div class='item'>"
|
||||
+ item.SumRate + "</div></div>";
|
||||
+ item.MaterialUse + "</div><div class='item'>"
|
||||
+ item.ContractCode + "</div><div class='item'>"
|
||||
+ item.Major + "</div><div class='item'>"
|
||||
+ item.MaterialCode + "</div><div class='item'>"
|
||||
+ item.TagNo + "</div><div class='item'>"
|
||||
+ item.BuyQuantity + "</div><div class='item'>"
|
||||
+ item.DeviceCode + "</div><div class='item'>"
|
||||
+ item.MainItemCode + "</div><div class='item'>"
|
||||
+ item.UnitName + "</div><div class='item'>"
|
||||
+ item.Remark + "</div></div>";
|
||||
i++;
|
||||
}
|
||||
divGZL.InnerHtml = quantityCompletionStr;
|
||||
if (quantityCompletions.Count() > 0)
|
||||
{
|
||||
if (quantityCompletions.First() != null && quantityCompletions.First().EndDate != null)
|
||||
{
|
||||
date = " (" + string.Format("{0:yyyy-MM}", quantityCompletions.First().EndDate) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
else //低温储罐项目显示低温储罐数据
|
||||
this.divGZL.InnerHtml= contractQuantitySheetsStr;
|
||||
this.hdContractQuantitySheets.Value = contractQuantitySheetsStr;
|
||||
//材料出库情况
|
||||
string materialRecordsStr = string.Empty;
|
||||
var materialRecords= from x in db.CLGL_PickMaterialRecord where x.ProjectId == projectId.ToString() select x;
|
||||
if (contractQuantitySheets.Count() > 0)
|
||||
{
|
||||
var lowTankCompletions = from x in Funs.DB.View_JDGL_LowTankCompletion where x.ProjectId == this.CurrUser.LoginProjectId orderby x.Code select x;
|
||||
string quantityCompletionStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>储罐编号</div><div class='item jd-title'>类型</div><div class='item jd-title'>单位</div><div class='item jd-title'>设计数量</div><div class='item jd-title'>计划完成</div><div class='item jd-title'>实际完成</div><div class='item jd-title'>计划完成率</div><div class='item jd-title'>累计计划完成</div><div class='item jd-title'>累计实际完成</div><div class='item jd-title'>累计计划完成率</div><div class='item jd-title'>总完成率</div></div>";
|
||||
materialRecordsStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>领料单号</div><div class='item jd-title'>领料时间</div><div class='item jd-title'>领料单位</div><div class='item jd-title'>领料截止时间</div><div class='item jd-title'>专业</div><div class='item jd-title'>材料编码</div><div class='item jd-title'>位号</div><div class='item jd-title'>申领量</div><div class='item jd-title'>批准量</div><div class='item jd-title'>实发量</div><div class='item jd-title'>装置号</div><div class='item jd-title'>主项号</div><div class='item jd-title'>发料备注</div></div>";
|
||||
int i = 1;
|
||||
foreach (var item in lowTankCompletions)
|
||||
foreach (var item in materialRecords)
|
||||
{
|
||||
quantityCompletionStr += "<div class='jd-item'><div class='item'>"
|
||||
materialRecordsStr += "<div class='jd-item'><div class='item'>"
|
||||
+ i + "</div><div class='item'>"
|
||||
+ item.Code + "</div><div class='item'>"
|
||||
+ item.Name + "</div><div class='item'>"
|
||||
+ item.Unit + "</div><div class='item'>"
|
||||
+ (item.TotalNum != null ? item.TotalNum.Value.ToString("F0") : "0") + "</div><div class='item'>"
|
||||
+ (item.PlanNum != null ? item.PlanNum.Value.ToString("F0") : "0") + "</div><div class='item'>"
|
||||
+ (item.RealNum != null ? item.RealNum.Value.ToString("F0") : "0") + "</div><div class='item'>"
|
||||
+ item.Rate + "</div><div class='item'>"
|
||||
+ item.TotalPlanNum + "</div><div class='item'>"
|
||||
+ item.TotalRealNum + "</div><div class='item'>"
|
||||
+ item.TotalRate + "</div><div class='item'>"
|
||||
+ item.SumRate + "</div></div>";
|
||||
+ item.PickCode + "</div><div class='item'>"
|
||||
+ (item.PickDate.HasValue?string.Format("{0:yyyy-MM-dd}", item.PickDate.Value) :"") + "</div><div class='item'>"
|
||||
+ item.PickUnit + "</div><div class='item'>"
|
||||
+ (item.PickLimitDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.PickLimitDate.Value) : "") + "</div><div class='item'>"
|
||||
+ item.Major + "</div><div class='item'>"
|
||||
+ item.MaterialCode + "</div><div class='item'>"
|
||||
+ item.TagNo + "</div><div class='item'>"
|
||||
+ item.ClaimQuantity + "</div><div class='item'>"
|
||||
+ item.ApproveQuantity + "</div><div class='item'>"
|
||||
+ item.ActualQuantity + "</div><div class='item'>"
|
||||
+ item.DeviceCode + "</div><div class='item'>"
|
||||
+ item.MainItemCode + "</div><div class='item'>"
|
||||
+ item.Remark + "</div></div>";
|
||||
i++;
|
||||
}
|
||||
divGZL.InnerHtml = quantityCompletionStr;
|
||||
if (lowTankCompletions.Count() > 0)
|
||||
}
|
||||
this.hdMaterialRecords.Value = materialRecordsStr;
|
||||
}
|
||||
}
|
||||
|
||||
protected string swiper_One1
|
||||
{
|
||||
if (lowTankCompletions.First() != null && lowTankCompletions.First().EndDate != null)
|
||||
get
|
||||
{
|
||||
date = " (" + string.Format("{0:yyyy-MM}", lowTankCompletions.First().EndDate) + ")";
|
||||
string contractQuantitySheetsStr = string.Empty;
|
||||
long projectId = BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId);
|
||||
var contractQuantitySheets = from x in Funs.DB.CLGL_ContractQuantitySheet where x.ProjectId == projectId.ToString() select x;
|
||||
if (contractQuantitySheets.Count() > 0)
|
||||
{
|
||||
contractQuantitySheetsStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>材料用途</div><div class='item jd-title'>合同号</div><div class='item jd-title'>专业</div><div class='item jd-title'>材料编码</div><div class='item jd-title'>位号</div><div class='item jd-title'>采购量</div><div class='item jd-title'>装置号</div><div class='item jd-title'>主项号</div><div class='item jd-title'>企业中文名称</div><div class='item jd-title'>备注</div></div>";
|
||||
int i = 1;
|
||||
foreach (var item in contractQuantitySheets)
|
||||
{
|
||||
contractQuantitySheetsStr += "<div class='jd-item'><div class='item'>"
|
||||
+ i + "</div><div class='item'>"
|
||||
+ item.MaterialUse + "</div><div class='item'>"
|
||||
+ item.ContractCode + "</div><div class='item'>"
|
||||
+ item.Major + "</div><div class='item'>"
|
||||
+ item.MaterialCode + "</div><div class='item'>"
|
||||
+ item.TagNo + "</div><div class='item'>"
|
||||
+ item.BuyQuantity + "</div><div class='item'>"
|
||||
+ item.DeviceCode + "</div><div class='item'>"
|
||||
+ item.MainItemCode + "</div><div class='item'>"
|
||||
+ item.UnitName + "</div><div class='item'>"
|
||||
+ item.Remark + "</div></div>";
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
divMonth.InnerHtml = "专业工作量表" + date;
|
||||
return contractQuantitySheetsStr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,24 @@ namespace FineUIPro.Web.common {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button imgBtn;
|
||||
|
||||
/// <summary>
|
||||
/// hdContractQuantitySheets 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlInputHidden hdContractQuantitySheets;
|
||||
|
||||
/// <summary>
|
||||
/// hdMaterialRecords 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlInputHidden hdMaterialRecords;
|
||||
|
||||
/// <summary>
|
||||
/// swiper2 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace FineUIPro.Web.common
|
|||
this.divBG.InnerHtml = designChangeOrders.Count().ToString();
|
||||
//工程量完成情况
|
||||
string date = string.Empty;
|
||||
var quantityCompletions = from x in Funs.DB.View_JDGL_QuantityCompletion where x.ProjectId == this.CurrUser.LoginProjectId orderby x.Name select x;
|
||||
var quantityCompletions = from x in Funs.DB.View_JDGL_QuantityCompletion where x.ProjectId == this.CurrUser.LoginProjectId orderby x.SortIndex, x.Name select x;
|
||||
if (quantityCompletions.Count() > 0)
|
||||
{
|
||||
string quantityCompletionStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>类型</div><div class='item jd-title'>单位</div><div class='item jd-title'>设计数量</div><div class='item jd-title'>计划完成</div><div class='item jd-title'>实际完成</div><div class='item jd-title'>计划完成率</div><div class='item jd-title'>累计计划完成</div><div class='item jd-title'>累计实际完成</div><div class='item jd-title'>累计计划完成率</div><div class='item jd-title'>总完成率</div></div>";
|
||||
|
|
Loading…
Reference in New Issue