五环大屏;进度管理;等
This commit is contained in:
@@ -263,12 +263,17 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
int AllCount = 0;
|
||||
int MCount = 0;
|
||||
var getallin = from x in Funs.DB.T_d_EmployInOutRecord
|
||||
join z in Funs.DB.Base_WorkPost on x.PostId equals z.WorkPostId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
//where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == Convert.ToDateTime("2023-08-28")
|
||||
select new { x.IDCardNo, z.PostType };
|
||||
List<string> pids = new List<string>();
|
||||
pids.Add(this.CurrUser.LoginProjectId);
|
||||
var getallin = APIPageDataService.getPersonNum(pids, DateTime.Now);
|
||||
|
||||
//int AllCount = 0;
|
||||
//int MCount = 0;
|
||||
//var getallin = from x in Funs.DB.T_d_EmployInOutRecord
|
||||
// join z in Funs.DB.Base_WorkPost on x.PostId equals z.WorkPostId into zGroup
|
||||
// from z in zGroup.DefaultIfEmpty()
|
||||
// where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
|
||||
// select new { x.IDCardNo, z.PostType };
|
||||
|
||||
//var getallin = (from x in Funs.DB.SitePerson_Checking
|
||||
// join z in Funs.DB.SitePerson_Person on x.PersonId equals z.PersonId into zGroup
|
||||
@@ -1268,42 +1273,32 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
string doneJdtjHtml = string.Empty;
|
||||
string month = string.Format("{0:yyyy-MM-01}", DateTime.Now);
|
||||
//DateTime months = Convert.ToDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-01");
|
||||
if (DateTime.Now.Day < 26)
|
||||
{
|
||||
month = string.Format("{0:yyyy-MM-01}", DateTime.Now.AddMonths(-1));
|
||||
//months = Convert.ToDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.AddMonths(-1).Month.ToString() + "-01");
|
||||
}
|
||||
string strSql = @"select qc.QuantityCompletionId,(select PlanNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as PlanNum,
|
||||
(select RealNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as RealNum,
|
||||
(select NextNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as NextNum,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 Months <= @month)) as TotalPlanNum,
|
||||
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) 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 Months <= @month) WHEN 0 THEN 0
|
||||
|
||||
ELSE 100 * (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) / (1.0 * (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) 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 Months <= @month) / (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 and q.Months<=@month order by q.Months desc) and qc.ProjectId=@ProjectId order by ql.SortIndex, ql.Name";
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.AppendLine($@"select pro.ProjectId,pro.ProjectCode,pro.ProjectName,qc.QuantityCompletionId,ql.Name,ql.Unit,ql.DesignNum,ql.SortIndex,qco.PlanNum as PlanNum,qco.RealNum as RealNum,
|
||||
CONVERT(NVARCHAR(10), ((CAST(CASE ISNULL(qco.PlanNum, 0) WHEN 0 THEN 0 ELSE 100 * ISNULL(qco.RealNum, 0) / (1.0 * qco.PlanNum) END AS DECIMAL(9, 2))))) AS Rate,
|
||||
--(select NextNum from JDGL_QuantityCompletion where QuantityListId=ql.QuantityListId and Months=@month) as NextNum,
|
||||
CONVERT(FLOAT, (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) as TotalPlanNum,
|
||||
CONVERT(FLOAT, (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) as TotalRealNum,
|
||||
CONVERT(NVARCHAR(10), ((CAST(CASE(select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) WHEN 0 THEN 0 ELSE 100 * (select sum(ISNULL(RealNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month) / (1.0 * (select sum(ISNULL(PlanNum, 0)) from JDGL_QuantityCompletion where ProjectId = ql.ProjectId and QuantityListId = qc.QuantityListId and Months <= @month)) 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 Months <= @month) / (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 ");
|
||||
strSql.AppendLine(@"from JDGL_QuantityList ql
|
||||
left join JDGL_QuantityCompletion qc on ql.QuantityListId=qc.QuantityListId
|
||||
left join Base_Project pro on pro.ProjectId=qc.ProjectId
|
||||
left join (select PlanNum,RealNum,QuantityListId from JDGL_QuantityCompletion where Months=@month) qco on qco.QuantityListId=ql.QuantityListId ");
|
||||
strSql.AppendLine("where qc.ProjectId=@ProjectId and isnull(pro.ProjectState,1)=1 and qc.QuantityCompletionId=(select top 1 QuantityCompletionId from JDGL_QuantityCompletion q where q.QuantityListId=qc.QuantityListId and q.Months<=@month order by q.Months desc) ");
|
||||
strSql.AppendLine("order by ql.SortIndex, ql.Name ");
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@month", month));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql.ToString(), parameter);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int j = 0; j < tb.Rows.Count; j++)
|
||||
@@ -1314,7 +1309,7 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant
|
||||
string planNum = Funs.RemoveZero(tb.Rows[j]["PlanNum"].ToString().Trim());
|
||||
string realNum = Funs.RemoveZero(tb.Rows[j]["RealNum"].ToString().Trim());
|
||||
string rate = tb.Rows[j]["Rate"].ToString().Trim();
|
||||
string nextNum = Funs.RemoveZero(tb.Rows[j]["NextNum"].ToString().Trim());
|
||||
//string nextNum = Funs.RemoveZero(tb.Rows[j]["NextNum"].ToString().Trim());
|
||||
string totalPlanNum = Funs.RemoveZero(tb.Rows[j]["TotalPlanNum"].ToString().Trim());
|
||||
string totalRealNum = Funs.RemoveZero(tb.Rows[j]["TotalRealNum"].ToString().Trim());
|
||||
string totalRate = tb.Rows[j]["TotalRate"].ToString().Trim();
|
||||
@@ -1505,8 +1500,8 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant
|
||||
listdata.Add(workPostCount2);
|
||||
//焊工
|
||||
listCategories.Add("焊工");
|
||||
int workPostCount6 = persons.Count(x => x.WorkPostId == Const.WorkPost_Welder1 || x.WorkPostId == Const.WorkPost_Welder2 ||
|
||||
x.WorkPostId == Const.WorkPost_Welder3 || x.WorkPostId == Const.WorkPost_Welder4 || x.WorkPostId == Const.WorkPost_Welder5);
|
||||
int workPostCount6 = persons.Count(x => x.WorkPostId == Const.WorkPost_Welder1 || x.WorkPostId == Const.WorkPost_Welder2 || x.WorkPostId == Const.WorkPost_Welder3
|
||||
|| x.WorkPostId == Const.WorkPost_Welder4 || x.WorkPostId == Const.WorkPost_Welder5 || x.WorkPostId == Const.WorkPost_Welder6);
|
||||
listdata.Add(workPostCount6);
|
||||
//铆工
|
||||
listCategories.Add("铆工");
|
||||
|
||||
Reference in New Issue
Block a user