集团数据对接
This commit is contained in:
@@ -320,6 +320,27 @@ namespace BLL
|
||||
public static int GetTotalDineNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
|
||||
where x.ProjectId == projectid
|
||||
select x;
|
||||
if (getD1.Count() > 0)
|
||||
{
|
||||
foreach (var item in getD1)
|
||||
{
|
||||
result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
||||
where x.ProjectId == projectid
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (getD2 != null)
|
||||
{
|
||||
result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -329,6 +350,27 @@ namespace BLL
|
||||
public static int GetCompleteDineNum(string projectid)
|
||||
{
|
||||
int result = 0;
|
||||
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
|
||||
where x.ProjectId == projectid
|
||||
select x;
|
||||
if (getD1.Count() > 0)
|
||||
{
|
||||
foreach (var item in getD1)
|
||||
{
|
||||
result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
||||
where x.ProjectId == projectid
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (getD2 != null)
|
||||
{
|
||||
result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -337,10 +379,20 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetTotalFilmNum(string projectid)
|
||||
{
|
||||
int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
|
||||
join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
where y.ProjectId == projectid
|
||||
select x.CHT_TotalFilm).ToList().Sum());
|
||||
//int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
|
||||
// join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
// where y.ProjectId == projectid
|
||||
// select x.CHT_TotalFilm).ToList().Sum());
|
||||
|
||||
int result = 0;
|
||||
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
||||
where x.ProjectId == projectid
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (getD2 != null)
|
||||
{
|
||||
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -349,10 +401,19 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static int GetOKFilmNum(string projectid)
|
||||
{
|
||||
int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
|
||||
join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
where y.ProjectId == projectid
|
||||
select x.CHT_PassFilm).ToList().Sum());
|
||||
//int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
|
||||
// join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
// where y.ProjectId == projectid
|
||||
// select x.CHT_PassFilm).ToList().Sum());
|
||||
int result = 0;
|
||||
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
||||
where x.ProjectId == projectid
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (getD2 != null)
|
||||
{
|
||||
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1504,7 +1504,7 @@ namespace BLL
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
|
||||
select x.OperativesNum).ToList().Sum(x => x.Value);
|
||||
select x).ToList().Sum(x => x.OperativesNum ?? 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1567,7 +1567,7 @@ namespace BLL
|
||||
{
|
||||
var result =
|
||||
(from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
|
||||
where x.ProjectId == projectid && x.IsSuperLargerHazard == true && x.OperativesNum != null && x.RecordTime > Const.DtmarkTime
|
||||
select x.OperativesNum).ToList().Sum(x => x.Value);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user