小程序接口修改

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

View File

@ -508,11 +508,14 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getTrainType()
{
var getDataLists = (from x in Funs.DB.Base_TrainType
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_TrainType
orderby x.TrainTypeCode
select new Model.BaseInfoItem { BaseInfoId = x.TrainTypeId, BaseInfoCode = x.TrainTypeCode, BaseInfoName = x.TrainTypeName }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -522,11 +525,14 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getTrainLevel()
{
var getDataLists = (from x in Funs.DB.Base_TrainLevel
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_TrainLevel
orderby x.TrainLevelCode
select new Model.BaseInfoItem { BaseInfoId = x.TrainLevelId, BaseInfoCode = x.TrainLevelCode, BaseInfoName = x.TrainLevelName }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -536,11 +542,14 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getLawsRegulationsType()
{
var getDataLists = (from x in Funs.DB.Base_LawsRegulationsType
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_LawsRegulationsType
orderby x.Code
select new Model.BaseInfoItem { BaseInfoId = x.Id, BaseInfoCode = x.Code, BaseInfoName = x.Name }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -550,11 +559,14 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getHSSEStandardListType()
{
var getDataLists = (from x in Funs.DB.Base_HSSEStandardListType
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_HSSEStandardListType
orderby x.TypeCode
select new Model.BaseInfoItem { BaseInfoId = x.TypeId, BaseInfoCode = x.TypeCode, BaseInfoName = x.TypeName }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -564,11 +576,14 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getRulesRegulationsType()
{
var getDataLists = (from x in Funs.DB.Base_RulesRegulationsType
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_RulesRegulationsType
orderby x.RulesRegulationsTypeCode
select new Model.BaseInfoItem { BaseInfoId = x.RulesRegulationsTypeId, BaseInfoCode = x.RulesRegulationsTypeCode, BaseInfoName = x.RulesRegulationsTypeName }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -578,11 +593,14 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getManageRuleType()
{
var getDataLists = (from x in Funs.DB.Base_ManageRuleType
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_ManageRuleType
orderby x.ManageRuleTypeCode
select new Model.BaseInfoItem { BaseInfoId = x.ManageRuleTypeId, BaseInfoCode = x.ManageRuleTypeCode, BaseInfoName = x.ManageRuleTypeName }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -592,12 +610,15 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getSpecialEquipment(bool isSpecial)
{
var getDataLists = (from x in Funs.DB.Base_SpecialEquipment
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_SpecialEquipment
where x.IsSpecial == isSpecial
orderby x.SpecialEquipmentCode
select new Model.BaseInfoItem { BaseInfoId = x.SpecialEquipmentId, BaseInfoCode = x.SpecialEquipmentCode, BaseInfoName = x.SpecialEquipmentName }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -607,11 +628,14 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getWorkStage()
{
var getDataLists = (from x in Funs.DB.Base_WorkStage
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Base_WorkStage
orderby x.WorkStageCode
select new Model.BaseInfoItem { BaseInfoId = x.WorkStageId, BaseInfoCode = x.WorkStageCode, BaseInfoName = x.WorkStageName }).ToList();
return getDataLists;
}
}
#endregion
#region
@ -623,12 +647,15 @@ namespace BLL
/// <returns></returns>
public static List<Model.BaseInfoItem> getTeamGroup(string projectId, string unitId)
{
var getDataLists = (from x in Funs.DB.ProjectData_TeamGroup
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.ProjectData_TeamGroup
where x.ProjectId == projectId && (unitId == null || x.UnitId == unitId)
orderby x.TeamGroupCode
select new Model.BaseInfoItem { BaseInfoId = x.TeamGroupId, BaseInfoCode = x.TeamGroupCode, BaseInfoName = x.TeamGroupName }).ToList();
return getDataLists;
}
}
/// <summary>
/// 获取项目班组组长

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);
}

View File

@ -122,33 +122,36 @@ 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)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
////保存附件
if (!string.IsNullOrEmpty(url))
{
if (isInsert == "1")
{
var att = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
var att = db.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
if (att != null)
{
url = att.AttachUrl + "," + url;
}
}
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(url, 10, null), url, menuId, dataId);
UploadFileService.SaveAttachUrlForApi(UploadFileService.GetSourceByAttachUrl(url, 10, null), url, menuId, dataId);
}
else
{
CommonService.DeleteAttachFileById(dataId);
CommonService.DeleteAttachFileByIdForApi(dataId);
}
}
}

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,

View File

@ -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") : "";

View File

@ -1,6 +1,10 @@
using System;
using Microsoft.SqlServer.Dts.Runtime;
using Model;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
@ -159,10 +163,10 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var jot = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
var jot = db.HJGL_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJointId);
var getDataLists = (from x in Funs.DB.HJGL_Batch_PointBatchItem
join y in Funs.DB.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
var getDataLists = (from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where x.PointBatchId == pointBatchId && x.PointState == null
&& y.JointAttribute == jot.JointAttribute
select new Model.NDETrustItem
@ -186,7 +190,92 @@ namespace BLL
/// <param name="pointBatchId"></param>
public static void AutoPointSave(string pointBatchId)
{
BLL.PointBatchDetailService.AutoPoint(pointBatchId);
AutoPoint(pointBatchId);
}
public static void AutoPoint(string pointBatchId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
int pointNum = 0;
int pointNumG = 0;
int pointNumA = 0;
var batch = db.HJGL_Batch_PointBatch.FirstOrDefault(e => e.PointBatchId == pointBatchId);
var batchItemNum = db.HJGL_Batch_PointBatchItem.Where(e => e.PointBatchId == pointBatchId).ToList();
if (batch.DetectionRateId != null && batchItemNum.Count() > 0)
{
var rate = db.Base_DetectionRate.FirstOrDefault(e => e.DetectionRateId == batch.DetectionRateId);
// 批里要检测的数量
pointNum = Convert.ToInt32(Math.Ceiling((batchItemNum.Count() * Convert.ToDouble(rate.DetectionRateValue)) * 0.01));
}
var weldG = from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where y.JointAttribute == "固定口" && x.PointBatchId == pointBatchId
select x;
var weldA = from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where y.JointAttribute == "活动口" && x.PointBatchId == pointBatchId
select x;
if (weldG.Count() > 0)
{
// 固定口检测数量
pointNumG = Convert.ToInt32(Math.Ceiling(weldG.Count() * 0.4));
}
// 活动口要检测的数量
pointNumA = pointNum - pointNumG;
if (pointNumG > 0)
{
int[] r = Funs.GetRandomNum(pointNumG, 1, weldG.Count());
int i = 0;
foreach (var p in weldG)
{
i++;
if (r.Contains(i))
{
Model.HJGL_Batch_PointBatchItem newBatchDetail = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == p.PointBatchItemId);
if (newBatchDetail != null)
{
newBatchDetail.PointState = "1";
newBatchDetail.PointDate = System.DateTime.Now;
db.SubmitChanges();
}
}
}
}
if (pointNumA > 0)
{
int[] r = Funs.GetRandomNum(pointNumA, 1, weldA.Count());
int j = 0;
foreach (var p in weldA)
{
j++;
if (r.Contains(j))
{
Model.HJGL_Batch_PointBatchItem newBatchDetail = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == p.PointBatchItemId);
if (newBatchDetail != null)
{
newBatchDetail.PointState = "1";
newBatchDetail.PointDate = System.DateTime.Now;
}
db.SubmitChanges();
}
}
}
Model.HJGL_Batch_PointBatch newBatch = db.HJGL_Batch_PointBatch.FirstOrDefault(e => e.PointBatchId == pointBatchId);
if (newBatch != null)
{
newBatch.EndDate = DateTime.Now;
db.SubmitChanges();
}
}
}
#endregion
@ -198,7 +287,9 @@ namespace BLL
/// <param name="newJointId">调为新的焊口</param>
public static void RePointSave(string oldJointId, string newJointId)
{
var oldPoint = BLL.PointBatchDetailService.GetBatchDetailByJotId(oldJointId);
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var oldPoint = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.WeldJointId == oldJointId);
if (oldPoint != null)
{
oldPoint.PointDate = null;
@ -208,14 +299,15 @@ namespace BLL
oldPoint.IsWelderFirst = null;
}
var newPoint = BLL.PointBatchDetailService.GetBatchDetailByJotId(newJointId);
var newPoint = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.WeldJointId == newJointId);
if (newPoint != null)
{
newPoint.PointState = "1";
newPoint.PointDate = DateTime.Now;
}
Funs.DB.SubmitChanges();
db.SubmitChanges();
}
}
#endregion
@ -262,11 +354,11 @@ namespace BLL
foreach (var trust in getViewGenerateTrustLists)
{
Model.HJGL_Batch_BatchTrust newBatchTrust = new Model.HJGL_Batch_BatchTrust();
var project = BLL.ProjectService.GetProjectByProjectId(trust.ProjectId);
var unit = BLL.UnitService.GetUnitByUnitId(trust.UnitId);
var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(trust.UnitWorkId);
var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(trust.DetectionTypeId);
var rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(trust.DetectionRateId);
var project = db.Base_Project.FirstOrDefault(e => e.ProjectId == trust.ProjectId) ;
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == trust.UnitId) ;
var unitWork = db.WBS_UnitWork.FirstOrDefault(e => e.UnitWorkId.ToString() == trust.UnitWorkId) ;
var ndt = db.Base_DetectionType.FirstOrDefault(e => e.DetectionTypeId == trust.DetectionTypeId) ;
var rate = db.Base_DetectionRate.FirstOrDefault(e => e.DetectionRateId == trust.DetectionRateId) ;
string perfix = string.Empty;
perfix = unit.UnitCode + "-" + ndt.DetectionTypeCode + "-" + rate.DetectionRateValue.ToString() + "%-";
@ -281,9 +373,9 @@ namespace BLL
newBatchTrust.UnitWorkId = trust.UnitWorkId;
newBatchTrust.DetectionTypeId = trust.DetectionTypeId;
newBatchTrust.NDEUuit = unitWork.NDEUnit;
BLL.Batch_BatchTrustService.AddBatchTrust(newBatchTrust); // 新增委托单
newBatchTrust.IsAudit = true;
db.HJGL_Batch_BatchTrust.InsertOnSubmit(newBatchTrust);
db.SubmitChanges();
// 生成委托条件对比
var generateTrustItem = from x in db.View_GenerateTrustItem
where x.ProjectId == trust.ProjectId
@ -307,7 +399,8 @@ namespace BLL
WeldJointId = item.WeldJointId,
CreateDate = DateTime.Now
};
Batch_BatchTrustItemService.AddBatchTrustItem(trustItem);
db.HJGL_Batch_BatchTrustItem.InsertOnSubmit(trustItem);
db.SubmitChanges();
}
Model.HJGL_Batch_PointBatchItem pointBatchItem = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == item.PointBatchItemId);
@ -322,11 +415,12 @@ namespace BLL
{
string toPointBatch = String.Join(",", toPointBatchList);
var updateTrut = BLL.Batch_BatchTrustService.GetBatchTrustById(trustBatchId);
var updateTrut = db.HJGL_Batch_BatchTrust.FirstOrDefault(e => e.TrustBatchId == trustBatchId);
if (updateTrut != null)
{
updateTrut.TopointBatch = toPointBatch;
BLL.Batch_BatchTrustService.UpdateBatchTrust(updateTrut);
db.SubmitChanges();
}
}
@ -423,7 +517,15 @@ namespace BLL
/// <param name="trustBatchId"></param>
public static void BatchTrustAudit(string trustBatchId)
{
BLL.Batch_BatchTrustService.UpdateBatchTrustAudit(trustBatchId, true);
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.HJGL_Batch_BatchTrust newBatchTrust = db.HJGL_Batch_BatchTrust.FirstOrDefault(e => e.TrustBatchId == trustBatchId);
if (newBatchTrust != null)
{
newBatchTrust.IsAudit = true;
db.SubmitChanges();
}
}
}
#endregion
@ -579,9 +681,9 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var record = BLL.RepairRecordService.GetRepairRecordById(repairRecordId);
var jot = BLL.WeldJointService.GetViewWeldJointById(record.WeldJointId);
var day = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(jot.WeldingDailyId);
var record = db.HJGL_RepairRecord.FirstOrDefault(e => e.RepairRecordId == repairRecordId);
var jot = db.View_HJGL_WeldJoint.FirstOrDefault(e => e.WeldJointId == record.WeldJointId);
var day = db.HJGL_WeldingDaily.FirstOrDefault(e => e.WeldingDailyId == jot.WeldingDailyId);
var repairExp = from x in db.HJGL_Batch_PointBatchItem
join z in db.HJGL_Batch_PointBatch on x.PointBatchId equals z.PointBatchId
@ -653,7 +755,7 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.HJGL_RepairRecord repairRecord = BLL.RepairRecordService.GetRepairRecordById(repairRecordId);
Model.HJGL_RepairRecord repairRecord = db.HJGL_RepairRecord.FirstOrDefault(e => e.RepairRecordId == repairRecordId);
// 更新返修记录
var repair = db.HJGL_RepairRecord.FirstOrDefault(x => x.RepairRecordId == repairRecordId);
if (repair != null)
@ -678,7 +780,7 @@ namespace BLL
}
db.SubmitChanges();
var exp = BLL.RepairRecordService.GetExportItem(repairRecordId);
var exp = db.HJGL_Batch_PointBatchItem.Where( x=>x.RepairRecordId == repairRecordId).ToList();
if (exp != null)
{
foreach (Model.HJGL_Batch_PointBatchItem item in exp)
@ -741,8 +843,8 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string submitStr = string.Empty;
Model.HJGL_RepairRecord repairRecord = BLL.RepairRecordService.GetRepairRecordById(repairRecordId);
var trustItem = from x in Funs.DB.HJGL_Batch_BatchTrustItem where x.RepairRecordId == repairRecordId select x;
Model.HJGL_RepairRecord repairRecord = db.HJGL_RepairRecord.FirstOrDefault(e => e.RepairRecordId == repairRecordId);
var trustItem = from x in db.HJGL_Batch_BatchTrustItem where x.RepairRecordId == repairRecordId select x;
if (trustItem.Count() == 0)
{
if (!string.IsNullOrEmpty(repairRecordId) && repairRecord.AuditDate.HasValue)
@ -757,8 +859,9 @@ namespace BLL
newRepairTrust.UnitId = repairRecord.UnitId;
newRepairTrust.UnitWorkId = repairRecord.UnitWorkId;
newRepairTrust.DetectionTypeId = repairRecord.DetectionTypeId;
BLL.Batch_BatchTrustService.AddBatchTrust(newRepairTrust); // 新增返修委托单
newRepairTrust.IsAudit = true;
db.HJGL_Batch_BatchTrust.InsertOnSubmit(newRepairTrust);
db.SubmitChanges(); ; // 新增返修委托单
Model.HJGL_Batch_BatchTrustItem newRepairTrustItem = new Model.HJGL_Batch_BatchTrustItem();
newRepairTrustItem.TrustBatchItemId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_BatchTrustItem));
@ -766,10 +869,10 @@ namespace BLL
newRepairTrustItem.RepairRecordId = repairRecordId;
newRepairTrustItem.WeldJointId = repairRecord.WeldJointId;
newRepairTrustItem.CreateDate = DateTime.Now;
Batch_BatchTrustItemService.AddBatchTrustItem(newRepairTrustItem);
Batch_BatchTrustItemService.AddBatchTrustItemForApi(newRepairTrustItem);
// 扩透委托
var exp = BLL.RepairRecordService.GetExportItem(repairRecordId);
var exp = db.HJGL_Batch_PointBatchItem .Where(x=> x.RepairRecordId == repairRecordId).ToList();
if (exp != null)
{
foreach (var q in exp)
@ -780,7 +883,7 @@ namespace BLL
newExportTrustItem.PointBatchItemId = q.PointBatchItemId;
newExportTrustItem.WeldJointId = q.WeldJointId;
newExportTrustItem.CreateDate = DateTime.Now;
Batch_BatchTrustItemService.AddBatchTrustItem(newExportTrustItem);
Batch_BatchTrustItemService.AddBatchTrustItemForApi(newExportTrustItem);
Model.HJGL_Batch_PointBatchItem pointBatchItem = db.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchItemId == q.PointBatchItemId);
pointBatchItem.IsBuildTrust = true;

