This commit is contained in:
2023-03-29 16:51:31 +08:00
128 changed files with 29873 additions and 58 deletions
+3 -1
View File
@@ -34,7 +34,8 @@ namespace BLL
TrainTypeName = trainType.TrainTypeName,
Remark = trainType.Remark,
IsAboutSendCard = trainType.IsAboutSendCard,
IsRepeat = trainType.IsRepeat
IsRepeat = trainType.IsRepeat,
TrainType=trainType.TrainType,
};
db.Base_TrainType.InsertOnSubmit(newTrainType);
db.SubmitChanges();
@@ -55,6 +56,7 @@ namespace BLL
newTrainType.Remark = trainType.Remark;
newTrainType.IsAboutSendCard = trainType.IsAboutSendCard;
newTrainType.IsRepeat = trainType.IsRepeat;
newTrainType.TrainType = trainType.TrainType;
db.SubmitChanges();
}
}
+2
View File
@@ -31,6 +31,7 @@ namespace BLL
WorkPostCode = workPost.WorkPostCode,
WorkPostName = workPost.WorkPostName,
PostType = workPost.PostType,
IsCQMS=workPost.IsCQMS,
IsHsse = workPost.IsHsse,
CNCodes = workPost.CNCodes,
Remark = workPost.Remark
@@ -54,6 +55,7 @@ namespace BLL
newWorkPost.WorkPostName = workPost.WorkPostName;
newWorkPost.PostType = workPost.PostType;
newWorkPost.IsHsse = workPost.IsHsse;
newWorkPost.IsCQMS = workPost.IsCQMS;
newWorkPost.CNCodes = workPost.CNCodes;
newWorkPost.Remark = workPost.Remark;
db.SubmitChanges();
+70 -9
View File
@@ -167,19 +167,80 @@ namespace BLL
/// <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);
// Model.Train_TrainPlan t = new Model.Train_TrainPlan();
// if (q != null)
// {
// t.TrainPlanId = q.TrainPlanId;
// t.ProjectId = q.ProjectId;
// t.TrainContent = q.TrainContent;
// t.PlanTrainDate = q.PlanTrainDate;
// t.RealTrainDate = q.RealTrainDate;
// t.Place = q.Place;
// t.TeachHour = q.TeachHour;
// t.CompileDate = q.CompileDate;
// t.TrainPersonNum = q.TrainPersonNum;
// t.PlanTrainPersons = q.PlanTrainPersons + "$" + ConvertPlanTrainPersons(q.PlanTrainPersons);
// t.TrainTypeId = q.TrainTypeId + "$" + (from y in db.Base_CQMSTrainType where y.TrainTypeId == q.TrainTypeId select y.TrainTypeName).First();
// t.RealTrainPersons = q.RealTrainPersons + "$" + Person_PersonsService.getPersonsNamesPersonIds(q.RealTrainPersons);
// t.HostMan = q.HostMan + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(q.HostMan);
// t.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
// t.AttachUrl = AttachFileService.getFileUrl(q.TrainPlanId);
// }
// return t;
//}
using (var db = new Model.SGGLDB(Funs.ConnString))
{
var q = db.Train_TrainPlan.FirstOrDefault(e => e.TrainPlanId == TrainPlanId);
if (q != null)
IQueryable<Model.Train_TrainPlan> q = db.Train_TrainPlan;
if (!string.IsNullOrEmpty(TrainPlanId))
{
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);
q = q.Where(e => e.TrainPlanId == TrainPlanId);
}
return q;
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(),
};
Model.Train_TrainPlan res = new Model.Train_TrainPlan();
var list = qres.FirstOrDefault();
Model.Train_TrainPlan cd = new Model.Train_TrainPlan();
cd.TrainPlanId = list.TrainPlanId;
cd.ProjectId = list.ProjectId;
cd.PlanTrainPersons = list.PlanTrainPersons + "$" + list.PlanTrainPersonsStr;
cd.TrainTypeId = list.TrainTypeId + "$" + list.TrainTypeName;
cd.TrainContent = list.TrainContent;
cd.PlanTrainDate = list.PlanTrainDate;
cd.HostMan = list.HostMan + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(list.HostMan);
cd.RealTrainDate = list.RealTrainDate;
cd.Place = list.Place;
cd.TeachHour = list.TeachHour;
cd.TrainPersonNum = list.TrainPersonNum;
cd.RealTrainPersons = list.RealTrainPersons + "$" + Person_PersonsService.getPersonsNamesPersonIds(list.RealTrainPersons);
cd.CompileDate = list.CompileDate;
cd.CompileMan = list.CompileMan + "$" + list.CompileManName;
cd.AttachUrl = AttachFileService.getFileUrl(list.TrainPlanId);
res = cd;
return res;
}
}
+35
View File
@@ -80,6 +80,25 @@ namespace BLL
return Funs.DB.AttachFile.FirstOrDefault(e => e.ToKeyId == toKey);
}
/// <summary>
/// 根据对应主键获取文件信息
/// </summary>
/// <param name="toKey">对应主键</param>
/// <returns>文件信息</returns>
public static string GetBtnFileUrl(object toKey)
{
string fileUrl = string.Empty;
if (toKey != null)
{
Model.AttachFile file = Funs.DB.AttachFile.FirstOrDefault(e => e.ToKeyId == toKey.ToString());
if (file != null && !string.IsNullOrEmpty(file.AttachUrl))
{
string url = file.AttachUrl.Replace('\\', '/');
fileUrl = BLL.UploadAttachmentService.ShowAttachment2("../../", url);
}
}
return fileUrl;
}
/// <summary>
///
/// </summary>
@@ -149,6 +168,22 @@ namespace BLL
}
/// <summary>
///
/// </summary>
/// <param name="toKeyId"></param>
/// <param name="menuId"></param>
/// <returns></returns>
public static IList<Model.AttachFile> GetBeforeFileList(string toKeyId, string menuId)
{
List<string> listToKeyId = new List<string>();
listToKeyId.Add(toKeyId);
// listToKeyId.Add(toKeyId + "r");
//listToKeyId.Add(toKeyId + "re");
var list = Funs.DB.AttachFile.Where(p => listToKeyId.Contains(p.ToKeyId) && p.MenuId == menuId).ToList();
return list;
}
/// <summary>
///
/// </summary>
+10
View File
@@ -317,6 +317,16 @@
#endregion
#region
/// <summary>
/// 安全总监岗位Id
/// </summary>
public static string WorkPost_HSSEDirector = "8A7C2CDF-AFB5-4826-9951-343253342DAC";
/// <summary>
/// 项目安全总监岗位Id
/// </summary>
public static string WorkPost_ProjectHSSEDirector = "5e6e259e-ea0a-4a63-8f52-df4a19a6c9fa";
/// <summary>
/// HSE工程师岗位Id
/// </summary>
@@ -47,6 +47,43 @@ namespace BLL
}
#endregion
#region
/// <summary>
/// 附件显示
/// </summary>
public static string ShowAttachment2(string rootPath, string path)
{
string htmlStr = string.Empty;
if (!string.IsNullOrEmpty(path))
{
htmlStr = "<table runat='server' cellpadding='5' cellspacing='5' style=\"width: 100%\">";
string[] arrStr = path.Split(new string[] { "," }, System.StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < arrStr.Length; i++)
{
if (!string.IsNullOrEmpty(arrStr[i]))
{
string[] urlArray = arrStr[i].Split('\\');
string scanUrl = string.Empty;
for (int j = 0; j < urlArray.Length; j++)
{
scanUrl += urlArray[j] + "|";
}
string url = rootPath + arrStr[i].Replace('\\', '/');
string[] subUrl = url.Split('/');
string fileName = subUrl[subUrl.Count() - 1];
string newFileName = fileName.Substring(fileName.IndexOf("_") + 1);
htmlStr += "<tr><td style=\"width: 60%\" align=\"left\"><span style='cursor:pointer;cursor:pointer;cursor:pointer;TEXT-DECORATION: underline;color:blue' onclick=\"window.open('" + url + "')\">" + newFileName + "</span></td>";
}
}
htmlStr += "</table>";
}
return htmlStr;
}
#endregion
#region
/// <summary>
/// 附件显示
@@ -29,7 +29,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.View_SitePerson_Person> getDataLists = from x in db.View_SitePerson_Person
private static IQueryable<Model.View_SitePerson_Person> getDataLists = from x in Funs.DB.View_SitePerson_Person
select x;
/// <summary>
@@ -637,7 +637,7 @@ namespace BLL
var getSitePerson = GetSitePersonByProjectIdPersonId(projectId, personId);
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
{
string prefix = UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId);
string prefix = UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId) + "-";
var getMaxCarNo = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == projectId && x.CardNo.Contains(prefix)).Max(x => x.CardNo);
if (!string.IsNullOrEmpty(getMaxCarNo) && getMaxCarNo.Length > 5)
{
@@ -660,7 +660,7 @@ namespace BLL
var getSitePerson = GetSitePersonById(sitepersinId);
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
{
cardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getSitePerson.ProjectId, UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId));
cardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getSitePerson.ProjectId, UnitService.GetUnitCodeByUnitId(getSitePerson.UnitId) +"-");
getSitePerson.CardNo = cardNo;
Funs.DB.SubmitChanges();
}