2023-03-16
This commit is contained in:
@@ -739,5 +739,119 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训对象
|
||||
/// <summary>
|
||||
/// 获取质量培训对象
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getPlanTrainPersons()
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Base_CQMSTrainObject
|
||||
orderby x.TrainObjectCode
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.TrainObjectId, BaseInfoName = x.TrainObjectName }).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训类别
|
||||
/// <summary>
|
||||
/// 获取质量培训类别
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getCQMSTrainType()
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in Funs.DB.Base_CQMSTrainType
|
||||
orderby x.TrainTypeCode
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.TrainTypeId, BaseInfoCode = x.TrainTypeCode, BaseInfoName = x.TrainTypeName }).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训主持人
|
||||
/// <summary>
|
||||
/// 获取质量培训主持人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getCQMSTrainHostMan(string projectId)
|
||||
{
|
||||
var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1, Const.QAManager + "," + Const.CQEngineer);
|
||||
List<Model.BaseInfoItem> items = new List<Model.BaseInfoItem>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.BaseInfoItem b = new Model.BaseInfoItem();
|
||||
b.BaseInfoId = item.PersonId;
|
||||
b.BaseInfoName = item.PersonName;
|
||||
items.Add(b);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训参与培训教育人员信息
|
||||
/// <summary>
|
||||
/// 获取质量培训参与培训教育人员信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getRealTrainPersons(string projectId)
|
||||
{
|
||||
var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1 + "," + Const.ProjectUnitType_2, null);
|
||||
List<Model.BaseInfoItem> items = new List<Model.BaseInfoItem>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.BaseInfoItem b = new Model.BaseInfoItem();
|
||||
b.BaseInfoId = item.PersonId;
|
||||
b.BaseInfoName = item.PersonName;
|
||||
items.Add(b);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量会议主持人
|
||||
/// <summary>
|
||||
/// 获取质量会议主持人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getCQMSMeetingHostMan(string projectId,string unitId)
|
||||
{
|
||||
var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByUnitIdsRoleIds(projectId, unitId, null);
|
||||
List<Model.BaseInfoItem> items = new List<Model.BaseInfoItem>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.BaseInfoItem b = new Model.BaseInfoItem();
|
||||
b.BaseInfoId = item.PersonId;
|
||||
b.BaseInfoName = item.PersonName;
|
||||
items.Add(b);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量会议参加人员
|
||||
/// <summary>
|
||||
/// 获取质量会议参加人员
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getAttentPerson(string projectId)
|
||||
{
|
||||
var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1 + "," + Const.ProjectUnitType_2, null);
|
||||
List<Model.BaseInfoItem> items = new List<Model.BaseInfoItem>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.BaseInfoItem b = new Model.BaseInfoItem();
|
||||
b.BaseInfoId = item.PersonId;
|
||||
b.BaseInfoName = item.PersonName;
|
||||
items.Add(b);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.PTG;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
@@ -572,7 +574,16 @@ namespace BLL
|
||||
|
||||
if (!string.IsNullOrEmpty(newProjectPerson.SitePersonId))
|
||||
{
|
||||
SitePerson_PersonService.UpdateSitePerson(newProjectPerson);
|
||||
Model.Sys_Log newlog = new Sys_Log
|
||||
{
|
||||
UserId = newPerson.PersonId,
|
||||
MenuId = Const.PersonListMenuId,
|
||||
OperationName = "APP修改人员",
|
||||
OperationLog = "修改人员"+newPerson.PersonName,
|
||||
DataId = newPerson.PersonId,
|
||||
ProjectId = person.ProjectId,
|
||||
};
|
||||
SitePerson_PersonService.UpdateSitePerson(newProjectPerson, newlog);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -36,6 +36,25 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目所有单位信息
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getProjectUnitLists(string projectId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var units = (from x in db.Base_Unit
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId
|
||||
orderby x.UnitName
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.UnitId, BaseInfoCode = x.UnitCode, BaseInfoName = x.UnitName }).ToList();
|
||||
return units;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5)
|
||||
/// </summary>
|
||||
|
||||
@@ -150,144 +150,6 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddProjectUser(string ProjectCode, string UserID)
|
||||
{
|
||||
Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString);
|
||||
Base_Project base_Project = new Base_Project();
|
||||
SitePerson_Person sitePerson = new SitePerson_Person();
|
||||
base_Project = BLL.ProjectService.GetProjectByProjectCode(ProjectCode);
|
||||
if (base_Project == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var ProUser = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(base_Project.ProjectId, UserID);
|
||||
if (ProUser == null)
|
||||
{
|
||||
sitePerson.SitePersonId = SQLHelper.GetNewID();
|
||||
sitePerson.ProjectId = base_Project.ProjectId;
|
||||
sitePerson.PersonId = UserID;
|
||||
sitePerson.UnitId = Const.UnitId_SEDIN;
|
||||
sitePerson.States = Const.State_1;
|
||||
SitePerson_PersonService.AddSitePerson(ProUser);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProUser.ProjectId = base_Project.ProjectId;
|
||||
ProUser.PersonId = UserID;
|
||||
ProUser.UnitId = Const.UnitId_SEDIN;
|
||||
ProUser.States = Const.State_1;
|
||||
SitePerson_PersonService.UpdateSitePerson(ProUser);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Pro_Person SavePro_Person(Pro_Person PersonjsonData)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Pro_Person rb = PersonjsonData;
|
||||
|
||||
Pro_Person _Person = new Pro_Person
|
||||
{
|
||||
data = new List<Pro_PersonDataItem>()
|
||||
};
|
||||
foreach (Pro_PersonDataItem item in rb.data)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (CheckDataIsNull(item)) //判断参数是否有空值
|
||||
{
|
||||
Pro_PersonDataItem pro_personDataItem = new Pro_PersonDataItem
|
||||
{
|
||||
ProjectCode = item.ProjectCode,
|
||||
UserCode = item.UserCode,
|
||||
UserName = item.UserName,
|
||||
IdentityCard = item.IdentityCard
|
||||
};
|
||||
|
||||
_Person.data.Add(pro_personDataItem);
|
||||
_Person.Message += item.UserCode + "--参数有误存在null值|";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (item.UserCode == null || item.UserCode == "")
|
||||
{
|
||||
Pro_PersonDataItem pro_personDataItem = new Pro_PersonDataItem
|
||||
{
|
||||
ProjectCode = item.ProjectCode,
|
||||
UserCode = item.UserCode,
|
||||
UserName = item.UserName,
|
||||
IdentityCard = item.IdentityCard
|
||||
};
|
||||
|
||||
_Person.data.Add(pro_personDataItem);
|
||||
_Person.Message += item.UserCode + "--身份证信息有误|";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.ProjectCode == null || item.ProjectCode == "")
|
||||
{
|
||||
Pro_PersonDataItem pro_personDataItem = new Pro_PersonDataItem
|
||||
{
|
||||
ProjectCode = item.ProjectCode,
|
||||
UserCode = item.UserCode,
|
||||
UserName = item.UserName,
|
||||
IdentityCard = item.IdentityCard
|
||||
};
|
||||
|
||||
_Person.data.Add(pro_personDataItem);
|
||||
_Person.Message += item.UserCode + "--项目代号不能为空|";
|
||||
continue;
|
||||
}
|
||||
|
||||
var getPerson = Person_PersonsService.GetPerson_PersonsByJobNum(item.UserCode);
|
||||
if (getPerson != null)
|
||||
{
|
||||
getPerson.JobNum = item.UserCode;
|
||||
getPerson.PersonName = item.UserName;
|
||||
getPerson.DataFrom = "API";
|
||||
db.SubmitChanges();
|
||||
APIHTGLPersonService.AddProjectUser(item.ProjectCode, getPerson.PersonId);
|
||||
}
|
||||
else
|
||||
{
|
||||
string newKeyID = SQLHelper.GetNewID();
|
||||
Model.Person_Persons newUser = new Model.Person_Persons
|
||||
{
|
||||
PersonId = newKeyID,
|
||||
Account = item.UserCode,
|
||||
JobNum = item.UserCode,
|
||||
PersonName = item.UserName,
|
||||
IdentityCard = item.IdentityCard,
|
||||
UnitId = Const.UnitId_SEDIN,
|
||||
Password = Funs.EncryptionPassword(Const.Password),
|
||||
DataFrom = "API",
|
||||
};
|
||||
db.Person_Persons.InsertOnSubmit(newUser);
|
||||
db.SubmitChanges();
|
||||
AddProjectUser(item.ProjectCode, newKeyID);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Pro_PersonDataItem pro_personDataItem = new Pro_PersonDataItem
|
||||
{
|
||||
ProjectCode = item.ProjectCode,
|
||||
UserCode = item.UserCode,
|
||||
UserName = item.UserName,
|
||||
IdentityCard = item.IdentityCard
|
||||
};
|
||||
|
||||
_Person.data.Add(pro_personDataItem);
|
||||
_Person.Message += ex.Message;
|
||||
}
|
||||
}
|
||||
return _Person;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool CheckDataIsNull(object t)
|
||||
{
|
||||
bool Isok = false;
|
||||
|
||||
@@ -91,6 +91,18 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetHandleManName(string MeetingId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
var a = Funs.DB.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveDate == null);
|
||||
if (a != null)
|
||||
{
|
||||
name = BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据质量会议编号获取一个质量会议审批信息
|
||||
/// </summary>
|
||||
@@ -155,5 +167,92 @@ namespace BLL
|
||||
{
|
||||
return db.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == BLL.Const.CQMSMeeting_Compile);
|
||||
}
|
||||
|
||||
public static List<Model.Meeting_CQMSMeetingApprove> GetListDataByIdForApi(string id)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Meeting_CQMSMeetingApprove
|
||||
where x.MeetingId == id && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.MeetingApproveId,
|
||||
x.MeetingId,
|
||||
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
};
|
||||
List<Model.Meeting_CQMSMeetingApprove> res = new List<Model.Meeting_CQMSMeetingApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Meeting_CQMSMeetingApprove approve = new Model.Meeting_CQMSMeetingApprove();
|
||||
approve.MeetingApproveId = item.MeetingApproveId;
|
||||
approve.MeetingId = item.MeetingId;
|
||||
approve.ApproveMan = item.ApproveMan;
|
||||
approve.ApproveDate = item.ApproveDate;
|
||||
approve.IsAgree = item.IsAgree;
|
||||
approve.ApproveIdea = item.ApproveIdea;
|
||||
approve.ApproveType = item.ApproveType;
|
||||
res.Add(approve);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.Meeting_CQMSMeetingApprove getCurrApproveForApi(string id)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Meeting_CQMSMeetingApprove newApprove = db.Meeting_CQMSMeetingApprove.FirstOrDefault(e => e.MeetingId == id && e.ApproveType != "S" && e.ApproveDate == null);
|
||||
return newApprove;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AddMeetingApproveForApi(Model.Meeting_CQMSMeetingApprove approve)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Meeting_CQMSMeetingApprove));
|
||||
Model.Meeting_CQMSMeetingApprove newApprove = new Model.Meeting_CQMSMeetingApprove();
|
||||
newApprove.MeetingApproveId = newKeyID;
|
||||
newApprove.MeetingId = approve.MeetingId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.Meeting_CQMSMeetingApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
return newKeyID;
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateMeetingApproveForApi(Model.Meeting_CQMSMeetingApprove approve)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Meeting_CQMSMeetingApprove newApprove = db.Meeting_CQMSMeetingApprove.FirstOrDefault(e => e.MeetingApproveId == approve.MeetingApproveId && e.ApproveDate == null);
|
||||
if (newApprove != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(approve.ApproveMan))
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
if (approve.ApproveDate.HasValue)
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveIdea))
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
if (approve.IsAgree.HasValue)
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveType))
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace BLL
|
||||
newCQMSMeeting.MeetingTheme = CQMSMeeting.MeetingTheme;
|
||||
newCQMSMeeting.MeetingContents = CQMSMeeting.MeetingContents;
|
||||
newCQMSMeeting.State = CQMSMeeting.State;
|
||||
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -156,5 +156,266 @@ namespace BLL
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据状态选择下一步办理类型
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> GetDHandleTypeByStateForApi(string state)
|
||||
{
|
||||
List<Model.BaseInfoItem> list = new List<Model.BaseInfoItem>();
|
||||
if (state == Const.CQMSMeeting_Compile || state == Const.CQMSMeeting_ReCompile)
|
||||
{
|
||||
Model.BaseInfoItem item = new Model.BaseInfoItem();
|
||||
item.BaseInfoId = Const.CQMSMeeting_Audit;
|
||||
item.BaseInfoName = "总包质量经理审批";
|
||||
list.Add(item);
|
||||
return list;
|
||||
}
|
||||
else if (state == Const.CQMSMeeting_Audit)
|
||||
{
|
||||
Model.BaseInfoItem item = new Model.BaseInfoItem();
|
||||
item.BaseInfoId = Const.CQMSMeeting_Complete;
|
||||
item.BaseInfoName = "审批完成";
|
||||
list.Add(item);
|
||||
Model.BaseInfoItem item2 = new Model.BaseInfoItem();
|
||||
item2.BaseInfoId = Const.CQMSMeeting_ReCompile;
|
||||
item2.BaseInfoName = "重新编制";
|
||||
list.Add(item2);
|
||||
return list;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据状态选择下一步办理类型
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> GetHandleManListForApi(string state, string id, string projectId)
|
||||
{
|
||||
List<Model.BaseInfoItem> list = new List<Model.BaseInfoItem>();
|
||||
if (state == Const.CQMSMeeting_Compile)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (state == Const.CQMSMeeting_ReCompile)
|
||||
{
|
||||
var user = BLL.Person_PersonsService.GetPerson_PersonsById(BLL.CQMS_MeetingApproveService.GetAuditMan(id, BLL.Const.CQMSMeeting_Compile).ApproveMan);
|
||||
Model.BaseInfoItem item = new Model.BaseInfoItem();
|
||||
item.BaseInfoId = user.PersonId;
|
||||
item.BaseInfoName = user.PersonName;
|
||||
list.Add(item);
|
||||
return list;
|
||||
}
|
||||
else if (state == Const.CQMSMeeting_Audit)
|
||||
{
|
||||
var users = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1, null);
|
||||
foreach (var user in users)
|
||||
{
|
||||
Model.BaseInfoItem item = new Model.BaseInfoItem();
|
||||
item.BaseInfoId = user.PersonId;
|
||||
item.BaseInfoName = user.PersonName;
|
||||
list.Add(item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.CQMSMeeting_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CQMSMeeting_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CQMSMeeting_Audit)
|
||||
{
|
||||
return "总包质量经理审批";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CQMSMeeting_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<Model.Meeting_CQMSMeeting> getListDataForApi(string projectId, int startRowIndex, int maximumRows, string meetingType)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
IQueryable<Model.Meeting_CQMSMeeting> q = db.Meeting_CQMSMeeting;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(meetingType))
|
||||
{
|
||||
q = q.Where(e => e.MeetingType == meetingType);
|
||||
}
|
||||
var qres = from x in q
|
||||
orderby x.CompileDate descending
|
||||
select new
|
||||
{
|
||||
x.MeetingId,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(),
|
||||
x.MeetingType,
|
||||
MeetingTypeStr = x.MeetingType == "M" ? "质量月例会" : "质量专题会",
|
||||
x.MeetingCode,
|
||||
x.MeetingDate,
|
||||
x.Place,
|
||||
x.HostMan,
|
||||
HostManName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.HostMan),
|
||||
x.AttentPerson,
|
||||
AttentPersonName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.AttentPerson),
|
||||
x.AttentPersonNum,
|
||||
x.MeetingTheme,
|
||||
x.MeetingContents,
|
||||
x.CompileDate,
|
||||
x.CompileMan,
|
||||
x.State,
|
||||
StateStr = ConvertState(x.State),
|
||||
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
|
||||
HandleManName = BLL.CQMS_MeetingApproveService.GetHandleManName(x.MeetingId),
|
||||
x.AttachUrl,
|
||||
};
|
||||
List<Model.Meeting_CQMSMeeting> res = new List<Model.Meeting_CQMSMeeting>();
|
||||
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Meeting_CQMSMeeting cd = new Model.Meeting_CQMSMeeting();
|
||||
cd.MeetingId = item.MeetingId;
|
||||
cd.ProjectId = item.ProjectId;
|
||||
cd.UnitId = item.UnitId + "$" + item.UnitName;
|
||||
cd.MeetingType = item.MeetingType + "$" + item.MeetingTypeStr;
|
||||
cd.MeetingCode = item.MeetingCode;
|
||||
cd.MeetingDate = item.MeetingDate;
|
||||
cd.Place = item.Place;
|
||||
cd.HostMan = item.HostMan + "$" + item.HostManName;
|
||||
cd.AttentPerson = item.AttentPerson + "$" + item.AttentPersonName;
|
||||
cd.AttentPersonNum = item.AttentPersonNum;
|
||||
cd.MeetingTheme = item.MeetingTheme;
|
||||
cd.MeetingContents = item.MeetingContents;
|
||||
cd.CompileDate = item.CompileDate;
|
||||
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName;
|
||||
cd.AttachUrl = AttachFileService.getFileUrl(item.MeetingId);
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取质量会议信息
|
||||
/// </summary>
|
||||
/// <param name="UnitWorkId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Meeting_CQMSMeeting GetMeetingByMeetingIdForApi(string MeetingId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = db.Meeting_CQMSMeeting.FirstOrDefault(e => e.MeetingId == MeetingId);
|
||||
if (q != null)
|
||||
{
|
||||
q.UnitId = q.UnitId + "$" + BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
|
||||
q.MeetingType = q.MeetingType + "$" + (q.MeetingType == "M" ? "质量月例会" : "质量专题会");
|
||||
q.HostMan = q.HostMan + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(q.HostMan);
|
||||
q.AttentPerson = q.AttentPerson + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(q.AttentPerson);
|
||||
q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
|
||||
q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.CQMS_MeetingApproveService.GetHandleManName(q.MeetingId);
|
||||
q.AttachUrl = AttachFileService.getFileUrl(q.MeetingId);
|
||||
}
|
||||
return q;
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddMeetingForApi(Model.Meeting_CQMSMeeting Meeting)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Meeting_CQMSMeeting newCQMSMeeting = new Model.Meeting_CQMSMeeting
|
||||
{
|
||||
MeetingId = Meeting.MeetingId,
|
||||
ProjectId = Meeting.ProjectId,
|
||||
UnitId = Meeting.UnitId,
|
||||
MeetingType = Meeting.MeetingType,
|
||||
MeetingCode = Meeting.MeetingCode,
|
||||
MeetingDate = Meeting.MeetingDate,
|
||||
Place = Meeting.Place,
|
||||
HostMan = Meeting.HostMan,
|
||||
AttentPerson = Meeting.AttentPerson,
|
||||
AttentPersonNum = Meeting.AttentPersonNum,
|
||||
MeetingTheme = Meeting.MeetingTheme,
|
||||
MeetingContents = Meeting.MeetingContents,
|
||||
State = Meeting.State,
|
||||
CompileMan = Meeting.CompileMan,
|
||||
CompileDate = Meeting.CompileDate,
|
||||
};
|
||||
|
||||
db.Meeting_CQMSMeeting.InsertOnSubmit(Meeting);
|
||||
db.SubmitChanges();
|
||||
|
||||
Model.Meeting_CQMSMeetingApprove approve = new Model.Meeting_CQMSMeetingApprove();
|
||||
approve.MeetingApproveId = BLL.SQLHelper.GetNewID();
|
||||
approve.MeetingId = Meeting.MeetingId;
|
||||
approve.ApproveType = BLL.Const.CQMSMeeting_Compile;
|
||||
approve.ApproveMan = Meeting.CompileMan;
|
||||
approve.ApproveDate = Meeting.CompileDate;
|
||||
db.Meeting_CQMSMeetingApprove.InsertOnSubmit(approve);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateMeetingForApi(Model.Meeting_CQMSMeeting Meeting)
|
||||
{
|
||||
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Meeting_CQMSMeeting newMeeting = db.Meeting_CQMSMeeting.First(e => e.MeetingId == Meeting.MeetingId);
|
||||
if (!string.IsNullOrEmpty(Meeting.UnitId))
|
||||
newMeeting.UnitId = Meeting.UnitId;
|
||||
if (!string.IsNullOrEmpty(Meeting.MeetingCode))
|
||||
newMeeting.MeetingCode = Meeting.MeetingCode;
|
||||
if (Meeting.MeetingDate.HasValue)
|
||||
newMeeting.MeetingDate = Meeting.MeetingDate;
|
||||
if (!string.IsNullOrEmpty(Meeting.Place))
|
||||
newMeeting.Place = Meeting.Place;
|
||||
if (!string.IsNullOrEmpty(Meeting.HostMan))
|
||||
newMeeting.HostMan = Meeting.HostMan;
|
||||
if (!string.IsNullOrEmpty(Meeting.AttentPerson))
|
||||
newMeeting.AttentPerson = Meeting.AttentPerson;
|
||||
if (Meeting.AttentPersonNum.HasValue)
|
||||
newMeeting.AttentPersonNum = Meeting.AttentPersonNum;
|
||||
if (!string.IsNullOrEmpty(Meeting.MeetingTheme))
|
||||
newMeeting.MeetingTheme = Meeting.MeetingTheme;
|
||||
if (!string.IsNullOrEmpty(Meeting.MeetingContents))
|
||||
newMeeting.MeetingContents = Meeting.MeetingContents;
|
||||
if (!string.IsNullOrEmpty(Meeting.State))
|
||||
newMeeting.State = Meeting.State;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,16 @@ namespace BLL
|
||||
{
|
||||
return db.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == state);
|
||||
}
|
||||
public static string GetHandleManName(string MainPlanId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
var a = Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveDate == null);
|
||||
if (a != null)
|
||||
{
|
||||
name = BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改总包施工计划审批信息
|
||||
/// </summary>
|
||||
@@ -207,5 +217,40 @@ namespace BLL
|
||||
{
|
||||
return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Compile);
|
||||
}
|
||||
|
||||
public static List<Model.Plan_MainPlanApprove> getApproveListDataByIdForApi(string MainPlanId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Plan_MainPlanApprove
|
||||
where x.MainPlanId == MainPlanId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.MainPlanApproveId,
|
||||
x.MainPlanId,
|
||||
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
};
|
||||
List<Model.Plan_MainPlanApprove> res = new List<Model.Plan_MainPlanApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Plan_MainPlanApprove cd = new Model.Plan_MainPlanApprove();
|
||||
cd.MainPlanApproveId = item.MainPlanApproveId;
|
||||
cd.MainPlanId = item.MainPlanId;
|
||||
cd.ApproveMan = item.ApproveMan;
|
||||
cd.ApproveDate = item.ApproveDate;
|
||||
cd.IsAgree = item.IsAgree;
|
||||
cd.ApproveIdea = item.ApproveIdea;
|
||||
cd.ApproveType = item.ApproveType + "$" + CQMS_MainPlanService.ConvertState(item.ApproveType);
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace BLL
|
||||
newMainPlan.State = MainPlan.State;
|
||||
newMainPlan.CompileMan = MainPlan.CompileMan;
|
||||
newMainPlan.CompileDate = MainPlan.CompileDate;
|
||||
newMainPlan.FilePath = MainPlan.FilePath;
|
||||
newMainPlan.FilePath = MainPlan.FilePath;
|
||||
db.Plan_MainPlan.InsertOnSubmit(newMainPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -123,5 +123,114 @@ namespace BLL
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.MainPlan_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit1)
|
||||
{
|
||||
return "施工经理审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit2)
|
||||
{
|
||||
return "部门评审小组审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit3)
|
||||
{
|
||||
return "审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit4)
|
||||
{
|
||||
return "项目经理批准";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit5)
|
||||
{
|
||||
return "评审小组组长确认";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<Model.Plan_MainPlan> getListDataForApi(string projectId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
IQueryable<Model.Plan_MainPlan> q = db.Plan_MainPlan;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
var qres = from x in q
|
||||
orderby x.CompileDate descending
|
||||
select new
|
||||
{
|
||||
x.MainPlanId,
|
||||
x.PlanCode,
|
||||
x.ProjectId,
|
||||
x.FileName,
|
||||
x.CompileDate,
|
||||
x.CompileMan,
|
||||
x.State,
|
||||
StateStr = ConvertState(x.State),
|
||||
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
|
||||
HandleManName = BLL.CQMS_MainPlanApproveService.GetHandleManName(x.MainPlanId),
|
||||
FilePath = x.FilePath,
|
||||
};
|
||||
List<Model.Plan_MainPlan> res = new List<Model.Plan_MainPlan>();
|
||||
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Plan_MainPlan cd = new Model.Plan_MainPlan();
|
||||
cd.MainPlanId = item.MainPlanId;
|
||||
cd.ProjectId = item.ProjectId;
|
||||
cd.PlanCode = item.PlanCode;
|
||||
cd.FileName = item.FileName;
|
||||
cd.CompileDate = item.CompileDate;
|
||||
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName;
|
||||
cd.FilePath = item.FilePath;
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取总包施工计划信息
|
||||
/// </summary>
|
||||
/// <param name="UnitWorkId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Plan_MainPlan GetMainPlanByMainPlanIdForApi(string MainPlanId)
|
||||
{
|
||||
var q = Funs.DB.Plan_MainPlan.FirstOrDefault(e => e.MainPlanId == MainPlanId);
|
||||
if (q != null)
|
||||
{
|
||||
q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.CQMS_MainPlanApproveService.GetHandleManName(q.MainPlanId);
|
||||
q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
|
||||
}
|
||||
return q;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,5 +259,51 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Model.Plan_SubPlanApprove> getApproveListDataByIdForApi(string SubPlanId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Plan_SubPlanApprove
|
||||
where x.SubPlanId == SubPlanId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.SubPlanApproveId,
|
||||
x.SubPlanId,
|
||||
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
};
|
||||
List<Model.Plan_SubPlanApprove> res = new List<Model.Plan_SubPlanApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Plan_SubPlanApprove cd = new Model.Plan_SubPlanApprove();
|
||||
cd.SubPlanApproveId = item.SubPlanApproveId;
|
||||
cd.SubPlanId = item.SubPlanId;
|
||||
cd.ApproveMan = item.ApproveMan;
|
||||
cd.ApproveDate = item.ApproveDate;
|
||||
cd.IsAgree = item.IsAgree;
|
||||
cd.ApproveIdea = item.ApproveIdea;
|
||||
cd.ApproveType = item.ApproveType + "$" + CQMS_SubPlanService.ConvertState(item.ApproveType);
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetHandleManName(string SubPlanId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
var a = Funs.DB.Plan_SubPlanApprove.FirstOrDefault(x => x.SubPlanId == SubPlanId && x.ApproveDate == null);
|
||||
if (a != null)
|
||||
{
|
||||
name = BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,5 +198,79 @@ namespace BLL
|
||||
rootNode.Nodes.Add(roleNode);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Model.Plan_SubPlan> getListDataForApi(string projectId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
IQueryable<Model.Plan_SubPlan> q = db.Plan_SubPlan;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
var qres = from x in q
|
||||
orderby x.CompileDate descending
|
||||
select new
|
||||
{
|
||||
x.SubPlanId,
|
||||
x.ProjectId,
|
||||
x.Code,
|
||||
x.UnitId,
|
||||
x.PlanName,
|
||||
x.UnitWorkIds,
|
||||
x.CNProfessionalCodes,
|
||||
x.CompileDate,
|
||||
x.CompileMan,
|
||||
x.State,
|
||||
x.Edition,
|
||||
StateStr = ConvertState(x.State),
|
||||
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
|
||||
UnitName = BLL.UnitService.GetUnitNameByUnitId(x.UnitId),
|
||||
UnitWorkNames=BLL.UnitWorkService.GetUnitWorkName(x.UnitWorkIds),
|
||||
CNProfessionalNames=BLL.CNProfessionalService.GetCNProfessionalNameByCode(x.CNProfessionalCodes),
|
||||
HandleManName = BLL.CQMS_SubPlanApproveService.GetHandleManName(x.SubPlanId),
|
||||
FilePath = x.FilePath,
|
||||
};
|
||||
List<Model.Plan_SubPlan> res = new List<Model.Plan_SubPlan>();
|
||||
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Plan_SubPlan cd = new Model.Plan_SubPlan();
|
||||
cd.SubPlanId = item.SubPlanId;
|
||||
cd.ProjectId = item.ProjectId;
|
||||
cd.Code = item.Code;
|
||||
cd.UnitId=item.UnitId + "$" + item.UnitName;
|
||||
cd.PlanName = item.PlanName;
|
||||
cd.UnitWorkIds=item.UnitWorkIds + "$" + item.UnitWorkNames;
|
||||
cd.CNProfessionalCodes = item.CNProfessionalCodes + "$" + item.CNProfessionalNames;
|
||||
cd.CompileDate = item.CompileDate;
|
||||
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName;
|
||||
cd.Edition = item.Edition;
|
||||
cd.FilePath = item.FilePath;
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据分包施工质量计划Id获取一个分包施工质量计划信息
|
||||
/// </summary>
|
||||
/// <param name="SubPlanCode">分包施工质量计划Id</param>
|
||||
/// <returns>一个分包施工质量计划实体</returns>
|
||||
public static Model.Plan_SubPlan GetSubPlanBySubPlanIdForApi(string SubPlanId)
|
||||
{
|
||||
var q= Funs.DB.Plan_SubPlan.FirstOrDefault(x => x.SubPlanId == SubPlanId);
|
||||
if (q != null)
|
||||
{
|
||||
q.UnitId = q.UnitId + "$" + BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
|
||||
q.UnitWorkIds = q.UnitWorkIds + "$" + BLL.UnitWorkService.GetUnitWorkName(q.UnitWorkIds);
|
||||
q.CNProfessionalCodes = q.CNProfessionalCodes + "$" + BLL.CNProfessionalService.GetCNProfessionalNameByCode(q.CNProfessionalCodes);
|
||||
q.CompileMan=q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
|
||||
q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.CQMS_SubPlanApproveService.GetHandleManName(q.SubPlanId);
|
||||
}
|
||||
return q;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,5 +115,73 @@ namespace BLL
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
//public static List<Model.Meeting_CQMSMeeting> getListDataForApi(string projectId, int startRowIndex, int maximumRows, string type)
|
||||
//{
|
||||
// using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
// {
|
||||
// IQueryable<Model.RewardAndPunish_RewardAndPunish> q = db.RewardAndPunish_RewardAndPunish;
|
||||
// if (!string.IsNullOrEmpty(projectId))
|
||||
// {
|
||||
// q = q.Where(e => e.ProjectId == projectId);
|
||||
// }
|
||||
// if (type!="0")
|
||||
// {
|
||||
// q = q.Where(e => e.Type == type);
|
||||
// }
|
||||
// var qres = from x in q
|
||||
// orderby x.CompileDate descending
|
||||
// select new
|
||||
// {
|
||||
// x.MeetingId,
|
||||
// x.ProjectId,
|
||||
// x.UnitId,
|
||||
// UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(),
|
||||
// x.MeetingType,
|
||||
// MeetingTypeStr = x.MeetingType == "M" ? "质量月例会" : "质量专题会",
|
||||
// x.MeetingCode,
|
||||
// x.MeetingDate,
|
||||
// x.Place,
|
||||
// x.HostMan,
|
||||
// HostManName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.HostMan),
|
||||
// x.AttentPerson,
|
||||
// AttentPersonName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.AttentPerson),
|
||||
// x.AttentPersonNum,
|
||||
// x.MeetingTheme,
|
||||
// x.MeetingContents,
|
||||
// x.CompileDate,
|
||||
// x.CompileMan,
|
||||
// x.State,
|
||||
// StateStr = ConvertState(x.State),
|
||||
// CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
|
||||
// HandleManName = BLL.CQMS_MeetingApproveService.GetHandleManName(x.MeetingId),
|
||||
// x.AttachUrl,
|
||||
// };
|
||||
// List<Model.Meeting_CQMSMeeting> res = new List<Model.Meeting_CQMSMeeting>();
|
||||
// var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// Model.Meeting_CQMSMeeting cd = new Model.Meeting_CQMSMeeting();
|
||||
// cd.MeetingId = item.MeetingId;
|
||||
// cd.ProjectId = item.ProjectId;
|
||||
// cd.UnitId = item.UnitId + "$" + item.UnitName;
|
||||
// cd.MeetingType = item.MeetingType + "$" + item.MeetingTypeStr;
|
||||
// cd.MeetingCode = item.MeetingCode;
|
||||
// cd.MeetingDate = item.MeetingDate;
|
||||
// cd.Place = item.Place;
|
||||
// cd.HostMan = item.HostMan + "$" + item.HostManName;
|
||||
// cd.AttentPerson = item.AttentPerson + "$" + item.AttentPersonName;
|
||||
// cd.AttentPersonNum = item.AttentPersonNum;
|
||||
// cd.MeetingTheme = item.MeetingTheme;
|
||||
// cd.MeetingContents = item.MeetingContents;
|
||||
// cd.CompileDate = item.CompileDate;
|
||||
// cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
// cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName;
|
||||
// cd.AttachUrl = AttachFileService.getFileUrl(item.MeetingId);
|
||||
// res.Add(cd);
|
||||
// }
|
||||
// return res;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,5 +78,165 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
//<summary>
|
||||
//获取培训对象
|
||||
//</summary>
|
||||
//<param name="state"></param>
|
||||
//<returns></returns>
|
||||
public static string ConvertPlanTrainPersons(object PlanTrainPersons)
|
||||
{
|
||||
string names = string.Empty;
|
||||
if (PlanTrainPersons != null)
|
||||
{
|
||||
string[] strs = PlanTrainPersons.ToString().Split(',');
|
||||
foreach (var item in strs)
|
||||
{
|
||||
names += BLL.CQMSTrainObjectService.GetTrainObjectNameById(item) + ",";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(names))
|
||||
{
|
||||
names = names.Substring(0, names.Length - 1);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static List<Model.Train_TrainPlan> getListDataForApi(string projectId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
IQueryable<Model.Train_TrainPlan> q = db.Train_TrainPlan;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
var qres = from x in q
|
||||
orderby x.CompileDate descending
|
||||
select new
|
||||
{
|
||||
x.TrainPlanId,
|
||||
x.ProjectId,
|
||||
x.PlanTrainPersons,
|
||||
PlanTrainPersonsStr = ConvertPlanTrainPersons(x.PlanTrainPersons),
|
||||
x.TrainTypeId,
|
||||
TrainTypeName = (from y in db.Base_CQMSTrainType where y.TrainTypeId == x.TrainTypeId select y.TrainTypeName).First(),
|
||||
x.TrainContent,
|
||||
x.PlanTrainDate,
|
||||
x.HostMan,
|
||||
x.RealTrainDate,
|
||||
x.Place,
|
||||
x.TeachHour,
|
||||
x.TrainPersonNum,
|
||||
x.RealTrainPersons,
|
||||
x.CompileDate,
|
||||
x.CompileMan,
|
||||
x.AttachUrl,
|
||||
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
|
||||
};
|
||||
List<Model.Train_TrainPlan> res = new List<Model.Train_TrainPlan>();
|
||||
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Train_TrainPlan cd = new Model.Train_TrainPlan();
|
||||
cd.TrainPlanId = item.TrainPlanId;
|
||||
cd.ProjectId = item.ProjectId;
|
||||
cd.PlanTrainPersons = item.PlanTrainPersons + "$" + item.PlanTrainPersonsStr;
|
||||
cd.TrainTypeId = item.TrainTypeId + "$" + item.TrainTypeName;
|
||||
cd.TrainContent = item.TrainContent;
|
||||
cd.PlanTrainDate = item.PlanTrainDate;
|
||||
cd.HostMan = item.HostMan;
|
||||
cd.RealTrainDate = item.RealTrainDate;
|
||||
cd.Place = item.Place;
|
||||
cd.TeachHour = item.TeachHour;
|
||||
cd.TrainPersonNum = item.TrainPersonNum;
|
||||
cd.RealTrainPersons = item.RealTrainPersons;
|
||||
cd.CompileDate = item.CompileDate;
|
||||
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
cd.AttachUrl = AttachFileService.getFileUrl(item.TrainPlanId);
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取质量培训信息
|
||||
/// </summary>
|
||||
/// <param name="UnitWorkId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Train_TrainPlan GetTraiPlanByTrainPlanIdForApi(string TrainPlanId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = db.Train_TrainPlan.FirstOrDefault(e => e.TrainPlanId == TrainPlanId);
|
||||
if (q != null)
|
||||
{
|
||||
q.PlanTrainPersons = q.PlanTrainPersons + "$" + ConvertPlanTrainPersons(q.PlanTrainPersons);
|
||||
q.TrainTypeId = q.TrainTypeId + "$" + (from y in db.Base_CQMSTrainType where y.TrainTypeId == q.TrainTypeId select y.TrainTypeName).First();
|
||||
q.RealTrainPersons = q.RealTrainPersons + "$" + Person_PersonsService.getPersonsNamesPersonIds(q.RealTrainPersons);
|
||||
q.HostMan = q.HostMan + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(q.HostMan);
|
||||
q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
|
||||
q.AttachUrl = AttachFileService.getFileUrl(q.TrainPlanId);
|
||||
}
|
||||
return q;
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddTrainPlanForApi(Model.Train_TrainPlan TrainPlan)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Train_TrainPlan newTrainPlan = new Model.Train_TrainPlan();
|
||||
newTrainPlan.TrainPlanId = TrainPlan.TrainPlanId;
|
||||
newTrainPlan.ProjectId = TrainPlan.ProjectId;
|
||||
newTrainPlan.PlanTrainPersons = TrainPlan.PlanTrainPersons;
|
||||
newTrainPlan.TrainTypeId = TrainPlan.TrainTypeId;
|
||||
newTrainPlan.TrainContent = TrainPlan.TrainContent;
|
||||
newTrainPlan.PlanTrainDate = TrainPlan.PlanTrainDate;
|
||||
newTrainPlan.HostMan = TrainPlan.HostMan;
|
||||
newTrainPlan.RealTrainDate = TrainPlan.RealTrainDate;
|
||||
newTrainPlan.Place = TrainPlan.Place;
|
||||
newTrainPlan.TeachHour = TrainPlan.TeachHour;
|
||||
newTrainPlan.TrainPersonNum = TrainPlan.TrainPersonNum;
|
||||
newTrainPlan.RealTrainPersons = TrainPlan.RealTrainPersons;
|
||||
newTrainPlan.CompileMan = TrainPlan.CompileMan;
|
||||
newTrainPlan.CompileDate = TrainPlan.CompileDate;
|
||||
db.Train_TrainPlan.InsertOnSubmit(newTrainPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateTrainPlanForApi(Model.Train_TrainPlan TrainPlan)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Train_TrainPlan newTrainPlan = db.Train_TrainPlan.FirstOrDefault(e => e.TrainPlanId == TrainPlan.TrainPlanId);
|
||||
if (newTrainPlan != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(TrainPlan.PlanTrainPersons))
|
||||
newTrainPlan.PlanTrainPersons = TrainPlan.PlanTrainPersons;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.TrainTypeId))
|
||||
newTrainPlan.TrainTypeId = TrainPlan.TrainTypeId;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.TrainContent))
|
||||
newTrainPlan.TrainContent = TrainPlan.TrainContent;
|
||||
if (TrainPlan.PlanTrainDate.HasValue)
|
||||
newTrainPlan.PlanTrainDate = TrainPlan.PlanTrainDate;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.HostMan))
|
||||
newTrainPlan.HostMan = TrainPlan.HostMan;
|
||||
if (TrainPlan.RealTrainDate.HasValue)
|
||||
newTrainPlan.RealTrainDate = TrainPlan.RealTrainDate;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.Place))
|
||||
newTrainPlan.Place = TrainPlan.Place;
|
||||
if (TrainPlan.TeachHour.HasValue)
|
||||
newTrainPlan.TeachHour = TrainPlan.TeachHour;
|
||||
if (TrainPlan.TrainPersonNum.HasValue)
|
||||
newTrainPlan.TrainPersonNum = TrainPlan.TrainPersonNum;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.RealTrainPersons))
|
||||
newTrainPlan.RealTrainPersons = TrainPlan.RealTrainPersons;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using FineUIPro;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
@@ -115,7 +116,7 @@ namespace BLL
|
||||
/// 设置人员进出场
|
||||
/// </summary>
|
||||
/// <param name="newitem"></param>
|
||||
public static void SetPersonItemInOut(Model.SitePerson_Person sitePerson)
|
||||
public static void SetPersonItemInOut(Model.SitePerson_Person sitePerson, Model.Sys_Log log)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
@@ -144,7 +145,7 @@ namespace BLL
|
||||
InTime = sitePerson.InTime,
|
||||
};
|
||||
|
||||
AddPersonItem(newPersonItem);
|
||||
AddPersonItem(newPersonItem, log);
|
||||
if (!getPersons.MultiProject.HasValue || getPersons.MultiProject == false)
|
||||
{
|
||||
var getOtherPersons = db.SitePerson_Person.Where(x => x.IdentityCard == sitePerson.IdentityCard && x.ProjectId != sitePerson.ProjectId && x.States == Const.ProjectPersonStates_1);
|
||||
@@ -182,7 +183,7 @@ namespace BLL
|
||||
/// 增加 人员进场
|
||||
/// </summary>
|
||||
/// <param name="newitem">实体</param>
|
||||
public static void AddPersonItem(Model.SitePerson_PersonItem newitem)
|
||||
public static void AddPersonItem(Model.SitePerson_PersonItem newitem, Model.Sys_Log log)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
@@ -271,6 +272,11 @@ namespace BLL
|
||||
db.SitePerson_PersonItem.InsertOnSubmit(newPersonItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
///更新人员出入记录日志
|
||||
if (log != null)
|
||||
{
|
||||
LogService.AddSys_Log(log);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using FineUIPro;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.PTG;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -697,9 +699,9 @@ namespace BLL
|
||||
Isprint = "0",
|
||||
States = person.States,
|
||||
};
|
||||
////现场人员项目出入场记录
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(newPerson);
|
||||
|
||||
////现场人员项目出入场记录
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(newPerson, null);
|
||||
db.SitePerson_Person.InsertOnSubmit(newPerson);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -709,7 +711,7 @@ namespace BLL
|
||||
/// 修改人员信息
|
||||
/// </summary>
|
||||
/// <param name="person">人员实体</param>
|
||||
public static void UpdateSitePerson(Model.SitePerson_Person person)
|
||||
public static void UpdateSitePerson(Model.SitePerson_Person person, Model.Sys_Log newlog)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
@@ -790,9 +792,9 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
if (setPersonItemInOut)
|
||||
{
|
||||
{
|
||||
////现场人员项目出入场记录
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(newPerson);
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(newPerson,newlog);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -850,7 +852,7 @@ namespace BLL
|
||||
{
|
||||
////现场人员项目出入场记录
|
||||
person.States = Const.ProjectPersonStates_2;
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(person);
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(person, null);
|
||||
|
||||
Funs.DB.SitePerson_Person.DeleteOnSubmit(person);
|
||||
Funs.DB.SubmitChanges();
|
||||
@@ -980,8 +982,18 @@ namespace BLL
|
||||
}
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
Model.Sys_Log newlog = new Sys_Log
|
||||
{
|
||||
UserId = getSitePerson.AuditorId,
|
||||
MenuId = Const.PersonListMenuId,
|
||||
OperationName = "现场人员审核",
|
||||
OperationLog = "现场人员审核" + getSitePerson.PersonName,
|
||||
DataId = getSitePerson.PersonId,
|
||||
ProjectId = getSitePerson.ProjectId,
|
||||
};
|
||||
|
||||
////现场人员项目出入场记录
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(getSitePerson);
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(getSitePerson, newlog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -776,7 +776,10 @@ namespace BLL
|
||||
newPerson.IdcardEndDate = person.IdcardEndDate;
|
||||
newPerson.IdcardForever = person.IdcardForever;
|
||||
newPerson.IdcardAddress = person.IdcardAddress;
|
||||
newPerson.Telephone = person.Telephone;
|
||||
if (!string.IsNullOrEmpty(person.Telephone) && newPerson.Telephone != person.Telephone)
|
||||
{
|
||||
newPerson.Telephone = person.Telephone;
|
||||
}
|
||||
newPerson.Birthday = person.Birthday;
|
||||
newPerson.Sex = person.Sex;
|
||||
newPerson.Address = person.Address;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
namespace BLL
|
||||
{
|
||||
using NPOI.SS.Formula.PTG;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
@@ -73,6 +74,70 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加操作日志
|
||||
/// </summary>
|
||||
/// <param name="CurrUser">操作人</param>
|
||||
/// <param name="code">编号</param>
|
||||
/// <param name="dataId">主键ID</param>
|
||||
/// <param name="strMenuId">菜单ID</param>
|
||||
/// <param name="strOperationName">操作名称</param>
|
||||
public static void AddSys_Log(Model.Sys_Log newsyslog)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
if (newsyslog != null)
|
||||
{
|
||||
Model.Sys_Log syslog = new Model.Sys_Log
|
||||
{
|
||||
LogId = SQLHelper.GetNewID(),
|
||||
HostName = Dns.GetHostName(),
|
||||
OperationTime = DateTime.Now,
|
||||
UserId = newsyslog.UserId,
|
||||
MenuId = newsyslog.MenuId,
|
||||
OperationName = newsyslog.OperationName,
|
||||
DataId = newsyslog.DataId,
|
||||
LogSource = 1,
|
||||
};
|
||||
|
||||
IPAddress[] ips = Dns.GetHostAddresses(syslog.HostName);
|
||||
if (ips.Length > 0)
|
||||
{
|
||||
foreach (IPAddress ip in ips)
|
||||
{
|
||||
if (ip.ToString().IndexOf('.') != -1)
|
||||
{
|
||||
syslog.Ip = ip.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
string opLog = string.Empty;
|
||||
var menu = db.Sys_Menu.FirstOrDefault(x => x.MenuId == newsyslog.MenuId);
|
||||
if (menu != null)
|
||||
{
|
||||
opLog = menu.MenuName + ":";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(newsyslog.OperationName))
|
||||
{
|
||||
opLog += newsyslog.OperationName;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(newsyslog.OperationLog))
|
||||
{
|
||||
syslog.OperationLog = opLog + ";" + newsyslog.OperationLog + "。";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(newsyslog.ProjectId) && newsyslog.ProjectId != "null")
|
||||
{
|
||||
syslog.ProjectId = newsyslog.ProjectId;
|
||||
}
|
||||
|
||||
db.Sys_Log.InsertOnSubmit(syslog);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据项目Id删除所有相关日志信息
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user