View File

@ -1,4 +1,5 @@
using System;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -261,16 +262,19 @@ namespace BLL
/// <param name="pipeLineId"></param>
/// <returns></returns>
private static string GetDetectionRate(string pipeLineId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string detectionRate = string.Empty;
var pipe = BLL.PipelineService.GetPipelineByPipelineId(pipeLineId);
var pipe = db.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipeLineId);
if (pipe != null && !string.IsNullOrEmpty(pipe.DetectionRateId))
{
var r = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipe.DetectionRateId);
var r = db.Base_DetectionRate.FirstOrDefault(e => e.DetectionRateId == pipe.DetectionRateId);
detectionRate = r.DetectionRateValue + "%";
}
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);
}

View File

@ -73,7 +73,8 @@ namespace BLL
/// <returns></returns>
public static void SavePreWeldingDaily(Model.HJGL_PreWeldingDailyItem newItem)
{
Model.SGGLDB db = Funs.DB;
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.HJGL_PreWeldingDaily newP = new Model.HJGL_PreWeldingDaily
{
PreWeldingDailyId = newItem.PreWeldingDailyId,
@ -95,7 +96,7 @@ namespace BLL
/// 更新
/// //
}
}
//if (newItem.BaseInfoItem != null && newItem.BaseInfoItem.Count() > 0)
//{
// foreach (var item in newItem.BaseInfoItem)

View File

@ -5,6 +5,7 @@ using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
@ -445,30 +446,32 @@ namespace BLL
/// <param name="id"></param>
/// <returns></returns>
private static int GetMustCheckJotNum(string flag, string id)
{
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 Funs.DB.HJGL_Pipeline where x.ProjectId == id select x).ToList();
pipeList = (from x in 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();
pipeList = (from x in 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();
pipeList = (from x in 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();
pipeList = (from x in 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();
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));
@ -477,3 +480,4 @@ namespace BLL
}
}
}
}

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);
}

View File

@ -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

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",

View File

@ -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

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);

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,

View File

@ -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

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)
{

View File

@ -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,7 +132,7 @@ namespace BLL
IsSelfRole = item.IsSelfRole
};
LicensePublicService.AddFlowOperate(newFlowOperate);
LicensePublicService.AddFlowOperateForApi(newFlowOperate);
}
}
}
@ -146,7 +146,9 @@ namespace BLL
/// <returns></returns>
public static void SaveFlowOperate(Model.FlowOperateItem flowOperate)
{
var getFlowOperate = LicensePublicService.GetFlowOperateById(flowOperate.FlowOperateId);
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;
@ -154,7 +156,7 @@ namespace BLL
getFlowOperate.IsAgree = flowOperate.IsAgree;
getFlowOperate.Opinion = flowOperate.Opinion;
getFlowOperate.IsClosed = flowOperate.IsAgree;///同意时,当前流程关闭;不同意则返回申请人。
LicensePublicService.UpdateFlowOperate(getFlowOperate);
db.SubmitChanges();
Model.License_FlowOperateItem newFlowOperateItem = new Model.License_FlowOperateItem
{
@ -165,8 +167,9 @@ namespace BLL
IsAgree = getFlowOperate.IsAgree,
Opinion = getFlowOperate.Opinion,
};
LicensePublicService.AddFlowOperateItem(newFlowOperateItem);
db.License_FlowOperateItem.InsertOnSubmit(newFlowOperateItem);
db.SubmitChanges();
}
}
}
#endregion

View File

@ -81,7 +81,7 @@ namespace BLL
IsUsed = item.IsUsed,
ConfirmManId = item.ConfirmManId,
};
LicensePublicService.AddLicenseItem(newLicenseItem);
LicensePublicService.AddLicenseItemForApi(newLicenseItem);
}
}
#endregion

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;
}

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);
}
}
}

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);
}
}
}

View File

@ -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}");
}
////保存附件

View File

@ -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();

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,

View File

@ -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";
}

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,10 +345,12 @@ namespace BLL
/// 新增 考试人员明细
/// </summary>
public static void AddTrainingTestRecord(List<Model.TestRecordItem> testRecords, Model.Training_TestPlan newTestPlan)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
foreach (var item in testRecords)
{
var person = PersonService.GetPersonById(item.TestManId);
var person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == item.TestManId);
if (person != null)
{
Model.Training_TestRecord newTrainDetail = new Model.Training_TestRecord
@ -356,7 +362,8 @@ namespace BLL
TestType = item.TestType,
Duration = newTestPlan.Duration,
};
TestRecordService.AddTestRecord(newTrainDetail);
TestRecordService.AddTestRecordForApi(newTrainDetail);
}
}
}
}
@ -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)

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;

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}");
}
}
}

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
{

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"

View File

@ -258,6 +258,31 @@ namespace BLL
}
return workPostName;
}
public static string getWorkPostNamesWorkPostIdsForApi(object workPostIds)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string workPostName = string.Empty;
if (workPostIds != null)
{
string[] ids = workPostIds.ToString().Split(',');
foreach (string id in ids)
{
var q = db.Base_WorkPost.FirstOrDefault(e => e.WorkPostId == id);
if (q != null)
{
workPostName += q.WorkPostName + ",";
}
}
if (workPostName != string.Empty)
{
workPostName = workPostName.Substring(0, workPostName.Length - 1); ;
}
}
return workPostName;
}
}
#endregion
#region ID得到岗位名称
@ -312,6 +337,31 @@ namespace BLL
}
return departName;
}
public static string getDepartNamesByIdsForApi(object departIdsIds)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string departName = string.Empty;
if (departIdsIds != null)
{
string[] ids = departIdsIds.ToString().Split(',');
foreach (string id in ids)
{
var q = db.Base_Depart.FirstOrDefault(e => e.DepartId == id);
if (q != null)
{
departName += q.DepartName + ",";
}
}
if (departName != string.Empty)
{
departName = departName.Substring(0, departName.Length - 1); ;
}
}
return departName;
}
}
#endregion
}

View File

@ -134,5 +134,30 @@ namespace BLL
return workStageName;
}
public static string getWorkStageNamesWorkStageIdsForApi(object workStageIds)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string workStageName = string.Empty;
if (workStageIds != null)
{
string[] workStages = workStageIds.ToString().Split(',');
foreach (string workStageId in workStages)
{
var q =db.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStageId);
if (q != null)
{
workStageName += q.WorkStageName + ",";
}
}
if (workStageName != string.Empty)
{
workStageName = workStageName.Substring(0, workStageName.Length - 1); ;
}
}
return workStageName;
}
}
}
}

View File

