@@ -62,7 +62,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
/// </summary>
/// <param name="keyValue">项目Id</param>
/// <returns></returns>
public IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue)
public IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue, string mainId )
{
try
{
@@ -70,7 +70,17 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
var strSql = new StringBuilder();
strSql.Append(@" select t.*,c.[type] as CalType,c.Name as CalName from QualityReportChild t join QualityReportMain m on t.Mainid=m.id
join QualityReportMain a on t.MainId = a.Id join CalculateProject c on t.ProjectId=c.id ");
strSql.Append($" WHERE 1=1 and a.FillinFromId='{keyValue}' and year(m.ReportTime)=year(getdate()) and month(m.ReportTime)='{month}'");
strSql.Append($" WHERE 1=1 and a.FillinFromId='{keyValue}' ");
if (!string.IsNullOrEmpty(mainId))
{
strSql.Append($" and t.MainId='{mainId}'");
}
else
{
strSql.Append($" and year(m.ReportTime)=year(getdate()) and month(m.ReportTime)='{month}'");
}
strSql.Append(" order by t.Sort ");
// 虚拟参数
var dp = new DynamicParameters(new { });
@@ -341,7 +351,7 @@ where a.Id='{keyValue}' order by b.Sort";
else
{
gs = gs.Replace("(", "(").Replace(")", ")");
if (gs.Contains("%"))
if (gs.Contains("*100 %"))
{
gs = gs.Replace("%", "");
var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs}))+'%' as num ");
@@ -349,7 +359,7 @@ where a.Id='{keyValue}' order by b.Sort";
}
else
{
var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs}) ) as num ");
var dt = db.FindTable($"select convert(decimal(18,2),{gs} ) as num ");
result = dt.Rows[0][0].ToString();
}
}