小程序接口修改

This commit is contained in:
2023-07-11 16:32:16 +08:00
parent ca5c3fe9a7
commit 4449a7754f
68 changed files with 4634 additions and 2984 deletions
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -355,7 +355,7 @@ namespace BLL
}
if (states == "0")
{
getViews = getViews.Where(x => x.IsUsed == 0 && !x.AuditorDate.HasValue);
getViews = getViews.Where(x => x.IsUsed == 2 && !x.AuditorDate.HasValue);
}
else if (states == "1")
{
@@ -583,7 +583,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
DateTime inDateTime=DateTime.Now;
if (!string.IsNullOrEmpty(InTime))
if (!string.IsNullOrEmpty(InTime)&&!"null".Equals(InTime))
{
inDateTime = DateTime.Parse(InTime);
}
+29 -26
View File
@@ -122,35 +122,38 @@ namespace BLL
toDoItem.UrlStr = att.AttachUrl + "," + toDoItem.UrlStr;
}
}
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(toDoItem.UrlStr, 10, null), toDoItem.UrlStr, toDoItem.MenuId, toDoItem.DataId);
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(toDoItem.UrlStr, 10, null), toDoItem.UrlStr, toDoItem.MenuId, toDoItem.DataId);
}
else
{
CommonService.DeleteAttachFileById(toDoItem.DataId);
CommonService.DeleteAttachFileByIdForApi(toDoItem.DataId);
}
}
}
public static void SaveAttachUrl(string menuId, string dataId, string url, string isInsert)
{
////保存附件
if (!string.IsNullOrEmpty(url))
public static void SaveAttachUrl(string menuId, string dataId, string url, string isInsert)
{
if (isInsert == "1")
{
var att = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
if (att != null)
{
url = att.AttachUrl + "," + url;
}
}
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(url, 10, null), url, menuId, dataId);
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
////保存附件
if (!string.IsNullOrEmpty(url))
{
if (isInsert == "1")
{
var att = db.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
if (att != null)
{
url = att.AttachUrl + "," + url;
}
}
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(url, 10, null), url, menuId, dataId);
}
else
{
CommonService.DeleteAttachFileByIdForApi(dataId);
}
}
}
else
{
CommonService.DeleteAttachFileById(dataId);
}
}
/// <summary>
/// 获取附件路径
@@ -177,12 +180,12 @@ namespace BLL
}
return fileUrl;
}
/// <summary>
/// 获取附件路径
/// </summary>
/// <returns></returns>
public static string getFileUrl(string menuId, string tokeyId, string url)
/// <summary>
/// 获取附件路径
/// </summary>
/// <returns></returns>
public static string getFileUrl(string menuId, string tokeyId, string url)
{
string fileUrl = url;
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+1 -1
View File
@@ -208,7 +208,7 @@ namespace BLL
Password = x.Password,
UserName = x.UserName,
RoleId = y.RoleId,
RoleName = RoleService.getRoleNamesRoleIds(y.RoleId),
RoleName = RoleService.getRoleNamesRoleIdsForApi(y.RoleId),
UnitId = y.UnitId,
UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName,
LoginProjectId = y.ProjectId,
@@ -137,11 +137,11 @@ namespace BLL.API.CQMS
inspectionManagement.AttachUrl2 = item.ProcessControl_InspectionManagement.AttachUrl2;
inspectionManagement.MainSendUnitId = item.ProcessControl_InspectionManagement.MainSendUnitId;
if(!string.IsNullOrEmpty(inspectionManagement.MainSendUnitId))
inspectionManagement.MainSendUnitName = UnitService.getUnitNamesUnitIds(inspectionManagement.MainSendUnitId);//item.ProcessControl_InspectionManagement.MainSendUnitName;
inspectionManagement.MainSendUnitName = UnitService.getUnitNamesUnitIdsForApi(inspectionManagement.MainSendUnitId);//item.ProcessControl_InspectionManagement.MainSendUnitName;
inspectionManagement.CCUnitIds = item.ProcessControl_InspectionManagement.CCUnitIds;
if (!string.IsNullOrEmpty(inspectionManagement.CCUnitIds))
{
inspectionManagement.CCUnitName = UnitService.getUnitNamesUnitIds(inspectionManagement.CCUnitIds);// item.ProcessControl_InspectionManagement.CCUnitName;
inspectionManagement.CCUnitName = UnitService.getUnitNamesUnitIdsForApi(inspectionManagement.CCUnitIds);// item.ProcessControl_InspectionManagement.CCUnitName;
}
inspectionManagement.PlanComplateDate = item.ProcessControl_InspectionManagement.PlanComplateDate.HasValue? item.ProcessControl_InspectionManagement.PlanComplateDate.Value.ToString("yyyy-MM-dd"): "";
@@ -211,11 +211,11 @@ namespace BLL.API.CQMS
inspectionManagement.AttachUrl2 = item.AttachUrl2;
inspectionManagement.MainSendUnitId = item.MainSendUnitId;
if (!string.IsNullOrEmpty(inspectionManagement.MainSendUnitId))
inspectionManagement.MainSendUnitName = UnitService.getUnitNamesUnitIds(inspectionManagement.MainSendUnitId);//item.MainSendUnitName;
inspectionManagement.MainSendUnitName = UnitService.getUnitNamesUnitIdsForApi(inspectionManagement.MainSendUnitId);//item.MainSendUnitName;
inspectionManagement.CCUnitIds = item.CCUnitIds;
if (!string.IsNullOrEmpty(inspectionManagement.CCUnitIds))
{
inspectionManagement.CCUnitName = UnitService.getUnitNamesUnitIds(inspectionManagement.CCUnitIds);// item.CCUnitName;
inspectionManagement.CCUnitName = UnitService.getUnitNamesUnitIdsForApi(inspectionManagement.CCUnitIds);// item.CCUnitName;
}
inspectionManagement.PlanComplateDate = item.PlanComplateDate.HasValue ? item.PlanComplateDate.Value.ToString("yyyy-MM-dd") : "";
@@ -297,11 +297,11 @@ namespace BLL.API.CQMS
inspectionManagement.AttachUrl2 = item.ProcessControl_InspectionManagement.AttachUrl2;
inspectionManagement.MainSendUnitId = item.ProcessControl_InspectionManagement.MainSendUnitId;
if (!string.IsNullOrEmpty(inspectionManagement.MainSendUnitId))
inspectionManagement.MainSendUnitName = UnitService.getUnitNamesUnitIds(inspectionManagement.MainSendUnitId);//item.ProcessControl_InspectionManagement.MainSendUnitName;
inspectionManagement.MainSendUnitName = UnitService.getUnitNamesUnitIdsForApi(inspectionManagement.MainSendUnitId);//item.ProcessControl_InspectionManagement.MainSendUnitName;
inspectionManagement.CCUnitIds = item.ProcessControl_InspectionManagement.CCUnitIds;
if (!string.IsNullOrEmpty(inspectionManagement.CCUnitIds))
{
inspectionManagement.CCUnitName = UnitService.getUnitNamesUnitIds(inspectionManagement.CCUnitIds);// item.ProcessControl_InspectionManagement.CCUnitName;
inspectionManagement.CCUnitName = UnitService.getUnitNamesUnitIdsForApi(inspectionManagement.CCUnitIds);// item.ProcessControl_InspectionManagement.CCUnitName;
}
inspectionManagement.PlanComplateDate = item.ProcessControl_InspectionManagement.PlanComplateDate.HasValue ? item.ProcessControl_InspectionManagement.PlanComplateDate.Value.ToString("yyyy-MM-dd") : "";
File diff suppressed because it is too large Load Diff
+27 -23
View File
@@ -1,4 +1,5 @@
using System;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -253,24 +254,27 @@ namespace BLL
return getDateInfo.FirstOrDefault();
}
}
#endregion
#endregion
/// <summary>
/// 根据管线ID获取探伤比例
/// </summary>
/// <param name="pipeLineId"></param>
/// <returns></returns>
private static string GetDetectionRate(string pipeLineId)
{
string detectionRate = string.Empty;
var pipe = BLL.PipelineService.GetPipelineByPipelineId(pipeLineId);
if (pipe != null && !string.IsNullOrEmpty(pipe.DetectionRateId))
/// <summary>
/// 根据管线ID获取探伤比例
/// </summary>
/// <param name="pipeLineId"></param>
/// <returns></returns>
private static string GetDetectionRate(string pipeLineId)
{
var r = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipe.DetectionRateId);
detectionRate = r.DetectionRateValue + "%";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string detectionRate = string.Empty;
var pipe = db.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipeLineId);
if (pipe != null && !string.IsNullOrEmpty(pipe.DetectionRateId))
{
var r = db.Base_DetectionRate.FirstOrDefault(e => e.DetectionRateId == pipe.DetectionRateId);
detectionRate = r.DetectionRateValue + "%";
}
return detectionRate;
}
}
return detectionRate;
}
#region
/// <summary>
@@ -521,15 +525,15 @@ namespace BLL
string jotId = addItem.WeldJointId;
if (!string.IsNullOrEmpty(jotId))
{
var jotInfo = BLL.PW_JointInfoService.GetJointInfoByJotID(jotId);
var jotInfo = db.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jotId);
if (jotInfo != null)
{
if (!string.IsNullOrEmpty(jotInfo.ISO_ID))
{
var isoInfo = BLL.PW_IsoInfoService.GetIsoInfoByIsoInfoId(jotInfo.ISO_ID);
var isoInfo =db.PW_IsoInfo.FirstOrDefault(e => e.ISO_ID == jotInfo.ISO_ID);
if (isoInfo != null)
{
workAreaCode = BLL.WorkAreaService.GetWorkAreaCodeByWorkAreaId(isoInfo.WorkAreaId);
workAreaCode = BLL.WorkAreaService.GetWorkAreaCodeByWorkAreaIdForApi(isoInfo.WorkAreaId);
}
}
}
@@ -546,9 +550,9 @@ namespace BLL
string DReportID = SQLHelper.GetNewID(typeof(Model.BO_WeldReportMain));
newWeldReportMain.DReportID = DReportID;
BLL.WeldReportService.AddWeldReport(newWeldReportMain);
BLL.LogService.AddSys_Log(BLL.UserService.GetUserByUserId(addItem.UserId), newWeldReportMain.JOT_DailyReportNo, DReportID, BLL.Const.HJGL_WeldReportMenuId, "添加焊接日报信息");
BLL.LogService.AddSys_Log(db.Sys_User.FirstOrDefault(e => e.UserId == addItem.UserId), newWeldReportMain.JOT_DailyReportNo, DReportID, BLL.Const.HJGL_WeldReportMenuId, "添加焊接日报信息");
Model.PW_JointInfo jot = BLL.PW_JointInfoService.GetJointInfoByJotID(addItem.WeldJointId);
Model.PW_JointInfo jot = db.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == addItem.WeldJointId);
jot.DReportID = newWeldReportMain.DReportID;
jot.JOT_CellWelder = addItem.CoverWelderId;
jot.JOT_FloorWelder = addItem.BackingWelderId;
@@ -565,9 +569,9 @@ namespace BLL
//jot.JOT_CellTemp = item.JOT_CellTemp;
//jot.JOT_LastTemp = item.JOT_LastTemp;
BLL.PW_JointInfoService.UpdateJointInfoByDReport(jot);
db.SubmitChanges();
//更新焊口号 修改固定焊口号后 +G
BLL.PW_JointInfoService.UpdateJointNoAddG(jot.JOT_ID, addItem.JointAttribute, "Add");
BLL.PW_JointInfoService.UpdateJointNoAddGForApi(jot.JOT_ID, addItem.JointAttribute, "Add");
SaveAttachFile(addItem.WeldJointId, BLL.Const.HJGL_WeldReportMenuId, addItem.AttachUrl);
}
+22 -21
View File
@@ -73,29 +73,30 @@ namespace BLL
/// <returns></returns>
public static void SavePreWeldingDaily(Model.HJGL_PreWeldingDailyItem newItem)
{
Model.SGGLDB db = Funs.DB;
Model.HJGL_PreWeldingDaily newP= new Model.HJGL_PreWeldingDaily
{
PreWeldingDailyId = newItem.PreWeldingDailyId,
ProjectId = newItem.ProjectId,
UnitWorkId = newItem.UnitWorkId,
UnitId = newItem.UnitId,
};
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.HJGL_PreWeldingDaily newP = new Model.HJGL_PreWeldingDaily
{
PreWeldingDailyId = newItem.PreWeldingDailyId,
ProjectId = newItem.ProjectId,
UnitWorkId = newItem.UnitWorkId,
UnitId = newItem.UnitId,
};
var updateItem = db.HJGL_PreWeldingDaily.FirstOrDefault(x => x.PreWeldingDailyId == newItem.PreWeldingDailyId);
if (updateItem == null)
{
newP.PreWeldingDailyId = SQLHelper.GetNewID();
db.HJGL_PreWeldingDaily.InsertOnSubmit(newP);
db.SubmitChanges();
}
else
{
/// 更新
/// //
}
var updateItem = db.HJGL_PreWeldingDaily.FirstOrDefault(x => x.PreWeldingDailyId == newItem.PreWeldingDailyId);
if (updateItem == null)
{
newP.PreWeldingDailyId = SQLHelper.GetNewID();
db.HJGL_PreWeldingDaily.InsertOnSubmit(newP);
db.SubmitChanges();
}
else
{
/// 更新
/// //
}
}
//if (newItem.BaseInfoItem != null && newItem.BaseInfoItem.Count() > 0)
//{
// foreach (var item in newItem.BaseInfoItem)
+403 -399
View File
@@ -5,185 +5,186 @@ using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public static class APIReportQueryService
{
#region
/// <summary>
/// 根据人员二维码获取焊工业绩
/// </summary>
/// <param name="personId"></param>
/// <returns></returns>
public static Model.WelderPerformanceItem GetWelderPerformanceByQRC(string personId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
public static class APIReportQueryService
{
#region
/// <summary>
/// 根据人员二维码获取焊工业绩
/// </summary>
/// <param name="personId"></param>
/// <returns></returns>
public static Model.WelderPerformanceItem GetWelderPerformanceByQRC(string personId)
{
// todo 二维码分解待做
var getDataLists = from x in db.View_WelderPerformance
where x.PersonId == personId
select new Model.WelderPerformanceItem
{
WelderCode = x.WelderCode,
PersonName = x.PersonName,
UnitName = x.UnitName,
CertificateLimitTime = x.CertificateLimitTime.ToString(),
WelderLevel = x.WelderLevel,
OnePassRate = x.PassRate,
TotalJotDin = x.Nowtotal_jot.ToString() + "/" + x.Nowtotal_din.ToString(),
WeldAvgNum = GetWeldAvgNum(personId, x.Nowtotal_din.HasValue ? x.Nowtotal_din.Value : 0),
OneCheckJotNum = x.OneCheckJotNum.ToString(),
OneCheckPassJotNum = x.OneCheckPassJotNum,
RepairJotNum = x.OneCheckRepairJotNum.ToString(),
ExpandJotNum = x.ExpandJotNum.ToString()
};
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
// todo 二维码分解待做
var getDataLists = from x in db.View_WelderPerformance
where x.PersonId == personId
select new Model.WelderPerformanceItem
{
WelderCode = x.WelderCode,
PersonName = x.PersonName,
UnitName = x.UnitName,
CertificateLimitTime = x.CertificateLimitTime.ToString(),
WelderLevel = x.WelderLevel,
OnePassRate = x.PassRate,
TotalJotDin = x.Nowtotal_jot.ToString() + "/" + x.Nowtotal_din.ToString(),
WeldAvgNum = GetWeldAvgNum(personId, x.Nowtotal_din.HasValue ? x.Nowtotal_din.Value : 0),
OneCheckJotNum = x.OneCheckJotNum.ToString(),
OneCheckPassJotNum = x.OneCheckPassJotNum,
RepairJotNum = x.OneCheckRepairJotNum.ToString(),
ExpandJotNum = x.ExpandJotNum.ToString()
};
return getDataLists.FirstOrDefault();
return getDataLists.FirstOrDefault();
}
}
}
#endregion
#endregion
private static string GetWeldAvgNum(string personId,decimal totalDin)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
private static string GetWeldAvgNum(string personId, decimal totalDin)
{
string vagDin = string.Empty;
var date = from x in db.HJGL_WeldJoint
join y in db.HJGL_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId
where x.BackingWelderId == personId || x.CoverWelderId == personId
select y.WeldingDate;
if (date.Count() > 0)
{
DateTime startDate = Convert.ToDateTime(date.Min());
DateTime endDate = Convert.ToDateTime(date.Max());
TimeSpan t = endDate - startDate;
int dayNum = t.Days;
vagDin = (totalDin / dayNum).ToString("0.##");
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string vagDin = string.Empty;
var date = from x in db.HJGL_WeldJoint
join y in db.HJGL_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId
where x.BackingWelderId == personId || x.CoverWelderId == personId
select y.WeldingDate;
if (date.Count() > 0)
{
DateTime startDate = Convert.ToDateTime(date.Min());
DateTime endDate = Convert.ToDateTime(date.Max());
TimeSpan t = endDate - startDate;
int dayNum = t.Days;
vagDin = (totalDin / dayNum).ToString("0.##");
}
return vagDin;
}
return vagDin;
}
}
}
#region
/// <summary>
/// 根据焊工号获取焊工业绩
/// </summary>
/// <param name="projectId"></param>
/// <param name="welderCode"></param>
/// <returns></returns>
public static Model.WelderPerformanceItem GetWelderPerformanceByWelderCode(string projectId,string welderCode)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
#region
/// <summary>
/// 根据焊工号获取焊工业绩
/// </summary>
/// <param name="projectId"></param>
/// <param name="welderCode"></param>
/// <returns></returns>
public static Model.WelderPerformanceItem GetWelderPerformanceByWelderCode(string projectId, string welderCode)
{
// todo 二维码分解待做
var getDataLists = from x in db.View_WelderPerformance
where x.ProjectId == projectId && x.WelderCode == welderCode
select new Model.WelderPerformanceItem
{
WelderCode = x.WelderCode,
PersonName = x.PersonName,
UnitName = x.UnitName,
CertificateLimitTime = x.CertificateLimitTime.ToString(),
WelderLevel = x.WelderLevel,
OnePassRate = x.PassRate,
TotalJotDin = x.Nowtotal_jot.ToString() + "/" + x.Nowtotal_din.ToString(),
WeldAvgNum = GetWeldAvgNum(x.PersonId, x.Nowtotal_din.HasValue ? x.Nowtotal_din.Value : 0),
OneCheckJotNum = x.OneCheckJotNum.ToString(),
OneCheckPassJotNum = x.OneCheckPassJotNum,
RepairJotNum = x.OneCheckRepairJotNum.ToString(),
ExpandJotNum = x.ExpandJotNum.ToString()
};
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
// todo 二维码分解待做
var getDataLists = from x in db.View_WelderPerformance
where x.ProjectId == projectId && x.WelderCode == welderCode
select new Model.WelderPerformanceItem
{
WelderCode = x.WelderCode,
PersonName = x.PersonName,
UnitName = x.UnitName,
CertificateLimitTime = x.CertificateLimitTime.ToString(),
WelderLevel = x.WelderLevel,
OnePassRate = x.PassRate,
TotalJotDin = x.Nowtotal_jot.ToString() + "/" + x.Nowtotal_din.ToString(),
WeldAvgNum = GetWeldAvgNum(x.PersonId, x.Nowtotal_din.HasValue ? x.Nowtotal_din.Value : 0),
OneCheckJotNum = x.OneCheckJotNum.ToString(),
OneCheckPassJotNum = x.OneCheckPassJotNum,
RepairJotNum = x.OneCheckRepairJotNum.ToString(),
ExpandJotNum = x.ExpandJotNum.ToString()
};
return getDataLists.FirstOrDefault();
return getDataLists.FirstOrDefault();
}
}
}
#endregion
#endregion
# region ID获取焊工合格项目
/// <summary>
/// 根据人员ID获取焊工合格项目
/// </summary>
/// <param name="personId"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> getWelderQualify(string personId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
#region ID获取焊工合格项目
/// <summary>
/// 根据人员ID获取焊工合格项目
/// </summary>
/// <param name="personId"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> getWelderQualify(string personId)
{
var getDataLists = (from x in db.Welder_WelderQualify
where x.WelderId == personId
orderby x.LimitDate
select new Model.BaseInfoItem
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Welder_WelderQualify
where x.WelderId == personId
orderby x.LimitDate
select new Model.BaseInfoItem
{
BaseInfoId = x.QualificationItem, // 合格项目
BaseInfoCode = x.CheckDate.HasValue ? x.CheckDate.Value.ToString() : "", // 批准日期
BaseInfoName = x.LimitDate.HasValue ? x.LimitDate.Value.ToString() : "" // 有效日期
}
).ToList();
return getDataLists;
}
}
#endregion
#region
/// <summary>
/// 焊工资质预警
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> GetWelderQualifyWarning(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var welder = from x in db.SitePerson_Person
where x.ProjectId == projectId && x.WorkPostId == Const.WorkPost_Welder
&& x.WelderCode != null
select x;
List<Model.BaseInfoItem> warnWelder = new List<Model.BaseInfoItem>();
foreach (var q in welder)
{
DateTime? validity = q.CertificateLimitTime;
DateTime nowDate = DateTime.Now;
if (validity != null)
{
if (validity.Value.AddMonths(-1) < nowDate && validity >= nowDate)
{
BaseInfoId = x.QualificationItem, // 合格项目
BaseInfoCode = x.CheckDate.HasValue ? x.CheckDate.Value.ToString() : "", // 批准日期
BaseInfoName = x.LimitDate.HasValue ? x.LimitDate.Value.ToString() : "" // 有效日期
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = q.PersonId;
item.BaseInfoCode = q.WelderCode;
item.BaseInfoName = q.CertificateLimitTime.HasValue ? q.CertificateLimitTime.Value.ToString() : "" + "即将过期";
warnWelder.Add(item);
}
).ToList();
return getDataLists;
}
}
#endregion
else if (validity < nowDate)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = q.PersonId;
item.BaseInfoCode = q.WelderCode;
item.BaseInfoName = q.CertificateLimitTime.HasValue ? q.CertificateLimitTime.Value.ToString() : "" + "已过期";
warnWelder.Add(item);
}
}
}
#region
/// <summary>
/// 焊工资质预警
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> GetWelderQualifyWarning(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
return warnWelder;
}
}
#endregion
#region 96%
/// <summary>
/// 焊工一次合格率低于96%预警
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> GetWelderOnePassRateWarning(string projectId)
{
var welder = from x in db.SitePerson_Person
where x.ProjectId == projectId && x.WorkPostId == Const.WorkPost_Welder
&& x.WelderCode != null
select x;
List<Model.BaseInfoItem> warnWelder = new List<Model.BaseInfoItem>();
foreach (var q in welder)
{
DateTime? validity = q.CertificateLimitTime;
DateTime nowDate = DateTime.Now;
if (validity != null)
{
if (validity.Value.AddMonths(-1) < nowDate && validity >= nowDate)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = q.PersonId;
item.BaseInfoCode = q.WelderCode;
item.BaseInfoName = q.CertificateLimitTime.HasValue ? q.CertificateLimitTime.Value.ToString() : "" + "即将过期";
warnWelder.Add(item);
}
else if (validity < nowDate)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = q.PersonId;
item.BaseInfoCode =q.WelderCode;
item.BaseInfoName = q.CertificateLimitTime.HasValue ? q.CertificateLimitTime.Value.ToString() : "" + "已过期";
warnWelder.Add(item);
}
}
}
return warnWelder;
}
}
#endregion
#region 96%
/// <summary>
/// 焊工一次合格率低于96%预警
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> GetWelderOnePassRateWarning(string projectId)
{
string strSql = @"SELECT welder.ProjectId, welder.WelderCode, welder.PersonName,
string strSql = @"SELECT welder.ProjectId, welder.WelderCode, welder.PersonName,
CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(oneCheck.OneCheckJotNum,0) WHEN 0 THEN 0
ELSE 100.0 * (ISNULL(oneCheck.OneCheckJotNum,0)-ISNULL(oneCheckRepair.oneCheckRepairJotNum,0))/(1.0 * oneCheck.OneCheckJotNum) END) AS DECIMAL(8,1))))+'%' AS passRate
FROM SitePerson_Person AS welder
@@ -214,266 +215,269 @@ namespace BLL
AND (CAST((CASE ISNULL(oneCheck.OneCheckJotNum,0) WHEN 0 THEN 0
ELSE 100.0 * (ISNULL(oneCheck.OneCheckJotNum,0)-ISNULL(oneCheckRepair.oneCheckRepairJotNum,0))/(1.0 * oneCheck.OneCheckJotNum) END) AS DECIMAL(8,1)))<=96";
List<SqlParameter> listStr = new List<SqlParameter>();
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND welder.ProjectId=@ProjectId";
listStr.Add(new SqlParameter("@ProjectId", projectId));
strSql += " AND welder.ProjectId=@ProjectId";
listStr.Add(new SqlParameter("@ProjectId", projectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
List<Model.BaseInfoItem> warnWelder = new List<Model.BaseInfoItem>();
List<Model.BaseInfoItem> warnWelder = new List<Model.BaseInfoItem>();
foreach (DataRow row in dt.Rows)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoCode = row["WelderCode"].ToString();
item.BaseInfoName = "一次合格率:" + row["passRate"].ToString();
warnWelder.Add(item);
}
return warnWelder;
foreach (DataRow row in dt.Rows)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoCode = row["WelderCode"].ToString();
item.BaseInfoName = "一次合格率:" + row["passRate"].ToString();
warnWelder.Add(item);
}
return warnWelder;
}
#endregion
#endregion
#region ID获取焊口信息和焊接信息
/// <summary>
/// 根据焊口ID获取焊口信息和焊接信息
/// </summary>
/// <param name="weldJointId"></param>
/// <returns></returns>
public static Model.JointCompreInfoItem GetJointCompreInfo(string weldJointId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
#region ID获取焊口信息和焊接信息
/// <summary>
/// 根据焊口ID获取焊口信息和焊接信息
/// </summary>
/// <param name="weldJointId"></param>
/// <returns></returns>
public static Model.JointCompreInfoItem GetJointCompreInfo(string weldJointId)
{
var getDateInfo = from x in db.View_HJGL_WeldJoint
where x.WeldJointId == weldJointId
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDateInfo = from x in db.View_HJGL_WeldJoint
where x.WeldJointId == weldJointId
select new Model.JointCompreInfoItem
{
WeldJointCode = x.WeldJointCode,
PipelineCode = x.PipelineCode,
PipingClass = x.PipingClassCode,
Medium = x.MediumCode,
DetectionType = x.DetectionTypeCode,
WeldType = x.WeldTypeCode,
Material = x.MaterialCode,
JointArea = x.JointArea,
JointAttribute = x.JointAttribute,
WeldingMode = x.WeldingMode,
Size = x.Size,
Dia = x.Dia,
Thickness = x.Thickness,
Specification = x.Specification,
WeldingMethodCode = x.WeldingMethodCode,
GrooveType = x.GrooveTypeCode,
WeldingLocation = x.WeldingLocationCode,
WeldingWire = x.WeldingWireCode,
WeldingRod = x.WeldingRodCode,
IsHotProess = x.IsHotProessStr,
WelderCode = x.WelderCode,
WeldingDate = x.WeldingDate,
WeldingDailyCode = x.WeldingDailyCode,
PointBatchCode = x.PointBatchCode,
IsPoint = x.IsPoint
select new Model.JointCompreInfoItem
{
WeldJointCode = x.WeldJointCode,
PipelineCode = x.PipelineCode,
PipingClass = x.PipingClassCode,
Medium = x.MediumCode,
DetectionType = x.DetectionTypeCode,
WeldType = x.WeldTypeCode,
Material = x.MaterialCode,
JointArea = x.JointArea,
JointAttribute = x.JointAttribute,
WeldingMode = x.WeldingMode,
Size = x.Size,
Dia = x.Dia,
Thickness = x.Thickness,
Specification = x.Specification,
WeldingMethodCode = x.WeldingMethodCode,
GrooveType = x.GrooveTypeCode,
WeldingLocation = x.WeldingLocationCode,
WeldingWire = x.WeldingWireCode,
WeldingRod = x.WeldingRodCode,
IsHotProess = x.IsHotProessStr,
WelderCode = x.WelderCode,
WeldingDate = x.WeldingDate,
WeldingDailyCode = x.WeldingDailyCode,
PointBatchCode = x.PointBatchCode,
IsPoint = x.IsPoint
};
return getDateInfo.FirstOrDefault();
};
return getDateInfo.FirstOrDefault();
}
}
}
#endregion
#endregion
#region
/// <summary>
/// 多维度查询报表
/// </summary>
/// <param name="projectId"></param>
/// <param name="unitId"></param>
/// <param name="unitWorkId"></param>
/// <param name="pipeLineId"></param>
/// <param name="material"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public static List<Model.ReportQueryItem> GetReportQueryByRequir(string projectId,string unitId,string unitWorkId, string pipeLineId, string material, string startTime,string endTime)
{
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", projectId));
if (!string.IsNullOrEmpty(pipeLineId))
#region
/// <summary>
/// 多维度查询报表
/// </summary>
/// <param name="projectId"></param>
/// <param name="unitId"></param>
/// <param name="unitWorkId"></param>
/// <param name="pipeLineId"></param>
/// <param name="material"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public static List<Model.ReportQueryItem> GetReportQueryByRequir(string projectId, string unitId, string unitWorkId, string pipeLineId, string material, string startTime, string endTime)
{
listStr.Add(new SqlParameter("@pipeLineId", pipeLineId));
}
else if (!string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
listStr.Add(new SqlParameter("@unitWorkId", unitWorkId));
}
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", projectId));
else if (!string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
listStr.Add(new SqlParameter("@unitId", unitId));
}
if (!string.IsNullOrEmpty(pipeLineId))
{
listStr.Add(new SqlParameter("@pipeLineId", pipeLineId));
}
else if (!string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
listStr.Add(new SqlParameter("@unitWorkId", unitWorkId));
}
if (!string.IsNullOrEmpty(material))
{
listStr.Add(new SqlParameter("@material", material));
}
else
{
listStr.Add(new SqlParameter("@material", null));
}
else if (!string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
listStr.Add(new SqlParameter("@unitId", unitId));
}
if (!string.IsNullOrEmpty(startTime))
{
listStr.Add(new SqlParameter("@startTime", Convert.ToDateTime(startTime)));
}
else
{
listStr.Add(new SqlParameter("@startTime", null));
}
if (!string.IsNullOrEmpty(material))
{
listStr.Add(new SqlParameter("@material", material));
}
else
{
listStr.Add(new SqlParameter("@material", null));
}
if (!string.IsNullOrEmpty(endTime))
{
listStr.Add(new SqlParameter("@endTime", Convert.ToDateTime(endTime)));
if (!string.IsNullOrEmpty(startTime))
{
listStr.Add(new SqlParameter("@startTime", Convert.ToDateTime(startTime)));
}
else
{
listStr.Add(new SqlParameter("@startTime", null));
}
if (!string.IsNullOrEmpty(endTime))
{
listStr.Add(new SqlParameter("@endTime", Convert.ToDateTime(endTime)));
}
else
{
listStr.Add(new SqlParameter("@endTime", null));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = null;
if (string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByProject", parameter);
}
if (!string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByUnit", parameter);
}
if (!string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByUnitWork", parameter);
}
if (!string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByPipeLine", parameter);
}
List<Model.ReportQueryItem> reportList = new List<Model.ReportQueryItem>();
foreach (DataRow row in dt.Rows)
{
string totalJot = row["TotalJot"].ToString();
string totalDin = row["TotalDin"].ToString();
string weldedJot = row["weldedJot"].ToString();
string weldedDin = row["weldedDin"].ToString();
string oneCheckJotNum = row["OneCheckJotNum"].ToString();
string oneCheckRepairJotNum = row["OneCheckRepairJotNum"].ToString();
string expandJotNum = row["OneExpandJotNum"].ToString();
Model.ReportQueryItem report = new Model.ReportQueryItem();
string code = string.Empty;
int mustCheckJotNum = 0;
if (string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("1", row["ProjectId"].ToString());
code = row["ProjectCode"].ToString();
report.ProjectCode = row["ProjectCode"].ToString();
}
if (!string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("2", row["UnitId"].ToString());
report.CUnit = row["UnitCode"].ToString();
}
if (!string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("3", row["UnitWorkId"].ToString());
report.UnitWork = row["UnitWorkCode"].ToString();
}
if (!string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("4", row["PipelineId"].ToString());
report.PipeLine = row["PipelineCode"].ToString();
}
string weldingRate = "0.0%";
if (totalJot != "0")
{
weldingRate = (Convert.ToInt32(weldedJot) * 100.0 / Convert.ToInt32(totalJot)).ToString() + "%";
}
string weldingOnePassRate = "0.0%";
if (oneCheckJotNum != "0")
{
weldingOnePassRate = ((Convert.ToInt32(oneCheckJotNum) - Convert.ToInt32(oneCheckRepairJotNum)) * 100.0 / Convert.ToInt32(oneCheckJotNum)).ToString() + "%";
}
string checkCompRate = "0.0%";
if (mustCheckJotNum != 0)
{
checkCompRate = (Convert.ToInt32(oneCheckJotNum) * 100.0 / mustCheckJotNum).ToString() + "%";
}
report.TotalJotDin = totalJot + "/" + totalDin;
report.WeldedJotDin = weldedJot + "/" + weldedDin;
report.WeldingRate = weldingRate;
report.WeldingOnePassRate = weldingOnePassRate;
report.MustCheckJotNum = mustCheckJotNum.ToString();
report.CheckedJotNum = oneCheckJotNum;
report.CheckCompRate = checkCompRate;
report.RepairJotNum = oneCheckRepairJotNum;
report.ExpandJotNum = expandJotNum;
reportList.Add(report);
}
return reportList;
}
else
#endregion
/// <summary>
/// 获取应检测焊口数
/// </summary>
/// <param name="flag">1-施工单位,2-单位工程,3-管线</param>
/// <param name="id"></param>
/// <returns></returns>
private static int GetMustCheckJotNum(string flag, string id)
{
listStr.Add(new SqlParameter("@endTime", null));
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
int num = 0;
List<Model.HJGL_Pipeline> pipeList = null;
if (flag == "1")
{
pipeList = (from x in db.HJGL_Pipeline where x.ProjectId == id select x).ToList();
}
if (flag == "2")
{
pipeList = (from x in db.HJGL_Pipeline where x.UnitId == id select x).ToList();
}
if (flag == "3")
{
pipeList = (from x in db.HJGL_Pipeline where x.UnitWorkId == id select x).ToList();
}
if (flag == "4")
{
pipeList = (from x in db.HJGL_Pipeline where x.PipelineId == id select x).ToList();
}
foreach (var pipe in pipeList)
{
var rate = db.Base_DetectionRate.FirstOrDefault(e => e.DetectionRateId == pipe.DetectionRateId);
int jointNum = (from x in db.HJGL_WeldJoint where x.PipelineId == pipe.PipelineId select x).Count();
int DetectionRateValue = int.Parse(rate.DetectionRateValue);
decimal n = Convert.ToDecimal(1.0 * jointNum * DetectionRateValue / 100);
num = num + Convert.ToInt32(Math.Ceiling(n));
}
return num;
}
}
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = null;
if (string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByProject", parameter);
}
if (!string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByUnit", parameter);
}
if (!string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByUnitWork", parameter);
}
if (!string.IsNullOrEmpty(pipeLineId))
{
dt = SQLHelper.GetDataTableRunProc("sp_ReportQueryByPipeLine", parameter);
}
List<Model.ReportQueryItem> reportList = new List<Model.ReportQueryItem>();
foreach (DataRow row in dt.Rows)
{
string totalJot = row["TotalJot"].ToString();
string totalDin = row["TotalDin"].ToString();
string weldedJot = row["weldedJot"].ToString();
string weldedDin = row["weldedDin"].ToString();
string oneCheckJotNum = row["OneCheckJotNum"].ToString();
string oneCheckRepairJotNum = row["OneCheckRepairJotNum"].ToString();
string expandJotNum = row["OneExpandJotNum"].ToString();
Model.ReportQueryItem report = new Model.ReportQueryItem();
string code = string.Empty;
int mustCheckJotNum = 0;
if (string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("1", row["ProjectId"].ToString());
code = row["ProjectCode"].ToString();
report.ProjectCode = row["ProjectCode"].ToString();
}
if (!string.IsNullOrEmpty(unitId) && string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("2", row["UnitId"].ToString());
report.CUnit = row["UnitCode"].ToString();
}
if (!string.IsNullOrEmpty(unitWorkId) && string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("3", row["UnitWorkId"].ToString());
report.UnitWork = row["UnitWorkCode"].ToString();
}
if (!string.IsNullOrEmpty(pipeLineId))
{
mustCheckJotNum = GetMustCheckJotNum("4", row["PipelineId"].ToString());
report.PipeLine = row["PipelineCode"].ToString();
}
string weldingRate = "0.0%";
if (totalJot != "0")
{
weldingRate = (Convert.ToInt32(weldedJot) * 100.0 / Convert.ToInt32(totalJot)).ToString() + "%";
}
string weldingOnePassRate = "0.0%";
if (oneCheckJotNum != "0")
{
weldingOnePassRate=((Convert.ToInt32(oneCheckJotNum)-Convert.ToInt32(oneCheckRepairJotNum))*100.0/ Convert.ToInt32(oneCheckJotNum)).ToString() + "%";
}
string checkCompRate = "0.0%";
if (mustCheckJotNum != 0)
{
checkCompRate = (Convert.ToInt32(oneCheckJotNum) * 100.0 / mustCheckJotNum).ToString() + "%";
}
report.TotalJotDin = totalJot + "/" + totalDin;
report.WeldedJotDin = weldedJot + "/" + weldedDin;
report.WeldingRate = weldingRate;
report.WeldingOnePassRate = weldingOnePassRate;
report.MustCheckJotNum = mustCheckJotNum.ToString();
report.CheckedJotNum = oneCheckJotNum;
report.CheckCompRate = checkCompRate;
report.RepairJotNum = oneCheckRepairJotNum;
report.ExpandJotNum = expandJotNum;
reportList.Add(report);
}
return reportList;
}
#endregion
/// <summary>
/// 获取应检测焊口数
/// </summary>
/// <param name="flag">1-施工单位,2-单位工程,3-管线</param>
/// <param name="id"></param>
/// <returns></returns>
private static int GetMustCheckJotNum(string flag, string id)
{
int num = 0;
List<Model.HJGL_Pipeline> pipeList = null;
if (flag == "1")
{
pipeList = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == id select x).ToList();
}
if (flag == "2")
{
pipeList = (from x in Funs.DB.HJGL_Pipeline where x.UnitId == id select x).ToList();
}
if (flag == "3")
{
pipeList = (from x in Funs.DB.HJGL_Pipeline where x.UnitWorkId == id select x).ToList();
}
if (flag == "4")
{
pipeList = (from x in Funs.DB.HJGL_Pipeline where x.PipelineId == id select x).ToList();
}
foreach (var pipe in pipeList)
{
var rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipe.DetectionRateId);
int jointNum = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipe.PipelineId select x).Count();
int DetectionRateValue = int.Parse(rate.DetectionRateValue);
decimal n = Convert.ToDecimal(1.0 * jointNum * DetectionRateValue / 100);
num = num + Convert.ToInt32(Math.Ceiling(n));
}
return num;
}
}
}
}
+10 -10
View File
@@ -99,9 +99,9 @@ namespace BLL
CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime),
DaySummary = x.DaySummary,
PartInUnitIds = x.PartInUnits,
PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits),
PartInUnitNames = UnitService.getUnitNamesUnitIdsForApi (x.PartInUnits),
PartInPersonIds = x.PartInPersonIds,
PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds),
PartInPersonNames = UserService.getUserNamesUserIdsForApi(x.PartInPersonIds),
PartInPersonNames2 = x.PartInPersonNames,
CompileManId = x.CompileMan,
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
@@ -159,7 +159,7 @@ namespace BLL
DaySummary = System.Web.HttpUtility.HtmlEncode(newItem.DaySummary),
PartInUnits = newItem.PartInUnitIds,
PartInPersonIds = newItem.PartInPersonIds,
PartInPersons = UserService.getUserNamesUserIds(newItem.PartInPersonIds),
PartInPersons = UserService.getUserNamesUserIdsForApi(newItem.PartInPersonIds),
PartInPersonNames = newItem.PartInPersonNames2,
CompileMan = newItem.CompileManId,
States = Const.State_0,
@@ -194,22 +194,22 @@ namespace BLL
db.Check_CheckSpecial.InsertOnSubmit(newCheckSpecial);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectCheckSpecialMenuId, newCheckSpecial.ProjectId, null, newCheckSpecial.CheckSpecialId, newCheckSpecial.CheckTime);
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(BLL.Const.ProjectCheckSpecialMenuId, newCheckSpecial.ProjectId, null, newCheckSpecial.CheckSpecialId, newCheckSpecial.CheckTime);
}
else
{
Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
Check_CheckSpecialService.UpdateCheckSpecialForApi(newCheckSpecial);
//// 删除专项检查明细项
Check_CheckSpecialDetailService.DeleteCheckSpecialDetails(newCheckSpecial.CheckSpecialId);
Check_CheckSpecialDetailService.DeleteCheckSpecialDetailsForApi(newCheckSpecial.CheckSpecialId);
}
////保存附件
if (!string.IsNullOrEmpty(newItem.AttachUrl1))
{
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl1, 10, null), newItem.AttachUrl1, Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId);
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl1, 10, null), newItem.AttachUrl1, Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId);
}
else
{
CommonService.DeleteAttachFileById(Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId);
CommonService.DeleteAttachFileByIdForApi(Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId);
}
///// 新增检查项
@@ -227,7 +227,7 @@ namespace BLL
if (getC == null)
{
newCheckSpecial.States = Const.State_2;
Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
Check_CheckSpecialService.UpdateCheckSpecialForApi(newCheckSpecial);
}
else
{
@@ -235,7 +235,7 @@ namespace BLL
var detailLists = db.Check_CheckSpecialDetail.Where(x => x.CheckSpecialId == newCheckSpecial.CheckSpecialId && x.CompleteStatus == false);
if (detailLists.Count() > 0)
{
message = Check_CheckSpecialService.IssueRectification(detailLists.ToList(), newCheckSpecial);
message = Check_CheckSpecialService.IssueRectificationForApi(detailLists.ToList(), newCheckSpecial);
}
@@ -123,15 +123,15 @@ namespace BLL
newConstructSolution.CompileDate = DateTime.Now;
newConstructSolution.ConstructSolutionId = SQLHelper.GetNewID();
newConstructSolution.ConstructSolutionCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectConstructSolutionMenuId, newConstructSolution.ProjectId, newConstructSolution.UnitId);
ConstructSolutionService.AddConstructSolution(newConstructSolution);
ConstructSolutionService.AddConstructSolutionForApi(newConstructSolution);
}
else
{
ConstructSolutionService.UpdateConstructSolution(newConstructSolution);
ConstructSolutionService.UpdateConstructSolutionForApi(newConstructSolution);
}
if (newConstructSolution.States == "1")
{
CommonService.btnSaveData(newConstructSolution.ProjectId, Const.ProjectConstructSolutionMenuId, newConstructSolution.ConstructSolutionId, newConstructSolution.CompileMan, true, newConstructSolution.CompileManName, "../Solution/ConstructSolutionView.aspx?ConstructSolutionId={0}");
CommonService.btnSaveDataForApi(newConstructSolution.ProjectId, Const.ProjectConstructSolutionMenuId, newConstructSolution.ConstructSolutionId, newConstructSolution.CompileMan, true, newConstructSolution.CompileManName, "../Solution/ConstructSolutionView.aspx?ConstructSolutionId={0}");
}
if (!string.IsNullOrEmpty(newItem.AttachUrl))
{
@@ -140,7 +140,7 @@ namespace BLL
}
else
{
CommonService.DeleteAttachFileById(newConstructSolution.ConstructSolutionId);
CommonService.DeleteAttachFileByIdForApi(newConstructSolution.ConstructSolutionId);
}
}
#endregion
+5 -5
View File
@@ -307,7 +307,7 @@ namespace BLL
db.Emergency_EmergencyList.InsertOnSubmit(newEmergency);
db.SubmitChanges();
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectEmergencyListMenuId, newEmergency.ProjectId, null, newEmergency.EmergencyListId, newEmergency.CompileDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectEmergencyListMenuId, newEmergency.ProjectId, null, newEmergency.EmergencyListId, newEmergency.CompileDate);
}
else
{
@@ -322,7 +322,7 @@ namespace BLL
}
if (emergencyInfo.States == Const.State_1)
{
CommonService.btnSaveData(newEmergency.ProjectId, Const.ProjectEmergencyListMenuId, newEmergency.EmergencyListId, newEmergency.CompileMan, true, newEmergency.EmergencyName, "../Emergency/EmergencyListView.aspx?EmergencyListId={0}");
CommonService.btnSaveDataForApi(newEmergency.ProjectId, Const.ProjectEmergencyListMenuId, newEmergency.EmergencyListId, newEmergency.CompileMan, true, newEmergency.EmergencyName, "../Emergency/EmergencyListView.aspx?EmergencyListId={0}");
}
menuId = Const.ProjectEmergencyListMenuId;
@@ -366,7 +366,7 @@ namespace BLL
}
if (emergencyInfo.States == Const.State_1)
{
CommonService.btnSaveData(newEmergency.ProjectId, Const.ProjectEmergencySupplyMenuId, newEmergency.FileId, newEmergency.CompileMan, true, newEmergency.FileName, "../Emergency/EmergencySupplyView.aspx?FileId={0}");
CommonService.btnSaveDataForApi(newEmergency.ProjectId, Const.ProjectEmergencySupplyMenuId, newEmergency.FileId, newEmergency.CompileMan, true, newEmergency.FileName, "../Emergency/EmergencySupplyView.aspx?FileId={0}");
}
menuId = Const.ProjectEmergencySupplyMenuId;
}
@@ -435,7 +435,7 @@ namespace BLL
if (emergencyInfo.States == Const.State_1)
{
CommonService.btnSaveData(newEmergency.ProjectId, Const.ProjectEmergencyTeamAndTrainMenuId, newEmergency.FileId, newEmergency.CompileMan, true, newEmergency.FileName, "../Emergency/EmergencyTeamAndTrainView.aspx?FileId={0}");
CommonService.btnSaveDataForApi(newEmergency.ProjectId, Const.ProjectEmergencyTeamAndTrainMenuId, newEmergency.FileId, newEmergency.CompileMan, true, newEmergency.FileName, "../Emergency/EmergencyTeamAndTrainView.aspx?FileId={0}");
}
menuId = Const.ProjectEmergencyTeamAndTrainMenuId;
}
@@ -567,7 +567,7 @@ namespace BLL
Model.BaseInfoItem newItem = new Model.BaseInfoItem
{
BaseInfoId = teamItem.PersonId,
BaseInfoName = BLL.PersonService.GetPersonNameById(teamItem.PersonId),
BaseInfoName = BLL.PersonService.GetPersonNameByIdForApi(teamItem.PersonId),
BaseInfoCode = teamItem.Tel,
Remark = teamItem.Job,
RemarkOther = "1",
@@ -131,20 +131,20 @@ namespace BLL
newEquipmentQuality.CompileDate = DateTime.Now;
newEquipmentQuality.EquipmentQualityId = SQLHelper.GetNewID();
newEquipmentQuality.EquipmentQualityCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.EquipmentQualityMenuId, newEquipmentQuality.ProjectId, newEquipmentQuality.UnitId);
EquipmentQualityService.AddEquipmentQuality(newEquipmentQuality);
EquipmentQualityService.AddEquipmentQualityForApi(newEquipmentQuality);
}
else
{
EquipmentQualityService.UpdateEquipmentQuality(newEquipmentQuality);
EquipmentQualityService.UpdateEquipmentQualityForApi(newEquipmentQuality);
}
if (!string.IsNullOrEmpty(newItem.AttachUrl))
{
////保存附件
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl, 10, null), newItem.AttachUrl, Const.EquipmentQualityMenuId, newEquipmentQuality.EquipmentQualityId);
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl, 10, null), newItem.AttachUrl, Const.EquipmentQualityMenuId, newEquipmentQuality.EquipmentQualityId);
}
else
{
CommonService.DeleteAttachFileById(newEquipmentQuality.EquipmentQualityId);
CommonService.DeleteAttachFileByIdForApi(newEquipmentQuality.EquipmentQualityId);
}
}
#endregion
+1 -1
View File
@@ -28,7 +28,7 @@ namespace BLL
var getFlowOperteList = ReturnFlowOperteList(projectId, userId, getDiaryDate.Value);
getItem.ProjectId = projectId;
getItem.UserId = userId;
getItem.UserName = UserService.GetUserNameByUserId(userId);
getItem.UserName = UserService.GetUserNameByUserIdForApi(userId);
getItem.DiaryDate = diaryDate;
getItem.HSEDiaryId = SQLHelper.GetNewID();
getItem.Value1 = getValues1(getFlowOperteList, projectId, userId, getDiaryDate.Value);
+3 -3
View File
@@ -31,7 +31,7 @@ namespace BLL
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate),
WorkStageIds = x.WorkStage,
WorkStageNames = WorkStageService.getWorkStageNamesWorkStageIds(x.WorkStage),
WorkStageNames = WorkStageService.getWorkStageNamesWorkStageIdsForApi(x.WorkStage),
Contents = x.Contents,
WorkAreaName = x.WorkAreaName,
IdentificationDate = string.Format("{0:yyyy-MM-dd}", x.IdentificationDate),
@@ -68,7 +68,7 @@ namespace BLL
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate),
WorkStageIds = x.WorkStage,
WorkStageNames = WorkStageService.getWorkStageNamesWorkStageIds(x.WorkStage),
WorkStageNames = WorkStageService.getWorkStageNamesWorkStageIdsForApi(x.WorkStage),
Contents = x.Contents,
WorkAreaName = x.WorkAreaName,
IdentificationDate = string.Format("{0:yyyy-MM-dd}", x.IdentificationDate),
@@ -98,7 +98,7 @@ namespace BLL
select new Model.HazardListSelectedItem
{
HazardId = x.HazardId,
WorkStageName = WorkStageService.getWorkStageNamesWorkStageIds(x.WorkStage),
WorkStageName = WorkStageService.getWorkStageNamesWorkStageIdsForApi(x.WorkStage),
SupHazardListTypeName = db.Technique_HazardListType.First(z => z.HazardListTypeId == y.SupHazardListTypeId).HazardListTypeName,
HazardListTypeName = y.HazardListTypeName,
HazardCode = y.HazardListTypeCode,
@@ -162,7 +162,7 @@ namespace BLL
newIncentiveNotice.CompileDate = DateTime.Now;
newIncentiveNotice.IncentiveNoticeId = SQLHelper.GetNewID();
newIncentiveNotice.IncentiveNoticeCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectIncentiveNoticeMenuId, newIncentiveNotice.ProjectId, newIncentiveNotice.UnitId);
IncentiveNoticeService.AddIncentiveNotice(newIncentiveNotice);
IncentiveNoticeService.AddIncentiveNoticeForApi(newIncentiveNotice);
}
else
{
@@ -261,7 +261,7 @@ namespace BLL
}
if (newIncentiveNotice.States == "1" || newIncentiveNotice.States == "0")
{
CommonService.btnSaveData(newIncentiveNotice.ProjectId, Const.ProjectIncentiveNoticeMenuId, newIncentiveNotice.IncentiveNoticeId, newIncentiveNotice.CompileMan, true, newIncentiveNotice.IncentiveNoticeCode, "../Check/IncentiveNoticeView.aspx?IncentiveNoticeId={0}");
CommonService.btnSaveDataForApi(newIncentiveNotice.ProjectId, Const.ProjectIncentiveNoticeMenuId, newIncentiveNotice.IncentiveNoticeId, newIncentiveNotice.CompileMan, true, newIncentiveNotice.IncentiveNoticeCode, "../Check/IncentiveNoticeView.aspx?IncentiveNoticeId={0}");
}
}
#endregion
+17 -17
View File
@@ -531,7 +531,7 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
if (!ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(projectId, unitId))
if (!ProjectUnitService.GetProjectUnitTypeByProjectIdUnitIdForApi(projectId, unitId))
{
unitId = null;
}
@@ -993,7 +993,7 @@ namespace BLL
ApplyManId = x.CompileMan,
ApplyManName = x.ApplicantMan,
ApplyDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate),
WorkPalce = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
WorkPalce = UnitWorkService.GetUnitWorkNameForApi(x.WorkAreaId),
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.StartDate),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.EndDate),
States = x.WorkStates,
@@ -1384,7 +1384,7 @@ namespace BLL
ApplyUnitName = db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName,
ApplyManName = x.ApplicantMan,
ApplyDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate),
WorkPalce = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
WorkPalce = UnitWorkService.GetUnitWorkNameForApi(x.WorkAreaId),
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.StartDate),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.EndDate),
States = x.WorkStates,
@@ -1534,7 +1534,7 @@ namespace BLL
newItem.LicenseCode = newFireWork.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectFireWorkMenuId, newFireWork.ProjectId, newFireWork.ApplyUnitId);
db.License_FireWork.InsertOnSubmit(newFireWork);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectFireWorkMenuId, newFireWork.ProjectId, newFireWork.ApplyUnitId, newFireWork.FireWorkId, newFireWork.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectFireWorkMenuId, newFireWork.ProjectId, newFireWork.ApplyUnitId, newFireWork.FireWorkId, newFireWork.ApplyDate);
}
else
{
@@ -1619,7 +1619,7 @@ namespace BLL
db.License_HeightWork.InsertOnSubmit(newHeightWork);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectHeightWorkMenuId, newHeightWork.ProjectId, newHeightWork.ApplyUnitId, newHeightWork.HeightWorkId, newHeightWork.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectHeightWorkMenuId, newHeightWork.ProjectId, newHeightWork.ApplyUnitId, newHeightWork.HeightWorkId, newHeightWork.ApplyDate);
}
else
{
@@ -1701,7 +1701,7 @@ namespace BLL
newItem.LicenseCode = newLimitedSpace.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectLimitedSpaceMenuId, newLimitedSpace.ProjectId, newLimitedSpace.ApplyUnitId);
db.License_LimitedSpace.InsertOnSubmit(newLimitedSpace);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectLimitedSpaceMenuId, newLimitedSpace.ProjectId, newLimitedSpace.ApplyUnitId, newLimitedSpace.LimitedSpaceId, newLimitedSpace.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectLimitedSpaceMenuId, newLimitedSpace.ProjectId, newLimitedSpace.ApplyUnitId, newLimitedSpace.LimitedSpaceId, newLimitedSpace.ApplyDate);
}
else
{
@@ -1792,7 +1792,7 @@ namespace BLL
newItem.LicenseCode = newRadialWork.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectRadialWorkMenuId, newRadialWork.ProjectId, newRadialWork.ApplyUnitId);
db.License_RadialWork.InsertOnSubmit(newRadialWork);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectRadialWorkMenuId, newRadialWork.ProjectId, newRadialWork.ApplyUnitId, newRadialWork.RadialWorkId, newRadialWork.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectRadialWorkMenuId, newRadialWork.ProjectId, newRadialWork.ApplyUnitId, newRadialWork.RadialWorkId, newRadialWork.ApplyDate);
}
else
{
@@ -1877,7 +1877,7 @@ namespace BLL
newItem.LicenseCode = newOpenCircuit.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectOpenCircuitMenuId, newOpenCircuit.ProjectId, newOpenCircuit.ApplyUnitId);
db.License_OpenCircuit.InsertOnSubmit(newOpenCircuit);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectOpenCircuitMenuId, newOpenCircuit.ProjectId, newOpenCircuit.ApplyUnitId, newOpenCircuit.OpenCircuitId, newOpenCircuit.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectOpenCircuitMenuId, newOpenCircuit.ProjectId, newOpenCircuit.ApplyUnitId, newOpenCircuit.OpenCircuitId, newOpenCircuit.ApplyDate);
}
else
{
@@ -1958,7 +1958,7 @@ namespace BLL
newItem.LicenseCode = newBreakGround.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectBreakGroundMenuId, newBreakGround.ProjectId, newBreakGround.ApplyUnitId);
db.License_BreakGround.InsertOnSubmit(newBreakGround);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectBreakGroundMenuId, newBreakGround.ProjectId, newBreakGround.ApplyUnitId, newBreakGround.BreakGroundId, newBreakGround.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectBreakGroundMenuId, newBreakGround.ProjectId, newBreakGround.ApplyUnitId, newBreakGround.BreakGroundId, newBreakGround.ApplyDate);
}
else
{
@@ -2040,7 +2040,7 @@ namespace BLL
newItem.LicenseCode = newNightWork.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectNightWorkMenuId, newNightWork.ProjectId, newNightWork.ApplyUnitId);
db.License_NightWork.InsertOnSubmit(newNightWork);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectNightWorkMenuId, newNightWork.ProjectId, newNightWork.ApplyUnitId, newNightWork.NightWorkId, newNightWork.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectNightWorkMenuId, newNightWork.ProjectId, newNightWork.ApplyUnitId, newNightWork.NightWorkId, newNightWork.ApplyDate);
}
else
{
@@ -2130,7 +2130,7 @@ namespace BLL
newItem.LicenseCode = newLiftingWork.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectLiftingWorkMenuId, newLiftingWork.ProjectId, newLiftingWork.ApplyUnitId);
db.License_LiftingWork.InsertOnSubmit(newLiftingWork);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectLiftingWorkMenuId, newLiftingWork.ProjectId, newLiftingWork.ApplyUnitId, newLiftingWork.LiftingWorkId, newLiftingWork.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectLiftingWorkMenuId, newLiftingWork.ProjectId, newLiftingWork.ApplyUnitId, newLiftingWork.LiftingWorkId, newLiftingWork.ApplyDate);
}
else
{
@@ -2214,7 +2214,7 @@ namespace BLL
newItem.LicenseCode = newTempElectricity.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectTempElectricityMenuId, newTempElectricity.ProjectId, newTempElectricity.ApplyUnitId);
db.License_TempElectricity.InsertOnSubmit(newTempElectricity);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTempElectricityMenuId, newTempElectricity.ProjectId, newTempElectricity.ApplyUnitId, newTempElectricity.TempElectricityId, newTempElectricity.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTempElectricityMenuId, newTempElectricity.ProjectId, newTempElectricity.ApplyUnitId, newTempElectricity.TempElectricityId, newTempElectricity.ApplyDate);
}
else
{
@@ -2299,7 +2299,7 @@ namespace BLL
newItem.LicenseCode = newPressureTest.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectPressureTestMenuId, newPressureTest.ProjectId, newPressureTest.ApplyUnitId);
db.License_PressureTest.InsertOnSubmit(newPressureTest);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTempElectricityMenuId, newPressureTest.ProjectId, newPressureTest.ApplyUnitId, newPressureTest.PressureTestId, newPressureTest.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTempElectricityMenuId, newPressureTest.ProjectId, newPressureTest.ApplyUnitId, newPressureTest.PressureTestId, newPressureTest.ApplyDate);
}
else
{
@@ -2388,7 +2388,7 @@ namespace BLL
db.License_JiaBan.InsertOnSubmit(newJiaBan);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectJiaBanWorkMenuId, newJiaBan.ProjectId, newJiaBan.ApplyUnitId, newJiaBan.JiaBanId, newJiaBan.ApplyDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectJiaBanWorkMenuId, newJiaBan.ProjectId, newJiaBan.ApplyUnitId, newJiaBan.JiaBanId, newJiaBan.ApplyDate);
}
else
{
@@ -2469,7 +2469,7 @@ namespace BLL
newItem.LicenseCode = newLicenseManager.LicenseManagerCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectLicenseManagerMenuId, newLicenseManager.ProjectId, newLicenseManager.UnitId);
db.License_LicenseManager.InsertOnSubmit(newLicenseManager);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectLicenseManagerMenuId, newLicenseManager.ProjectId, newLicenseManager.UnitId, newLicenseManager.LicenseManagerId, newLicenseManager.CompileDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectLicenseManagerMenuId, newLicenseManager.ProjectId, newLicenseManager.UnitId, newLicenseManager.LicenseManagerId, newLicenseManager.CompileDate);
}
else
{
@@ -2488,7 +2488,7 @@ namespace BLL
}
if (newLicenseManager.States == Const.State_2)
{
CommonService.btnSaveData(newLicenseManager.ProjectId, Const.ProjectLicenseManagerMenuId, newLicenseManager.LicenseManagerId, newLicenseManager.CompileMan, true, newLicenseManager.LicenseManagerCode, "../License/LicenseManagerView.aspx?LicenseManagerId={0}");
CommonService.btnSaveDataForApi(newLicenseManager.ProjectId, Const.ProjectLicenseManagerMenuId, newLicenseManager.LicenseManagerId, newLicenseManager.CompileMan, true, newLicenseManager.LicenseManagerCode, "../License/LicenseManagerView.aspx?LicenseManagerId={0}");
}
//// 保存附件
APIUpLoadFileService.SaveAttachUrl(newItem.MenuId, strLicenseId, newItem.AttachUrl, "0");
@@ -3744,7 +3744,7 @@ namespace BLL
db.License_FlowOperate.DeleteAllOnSubmit(getDelFlows);
}
//// 删除编码表记录
CodeRecordsService.DeleteCodeRecordsByDataId(strLicenseId);
CodeRecordsService.DeleteCodeRecordsByDataIdForApi(strLicenseId);
#region
if (newItem.MenuId == Const.ProjectFireWorkMenuId)
{
@@ -28,7 +28,7 @@ namespace BLL
AuditFlowName = x.AuditFlowName,
SortIndex = x.SortIndex ?? 1,
RoleIds = x.RoleIds,
RoleNames = RoleService.getRoleNamesRoleIds(x.RoleIds),
RoleNames = RoleService.getRoleNamesRoleIdsForApi(x.RoleIds),
OperaterId = x.OperaterId,
OperaterName = db.Sys_User.First(u => u.UserId == x.OperaterId).UserName,
OperaterTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.OperaterTime),
@@ -63,7 +63,7 @@ namespace BLL
AuditFlowName = x.AuditFlowName,
SortIndex = x.SortIndex ?? 1,
RoleIds = x.RoleIds,
RoleNames = RoleService.getRoleNamesRoleIds(x.RoleIds),
RoleNames = RoleService.getRoleNamesRoleIdsForApi(x.RoleIds),
OperaterId = x.OperaterId,
OperaterName = db.Sys_User.First(u => u.UserId == x.OperaterId).UserName,
OperaterTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.OperaterTime),
@@ -132,43 +132,46 @@ namespace BLL
IsSelfRole = item.IsSelfRole
};
LicensePublicService.AddFlowOperate(newFlowOperate);
LicensePublicService.AddFlowOperateForApi(newFlowOperate);
}
}
}
#endregion
#endregion
#region -[State=1]
/// <summary>
/// 保存作业票-流程审核
/// </summary>
/// <param name="flowOperate">流程审核集合</param>
/// <returns></returns>
public static void SaveFlowOperate(Model.FlowOperateItem flowOperate)
{
var getFlowOperate = LicensePublicService.GetFlowOperateById(flowOperate.FlowOperateId);
if (getFlowOperate != null)
#region -[State=1]
/// <summary>
/// 保存作业票-流程审核
/// </summary>
/// <param name="flowOperate">流程审核集合</param>
/// <returns></returns>
public static void SaveFlowOperate(Model.FlowOperateItem flowOperate)
{
getFlowOperate.OperaterId = flowOperate.OperaterId;
getFlowOperate.OperaterTime = System.DateTime.Now;
getFlowOperate.IsAgree = flowOperate.IsAgree;
getFlowOperate.Opinion = flowOperate.Opinion;
getFlowOperate.IsClosed = flowOperate.IsAgree;///同意时,当前流程关闭;不同意则返回申请人。
LicensePublicService.UpdateFlowOperate(getFlowOperate);
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getFlowOperate = db.License_FlowOperate.FirstOrDefault(e => e.FlowOperateId == flowOperate.FlowOperateId);
if (getFlowOperate != null)
{
getFlowOperate.OperaterId = flowOperate.OperaterId;
getFlowOperate.OperaterTime = System.DateTime.Now;
getFlowOperate.IsAgree = flowOperate.IsAgree;
getFlowOperate.Opinion = flowOperate.Opinion;
getFlowOperate.IsClosed = flowOperate.IsAgree;///同意时,当前流程关闭;不同意则返回申请人。
db.SubmitChanges();
Model.License_FlowOperateItem newFlowOperateItem = new Model.License_FlowOperateItem
{
FlowOperateItemId = SQLHelper.GetNewID(),
FlowOperateId = getFlowOperate.FlowOperateId,
OperaterId = getFlowOperate.OperaterId,
OperaterTime = getFlowOperate.OperaterTime,
IsAgree = getFlowOperate.IsAgree,
Opinion = getFlowOperate.Opinion,
};
LicensePublicService.AddFlowOperateItem(newFlowOperateItem);
Model.License_FlowOperateItem newFlowOperateItem = new Model.License_FlowOperateItem
{
FlowOperateItemId = SQLHelper.GetNewID(),
FlowOperateId = getFlowOperate.FlowOperateId,
OperaterId = getFlowOperate.OperaterId,
OperaterTime = getFlowOperate.OperaterTime,
IsAgree = getFlowOperate.IsAgree,
Opinion = getFlowOperate.Opinion,
};
db.License_FlowOperateItem.InsertOnSubmit(newFlowOperateItem);
db.SubmitChanges();
}
}
}
}
#endregion
}
}
+1 -1
View File
@@ -81,7 +81,7 @@ namespace BLL
IsUsed = item.IsUsed,
ConfirmManId = item.ConfirmManId,
};
LicensePublicService.AddLicenseItem(newLicenseItem);
LicensePublicService.AddLicenseItemForApi(newLicenseItem);
}
}
#endregion
+19 -19
View File
@@ -86,7 +86,7 @@ namespace BLL
MeetingHostManOther = x.MeetingHostManOther,
MeetingHostManName = db.Sys_User.First(z => z.UserId == x.MeetingHostManId).UserName,
AttentPersonIds = x.AttentPersonIds,
AttentPersonNames = UserService.getUserNamesUserIds(x.AttentPersonIds),
AttentPersonNames = UserService.getUserNamesUserIdsForApi(x.AttentPersonIds),
}).FirstOrDefault();
}
else if (meetingType == "M")
@@ -119,7 +119,7 @@ namespace BLL
MeetingHostManId = x.MeetingHostManId,
MeetingHostManName = db.Sys_User.First(z => z.UserId == x.MeetingHostManId).UserName,
AttentPersonIds = x.AttentPersonIds,
AttentPersonNames = UserService.getUserNamesUserIds(x.AttentPersonIds),
AttentPersonNames = UserService.getUserNamesUserIdsForApi(x.AttentPersonIds),
}).FirstOrDefault();
}
else if (meetingType == "S")
@@ -152,7 +152,7 @@ namespace BLL
MeetingHostManId = x.MeetingHostManId,
MeetingHostManName = db.Sys_User.First(z => z.UserId == x.MeetingHostManId).UserName,
AttentPersonIds = x.AttentPersonIds,
AttentPersonNames = UserService.getUserNamesUserIds(x.AttentPersonIds),
AttentPersonNames = UserService.getUserNamesUserIdsForApi(x.AttentPersonIds),
}).FirstOrDefault();
}
else
@@ -185,7 +185,7 @@ namespace BLL
MeetingHostManId = x.MeetingHostManId,
MeetingHostManName = db.Sys_User.First(z => z.UserId == x.MeetingHostManId).UserName,
AttentPersonIds = x.AttentPersonIds,
AttentPersonNames = UserService.getUserNamesUserIds(x.AttentPersonIds),
AttentPersonNames = UserService.getUserNamesUserIdsForApi(x.AttentPersonIds),
}).FirstOrDefault();
}
return getMeetItem;
@@ -412,15 +412,15 @@ namespace BLL
newClassMeeting.CompileDate = DateTime.Now;
meeting.MeetingId = newClassMeeting.ClassMeetingId = SQLHelper.GetNewID();
newClassMeeting.ClassMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectClassMeetingMenuId, newClassMeeting.ProjectId, null);
ClassMeetingService.AddClassMeeting(newClassMeeting);
ClassMeetingService.AddClassMeetingForApi(newClassMeeting);
}
else
{
ClassMeetingService.UpdateClassMeeting(newClassMeeting);
ClassMeetingService.UpdateClassMeetingForApi(newClassMeeting);
}
if (meeting.States == "1")
{
CommonService.btnSaveData(meeting.ProjectId, Const.ProjectClassMeetingMenuId, newClassMeeting.ClassMeetingId, newClassMeeting.CompileMan, true, newClassMeeting.ClassMeetingName, "../Meeting/ClassMeetingView.aspx?ClassMeetingId={0}");
CommonService.btnSaveDataForApi(meeting.ProjectId, Const.ProjectClassMeetingMenuId, newClassMeeting.ClassMeetingId, newClassMeeting.CompileMan, true, newClassMeeting.ClassMeetingName, "../Meeting/ClassMeetingView.aspx?ClassMeetingId={0}");
}
menuId = Const.ProjectClassMeetingMenuId;
@@ -463,15 +463,15 @@ namespace BLL
newWeekMeeting.CompileDate = DateTime.Now;
meeting.MeetingId = newWeekMeeting.WeekMeetingId = SQLHelper.GetNewID();
newWeekMeeting.WeekMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectWeekMeetingMenuId, newWeekMeeting.ProjectId, null);
WeekMeetingService.AddWeekMeeting(newWeekMeeting);
WeekMeetingService.AddWeekMeetingForApi(newWeekMeeting);
}
else
{
WeekMeetingService.UpdateWeekMeeting(newWeekMeeting);
WeekMeetingService.UpdateWeekMeetingForApi(newWeekMeeting);
}
if (meeting.States == "1")
{
CommonService.btnSaveData(meeting.ProjectId, Const.ProjectWeekMeetingMenuId, newWeekMeeting.WeekMeetingId, newWeekMeeting.CompileMan, true, newWeekMeeting.WeekMeetingName, "../Meeting/WeekMeetingView.aspx?WeekMeetingId={0}");
CommonService.btnSaveDataForApi(meeting.ProjectId, Const.ProjectWeekMeetingMenuId, newWeekMeeting.WeekMeetingId, newWeekMeeting.CompileMan, true, newWeekMeeting.WeekMeetingName, "../Meeting/WeekMeetingView.aspx?WeekMeetingId={0}");
}
menuId = Const.ProjectWeekMeetingMenuId;
}
@@ -512,15 +512,15 @@ namespace BLL
newMonthMeeting.CompileDate = DateTime.Now;
meeting.MeetingId = newMonthMeeting.MonthMeetingId = SQLHelper.GetNewID();
newMonthMeeting.MonthMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectMonthMeetingMenuId, newMonthMeeting.ProjectId, null);
MonthMeetingService.AddMonthMeeting(newMonthMeeting);
MonthMeetingService.AddMonthMeetingForApi(newMonthMeeting);
}
else
{
MonthMeetingService.UpdateMonthMeeting(newMonthMeeting);
MonthMeetingService.UpdateMonthMeetingForApi(newMonthMeeting);
}
if (meeting.States == "1")
{
CommonService.btnSaveData(meeting.ProjectId, Const.ProjectMonthMeetingMenuId, newMonthMeeting.MonthMeetingId, newMonthMeeting.CompileMan, true, newMonthMeeting.MonthMeetingName, "../Meeting/MonthMeetingView.aspx?MonthMeetingId={0}");
CommonService.btnSaveDataForApi(meeting.ProjectId, Const.ProjectMonthMeetingMenuId, newMonthMeeting.MonthMeetingId, newMonthMeeting.CompileMan, true, newMonthMeeting.MonthMeetingName, "../Meeting/MonthMeetingView.aspx?MonthMeetingId={0}");
}
menuId = Const.ProjectMonthMeetingMenuId;
}
@@ -562,15 +562,15 @@ namespace BLL
newSpecialMeeting.CompileDate = DateTime.Now;
meeting.MeetingId = newSpecialMeeting.SpecialMeetingId = SQLHelper.GetNewID();
newSpecialMeeting.SpecialMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectSpecialMeetingMenuId, newSpecialMeeting.ProjectId, null);
SpecialMeetingService.AddSpecialMeeting(newSpecialMeeting);
SpecialMeetingService.AddSpecialMeetingForApi(newSpecialMeeting);
}
else
{
SpecialMeetingService.UpdateSpecialMeeting(newSpecialMeeting);
SpecialMeetingService.UpdateSpecialMeetingForApi(newSpecialMeeting);
}
if (meeting.States == "1")
{
CommonService.btnSaveData(meeting.ProjectId, Const.ProjectSpecialMeetingMenuId, newSpecialMeeting.SpecialMeetingId, newSpecialMeeting.CompileMan, true, newSpecialMeeting.SpecialMeetingName, "../Meeting/SpecialMeetingView.aspx?SpecialMeetingId={0}");
CommonService.btnSaveDataForApi(meeting.ProjectId, Const.ProjectSpecialMeetingMenuId, newSpecialMeeting.SpecialMeetingId, newSpecialMeeting.CompileMan, true, newSpecialMeeting.SpecialMeetingName, "../Meeting/SpecialMeetingView.aspx?SpecialMeetingId={0}");
}
menuId = Const.ProjectSpecialMeetingMenuId;
}
@@ -612,15 +612,15 @@ namespace BLL
newAttendMeeting.CompileDate = DateTime.Now;
meeting.MeetingId = newAttendMeeting.AttendMeetingId = SQLHelper.GetNewID();
newAttendMeeting.AttendMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectAttendMeetingMenuId, newAttendMeeting.ProjectId, null);
AttendMeetingService.AddAttendMeeting(newAttendMeeting);
AttendMeetingService.AddAttendMeetingForApi(newAttendMeeting);
}
else
{
AttendMeetingService.UpdateAttendMeeting(newAttendMeeting);
AttendMeetingService.UpdateAttendMeetingForApi(newAttendMeeting);
}
if (meeting.States == "1")
{
CommonService.btnSaveData(meeting.ProjectId, Const.ProjectAttendMeetingMenuId, newAttendMeeting.AttendMeetingId, newAttendMeeting.CompileMan, true, newAttendMeeting.AttendMeetingName, "../Meeting/AttendMeetingView.aspx?AttendMeetingId={0}");
CommonService.btnSaveDataForApi(meeting.ProjectId, Const.ProjectAttendMeetingMenuId, newAttendMeeting.AttendMeetingId, newAttendMeeting.CompileMan, true, newAttendMeeting.AttendMeetingName, "../Meeting/AttendMeetingView.aspx?AttendMeetingId={0}");
}
menuId = Const.ProjectAttendMeetingMenuId;
}
+6 -6
View File
@@ -51,7 +51,7 @@ namespace BLL
DutyPersonName = db.Sys_User.First(u => u.UserId == x.DutyPersonId).UserName,
DutyPersonDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.DutyPersonDate),
ProfessionalEngineerId = x.ProfessionalEngineerId,
ProfessionalEngineerName = UserService.getUserNamesUserIds(x.ProfessionalEngineerId),
ProfessionalEngineerName = UserService.getUserNamesUserIdsForApi(x.ProfessionalEngineerId),
ProfessionalEngineerTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ProfessionalEngineerTime),
ConstructionManagerId = x.ConstructionManagerId,
ConstructionManagerName = db.Sys_User.First(u => u.UserId == x.ConstructionManagerId).UserName,
@@ -203,7 +203,7 @@ namespace BLL
db.Check_PauseNotice.InsertOnSubmit(newPauseNotice);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectPauseNoticeMenuId, newPauseNotice.ProjectId, newPauseNotice.UnitId, newPauseNotice.PauseNoticeId, newPauseNotice.CompileDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectPauseNoticeMenuId, newPauseNotice.ProjectId, newPauseNotice.UnitId, newPauseNotice.PauseNoticeId, newPauseNotice.CompileDate);
//// 回写巡检记录表
if (!string.IsNullOrEmpty(newItem.HazardRegisterId))
{
@@ -360,7 +360,7 @@ namespace BLL
if (newItem.PauseStates == Const.State_0 || newItem.PauseStates == Const.State_1)
{ //// 通知单附件
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.PauseNoticeAttachUrl, 10, null), newItem.PauseNoticeAttachUrl, Const.ProjectPauseNoticeMenuId, newPauseNotice.PauseNoticeId);
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(newItem.PauseNoticeAttachUrl, 10, null), newItem.PauseNoticeAttachUrl, Const.ProjectPauseNoticeMenuId, newPauseNotice.PauseNoticeId);
}
if (getUpdate != null && getUpdate.States == Const.State_2)
{
@@ -373,7 +373,7 @@ namespace BLL
getcheck.CompletedDate = DateTime.Now;
db.SubmitChanges();
//// 根据明细ID判断是否全部整改完成 并更新专项检查状态
Check_CheckSpecialService.UpdateCheckSpecialStates(getcheck.CheckSpecialId);
Check_CheckSpecialService.UpdateCheckSpecialStatesForApi(getcheck.CheckSpecialId);
}
}
}
@@ -397,11 +397,11 @@ namespace BLL
////保存附件
if (!string.IsNullOrEmpty(attachUrl))
{
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(attachUrl, 10, null), attachUrl, menuId, getPauseNotice.PauseNoticeId);
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(attachUrl, 10, null), attachUrl, menuId, getPauseNotice.PauseNoticeId);
}
else
{
CommonService.DeleteAttachFileById(menuId, getPauseNotice.PauseNoticeId);
CommonService.DeleteAttachFileByIdForApi(menuId, getPauseNotice.PauseNoticeId);
}
}
}
+4 -4
View File
@@ -220,7 +220,7 @@ namespace BLL
newPunishNotice.PunishNoticeCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectPunishNoticeMenuId, newPunishNotice.ProjectId, newPunishNotice.UnitId);
db.Check_PunishNotice.InsertOnSubmit(newPunishNotice);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectPunishNoticeMenuId, newPunishNotice.ProjectId, newPunishNotice.UnitId, newPunishNotice.PunishNoticeId, newPunishNotice.CompileDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectPunishNoticeMenuId, newPunishNotice.ProjectId, newPunishNotice.UnitId, newPunishNotice.PunishNoticeId, newPunishNotice.CompileDate);
//// 回写巡检记录表
if (!string.IsNullOrEmpty(newItem.HazardRegisterId))
@@ -438,7 +438,7 @@ namespace BLL
getcheck.CompletedDate = DateTime.Now;
db.SubmitChanges();
//// 根据明细ID判断是否全部整改完成 并更新专项检查状态
Check_CheckSpecialService.UpdateCheckSpecialStates(getcheck.CheckSpecialId);
Check_CheckSpecialService.UpdateCheckSpecialStatesForApi(getcheck.CheckSpecialId);
}
}
}
@@ -466,11 +466,11 @@ namespace BLL
////保存附件
if (!string.IsNullOrEmpty(attachUrl))
{
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(attachUrl, 10, null), attachUrl, menuId, getPunishNotice.PunishNoticeId);
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(attachUrl, 10, null), attachUrl, menuId, getPunishNotice.PunishNoticeId);
}
else
{
CommonService.DeleteAttachFileById(menuId, getPunishNotice.PunishNoticeId);
CommonService.DeleteAttachFileByIdForApi(menuId, getPunishNotice.PunishNoticeId);
}
}
}
@@ -41,7 +41,7 @@ namespace BLL
SendPersonName = db.Sys_User.First(u => u.UserId == x.SendPersonId).UserName,
MainContent = x.MainContent,
UnitIds = x.UnitIds,
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(x.UnitIds),
FileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId, null),
ReplyFileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId + "#1", null),
Issue = (db.InformationProject_ReceiveFileManager.FirstOrDefault(y => y.FromId == x.ReceiveFileManagerId) == null) ? false : true,
@@ -83,7 +83,7 @@ namespace BLL
SendPersonName = db.Sys_User.First(u => u.UserId == x.SendPersonId).UserName,
MainContent = x.MainContent,
UnitIds = x.UnitIds,
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(x.UnitIds),
FileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId, null),
ReplyFileAttachUrl = APIUpLoadFileService.getFileUrl(x.ReceiveFileManagerId + "#1", null),
States = x.States,
@@ -165,7 +165,7 @@ namespace BLL
}
if (newItem.States == "1")
{
CommonService.btnSaveData(newItem.ProjectId, Const.ReceiveFileManagerMenuId, newReceiveFile.ReceiveFileManagerId, newReceiveFile.SendPersonId, true, newReceiveFile.ReceiveFileName, "../ReceiveFileManager/ReceiveFileManagerView.aspx?ReceiveFileManagerId={0}");
CommonService.btnSaveDataForApi(newItem.ProjectId, Const.ReceiveFileManagerMenuId, newReceiveFile.ReceiveFileManagerId, newReceiveFile.SendPersonId, true, newReceiveFile.ReceiveFileName, "../ReceiveFileManager/ReceiveFileManagerView.aspx?ReceiveFileManagerId={0}");
}
////保存附件
@@ -216,7 +216,7 @@ namespace BLL
newRectifyNotices.RectifyNoticesCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectRectifyNoticesMenuId, newRectifyNotices.ProjectId, newRectifyNotices.UnitId);
db.Check_RectifyNotices.InsertOnSubmit(newRectifyNotices);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectRectifyNoticesMenuId, newRectifyNotices.ProjectId, newRectifyNotices.UnitId, newRectifyNotices.RectifyNoticesId, newRectifyNotices.CheckedDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectRectifyNoticesMenuId, newRectifyNotices.ProjectId, newRectifyNotices.UnitId, newRectifyNotices.RectifyNoticesId, newRectifyNotices.CheckedDate);
//// 整改单附件
if (!string.IsNullOrEmpty(rectifyNotices.BeAttachUrl))
{
@@ -307,7 +307,7 @@ namespace BLL
{
foreach (var cdeleteItem in deleteItem)
{
CommonService.DeleteAttachFileById(cdeleteItem.RectifyNoticesItemId);
CommonService.DeleteAttachFileByIdForApi(cdeleteItem.RectifyNoticesItemId);
}
db.Check_RectifyNoticesItem.DeleteAllOnSubmit(deleteItem);
}
@@ -454,7 +454,7 @@ namespace BLL
db.SubmitChanges();
}
//// 根据明细ID判断是否全部整改完成 并更新专项检查状态
Check_CheckSpecialService.UpdateCheckSpecialStates(getcheck.FirstOrDefault().CheckSpecialId);
Check_CheckSpecialService.UpdateCheckSpecialStatesForApi(getcheck.FirstOrDefault().CheckSpecialId);
}
}
db.SubmitChanges();
+1 -1
View File
@@ -266,7 +266,7 @@ namespace BLL
TestType = x.TestType,
TestTypeName = x.TestType == "1" ? "单选题" : (x.TestType == "2" ? "多选题" : "判断题"),
WorkPostIds = x.WorkPostIds,
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostIds),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIdsForApi(x.WorkPostIds),
AItem = x.AItem,
BItem = x.BItem,
CItem = x.CItem,
@@ -81,9 +81,9 @@ namespace BLL
newTestRecord.UnitId = newTestRecord.UnitId = Const.UnitId_CD;
}
}
newTestRecord.DepartName = DepartService.getDepartNameById(newTestRecord.DepartId);
newTestRecord.UnitName = UnitService.GetUnitNameByUnitId(newTestRecord.UnitId);
newTestRecord.ProjectName = ProjectService.GetProjectNameByProjectId(newTestRecord.ProjectId);
newTestRecord.DepartName = DepartService.getDepartNameByIdForApi(newTestRecord.DepartId);
newTestRecord.UnitName = UnitService.GetUnitNameByUnitIdForApi(newTestRecord.UnitId);
newTestRecord.ProjectName = ProjectService.GetProjectNameByProjectIdForApi(newTestRecord.ProjectId);
if (newTestRecord.UnitId == Const.UnitId_CD)
{
newTestRecord.IsThiUnit = true;
@@ -146,7 +146,7 @@ namespace BLL
{
newTestRecord.ManType = "2";
}
else if (UserService.GetUserByUserId(testRecord.TestManId) != null)
else if (db.Sys_User.FirstOrDefault(e => e.UserId == testRecord.TestManId) != null)
{
newTestRecord.ManType = "1";
}
+35 -28
View File
@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using EmitMapper;
using EmitMapper.MappingConfiguration;
using Newtonsoft.Json.Linq;
namespace BLL
{
@@ -36,7 +37,7 @@ namespace BLL
TestPlanName = x.PlanName,
ProjectId = x.ProjectId,
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
TestPlanManId = x.PlanManId,
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
TestPalce = x.TestPalce,
@@ -60,7 +61,7 @@ namespace BLL
ProjectId = x.ProjectId,
TestPlanManId = x.PlanManId,
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
TestPalce = x.TestPalce,
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
@@ -105,11 +106,11 @@ namespace BLL
QuestionCount = x.QuestionCount ?? 0,
TestPalce = x.TestPalce,
UnitIds = x.UnitIds,
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(x.UnitIds),
WorkPostIds = x.WorkPostIds,
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostIds),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIdsForApi(x.WorkPostIds),
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
States = x.States,
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
TrainingPlanId = x.PlanId,
@@ -203,7 +204,7 @@ namespace BLL
db.Training_TestPlan.InsertOnSubmit(newTestPlan);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, newTestPlan.TestPlanId, newTestPlan.PlanDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, newTestPlan.TestPlanId, newTestPlan.PlanDate);
}
else
{
@@ -223,6 +224,9 @@ namespace BLL
isUpdate.WorkPostIds = newTestPlan.WorkPostIds;
isUpdate.DepartIds = newTestPlan.DepartIds;
isUpdate.TrainTypeId = newTestPlan.TrainTypeId;
isUpdate.SValue = newTestPlan.SValue;
isUpdate.MValue = newTestPlan.MValue;
isUpdate.JValue = newTestPlan.JValue;
////删除 考生记录
var deleteRecords = from x in db.Training_TestRecord
where x.TestPlanId == isUpdate.TestPlanId
@@ -314,7 +318,7 @@ namespace BLL
{
foreach (var item in getTestPlan.TestPlanTrainingItems)
{
var trainingType = TestTrainingService.GetTestTrainingById(item.TrainingTypeId);
var trainingType = db.Training_TestTraining.FirstOrDefault(e => e.TrainingId == item.TrainingTypeId);
if (trainingType != null)
{
Model.Training_TestPlanTraining newPlanItem = new Model.Training_TestPlanTraining
@@ -341,24 +345,27 @@ namespace BLL
/// 新增 考试人员明细
/// </summary>
public static void AddTrainingTestRecord(List<Model.TestRecordItem> testRecords, Model.Training_TestPlan newTestPlan)
{
foreach (var item in testRecords)
{
var person = PersonService.GetPersonById(item.TestManId);
if (person != null)
{
Model.Training_TestRecord newTrainDetail = new Model.Training_TestRecord
{
TestRecordId = SQLHelper.GetNewID(),
ProjectId = newTestPlan.ProjectId,
TestPlanId = newTestPlan.TestPlanId,
TestManId = item.TestManId,
TestType = item.TestType,
Duration= newTestPlan.Duration,
};
TestRecordService.AddTestRecord(newTrainDetail);
}
}
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
foreach (var item in testRecords)
{
var person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == item.TestManId);
if (person != null)
{
Model.Training_TestRecord newTrainDetail = new Model.Training_TestRecord
{
TestRecordId = SQLHelper.GetNewID(),
ProjectId = newTestPlan.ProjectId,
TestPlanId = newTestPlan.TestPlanId,
TestManId = item.TestManId,
TestType = item.TestType,
Duration = newTestPlan.Duration,
};
TestRecordService.AddTestRecordForApi(newTrainDetail);
}
}
}
}
/// <summary>
@@ -417,11 +424,11 @@ namespace BLL
TestStartTime = DateTime.Now,
TestPalce = getTrainingPlan.TeachAddress,
UnitIds = getTrainingPlan.UnitIds,
UnitNames = UnitService.getUnitNamesUnitIds(getTrainingPlan.UnitIds),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(getTrainingPlan.UnitIds),
WorkPostIds = getTrainingPlan.WorkPostId,
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(getTrainingPlan.WorkPostId),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIdsForApi(getTrainingPlan.WorkPostId),
DepartIds=getTrainingPlan.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(getTrainingPlan.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(getTrainingPlan.DepartIds),
PlanId = getTrainingPlan.PlanId,
States = "0",
};
@@ -477,7 +484,7 @@ namespace BLL
{
db.Training_TestPlan.InsertOnSubmit(newTestPlan);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, testPlanId, newTestPlan.PlanDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, testPlanId, newTestPlan.PlanDate);
///培训人员
var getTrainingTask = (from x in db.Training_Task where x.PlanId == trainingPlanId select x).ToList();
foreach (var itemTask in getTrainingTask)
+4 -4
View File
@@ -498,7 +498,7 @@ namespace BLL
}
if (!string.IsNullOrEmpty(strPass))
{
int PassingScore = SysConstSetService.getPassScore();
int PassingScore = SysConstSetService.getPassScoreForApi();
if (strPass == "0")
{
getDataLists = getDataLists.Where(x => x.TestScores < PassingScore);
@@ -556,7 +556,7 @@ namespace BLL
}
if (!string.IsNullOrEmpty(strPass))
{
int PassingScore = SysConstSetService.getPassScore();
int PassingScore = SysConstSetService.getPassScoreForApi();
if (strPass == "0")
{
getDataLists = getDataLists.Where(x => x.TestScores < PassingScore);
@@ -592,14 +592,14 @@ namespace BLL
var user = db.Sys_User.FirstOrDefault(x => x.UserId == testManId);
if (user != null)
{
name = UnitService.GetUnitNameByUnitId(user.UnitId);
name = UnitService.GetUnitNameByUnitIdForApi(user.UnitId);
}
else
{
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == testManId);
if (getPerson != null)
{
name = UnitService.GetUnitNameByUnitId(getPerson.UnitId);
name = UnitService.GetUnitNameByUnitIdForApi(getPerson.UnitId);
}
}
return name;
+6 -6
View File
@@ -71,8 +71,8 @@ namespace BLL
WorkPostIds = x.WorkPostIds,
TrainContent = x.TrainContent,
AttachUrl = db.AttachFile.First(y => y.ToKeyId == x.TrainingId).AttachUrl.Replace('\\', '/'),
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostIds),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(x.UnitIds),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIdsForApi(x.WorkPostIds),
};
return getDataLists.FirstOrDefault();
}
@@ -117,7 +117,7 @@ namespace BLL
WorkPostIds = getTrainingPlan.WorkPostId,
PlanId = getTrainingPlan.PlanId,
};
newTrainRecord.CompileMan = UserService.GetUserNameByUserId(getTrainingPlan.DesignerId);
newTrainRecord.CompileMan = UserService.GetUserNameByUserIdForApi(getTrainingPlan.DesignerId);
///获取培训人员
var getTrainingTasks = from x in db.Training_Task
where x.PlanId == getTrainingPlan.PlanId
@@ -171,15 +171,15 @@ namespace BLL
var getPerson = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == newDetail.PersonId);
if (getPerson != null && string.IsNullOrEmpty(getPerson.CardNo))
{
getPerson.CardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getPerson.ProjectId, UnitService.GetUnitCodeByUnitId(getPerson.UnitId));
getPerson.CardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getPerson.ProjectId, UnitService.GetUnitCodeByUnitIdForApi(getPerson.UnitId));
db.SubmitChanges();
}
}
}
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTrainRecordMenuId, newTrainRecord.ProjectId, null, newTrainRecord.TrainingId, newTrainRecord.TrainStartDate);
CommonService.btnSaveData(newTrainRecord.ProjectId, Const.ProjectTrainRecordMenuId, newTrainRecord.TrainingId, getTrainingPlan.DesignerId, true, newTrainRecord.TrainTitle, "../EduTrain/TrainRecordView.aspx?TrainingId={0}");
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTrainRecordMenuId, newTrainRecord.ProjectId, null, newTrainRecord.TrainingId, newTrainRecord.TrainStartDate);
CommonService.btnSaveDataForApi(newTrainRecord.ProjectId, Const.ProjectTrainRecordMenuId, newTrainRecord.TrainingId, getTrainingPlan.DesignerId, true, newTrainRecord.TrainTitle, "../EduTrain/TrainRecordView.aspx?TrainingId={0}");
}
}
}
+5 -5
View File
@@ -77,10 +77,10 @@ namespace BLL
UnitIds = x.UnitIds,
WorkPostId = x.WorkPostId,
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
TrainContent = x.TrainContent,
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostId),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(x.UnitIds),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIdsForApi(x.WorkPostId),
DesignerId = x.DesignerId,
DesignerName = db.Sys_User.First(y => y.UserId == x.DesignerId).UserName,
DesignerDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TrainStartDate),
@@ -177,7 +177,7 @@ namespace BLL
{
newTrainingPlan.DesignerDate = DateTime.Now;
string unitId = string.Empty;
var user = UserService.GetUserByUserId(newTrainingPlan.DesignerId);
var user = db.Sys_User.FirstOrDefault(x=>x.UserId==newTrainingPlan.DesignerId);
if (user != null)
{
unitId = user.UnitId;
@@ -190,7 +190,7 @@ namespace BLL
db.Training_Plan.InsertOnSubmit(newTrainingPlan);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTrainingPlanMenuId, newTrainingPlan.ProjectId, null, newTrainingPlan.PlanId, newTrainingPlan.DesignerDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTrainingPlanMenuId, newTrainingPlan.ProjectId, null, newTrainingPlan.PlanId, newTrainingPlan.DesignerDate);
}
else
{
+1 -1
View File
@@ -18,7 +18,7 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
personId = PersonService.GetPersonIdByUserId(personId);
personId = PersonService.GetPersonIdByUserIdForApi(personId);
var getDataLists = (from x in db.Training_Task
join y in db.Training_Plan on x.PlanId equals y.PlanId
where ((string.IsNullOrEmpty(projectId) && x.ProjectId == null) || (!string.IsNullOrEmpty(projectId) && x.ProjectId == projectId)) && x.UserId == personId && y.States != "0"