@ -37,11 +37,13 @@ namespace BLL
public static void DeleteConstructSolution(string constructSolutionId)
{
Model.SGGLDB db = Funs.DB;
Model.Solution_CQMSConstructSolution constructSolution = db.Solution_CQMSConstructSolution.First(e => e.ConstructSolutionId == constructSolutionId);
Model.Solution_CQMSConstructSolution constructSolution = db.Solution_CQMSConstructSolution.FirstOrDefault(e => e.ConstructSolutionId == constructSolutionId);
if (constructSolution != null)
{
db.Solution_CQMSConstructSolution.DeleteOnSubmit(constructSolution);
db.SubmitChanges();
}
}
/// <summary>
/// 增加方案审查信息

View File

@ -1,4 +1,5 @@
using System;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -44,6 +45,19 @@ namespace BLL
Funs.DB.Sys_CodeRecords.DeleteOnSubmit(codeRecords);
}
}
public static void DeleteCodeRecordsByDataIdForApi(string dataId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var codeRecords = db.Sys_CodeRecords.FirstOrDefault(x => x.DataId == dataId);
if (codeRecords != null)
{
///删除文件柜A中数据
// BLL.FileCabinetAItemService.DeleteFileCabinetAItemByID(dataId);
db.Sys_CodeRecords.DeleteOnSubmit(codeRecords);
}
}
}
#region idid返回编码 ()
/// <summary>
@ -73,7 +87,7 @@ namespace BLL
{
////项目
string ruleCode = string.Empty;
var project = ProjectService.GetProjectByProjectId(projectId);
var project = db.Base_Project.FirstOrDefault(e => e.ProjectId == projectId) ;
if (project != null)
{
string projectCode = project.ProjectCode; ///项目编号
@ -96,7 +110,7 @@ namespace BLL
}
if (sysCodeTemplateRule.IsUnitCode == true)
{
var unit = UnitService.GetUnitByUnitId(unitId);
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == unitId);
if (unit != null)
{
ruleCode += unit.UnitCode + symbol;
@ -276,6 +290,138 @@ namespace BLL
return ruleCode;
}
public static string InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(string menuId, string projectId, string unitId, string dataId, DateTime? compileDate)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string ruleCode = string.Empty;
var IsHaveCodeRecords = db.Sys_CodeRecords.FirstOrDefault(x => x.DataId == dataId);
if (IsHaveCodeRecords == null) ///是否已存在编码
{
string ruleCodeower = string.Empty;
int digit = 4; ///流水位数
string symbolower = "-"; ///业主间隔符
int digitower = 4; ///业主流水位数
string symbol = "-"; ///间隔符
var project = db.Base_Project.FirstOrDefault(e => e.ProjectId == projectId); ////项目
if (project != null && !string.IsNullOrEmpty(dataId))
{
string projectCode = project.ProjectCode; ///项目编号
////编码规则表
var sysCodeTemplateRule = db.ProjectData_CodeTemplateRule.FirstOrDefault(x => x.MenuId == menuId && x.ProjectId == projectId);
if (sysCodeTemplateRule != null)
{
symbol = sysCodeTemplateRule.Symbol;
symbolower = sysCodeTemplateRule.OwerSymbol;
if (sysCodeTemplateRule.Digit.HasValue)
{
digit = sysCodeTemplateRule.Digit.Value;
}
if (sysCodeTemplateRule.OwerDigit.HasValue)
{
digitower = sysCodeTemplateRule.OwerDigit.Value;
}
if (sysCodeTemplateRule.IsProjectCode == true)
{
ruleCode = projectCode + symbol;
}
if (sysCodeTemplateRule.OwerIsProjectCode == true)
{
ruleCodeower = projectCode + symbolower;
}
if (!string.IsNullOrEmpty(sysCodeTemplateRule.Prefix))
{
ruleCode += sysCodeTemplateRule.Prefix + symbol;
}
if (!string.IsNullOrEmpty(sysCodeTemplateRule.OwerPrefix))
{
ruleCodeower += sysCodeTemplateRule.OwerPrefix + symbolower;
}
if (sysCodeTemplateRule.IsUnitCode == true || sysCodeTemplateRule.OwerIsUnitCode == true)
{
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == unitId);
if (unit != null)
{
if (sysCodeTemplateRule.IsUnitCode == true)
{ ruleCode = unit.UnitCode + symbol; }
if (sysCodeTemplateRule.OwerIsUnitCode == true)
{
ruleCodeower = unit.UnitCode + symbolower;
}
}
}
}
}
////获取编码记录表最大排列序号
int maxNewSortIndex = 0;
if (!String.IsNullOrEmpty(projectId))
{
var maxSortIndex = db.Sys_CodeRecords.Where(x => x.ProjectId == projectId && x.MenuId == menuId).Select(x => x.SortIndex).Max();
if (maxSortIndex.HasValue)
{
maxNewSortIndex = maxSortIndex.Value;
}
}
else
{
var maxSortIndexNull = db.Sys_CodeRecords.Where(x => x.MenuId == menuId).Select(x => x.SortIndex).Max();
if (maxSortIndexNull.HasValue)
{
maxNewSortIndex = maxSortIndexNull.Value;
}
}
maxNewSortIndex = maxNewSortIndex + 1;
////插入数据库
Model.Sys_CodeRecords newCodeRecords = new Model.Sys_CodeRecords
{
CodeRecordId = SQLHelper.GetNewID(typeof(Model.Sys_CodeRecords))
};
if (project != null)
{
newCodeRecords.ProjectId = project.ProjectId;
}
newCodeRecords.MenuId = menuId;
newCodeRecords.DataId = dataId;
newCodeRecords.UnitId = unitId;
newCodeRecords.SortIndex = maxNewSortIndex;
newCodeRecords.CompileDate = compileDate;
newCodeRecords.RuleCodes = ruleCode;
newCodeRecords.Digit = digit;
newCodeRecords.OwnerRuleCodes = ruleCodeower;
newCodeRecords.OwerDigit = digitower;
if (!string.IsNullOrEmpty(ruleCode))
{
newCodeRecords.Code = ruleCode + (maxNewSortIndex.ToString().PadLeft(digit, '0')); ///字符自动补零 编码
}
else
{
newCodeRecords.Code = (maxNewSortIndex.ToString().PadLeft(digit, '0'));
}
if (!string.IsNullOrEmpty(ruleCodeower))
{
newCodeRecords.OwnerCode = ruleCodeower + (maxNewSortIndex.ToString().PadLeft(digitower, '0')); ///字符自动补零 业主编码
}
else
{
newCodeRecords.OwnerCode = (maxNewSortIndex.ToString().PadLeft(digitower, '0'));
}
db.Sys_CodeRecords.InsertOnSubmit(newCodeRecords);
db.SubmitChanges();
}
else
{
ruleCode = IsHaveCodeRecords.Code;
}
return ruleCode;
}
}
#endregion
#region id,id

View File

@ -1,4 +1,5 @@
using BLL.CNCECHSSEService;
using Model;
using System;
using System.Collections.Generic;
using System.IO;
@ -501,7 +502,23 @@ namespace BLL
Funs.DB.SubmitChanges();
}
}
public static void DeleteAttachFileByIdForApi(string id)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.AttachFile attachFile = db.AttachFile.FirstOrDefault(e => e.ToKeyId == id);
if (attachFile != null)
{
if (!string.IsNullOrEmpty(attachFile.AttachUrl))
{
UploadFileService.DeleteFile(Funs.RootPath, attachFile.AttachUrl);
}
db.AttachFile.DeleteOnSubmit(attachFile);
db.SubmitChanges();
}
}
}
/// <summary>
///根据主键删除附件
/// </summary>
@ -521,6 +538,23 @@ namespace BLL
db.SubmitChanges();
}
}
public static void DeleteAttachFileByIdForApi(string menuId, string id)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.AttachFile attachFile = db.AttachFile.FirstOrDefault(e => e.MenuId == menuId && e.ToKeyId == id);
if (attachFile != null)
{
if (!string.IsNullOrEmpty(attachFile.AttachUrl))
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, attachFile.AttachUrl);
}
db.AttachFile.DeleteOnSubmit(attachFile);
db.SubmitChanges();
}
}
}
#endregion
#region
@ -627,6 +661,86 @@ namespace BLL
}
}
}
}
public static void btnSaveDataForApi(string projectId, string menuId, string dataId, string userId, bool isClosed, string content, string url)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Sys_FlowOperate newFlowOperate = new Model.Sys_FlowOperate
{
MenuId = menuId,
DataId = dataId,
OperaterId = userId,
State = Const.State_2,
IsClosed = isClosed,
Opinion = "系统自动关闭流程",
ProjectId = projectId,
Url = url
};
var user = db.Sys_User.FirstOrDefault(e => e.UserId == newFlowOperate.OperaterId);
if (user != null)
{
var roles = RoleService.GetRoleByRoleId(user.RoleId);
if (roles != null && !string.IsNullOrEmpty(roles.RoleName))
{
newFlowOperate.AuditFlowName = "[" + roles.RoleName + "]";
}
else
{
newFlowOperate.AuditFlowName = "[" + user.UserName + "]";
}
newFlowOperate.AuditFlowName += "系统审核完成";
}
var updateFlowOperate = from x in db.Sys_FlowOperate
where x.DataId == newFlowOperate.DataId && (x.IsClosed == false || !x.IsClosed.HasValue)
select x;
if (updateFlowOperate.Count() > 0)
{
foreach (var item in updateFlowOperate)
{
item.OperaterId = newFlowOperate.OperaterId;
item.OperaterTime = System.DateTime.Now;
item.State = newFlowOperate.State;
item.Opinion = newFlowOperate.Opinion;
item.AuditFlowName = "系统审核完成";
item.IsClosed = newFlowOperate.IsClosed;
db.SubmitChanges();
}
}
else
{
int maxSortIndex = 1;
var flowSet = db.Sys_FlowOperate.Where(x => x.DataId == newFlowOperate.DataId);
var sortIndex = flowSet.Select(x => x.SortIndex).Max();
if (sortIndex.HasValue)
{
maxSortIndex = sortIndex.Value + 1;
}
newFlowOperate.FlowOperateId = SQLHelper.GetNewID(typeof(Model.Sys_FlowOperate));
newFlowOperate.SortIndex = maxSortIndex;
newFlowOperate.OperaterTime = System.DateTime.Now;
newFlowOperate.AuditFlowName = "系统审核完成";
db.Sys_FlowOperate.InsertOnSubmit(newFlowOperate);
db.SubmitChanges();
}
if (newFlowOperate.IsClosed == true)
{
var updateNoClosedFlowOperate = from x in Funs.DB.Sys_FlowOperate
where x.DataId == newFlowOperate.DataId && (x.IsClosed == false || !x.IsClosed.HasValue)
select x;
if (updateNoClosedFlowOperate.Count() > 0)
{
foreach (var itemClosed in updateNoClosedFlowOperate)
{
itemClosed.IsClosed = true;
db.SubmitChanges();
}
}
}
}
}
#endregion

View File

