关键事项、周进度、月度计划
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
@@ -48,22 +51,44 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
{
|
||||
DateTime months = Convert.ToDateTime(this.txtMonth.Text + "-01");
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Grid1.DataSource = from x in db.JDGL_MonthPlan
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.Months == months
|
||||
orderby x.SortIndex
|
||||
select new
|
||||
{
|
||||
x.MonthPlanId,
|
||||
x.ProjectId,
|
||||
x.Months,
|
||||
UnitId = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
x.NodeContent,
|
||||
x.PlanDate,
|
||||
DutyPerson = db.Sys_User.First(y => y.UserId == x.DutyPerson).UserName,
|
||||
x.RealDate,
|
||||
x.Remark,
|
||||
};
|
||||
|
||||
string strSql = @"select
|
||||
mplan.MonthPlanId,mplan.ProjectId,mplan.Months,mplan.NodeContent,mplan.PlanDate,mplan.RealDate,mplan.Remark,unit.UnitName as UnitId
|
||||
,DutyPerson = STUFF((SELECT ',' + p.UserName FROM dbo.Sys_User as p where PATINDEX('%,' + RTRIM(p.UserId) + ',%', ',' + mplan.DutyPerson + ',') > 0 FOR XML PATH('')), 1, 1,'')
|
||||
from JDGL_MonthPlan as mplan
|
||||
left join Base_Unit as unit on unit.UnitId = mplan.UnitId
|
||||
where mplan.ProjectId = @ProjectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
|
||||
strSql += " and mplan.Months = @months";
|
||||
listStr.Add(new SqlParameter("@months", months));
|
||||
strSql += " order by mplan.SortIndex ";
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
Grid1.DataSource = tb;
|
||||
Grid1.DataBind();
|
||||
|
||||
|
||||
//Grid1.DataSource = from x in db.JDGL_MonthPlan
|
||||
// where x.ProjectId == this.CurrUser.LoginProjectId && x.Months == months
|
||||
// orderby x.SortIndex
|
||||
// select new
|
||||
// {
|
||||
// x.MonthPlanId,
|
||||
// x.ProjectId,
|
||||
// x.Months,
|
||||
// UnitId = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
// x.NodeContent,
|
||||
// x.PlanDate,
|
||||
// DutyPerson = db.Sys_User.First(y => y.UserId == x.DutyPerson).UserName,
|
||||
// x.RealDate,
|
||||
// x.Remark,
|
||||
// };
|
||||
//Grid1.DataBind();
|
||||
}
|
||||
|
||||
#region 月份选择事件
|
||||
@@ -110,11 +135,22 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
}
|
||||
MonthPlan.NodeContent = item.NodeContent;
|
||||
MonthPlan.PlanDate = item.PlanDate;
|
||||
var user = users.FirstOrDefault(x => x.UserName == item.DutyPerson);
|
||||
if (user != null)
|
||||
var dutyPersons = item.DutyPerson.Split(',');
|
||||
string dutyPersonIds = string.Empty;
|
||||
foreach (var dutyPerson in dutyPersons)
|
||||
{
|
||||
MonthPlan.DutyPerson = user.UserId;
|
||||
var user = users.FirstOrDefault(x => x.UserName == dutyPerson);
|
||||
if (user != null)
|
||||
{
|
||||
dutyPersonIds = !string.IsNullOrWhiteSpace(dutyPersonIds) ? $"{dutyPersonIds},{user.UserId}" : user.UserId;
|
||||
}
|
||||
}
|
||||
MonthPlan.DutyPerson = dutyPersonIds;
|
||||
//var user = users.FirstOrDefault(x => x.UserName == item.DutyPerson);
|
||||
//if (user != null)
|
||||
//{
|
||||
// MonthPlan.DutyPerson = user.UserId;
|
||||
//}
|
||||
MonthPlan.RealDate = item.RealDate;
|
||||
MonthPlan.Remark = item.Remark;
|
||||
MonthPlan.CompileMan = this.CurrUser.UserId;
|
||||
|
||||
Reference in New Issue
Block a user