@ -350,7 +350,56 @@ namespace BLL
}
}
}
public static void SaveAttachUrlForApi(string source, string attachUrl, string menuId, string toKeyId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
if (string.IsNullOrEmpty(rootUrl))
{
rootUrl = Funs.RootPath;
}
List<Model.AttachFile> sour = (from x in db.AttachFile
where x.MenuId == menuId && x.ToKeyId == toKeyId
select x).ToList();
if (sour.Count() == 0)
{
Model.AttachFile att = new Model.AttachFile
{
AttachFileId = SQLHelper.GetNewID(),
ToKeyId = toKeyId,
AttachSource = source.ToString(),
AttachUrl = attachUrl,
MenuId = menuId,
// ImageByte= imageByte,
//AttachPath= attachPath,
};
if (menuId == BLL.Const.PersonListMenuId)
{
att.ImageByte = AttachFileService.SetImageToByteArray(rootUrl + attachUrl.Split(',')[0]);
}
db.AttachFile.InsertOnSubmit(att);
db.SubmitChanges();
}
else
{
Model.AttachFile att = db.AttachFile.FirstOrDefault(x => x.MenuId == menuId && x.AttachFileId == sour.First().AttachFileId);
if (att != null)
{
att.ToKeyId = toKeyId;
att.AttachSource = source.ToString();
att.AttachUrl = attachUrl;
att.MenuId = menuId;
if (menuId == BLL.Const.PersonListMenuId)
{
att.ImageByte = AttachFileService.SetImageToByteArray(rootUrl + attachUrl.Split(',')[0]);
}
db.SubmitChanges();
}
}
}
}
/// <summary>
/// 通过附件路径得到Source
/// </summary>

View File

@ -1,4 +1,5 @@
using System;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -54,7 +55,33 @@ namespace BLL
UpdateTrustNum(batchTrustItem.TrustBatchItemId, 1);
}
public static void AddBatchTrustItemForApi(Model.HJGL_Batch_BatchTrustItem batchTrustItem)
{
Model.SGGLDB db = Funs.DB;
Model.HJGL_Batch_BatchTrustItem newTrustBatchItem = new Model.HJGL_Batch_BatchTrustItem
{
TrustBatchItemId = batchTrustItem.TrustBatchItemId,
TrustBatchId = batchTrustItem.TrustBatchId,
PointBatchItemId = batchTrustItem.PointBatchItemId,
RepairRecordId = batchTrustItem.RepairRecordId,
WeldJointId = batchTrustItem.WeldJointId,
CreateDate = batchTrustItem.CreateDate,
RepairNum = batchTrustItem.RepairNum,
};
db.HJGL_Batch_BatchTrustItem.InsertOnSubmit(newTrustBatchItem);
var trustBatchItem = db.HJGL_Batch_BatchTrustItem.FirstOrDefault(x => x.TrustBatchItemId == batchTrustItem.TrustBatchItemId);
if (trustBatchItem != null)
{
trustBatchItem.TrustNum = trustBatchItem.TrustNum ?? 0 + 1;
if (trustBatchItem.TrustNum < 0)
{
trustBatchItem.TrustNum = 0;
}
}
db.SubmitChanges();
}
/// <summary>
/// 修改无损委托
@ -133,16 +160,18 @@ namespace BLL
public static bool GetIsGenerateTrust(string pointBatchItemId)
{
bool isShow = true;
var trustBatchItem = Funs.DB.HJGL_Batch_BatchTrustItem.FirstOrDefault(x => x.PointBatchItemId == pointBatchItemId);
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var trustBatchItem = db.HJGL_Batch_BatchTrustItem.FirstOrDefault(x => x.PointBatchItemId == pointBatchItemId);
if (trustBatchItem != null)
{
var checkItem = Funs.DB.HJGL_Batch_NDEItem.FirstOrDefault(x => x.TrustBatchItemId == trustBatchItem.TrustBatchItemId && x.CheckResult == "1");
var checkItem = db.HJGL_Batch_NDEItem.FirstOrDefault(x => x.TrustBatchItemId == trustBatchItem.TrustBatchItemId && x.CheckResult == "1");
if (checkItem != null)
{
isShow = false;
}
}
}
return isShow;
}
#endregion

View File

@ -450,7 +450,30 @@ namespace BLL
Funs.DB.SubmitChanges();
}
}
public static void UpdateJointNoAddGForApi(string jotId, string jointAttribute, string operateState)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
if (operateState == Const.BtnDelete || jointAttribute != "固定")
{
Model.PW_JointInfo deleteJointInfo = db.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jotId);
if (deleteJointInfo.JOT_JointNo.Last() == 'G')
{
deleteJointInfo.JOT_JointNo = deleteJointInfo.JOT_JointNo.Substring(0, deleteJointInfo.JOT_JointNo.Length - 1);
db.SubmitChanges();
}
}
else
{
Model.PW_JointInfo addJointInfo = db.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jotId);
if (addJointInfo.JOT_JointNo.Last() != 'G')
{
addJointInfo.JOT_JointNo += "G";
}
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据焊接日报ID获取焊接日期
/// </summary>

View File

@ -122,7 +122,23 @@ namespace BLL
db.SubmitChanges();
}
}
public static void DeleteCheckSpecialDetailsForApi(string checkSpecialId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.Check_CheckSpecialDetail where x.CheckSpecialId == checkSpecialId select x).ToList();
if (q != null)
{
//foreach (var item in q)
//{
// ////删除附件表
// BLL.CommonService.DeleteAttachFileById(item.CheckSpecialDetailId);
//}
db.Check_CheckSpecialDetail.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据专项检查ID删除一条专项检查明细信息
/// </summary>

View File

@ -120,7 +120,31 @@ namespace BLL
db.SubmitChanges();
}
}
public static void UpdateCheckSpecialForApi(Model.Check_CheckSpecial checkSpecial)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Check_CheckSpecial newCheckSpecial = db.Check_CheckSpecial.FirstOrDefault(e => e.CheckSpecialId == checkSpecial.CheckSpecialId);
if (newCheckSpecial != null)
{
newCheckSpecial.CheckSpecialCode = checkSpecial.CheckSpecialCode;
//newCheckSpecial.ProjectId = checkSpecial.ProjectId;
newCheckSpecial.CheckPerson = checkSpecial.CheckPerson;
newCheckSpecial.CheckTime = checkSpecial.CheckTime;
newCheckSpecial.ScanUrl = checkSpecial.ScanUrl;
newCheckSpecial.DaySummary = checkSpecial.DaySummary;
newCheckSpecial.PartInUnits = checkSpecial.PartInUnits;
newCheckSpecial.PartInPersons = checkSpecial.PartInPersons;
newCheckSpecial.PartInPersonIds = checkSpecial.PartInPersonIds;
newCheckSpecial.PartInPersonNames = checkSpecial.PartInPersonNames;
newCheckSpecial.CheckAreas = checkSpecial.CheckAreas;
newCheckSpecial.States = checkSpecial.States;
newCheckSpecial.CheckType = checkSpecial.CheckType;
newCheckSpecial.CheckItemSetId = checkSpecial.CheckItemSetId;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据专项检查ID 更新专项检查状态
/// </summary>
@ -138,6 +162,22 @@ namespace BLL
}
}
}
public static void UpdateCheckSpecialStatesForApi(string checkSpecialId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getS = db.Check_CheckSpecial.FirstOrDefault(x => x.CheckSpecialId == checkSpecialId);
if (getS != null && getS.States == Const.State_1)
{
var getNCDetail = db.Check_CheckSpecialDetail.FirstOrDefault(x => x.CheckSpecialId == getS.CheckSpecialId && x.CompleteStatus == false);
if (getNCDetail == null)
{
getS.States = Const.State_2;
db.SubmitChanges();
}
}
}
}
/// <summary>
/// 根据专项检查ID删除对应专项检查记录信息
@ -282,6 +322,82 @@ namespace BLL
}
return info;
}
public static string IssueRectificationForApi(List<Model.Check_CheckSpecialDetail> detailLists, Model.Check_CheckSpecial checkSpecial)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string info = string.Empty;
if (detailLists.Count() > 0 && checkSpecial != null)
{
////隐患整改单
var getDetail1 = detailLists.Where(x => x.CompleteStatus == false);
if (getDetail1.Count() > 0)
{
var getUnitList = getDetail1.Select(x => x.UnitId).Distinct();
foreach (var unitItem in getUnitList)
{
var getUnitItemList = getDetail1.Where(x => x.UnitId == unitItem);
foreach (var item in getUnitItemList)
{
Model.HSSE_Hazard_HazardRegister register = db.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.CheckItemDetailId == item.CheckSpecialDetailId);
if (register == null)
{
register = new Model.HSSE_Hazard_HazardRegister();
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(register);
}
register.ProjectId = checkSpecial.ProjectId;
register.CheckItemDetailId = item.CheckSpecialDetailId;
register.ProblemTypes = "2"; //1 安全问题 2 专项巡检
register.RegisterTypesId = item.CheckItem;
// register.CheckCycle = this.ckType.SelectedValue;
register.IsEffective = "1";
register.RegisterDate = checkSpecial.CheckTime;
register.CheckTime = checkSpecial.CheckTime;
register.ResponsibleUnit = item.UnitId;
register.Place = item.WorkArea;
register.RegisterDef = item.Unqualified;
// register.HandleIdea = item.Suggestions;
register.ResponsibleMan = item.HSEManage;
register.Risk_Level = item.RiskLevel;
register.Requirements = item.Suggestions;
register.RectificationPeriod = item.LimitedDate;
register.CheckManId = checkSpecial.CompileMan;
//register.CutPayment = Funs.GetNewIntOrZero(this.txtCutPayment.Text.Trim());
register.States = "1"; //待整改
if (string.IsNullOrEmpty(register.HazardRegisterId))
{
register.HazardRegisterId = Guid.NewGuid().ToString();
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
register.ImageUrl = url;
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
db.SubmitChanges();
}
else
{
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
register.ImageUrl = url;
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
db.SubmitChanges();
}
}
}
info += "整改已下发。";
}
Check_CheckSpecialService.UpdateCheckSpecialForApi(checkSpecial);
}
if (!string.IsNullOrEmpty(info))
{
info += "请在相应办理页面提交!";
}
return info;
}
}
public static void SaveAttachFile(string dataId, string menuId, string url)
{
Model.ToDoItem toDoItem = new Model.ToDoItem

View File

@ -163,6 +163,38 @@ namespace BLL
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectIncentiveNoticeMenuId, incentiveNotice.ProjectId, null, incentiveNotice.IncentiveNoticeId, incentiveNotice.CompileDate);
}
public static void AddIncentiveNoticeForApi(Model.Check_IncentiveNotice incentiveNotice)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Check_IncentiveNotice newIncentiveNotice = new Model.Check_IncentiveNotice
{
IncentiveNoticeId = incentiveNotice.IncentiveNoticeId,
ProjectId = incentiveNotice.ProjectId,
IncentiveNoticeCode = incentiveNotice.IncentiveNoticeCode,
UnitId = incentiveNotice.UnitId,
TeamGroupId = incentiveNotice.TeamGroupId,
IncentiveDate = incentiveNotice.IncentiveDate,
PersonId = incentiveNotice.PersonId,
BasicItem = incentiveNotice.BasicItem,
IncentiveMoney = incentiveNotice.IncentiveMoney,
TitleReward = incentiveNotice.TitleReward,
MattleReward = incentiveNotice.MattleReward,
FileContents = incentiveNotice.FileContents,
AttachUrl = incentiveNotice.AttachUrl,
CompileMan = incentiveNotice.CompileMan,
CompileDate = incentiveNotice.CompileDate,
States = incentiveNotice.States,
SignMan = incentiveNotice.SignMan,
ApproveMan = incentiveNotice.ApproveMan,
RewardType = incentiveNotice.RewardType,
Currency = incentiveNotice.Currency
};
db.Check_IncentiveNotice.InsertOnSubmit(newIncentiveNotice);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectIncentiveNoticeMenuId, incentiveNotice.ProjectId, null, incentiveNotice.IncentiveNoticeId, incentiveNotice.CompileDate);
}
}
/// <summary>
/// 修改奖励通知单

View File

@ -53,7 +53,37 @@ namespace BLL
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
db.SubmitChanges();
}
public static void AddTestRecordForApi(Model.Training_TestRecord testRecord)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
{
TestRecordId = testRecord.TestRecordId,
ProjectId = testRecord.ProjectId,
TestPlanId = testRecord.TestPlanId,
TestManId = testRecord.TestManId,
TestType = testRecord.TestType,
};
if (string.IsNullOrEmpty(newTestRecord.TestType))
{
var getTrainTypeName = (from x in db.Training_TestPlan
join y in db.Training_Plan on x.PlanId equals y.PlanId
join z in db.Base_TrainType on y.TrainTypeId equals z.TrainTypeId
where x.TestPlanId == testRecord.TestPlanId
select z).FirstOrDefault();
if (getTrainTypeName != null)
{
testRecord.TestType = getTrainTypeName.TrainTypeName;
}
}
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
db.SubmitChanges();
}
}
/// <summary>
/// 修改考试记录信息
/// </summary>

View File

@ -1253,6 +1253,23 @@ namespace BLL
db.License_LicenseItem.InsertOnSubmit(newLicenseItem);
db.SubmitChanges();
}
public static void AddLicenseItemForApi(Model.License_LicenseItem licenseItem)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.License_LicenseItem newLicenseItem = new Model.License_LicenseItem
{
LicenseItemId = SQLHelper.GetNewID(),
DataId = licenseItem.DataId,
SortIndex = licenseItem.SortIndex,
SafetyMeasures = licenseItem.SafetyMeasures,
IsUsed = licenseItem.IsUsed,
ConfirmManId = licenseItem.ConfirmManId,
};
db.License_LicenseItem.InsertOnSubmit(newLicenseItem);
db.SubmitChanges();
}
}
/// <summary>
/// 修改-安全措施
@ -1347,6 +1364,25 @@ namespace BLL
db.License_FlowOperate.InsertOnSubmit(newFlowOperate);
db.SubmitChanges();
}
public static void AddFlowOperateForApi(Model.License_FlowOperate flowOperate)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.License_FlowOperate newFlowOperate = new Model.License_FlowOperate
{
FlowOperateId = SQLHelper.GetNewID(),
DataId = flowOperate.DataId,
MenuId = flowOperate.MenuId,
OperaterId = flowOperate.OperaterId,
AuditFlowName = flowOperate.AuditFlowName,
SortIndex = flowOperate.SortIndex,
RoleIds = flowOperate.RoleIds,
IsFlowEnd = flowOperate.IsFlowEnd,
};
db.License_FlowOperate.InsertOnSubmit(newFlowOperate);
db.SubmitChanges();
}
}
/// <summary>
/// 修改审核信息

View File

@ -79,7 +79,38 @@ namespace BLL
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectAttendMeetingMenuId, attendMeeting.ProjectId, null, attendMeeting.AttendMeetingId, attendMeeting.CompileDate);
}
public static void AddAttendMeetingForApi(Model.Meeting_AttendMeeting attendMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_AttendMeeting newAttendMeeting = new Model.Meeting_AttendMeeting
{
AttendMeetingId = attendMeeting.AttendMeetingId,
ProjectId = attendMeeting.ProjectId,
UnitId = attendMeeting.UnitId,
AttendMeetingCode = attendMeeting.AttendMeetingCode,
AttendMeetingName = attendMeeting.AttendMeetingName,
AttendMeetingDate = attendMeeting.AttendMeetingDate,
CompileMan = attendMeeting.CompileMan,
AttendMeetingContents = attendMeeting.AttendMeetingContents,
CompileDate = attendMeeting.CompileDate,
States = attendMeeting.States,
MeetingHours = attendMeeting.MeetingHours,
MeetingHostMan = attendMeeting.MeetingHostMan,
AttentPerson = attendMeeting.AttentPerson,
MeetingPlace = attendMeeting.MeetingPlace,
MeetingHostManId = attendMeeting.MeetingHostManId,
AttentPersonIds = attendMeeting.AttentPersonIds,
AttentPersonNum = attendMeeting.AttentPersonNum,
MeetingHostManOther = attendMeeting.MeetingHostManOther
};
db.Meeting_AttendMeeting.InsertOnSubmit(attendMeeting);
db.SubmitChanges();
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectAttendMeetingMenuId, attendMeeting.ProjectId, null, attendMeeting.AttendMeetingId, attendMeeting.CompileDate);
}
}
/// <summary>
/// 修改其他会议记录
/// </summary>
@ -110,7 +141,34 @@ namespace BLL
db.SubmitChanges();
}
}
public static void UpdateAttendMeetingForApi(Model.Meeting_AttendMeeting attendMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_AttendMeeting newAttendMeeting = db.Meeting_AttendMeeting.FirstOrDefault(e => e.AttendMeetingId == attendMeeting.AttendMeetingId);
if (newAttendMeeting != null)
{
//newAttendMeeting.ProjectId = attendMeeting.ProjectId;
newAttendMeeting.UnitId = attendMeeting.UnitId;
newAttendMeeting.AttendMeetingCode = attendMeeting.AttendMeetingCode;
newAttendMeeting.AttendMeetingName = attendMeeting.AttendMeetingName;
newAttendMeeting.AttendMeetingDate = attendMeeting.AttendMeetingDate;
newAttendMeeting.CompileMan = attendMeeting.CompileMan;
newAttendMeeting.AttendMeetingContents = attendMeeting.AttendMeetingContents;
newAttendMeeting.CompileDate = attendMeeting.CompileDate;
newAttendMeeting.States = attendMeeting.States;
newAttendMeeting.MeetingHours = attendMeeting.MeetingHours;
newAttendMeeting.MeetingHostMan = attendMeeting.MeetingHostMan;
newAttendMeeting.AttentPerson = attendMeeting.AttentPerson;
newAttendMeeting.MeetingPlace = attendMeeting.MeetingPlace;
newAttendMeeting.MeetingHostManId = attendMeeting.MeetingHostManId;
newAttendMeeting.AttentPersonIds = attendMeeting.AttentPersonIds;
newAttendMeeting.MeetingHostManOther = attendMeeting.MeetingHostManOther;
newAttendMeeting.AttentPersonNum = attendMeeting.AttentPersonNum;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除其他会议记录
/// </summary>

View File

@ -51,7 +51,36 @@ namespace BLL
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectClassMeetingMenuId, classMeeting.ProjectId, null, classMeeting.ClassMeetingId, classMeeting.CompileDate);
}
public static void AddClassMeetingForApi(Model.Meeting_ClassMeeting classMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_ClassMeeting newClassMeeting = new Model.Meeting_ClassMeeting
{
ClassMeetingId = classMeeting.ClassMeetingId,
ProjectId = classMeeting.ProjectId,
UnitId = classMeeting.UnitId,
TeamGroupId = classMeeting.TeamGroupId,
ClassMeetingCode = classMeeting.ClassMeetingCode,
ClassMeetingName = classMeeting.ClassMeetingName,
ClassMeetingDate = classMeeting.ClassMeetingDate,
ClassMeetingContents = classMeeting.ClassMeetingContents,
CompileMan = classMeeting.CompileMan,
CompileDate = classMeeting.CompileDate,
States = classMeeting.States,
MeetingPlace = classMeeting.MeetingPlace,
MeetingHours = classMeeting.MeetingHours,
MeetingHostMan = classMeeting.MeetingHostMan,
AttentPerson = classMeeting.AttentPerson,
AttentPersonNum = classMeeting.AttentPersonNum,
MeetingHostManOther = classMeeting.MeetingHostManOther
};
db.Meeting_ClassMeeting.InsertOnSubmit(newClassMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(BLL.Const.ProjectClassMeetingMenuId, classMeeting.ProjectId, null, classMeeting.ClassMeetingId, classMeeting.CompileDate);
}
}
/// <summary>
/// 修改班前会
/// </summary>
@ -82,7 +111,34 @@ namespace BLL
db.SubmitChanges();
}
}
public static void UpdateClassMeetingForApi(Model.Meeting_ClassMeeting classMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_ClassMeeting newClassMeeting = db.Meeting_ClassMeeting.FirstOrDefault(e => e.ClassMeetingId == classMeeting.ClassMeetingId);
if (newClassMeeting != null)
{
// newClassMeeting.ProjectId = classMeeting.ProjectId;
newClassMeeting.UnitId = classMeeting.UnitId;
newClassMeeting.TeamGroupId = classMeeting.TeamGroupId;
newClassMeeting.ClassMeetingCode = classMeeting.ClassMeetingCode;
newClassMeeting.ClassMeetingName = classMeeting.ClassMeetingName;
newClassMeeting.ClassMeetingDate = classMeeting.ClassMeetingDate;
newClassMeeting.ClassMeetingContents = classMeeting.ClassMeetingContents;
newClassMeeting.CompileMan = classMeeting.CompileMan;
newClassMeeting.CompileDate = classMeeting.CompileDate;
newClassMeeting.States = classMeeting.States;
newClassMeeting.MeetingPlace = classMeeting.MeetingPlace;
newClassMeeting.MeetingHours = classMeeting.MeetingHours;
newClassMeeting.MeetingHostMan = classMeeting.MeetingHostMan;
newClassMeeting.AttentPerson = classMeeting.AttentPerson;
newClassMeeting.AttentPersonNum = classMeeting.AttentPersonNum;
newClassMeeting.MeetingHostManOther = classMeeting.MeetingHostManOther;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除班前会
/// </summary>

View File

@ -95,7 +95,37 @@ namespace BLL
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectMonthMeetingMenuId, monthMeeting.ProjectId, null, monthMeeting.MonthMeetingId, monthMeeting.CompileDate);
}
public static void AddMonthMeetingForApi(Model.Meeting_MonthMeeting monthMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_MonthMeeting newMonthMeeting = new Model.Meeting_MonthMeeting
{
MonthMeetingId = monthMeeting.MonthMeetingId,
ProjectId = monthMeeting.ProjectId,
UnitId = monthMeeting.UnitId,
MonthMeetingCode = monthMeeting.MonthMeetingCode,
MonthMeetingName = monthMeeting.MonthMeetingName,
MonthMeetingDate = monthMeeting.MonthMeetingDate,
CompileMan = monthMeeting.CompileMan,
MonthMeetingContents = monthMeeting.MonthMeetingContents,
CompileDate = monthMeeting.CompileDate,
States = monthMeeting.States,
AttentPersonNum = monthMeeting.AttentPersonNum,
MeetingHours = monthMeeting.MeetingHours,
MeetingHostMan = monthMeeting.MeetingHostMan,
AttentPerson = monthMeeting.AttentPerson,
MeetingPlace = monthMeeting.MeetingPlace,
MeetingHostManId = monthMeeting.MeetingHostManId,
AttentPersonIds = monthMeeting.AttentPersonIds,
MeetingHostManOther = monthMeeting.MeetingHostManOther
};
db.Meeting_MonthMeeting.InsertOnSubmit(newMonthMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(BLL.Const.ProjectMonthMeetingMenuId, monthMeeting.ProjectId, null, monthMeeting.MonthMeetingId, monthMeeting.CompileDate);
}
}
/// <summary>
/// 修改安全月例会
/// </summary>
@ -126,6 +156,34 @@ namespace BLL
db.SubmitChanges();
}
}
public static void UpdateMonthMeetingForApi(Model.Meeting_MonthMeeting monthMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_MonthMeeting newMonthMeeting = db.Meeting_MonthMeeting.FirstOrDefault(e => e.MonthMeetingId == monthMeeting.MonthMeetingId);
if (newMonthMeeting != null)
{
//newMonthMeeting.ProjectId = monthMeeting.ProjectId;
newMonthMeeting.UnitId = monthMeeting.UnitId;
newMonthMeeting.MonthMeetingCode = monthMeeting.MonthMeetingCode;
newMonthMeeting.MonthMeetingName = monthMeeting.MonthMeetingName;
newMonthMeeting.MonthMeetingDate = monthMeeting.MonthMeetingDate;
newMonthMeeting.CompileMan = monthMeeting.CompileMan;
newMonthMeeting.MonthMeetingContents = monthMeeting.MonthMeetingContents;
newMonthMeeting.CompileDate = monthMeeting.CompileDate;
newMonthMeeting.States = monthMeeting.States;
newMonthMeeting.AttentPersonNum = monthMeeting.AttentPersonNum;
newMonthMeeting.MeetingHours = monthMeeting.MeetingHours;
newMonthMeeting.MeetingHostMan = monthMeeting.MeetingHostMan;
newMonthMeeting.AttentPerson = monthMeeting.AttentPerson;
newMonthMeeting.MeetingPlace = monthMeeting.MeetingPlace;
newMonthMeeting.MeetingHostManId = monthMeeting.MeetingHostManId;
newMonthMeeting.AttentPersonIds = monthMeeting.AttentPersonIds;
newMonthMeeting.MeetingHostManOther = monthMeeting.MeetingHostManOther;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除安全月例会

View File

@ -95,6 +95,37 @@ namespace BLL
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectSpecialMeetingMenuId, specialMeeting.ProjectId, null, specialMeeting.SpecialMeetingId, specialMeeting.CompileDate);
}
public static void AddSpecialMeetingForApi(Model.Meeting_SpecialMeeting specialMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_SpecialMeeting newSpecialMeeting = new Model.Meeting_SpecialMeeting
{
SpecialMeetingId = specialMeeting.SpecialMeetingId,
ProjectId = specialMeeting.ProjectId,
UnitId = specialMeeting.UnitId,
SpecialMeetingCode = specialMeeting.SpecialMeetingCode,
SpecialMeetingName = specialMeeting.SpecialMeetingName,
SpecialMeetingDate = specialMeeting.SpecialMeetingDate,
CompileMan = specialMeeting.CompileMan,
SpecialMeetingContents = specialMeeting.SpecialMeetingContents,
CompileDate = specialMeeting.CompileDate,
States = specialMeeting.States,
AttentPersonNum = specialMeeting.AttentPersonNum,
MeetingHours = specialMeeting.MeetingHours,
MeetingHostMan = specialMeeting.MeetingHostMan,
AttentPerson = specialMeeting.AttentPerson,
MeetingPlace = specialMeeting.MeetingPlace,
MeetingHostManId = specialMeeting.MeetingHostManId,
AttentPersonIds = specialMeeting.AttentPersonIds,
MeetingHostManOther = specialMeeting.MeetingHostManOther
};
db.Meeting_SpecialMeeting.InsertOnSubmit(newSpecialMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(BLL.Const.ProjectSpecialMeetingMenuId, specialMeeting.ProjectId, null, specialMeeting.SpecialMeetingId, specialMeeting.CompileDate);
}
}
/// <summary>
/// 修改专题例会
@ -126,6 +157,34 @@ namespace BLL
db.SubmitChanges();
}
}
public static void UpdateSpecialMeetingForApi(Model.Meeting_SpecialMeeting specialMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_SpecialMeeting newSpecialMeeting = db.Meeting_SpecialMeeting.FirstOrDefault(e => e.SpecialMeetingId == specialMeeting.SpecialMeetingId);
if (newSpecialMeeting != null)
{
//newSpecialMeeting.ProjectId = specialMeeting.ProjectId;
newSpecialMeeting.UnitId = specialMeeting.UnitId;
newSpecialMeeting.SpecialMeetingCode = specialMeeting.SpecialMeetingCode;
newSpecialMeeting.SpecialMeetingName = specialMeeting.SpecialMeetingName;
newSpecialMeeting.SpecialMeetingDate = specialMeeting.SpecialMeetingDate;
newSpecialMeeting.CompileMan = specialMeeting.CompileMan;
newSpecialMeeting.SpecialMeetingContents = specialMeeting.SpecialMeetingContents;
newSpecialMeeting.CompileDate = specialMeeting.CompileDate;
newSpecialMeeting.States = specialMeeting.States;
newSpecialMeeting.AttentPersonNum = specialMeeting.AttentPersonNum;
newSpecialMeeting.MeetingHours = specialMeeting.MeetingHours;
newSpecialMeeting.MeetingHostMan = specialMeeting.MeetingHostMan;
newSpecialMeeting.AttentPerson = specialMeeting.AttentPerson;
newSpecialMeeting.MeetingPlace = specialMeeting.MeetingPlace;
newSpecialMeeting.MeetingHostManId = specialMeeting.MeetingHostManId;
newSpecialMeeting.AttentPersonIds = specialMeeting.AttentPersonIds;
newSpecialMeeting.MeetingHostManOther = specialMeeting.MeetingHostManOther;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除专题例会

View File

@ -95,7 +95,37 @@ namespace BLL
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectWeekMeetingMenuId, weekMeeting.ProjectId, null, weekMeeting.WeekMeetingId, weekMeeting.CompileDate);
}
public static void AddWeekMeetingForApi(Model.Meeting_WeekMeeting weekMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_WeekMeeting newWeekMeeting = new Model.Meeting_WeekMeeting
{
WeekMeetingId = weekMeeting.WeekMeetingId,
ProjectId = weekMeeting.ProjectId,
UnitId = weekMeeting.UnitId,
WeekMeetingCode = weekMeeting.WeekMeetingCode,
WeekMeetingName = weekMeeting.WeekMeetingName,
WeekMeetingDate = weekMeeting.WeekMeetingDate,
CompileMan = weekMeeting.CompileMan,
WeekMeetingContents = weekMeeting.WeekMeetingContents,
CompileDate = weekMeeting.CompileDate,
States = weekMeeting.States,
AttentPersonNum = weekMeeting.AttentPersonNum,
MeetingHours = weekMeeting.MeetingHours,
MeetingHostMan = weekMeeting.MeetingHostMan,
AttentPerson = weekMeeting.AttentPerson,
MeetingPlace = weekMeeting.MeetingPlace,
MeetingHostManId = weekMeeting.MeetingHostManId,
AttentPersonIds = weekMeeting.AttentPersonIds,
MeetingHostManOther = weekMeeting.MeetingHostManOther
};
db.Meeting_WeekMeeting.InsertOnSubmit(newWeekMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(BLL.Const.ProjectWeekMeetingMenuId, weekMeeting.ProjectId, null, weekMeeting.WeekMeetingId, weekMeeting.CompileDate);
}
}
/// <summary>
/// 修改周例会
/// </summary>
@ -126,6 +156,35 @@ namespace BLL
db.SubmitChanges();
}
}
public static void UpdateWeekMeetingForApi(Model.Meeting_WeekMeeting weekMeeting)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Meeting_WeekMeeting newWeekMeeting = db.Meeting_WeekMeeting.FirstOrDefault(e => e.WeekMeetingId == weekMeeting.WeekMeetingId);
if (newWeekMeeting != null)
{
//newWeekMeeting.ProjectId = weekMeeting.ProjectId;
newWeekMeeting.UnitId = weekMeeting.UnitId;
newWeekMeeting.WeekMeetingCode = weekMeeting.WeekMeetingCode;
newWeekMeeting.WeekMeetingName = weekMeeting.WeekMeetingName;
newWeekMeeting.WeekMeetingDate = weekMeeting.WeekMeetingDate;
newWeekMeeting.CompileMan = weekMeeting.CompileMan;
newWeekMeeting.WeekMeetingContents = weekMeeting.WeekMeetingContents;
newWeekMeeting.CompileDate = weekMeeting.CompileDate;
newWeekMeeting.States = weekMeeting.States;
newWeekMeeting.AttentPersonNum = weekMeeting.AttentPersonNum;
newWeekMeeting.MeetingHours = weekMeeting.MeetingHours;
newWeekMeeting.MeetingHostMan = weekMeeting.MeetingHostMan;
newWeekMeeting.AttentPerson = weekMeeting.AttentPerson;
newWeekMeeting.MeetingPlace = weekMeeting.MeetingPlace;
newWeekMeeting.MeetingHostManId = weekMeeting.MeetingHostManId;
newWeekMeeting.AttentPersonIds = weekMeeting.AttentPersonIds;
newWeekMeeting.MeetingHostManOther = weekMeeting.MeetingHostManOther;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除周例会

View File

@ -67,7 +67,37 @@ namespace BLL
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.EquipmentQualityMenuId, equipmentQuality.ProjectId, null, equipmentQuality.EquipmentQualityId, equipmentQuality.CompileDate);
}
public static void AddEquipmentQualityForApi(Model.QualityAudit_EquipmentQuality equipmentQuality)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.QualityAudit_EquipmentQuality newEquipmentQuality = new Model.QualityAudit_EquipmentQuality
{
EquipmentQualityId = equipmentQuality.EquipmentQualityId,
ProjectId = equipmentQuality.ProjectId,
EquipmentQualityCode = equipmentQuality.EquipmentQualityCode,
UnitId = equipmentQuality.UnitId,
SpecialEquipmentId = equipmentQuality.SpecialEquipmentId,
EquipmentQualityName = equipmentQuality.EquipmentQualityName,
SizeModel = equipmentQuality.SizeModel,
FactoryCode = equipmentQuality.FactoryCode,
CertificateCode = equipmentQuality.CertificateCode,
CheckDate = equipmentQuality.CheckDate,
LimitDate = equipmentQuality.LimitDate,
InDate = equipmentQuality.InDate,
OutDate = equipmentQuality.OutDate,
ApprovalPerson = equipmentQuality.ApprovalPerson,
CarNum = equipmentQuality.CarNum,
Remark = equipmentQuality.Remark,
CompileMan = equipmentQuality.CompileMan,
CompileDate = equipmentQuality.CompileDate
};
db.QualityAudit_EquipmentQuality.InsertOnSubmit(newEquipmentQuality);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.EquipmentQualityMenuId, equipmentQuality.ProjectId, null, equipmentQuality.EquipmentQualityId, equipmentQuality.CompileDate);
}
}
/// <summary>
/// 修改特殊机具设备资质
/// </summary>
@ -99,7 +129,35 @@ namespace BLL
db.SubmitChanges();
}
}
public static void UpdateEquipmentQualityForApi(Model.QualityAudit_EquipmentQuality equipmentQuality)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.QualityAudit_EquipmentQuality newEquipmentQuality = db.QualityAudit_EquipmentQuality.FirstOrDefault(e => e.EquipmentQualityId == equipmentQuality.EquipmentQualityId);
if (newEquipmentQuality != null)
{
newEquipmentQuality.ProjectId = equipmentQuality.ProjectId;
newEquipmentQuality.EquipmentQualityCode = equipmentQuality.EquipmentQualityCode;
newEquipmentQuality.UnitId = equipmentQuality.UnitId;
newEquipmentQuality.SpecialEquipmentId = equipmentQuality.SpecialEquipmentId;
newEquipmentQuality.EquipmentQualityName = equipmentQuality.EquipmentQualityName;
newEquipmentQuality.SizeModel = equipmentQuality.SizeModel;
newEquipmentQuality.FactoryCode = equipmentQuality.FactoryCode;
newEquipmentQuality.CertificateCode = equipmentQuality.CertificateCode;
newEquipmentQuality.CheckDate = equipmentQuality.CheckDate;
newEquipmentQuality.LimitDate = equipmentQuality.LimitDate;
newEquipmentQuality.InDate = equipmentQuality.InDate;
newEquipmentQuality.OutDate = equipmentQuality.OutDate;
newEquipmentQuality.ApprovalPerson = equipmentQuality.ApprovalPerson;
newEquipmentQuality.CarNum = equipmentQuality.CarNum;
newEquipmentQuality.Remark = equipmentQuality.Remark;
newEquipmentQuality.CompileMan = equipmentQuality.CompileMan;
newEquipmentQuality.CompileDate = equipmentQuality.CompileDate;
newEquipmentQuality.QRCodeAttachUrl = equipmentQuality.QRCodeAttachUrl;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除特殊机具设备资质
/// </summary>

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using FineUIPro;
using Model;
namespace BLL
{
@ -126,6 +127,19 @@ namespace BLL
}
return name;
}
public static string GetPersonNameByIdForApi(string personId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string name = string.Empty;
var getp = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == personId);
if (getp != null)
{
name = getp.PersonName;
}
return name;
}
}
/// <summary>
/// 根据UserId主键获取人员信息
@ -151,6 +165,28 @@ namespace BLL
return personId;
}
public static string GetPersonIdByUserIdForApi(string userId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string personId = userId;
var getPerson = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == userId);
if (getPerson == null)
{
var getUser = db.Sys_User.FirstOrDefault(e => e.UserId == userId);
if (getUser != null)
{
getPerson = db.SitePerson_Person.FirstOrDefault(e => e.IdentityCard == getUser.IdentityCard);
if (getPerson != null)
{
personId = getPerson.PersonId;
}
}
}
return personId;
}
}
/// <summary>
/// 根据UserId主键获取人员信息

View File

@ -78,7 +78,35 @@ namespace BLL
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectConstructSolutionMenuId, constructSolution.ProjectId, null, constructSolution.ConstructSolutionId, constructSolution.CompileDate);
}
}
public static void AddConstructSolutionForApi(Model.Solution_ConstructSolution constructSolution)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Solution_ConstructSolution newConstructSolution = new Model.Solution_ConstructSolution
{
ConstructSolutionId = constructSolution.ConstructSolutionId,
ProjectId = constructSolution.ProjectId,
ConstructSolutionCode = constructSolution.ConstructSolutionCode,
ConstructSolutionName = constructSolution.ConstructSolutionName,
VersionNo = constructSolution.VersionNo,
UnitId = constructSolution.UnitId,
InvestigateType = constructSolution.InvestigateType,
SolutinType = constructSolution.SolutinType,
FileContents = constructSolution.FileContents,
Remark = constructSolution.Remark,
CompileMan = constructSolution.CompileMan,
CompileManName = constructSolution.CompileManName,
CompileDate = constructSolution.CompileDate,
States = constructSolution.States
};
db.Solution_ConstructSolution.InsertOnSubmit(newConstructSolution);
db.SubmitChanges();
if (constructSolution.ConstructSolutionCode == BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectConstructSolutionMenuId, constructSolution.ProjectId, null))
{
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectConstructSolutionMenuId, constructSolution.ProjectId, null, constructSolution.ConstructSolutionId, constructSolution.CompileDate);
}
}
}
/// <summary>
/// 修改施工方案/审查
/// </summary>
@ -109,6 +137,49 @@ namespace BLL
}
}
}
public static void UpdateConstructSolutionForApi(Model.Solution_ConstructSolution constructSolution)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Solution_ConstructSolution newConstructSolution = db.Solution_ConstructSolution.FirstOrDefault(e => e.ConstructSolutionId == constructSolution.ConstructSolutionId);
if (newConstructSolution != null)
{
newConstructSolution.ConstructSolutionName = constructSolution.ConstructSolutionName;
newConstructSolution.VersionNo = constructSolution.VersionNo;
newConstructSolution.UnitId = constructSolution.UnitId;
newConstructSolution.InvestigateType = constructSolution.InvestigateType;
newConstructSolution.SolutinType = constructSolution.SolutinType;
newConstructSolution.FileContents = constructSolution.FileContents;
newConstructSolution.Remark = constructSolution.Remark;
newConstructSolution.States = constructSolution.States;
if (!string.IsNullOrEmpty(constructSolution.QRCodeAttachUrl))
{
newConstructSolution.QRCodeAttachUrl = constructSolution.QRCodeAttachUrl;
}
db.SubmitChanges();
string code = string.Empty;
var codeRecords = db.Sys_CodeRecords.FirstOrDefault(x => x.DataId == constructSolution.ConstructSolutionId);
if (codeRecords != null)
{
code = codeRecords.Code;
}
if (constructSolution.ConstructSolutionCode != code)
{
var codeRecords1 = db.Sys_CodeRecords.FirstOrDefault(x => x.DataId == constructSolution.ConstructSolutionId);
if (codeRecords1 != null)
{
///删除文件柜A中数据
// BLL.FileCabinetAItemService.DeleteFileCabinetAItemByID(dataId);
db.Sys_CodeRecords.DeleteOnSubmit(codeRecords1);
db.SubmitChanges();
}
}
}
}
}
/// <summary>
/// 根据主键删除施工方案/审查

View File

@ -37,7 +37,7 @@ namespace BLL
public static void DeleteConstructSolution(string constructSolutionId)
{
Model.SGGLDB db = Funs.DB;
Model.Solution_HSSEConstructSolution constructSolution = db.Solution_HSSEConstructSolution.First(e => e.ConstructSolutionId == constructSolutionId);
Model.Solution_HSSEConstructSolution constructSolution = db.Solution_HSSEConstructSolution.FirstOrDefault(e => e.ConstructSolutionId == constructSolutionId);
db.Solution_HSSEConstructSolution.DeleteOnSubmit(constructSolution);
db.SubmitChanges();
@ -50,11 +50,13 @@ namespace BLL
public static void DeleteConstructSolutionByCQMSConstructSolutionId(string CQMSConstructSolutionId)
{
Model.SGGLDB db = Funs.DB;
Model.Solution_HSSEConstructSolution constructSolution = db.Solution_HSSEConstructSolution.First(e => e.CQMSConstructSolutionId == CQMSConstructSolutionId);
Model.Solution_HSSEConstructSolution constructSolution = db.Solution_HSSEConstructSolution.FirstOrDefault(e => e.CQMSConstructSolutionId == CQMSConstructSolutionId);
if (constructSolution != null)
{
db.Solution_HSSEConstructSolution.DeleteOnSubmit(constructSolution);
db.SubmitChanges();
}
}
/// <summary>
/// 增加方案审查信息

View File

@ -60,6 +60,28 @@ namespace BLL
/// </summary>
/// <param name="ReceiveFileManager"></param>
public static void UpdateReceiveFileManager(Model.InformationProject_ReceiveFileManager ReceiveFileManager)
{
Model.SGGLDB db = Funs.DB;
Model.InformationProject_ReceiveFileManager newReceiveFileManager = db.InformationProject_ReceiveFileManager.FirstOrDefault(e => e.ReceiveFileManagerId == ReceiveFileManager.ReceiveFileManagerId);
if (newReceiveFileManager != null)
{
// newReceiveFileManager.ReceiveFileCode = ReceiveFileManager.ReceiveFileCode;
newReceiveFileManager.ReceiveFileName = ReceiveFileManager.ReceiveFileName;
newReceiveFileManager.Version = ReceiveFileManager.Version;
newReceiveFileManager.FileUnitId = ReceiveFileManager.FileUnitId;
newReceiveFileManager.FileCode = ReceiveFileManager.FileCode;
newReceiveFileManager.FilePageNum = ReceiveFileManager.FilePageNum;
newReceiveFileManager.GetFileDate = ReceiveFileManager.GetFileDate;
newReceiveFileManager.SendPersonId = ReceiveFileManager.SendPersonId;
newReceiveFileManager.MainContent = ReceiveFileManager.MainContent;
newReceiveFileManager.AttachUrl = ReceiveFileManager.AttachUrl;
newReceiveFileManager.States = ReceiveFileManager.States;
newReceiveFileManager.UnitIds = ReceiveFileManager.UnitIds;
newReceiveFileManager.FileType = ReceiveFileManager.FileType;
db.SubmitChanges();
}
}
public static void UpdateReceiveFileManagerForApi(Model.InformationProject_ReceiveFileManager ReceiveFileManager)
{
Model.SGGLDB db = Funs.DB;
Model.InformationProject_ReceiveFileManager newReceiveFileManager = db.InformationProject_ReceiveFileManager.FirstOrDefault(e => e.ReceiveFileManagerId == ReceiveFileManager.ReceiveFileManagerId);

View File

@ -45,7 +45,19 @@
}
return name;
}
public static string GetProjectNameByProjectIdForApi(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string name = string.Empty;
var project =db.Base_Project.FirstOrDefault(e => e.ProjectId == projectId);
if (project != null)
{
name = project.ProjectName;
}
return name;
}
}
/// <summary>
///根据ID获取项目编号
/// </summary>

View File

@ -142,7 +142,26 @@
return isShow;
}
public static bool GetProjectUnitTypeByProjectIdUnitIdForApi(string projectId, string unitId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
bool isShow = false;
if (unitId != Const.UnitId_CD)
{
var pUnit = db.Project_ProjectUnit.FirstOrDefault(e => e.ProjectId == projectId && e.UnitId == unitId);
if (pUnit != null)
{
if (pUnit.UnitType == Const.ProjectUnitType_2 || pUnit.UnitType == Const.ProjectUnitType_0)
{
isShow = true;
}
}
}
return isShow;
}
}
#region
/// <summary>
/// 项目类型单位表下拉框

View File

@ -483,6 +483,30 @@ namespace BLL
}
return unitWorkName;
}
public static string GetUnitWorkNameForApi(string unitWorkIds)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string unitWorkName = string.Empty;
if (!string.IsNullOrEmpty(unitWorkIds))
{
string[] strs = unitWorkIds.Split(',');
foreach (var item in strs)
{
var un = db.WBS_UnitWork.FirstOrDefault(e => e.UnitWorkId == item);
if (un != null)
{
unitWorkName += un.UnitWorkName + GetProjectType(un.ProjectType) + ",";
}
}
if (!string.IsNullOrEmpty(unitWorkName))
{
unitWorkName = unitWorkName.Substring(0, unitWorkName.LastIndexOf(","));
}
}
return unitWorkName;
}
}
/// <summary>
/// 获取单位工程下拉列表

View File

@ -283,6 +283,19 @@ namespace BLL
}
return name;
}
public static string GetWorkAreaCodeByWorkAreaIdForApi(string workAreaId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string name = string.Empty;
var WorkArea =db.ProjectData_WorkArea.FirstOrDefault(x => x.WorkAreaId == workAreaId);
if (WorkArea != null)
{
name = WorkArea.WorkAreaCode;
}
return name;
}
}
/// <summary>
/// 根据项目ID、装置Id、单位ID获取班组下拉选择项

View File

@ -99,6 +99,19 @@ namespace BLL
}
return name;
}
public static string getDepartNameByIdForApi(string departId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string name = string.Empty;
var dep = db.Base_Depart.FirstOrDefault(e => e.DepartId == departId);
if (dep != null)
{
name = dep.DepartName;
}
return name;
}
}
#region
/// <summary>

View File

@ -170,6 +170,30 @@
return roleName;
}
public static string getRoleNamesRoleIdsForApi(object roleIds)
{
string roleName = string.Empty;
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
if (roleIds != null)
{
string[] roles = roleIds.ToString().Split(',');
foreach (string roleId in roles)
{
var q = db.Sys_Role.FirstOrDefault(x => x.RoleId == roleId);
if (q != null && !roleName.Contains(q.RoleName))
{
roleName += q.RoleName + ",";
}
}
if (roleName != string.Empty)
{
roleName = roleName.Substring(0, roleName.Length - 1); ;
}
}
}
return roleName;
}
/// <summary>
/// 角色下拉框

View File

@ -126,6 +126,19 @@
}
return passScore;
}
public static int getPassScoreForApi()
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
int passScore = 80;
var testRule = db.Sys_TestRule.FirstOrDefault();
if (testRule != null)
{
passScore = testRule.PassingScore;
}
return passScore;
}
}
#region
/// <summary>

View File

@ -1,4 +1,5 @@
using System;
using NPOI.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -332,6 +333,20 @@ namespace BLL
}
return name;
}
public static string GetUnitNameByUnitIdForApi(string unitId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string name = string.Empty;
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == unitId);
if (unit != null)
{
name = unit.UnitName;
}
return name;
}
}
public static string GetUnitNameByUnitId(object unitId)
{
string name = string.Empty;
@ -391,7 +406,19 @@ namespace BLL
}
return code;
}
public static string GetUnitCodeByUnitIdForApi(string unitId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string code = string.Empty;
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == unitId);
if (unit != null)
{
code = unit.UnitCode;
}
return code;
}
}
#region
/// <summary>
/// 单位表下拉框
@ -644,6 +671,31 @@ namespace BLL
}
return unitName;
}
public static string getUnitNamesUnitIdsForApi(object unitIds)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string unitName = string.Empty;
if (unitIds != null)
{
string[] ids = unitIds.ToString().Split(',');
foreach (string id in ids)
{
var q = db.Base_Unit.FirstOrDefault(x => x.UnitId == id) ;
if (q != null)
{
unitName += q.UnitName + ",";
}
}
if (unitName != string.Empty)
{
unitName = unitName.Substring(0, unitName.Length - 1); ;
}
}
return unitName;
}
}
#endregion

View File

@ -160,7 +160,20 @@ namespace BLL
return userName;
}
public static string GetUserNameByUserIdForApi(string userId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string userName = string.Empty;
Model.Sys_User user = db.Sys_User.FirstOrDefault(e => e.UserId == userId);
if (user != null)
{
userName = user.UserName;
}
return userName;
}
}
/// <summary>
/// 根据用户获取用户名称
/// </summary>
@ -1323,6 +1336,31 @@ namespace BLL
return userName;
}
public static string getUserNamesUserIdsForApi(object userIds)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string userName = string.Empty;
if (userIds != null)
{
string[] ids = userIds.ToString().Split(',');
foreach (string id in ids)
{
var q = db.Sys_User.FirstOrDefault(e => e.UserId == id);
if (q != null)
{
userName += q.UserName + ",";
}
}
if (userName != string.Empty)
{
userName = userName.Substring(0, userName.Length - 1); ;
}
}
return userName;
}
}
#endregion
/// <summary>

View File

@ -597,3 +597,140 @@ IP地址:::1
出错时间:07/01/2023 14:46:08
错误信息开始=====>
错误类型:InvalidOperationException
错误信息:序列不包含任何元素
错误堆栈:
在 System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
在 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
在 System.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
在 System.Linq.Queryable.First[TSource](IQueryable`1 source, Expression`1 predicate)
在 BLL.HSSEConstructSolutionService.DeleteConstructSolutionByCQMSConstructSolutionId(String CQMSConstructSolutionId) 位置 D:\project\vs\sggl_cd\SGGL\BLL\HSSE\Solution\HSSEConstructSolutionService.cs:行号 53
在 FineUIPro.Web.CQMS.Solution.ConstructSolution.btnMenuDel_Click(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\Solution\ConstructSolution.aspx.cs:行号 852
在 FineUIPro.MenuButton.OnClick(EventArgs e)
在 (MenuButton , EventArgs )
在 FineUIPro.MenuButton.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:07/04/2023 15:36:22
出错文件:http://localhost:1295/CQMS/Solution/ConstructSolution.aspx
IP地址:::1
操作人员:JT
出错时间:07/04/2023 15:36:22
错误信息开始=====>
错误类型:InvalidOperationException
错误信息:序列不包含任何元素
错误堆栈:
在 System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
在 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
在 System.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
在 System.Linq.Queryable.First[TSource](IQueryable`1 source, Expression`1 predicate)
在 BLL.HSSEConstructSolutionService.DeleteConstructSolutionByCQMSConstructSolutionId(String CQMSConstructSolutionId) 位置 D:\project\vs\sggl_cd\SGGL\BLL\HSSE\Solution\HSSEConstructSolutionService.cs:行号 53
在 FineUIPro.Web.CQMS.Solution.ConstructSolution.btnMenuDel_Click(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\Solution\ConstructSolution.aspx.cs:行号 852
在 FineUIPro.MenuButton.OnClick(EventArgs e)
在 (MenuButton , EventArgs )
在 FineUIPro.MenuButton.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:07/04/2023 15:36:36
出错文件:http://localhost:1295/CQMS/Solution/ConstructSolution.aspx
IP地址:::1
操作人员:JT
出错时间:07/04/2023 15:36:36
错误信息开始=====>
错误类型:FormatException
错误信息:索引(从零开始)必须大于或等于零,且小于参数列表的大小。
错误堆栈:
在 System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
在 System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
在 System.String.Format(String format, Object arg0)
在 FineUIPro.HyperLinkField.VQscVYXUOqxsrrrlgEYaXHIhTAZB(GridRow )
在 (GridColumn , GridRow )
在 FineUIPro.GridRow.BkpgFeAELTFlAvoTrOBrConfcLJbA()
在 (GridRow )
在 FineUIPro.Grid.BkpgFeAELTFlAvoTrOBrConfcLJbA(Int32 , Object )
在 (Grid , Int32 , Object )
在 FineUIPro.Grid.CRTRkdQFrrBRFQuCddjZPswlTORP(IEnumerable , Boolean )
在 (Grid , IEnumerable , Boolean )
在 FineUIPro.Grid.DataBind(Boolean keepCurrentData)
在 (Grid , Boolean )
在 FineUIPro.Grid.DataBind()
在 FineUIPro.Web.AttachFile.webuploader.BindGrid() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\AttachFile\webuploader.aspx.cs:行号 153
在 FineUIPro.Web.AttachFile.webuploader.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\AttachFile\webuploader.aspx.cs:行号 117
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:07/08/2023 17:49:49
出错文件:http://localhost:1295/AttachFile/webuploader.aspx?type=0&toKeyId=444bf309-526a-4c08-b9e9-76a4f676740b&path=FileUpload/PZHGL/XmsgGlgdUrl/&menuId=90217D8E-D2AC-4B8D-A1A7-A27317890408
IP地址:::1
操作人员:JT
出错时间:07/08/2023 17:49:49
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.HSSE.HiddenInspection.HiddenRectificationList.GetButtonPower() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\HiddenInspection\HiddenRectificationList.aspx.cs:行号 826
在 FineUIPro.Web.HSSE.HiddenInspection.HiddenRectificationList.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\HiddenInspection\HiddenRectificationList.aspx.cs:行号 44
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:07/09/2023 10:53:56
出错文件:http://localhost:1295/HSSE/HiddenInspection/HiddenRectificationList.aspx
IP地址:::1
出错时间:07/09/2023 10:53:57
错误信息开始=====>
错误类型:SqlException
错误信息:参数化查询 '(@ProjectId nvarchar(4000))select HazardList.HazardListId,Hazard' 需要参数 '@ProjectId',但未提供该参数。
错误堆栈:
在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
在 System.Data.SqlClient.SqlDataReader.get_MetaData()
在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
在 BLL.SQLHelper.GetDataTableRunText(String strSql, SqlParameter[] parameters) 位置 D:\project\vs\sggl_cd\SGGL\BLL\SQLHelper.cs:行号 311
在 FineUIPro.Web.HSSE.Hazard.HazardList.BindGrid() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\Hazard\HazardList.aspx.cs:行号 100
在 FineUIPro.Web.HSSE.Hazard.HazardList.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\Hazard\HazardList.aspx.cs:行号 65
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:07/09/2023 11:29:41
出错文件:http://localhost:1295/HSSE/Hazard/HazardList.aspx
IP地址:::1
操作人员:JT
出错时间:07/09/2023 11:29:41

View File

@ -374,7 +374,11 @@ namespace FineUIPro.Web.HSSE.Hazard
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = Grid1.RecordCount;
this.BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}

View File

@ -174,12 +174,12 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
}
if (this.drpStates.SelectedValueArray.Contains("2"))
{
strSqlTemp += " ( States in( '2','3') and RectificationPeriod > RectificationTime) OR";
strSqlTemp += " ( States in( '2','3') and datediff(DAY,RectificationPeriod,RectificationTime)>0 ) OR";
}
if (this.drpStates.SelectedValueArray.Contains("3"))
{
strSqlTemp += " (States in( '2','3') and RectificationPeriod < RectificationTime ) OR";
strSqlTemp += " (States in( '2','3') and datediff(DAY,RectificationPeriod,RectificationTime)<=0 ) OR";
}
if (this.drpStates.SelectedValueArray.Contains("4"))
@ -655,15 +655,17 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
Model.View_Hazard_HazardRegister registration = (from x in Funs.DB.View_Hazard_HazardRegister where x.HazardRegisterId == registrationId.ToString() select x).FirstOrDefault();
if (registration != null)
{
if (registration.States == "1" && registration.RectificationPeriod.Value > DateTime.Now)
DateTime RectificationPeriod = DateTime.Parse(registration.RectificationPeriod.Value.ToString("yyyy-MM-dd")).AddDays(1);
if (registration.States == "1" && RectificationPeriod > DateTime.Now)
{
state += "未整改";
}
else if ((registration.States == "2" || registration.States == "3")&& registration.RectificationPeriod.Value>registration.RectificationTime.Value)
else if ((registration.States == "2" || registration.States == "3")&& RectificationPeriod > registration.RectificationTime.Value)
{
state += "按时整改";
}
else if ((registration.States == "2" || registration.States == "3") && registration.RectificationPeriod.Value < registration.RectificationTime.Value)
else if ((registration.States == "2" || registration.States == "3") && RectificationPeriod <= registration.RectificationTime.Value)
{
state += "超期整改";

View File

@ -12,7 +12,7 @@
<appSettings>
<!--连接字符串-->
<!--<add key="ConnectionString" value="Server=.;Database=SGGLDB_CD;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>-->
<add key="ConnectionString" value="Server=.\;Database=SGGLDB_CD;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true; Connect Timeout=1200;Pooling=true; MAX Pool Size=512;Min Pool Size=50;Connection Lifetime=30"/>
<add key="ConnectionString" value="Server=.;Database=SGGLDB_CD;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true; Connect Timeout=1200;Pooling=true; MAX Pool Size=512;Min Pool Size=50;Connection Lifetime=30"/>
<!--系统名称-->
<add key="SystemName" value="数字化施工管理信息平台V1.0"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>