2023-10-08
This commit is contained in:
commit
7d87e48818
Binary file not shown.
|
@ -0,0 +1,47 @@
|
|||
--专项检查检查记录接收人
|
||||
alter table Check_CheckSpecial add ReceiveMan nvarchar(2000) null;
|
||||
|
||||
--States:0-保存 1-提交 2-审核通过 3-已确认
|
||||
|
||||
|
||||
--修改专项检查明细视图
|
||||
/****** Object: View [dbo].[View_CheckSpecialDetail] Script Date: 2023/9/30 11:19:54 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
/*LEFT JOIN Sys_Const AS const ON const.ConstValue = detail.HandleStep and const.GroupId='HandleStep'*/
|
||||
ALTER VIEW [dbo].[View_CheckSpecialDetail]
|
||||
AS
|
||||
SELECT detail.CheckSpecialDetailId, detail.CheckSpecialId, detail.CheckItem, checkItemSet.CheckItemName, detail.Unqualified,
|
||||
detail.SortIndex, detail.UnitId, detail.HandleStep, detail.CompleteStatus,
|
||||
(CASE WHEN detail.CompleteStatus = 1 THEN '合格' ELSE '不合格' END) AS CompleteStatusName, detail.LimitedDate,
|
||||
detail.CompletedDate, detail.CheckContent, detail.CheckArea,
|
||||
workArea.UnitWorkName + (CASE WHEN workArea.ProjectType = '1' THEN '(建筑)' WHEN workArea.ProjectType = '2' THEN '(安装)'
|
||||
ELSE '' END) AS CheckAreaName, detail.DataId, detail.DataType, unit.UnitName,
|
||||
dbo.GetConstTextByIds(detail.HandleStep) AS HandleStepStr,
|
||||
(CASE WHEN detail.DataType LIKE '%1%' THEN '下发整改单:' +
|
||||
(SELECT RectifyNoticesCode
|
||||
FROM Check_RectifyNotices
|
||||
WHERE detail.DataId LIKE '%' + RectifyNoticesId + '%') ELSE '' END)
|
||||
+ (CASE WHEN detail.DataType LIKE '%2%' THEN '下发处罚单:' +
|
||||
(SELECT PunishNoticeCode
|
||||
FROM Check_PunishNotice
|
||||
WHERE detail.DataId LIKE '%' + PunishNoticeId + '%') ELSE '' END)
|
||||
+ (CASE WHEN detail.DataType = '3' THEN '下发暂停令:' +
|
||||
(SELECT PauseNoticeCode
|
||||
FROM Check_PauseNotice
|
||||
WHERE detail.DataId LIKE '%' + PauseNoticeId + '%') ELSE '' END) AS HandleStepLink, detail.HiddenHazardType,
|
||||
(CASE WHEN detail.HiddenHazardType = '3' THEN '重大' WHEN detail.HiddenHazardType = '2' THEN '较大' WHEN detail.HiddenHazardType
|
||||
= '1' THEN '一般' ELSE '' END) AS HiddenHazardTypeName, detail.CheckItemSetId, detail.CheckItemSetContent,
|
||||
detail.Rectification_Date
|
||||
FROM dbo.Check_CheckSpecialDetail AS detail LEFT OUTER JOIN
|
||||
dbo.Technique_CheckItemSet AS checkItemSet ON checkItemSet.CheckItemSetId = detail.CheckItem LEFT OUTER JOIN
|
||||
dbo.Base_Unit AS unit ON unit.UnitId = detail.UnitId LEFT OUTER JOIN
|
||||
dbo.WBS_UnitWork AS workArea ON detail.CheckArea = workArea.UnitWorkId
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
alter table Base_Project add ProjType nvarchar(50) null
|
||||
GO
|
||||
alter table Base_Project add ProjPhase nvarchar(50) null
|
||||
GO
|
|
@ -0,0 +1,31 @@
|
|||
Create VIEW [dbo].[View_QualityAudit_GeneralEquipmentQuality] AS
|
||||
/*机具设备资质信息列表视图*/
|
||||
SELECT equ.GeneralEquipmentQualityId
|
||||
,equ.ProjectId
|
||||
,equ.GeneralEquipmentQualityCode
|
||||
,equ.UnitId
|
||||
,Unit.UnitName
|
||||
,equ.SpecialEquipmentId
|
||||
,sp.SpecialEquipmentName
|
||||
,equ.[IsQualified]
|
||||
,equ.EquipmentCount
|
||||
,equ.InDate
|
||||
,equ.Remark
|
||||
,equ.CompileMan
|
||||
,U.UserName AS CompileManName
|
||||
,equ.CompileDate
|
||||
,equ.QRCodeAttachUrl
|
||||
,REPLACE(a.AttachUrl,'\', '/') AS AttachUrl
|
||||
FROM QualityAudit_GeneralEquipmentQuality AS equ
|
||||
LEFT JOIN Base_Unit AS Unit ON Unit.UnitId=equ.UnitId
|
||||
LEFT JOIN Base_SpecialEquipment AS sp ON equ.SpecialEquipmentId = sp.SpecialEquipmentId
|
||||
LEFT JOIN Sys_User AS U ON U.UserId = equ.CompileMan
|
||||
LEFT JOIN AttachFile AS a ON a.ToKeyId = equ.GeneralEquipmentQualityId
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
update QualityAudit_GeneralEquipmentQuality set QRCodeAttachUrl =NULL
|
||||
GO
|
|
@ -58,7 +58,7 @@ namespace BLL
|
|||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getPerson = from x in db.View_SitePerson_Person
|
||||
where x.PersonId == personId || x.IdentityCard == personId
|
||||
where (x.PersonId == personId || x.IdentityCard == personId)
|
||||
select new Model.PersonItem
|
||||
{
|
||||
PersonId = x.PersonId,
|
||||
|
@ -1752,5 +1752,83 @@ namespace BLL
|
|||
|
||||
return message;
|
||||
}
|
||||
|
||||
#region 二维码扫码获取人员
|
||||
/// <summary>
|
||||
/// 二维码扫码获取人员
|
||||
/// </summary>
|
||||
/// <param name="personId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PersonItem getPersonByPersonIdQrcode(string personId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getPerson = from x in db.View_SitePerson_Person
|
||||
where (x.PersonId == personId || x.IdentityCard == personId) && x.IsUsed == true
|
||||
select new Model.PersonItem
|
||||
{
|
||||
PersonId = x.PersonId,
|
||||
CardNo = x.CardNo,
|
||||
PersonName = x.PersonName,
|
||||
Sex = x.Sex,
|
||||
SexName = x.SexName,
|
||||
IdentityCard = x.IdentityCard,
|
||||
Address = x.Address,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectCode = x.ProjectCode,
|
||||
ProjectName = x.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitCode = x.UnitCode,
|
||||
UnitName = x.UnitName,
|
||||
TeamGroupId = x.TeamGroupId,
|
||||
TeamGroupName = x.TeamGroupName,
|
||||
WorkPostId = x.WorkPostId,
|
||||
WorkPostName = x.WorkPostName,
|
||||
InTime = string.Format("{0:yyyy-MM-dd}", x.InTime),
|
||||
OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime),
|
||||
OutResult = x.OutResult,
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
IsUsed = x.IsUsed,
|
||||
IsUsedName = x.IsUsed == false ? "不启用" : "启用",
|
||||
AuditorId = x.AuditorId,
|
||||
AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
|
||||
IsForeign = x.IsForeign.HasValue ? x.IsForeign : false,
|
||||
IsOutside = x.IsOutside.HasValue ? x.IsOutside : false,
|
||||
AuditorDate = string.Format("{0:yyyy-MM-dd}", x.AuditorDate),
|
||||
AttachUrl1 = x.IDCardUrl == null ? APIUpLoadFileService.getFileUrl(personId + "#1", null) : x.IDCardUrl.Replace('\\', '/'),
|
||||
AttachUrl2 = APIUpLoadFileService.getFileUrl(personId + "#2", null),
|
||||
AttachUrl3 = APIUpLoadFileService.getFileUrl(personId + "#3", null),
|
||||
AttachUrl4 = getAttachUrl4(x.PersonId),
|
||||
AttachUrl5 = APIUpLoadFileService.getFileUrl(personId + "#5", null),
|
||||
IdcardType = x.IdcardType,
|
||||
IdcardTypeName = x.IdcardTypeName,
|
||||
IdcardStartDate = string.Format("{0:yyyy-MM-dd}", x.IdcardStartDate),
|
||||
IdcardEndDate = string.Format("{0:yyyy-MM-dd}", x.IdcardEndDate),
|
||||
IdcardForever = x.IdcardForever,
|
||||
IdcardForeverStr = x.IdcardForeverStr,
|
||||
PoliticsStatus = x.PoliticsStatus,
|
||||
PoliticsStatusName = x.PoliticsStatusName,
|
||||
IdcardAddress = x.IdcardAddress,
|
||||
Nation = x.Nation,
|
||||
NationName = x.NationName,
|
||||
EduLevel = x.EduLevel,
|
||||
EduLevelName = x.EduLevelName,
|
||||
MaritalStatus = x.MaritalStatus,
|
||||
MaritalStatusName = x.MaritalStatusName,
|
||||
CountryCode = x.CountryCode,
|
||||
CountryName = x.CountryName,
|
||||
ProvinceCode = x.ProvinceCode,
|
||||
ProvinceName = x.ProvinceName,
|
||||
MainCNProfessionalId = x.MainCNProfessionalId,
|
||||
MainCNProfessionalName = x.MainCNProfessionalName,
|
||||
ViceCNProfessionalId = x.ViceCNProfessionalId,
|
||||
ViceCNProfessionalName = x.ViceCNProfessionalName
|
||||
};
|
||||
return getPerson.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,37 +14,96 @@ namespace BLL
|
|||
/// </summary>
|
||||
/// <param name="CheckSpecialId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.CheckSpecialItem getCheckSpecialById(string CheckSpecialId)
|
||||
public static Model.CheckSpecialItem getCheckSpecialById(string CheckSpecialId,string state="0")
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getInfo = from x in db.Check_CheckSpecial
|
||||
where x.CheckSpecialId == CheckSpecialId
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
ProjectId = x.ProjectId,
|
||||
CheckSpecialCode = x.CheckSpecialCode,
|
||||
CheckTypeName = (x.CheckType == "1" ? "联合" : "专项"),
|
||||
CheckType = x.CheckType,
|
||||
CheckItemSetId = x.CheckItemSetId,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName,
|
||||
CheckPersonId = x.CheckPerson,
|
||||
CheckPersonName = db.Sys_User.First(u => u.UserId == x.CheckPerson).UserName,
|
||||
CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime),
|
||||
DaySummary = x.DaySummary,
|
||||
PartInUnitIds = x.PartInUnits,
|
||||
PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits),
|
||||
PartInPersonIds = x.PartInPersonIds,
|
||||
PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds),
|
||||
PartInPersonNames2 = x.PartInPersonNames,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId),
|
||||
};
|
||||
return getInfo.FirstOrDefault();
|
||||
if (state == "0")
|
||||
{
|
||||
//状态是0的时候查看所有
|
||||
var getInfo = from x in db.Check_CheckSpecial
|
||||
where x.CheckSpecialId == CheckSpecialId
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
ProjectId = x.ProjectId,
|
||||
CheckSpecialCode = x.CheckSpecialCode,
|
||||
CheckTypeName = (x.CheckType == "1" ? "联合" : "专项"),
|
||||
CheckType = x.CheckType,
|
||||
CheckItemSetId = x.CheckItemSetId,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName,
|
||||
CheckPersonId = x.CheckPerson,
|
||||
CheckPersonName = db.Sys_User.First(u => u.UserId == x.CheckPerson).UserName,
|
||||
CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime),
|
||||
DaySummary = x.DaySummary,
|
||||
PartInUnitIds = x.PartInUnits,
|
||||
PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits),
|
||||
PartInPersonIds = x.PartInPersonIds,
|
||||
PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds),
|
||||
PartInPersonNames2 = x.PartInPersonNames,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId,"0"),
|
||||
|
||||
ResponsibleUnit = x.ResponsibleUnit,
|
||||
ResponsibleUnitName = UnitService.GetUnitNameByUnitId(x.ResponsibleUnit),
|
||||
WorkAreaId = x.WorkAreaId,
|
||||
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
|
||||
QuestionType = x.QuestionType,
|
||||
QuestionTypeName = UnitService.GetQuestionTypeId(x.QuestionType),
|
||||
|
||||
ResponsibleMan = x.ResponsibleMan,
|
||||
ReceiveMan = x.ReceiveMan,
|
||||
ReceiveManName = UserService.getUserNamesUserIds(x.ReceiveMan)
|
||||
|
||||
};
|
||||
return getInfo.FirstOrDefault();
|
||||
}
|
||||
else {
|
||||
//状态是1的时候查看不合格的子项
|
||||
var getInfo = from x in db.Check_CheckSpecial
|
||||
where x.CheckSpecialId == CheckSpecialId
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
ProjectId = x.ProjectId,
|
||||
CheckSpecialCode = x.CheckSpecialCode,
|
||||
CheckTypeName = (x.CheckType == "1" ? "联合" : "专项"),
|
||||
CheckType = x.CheckType,
|
||||
CheckItemSetId = x.CheckItemSetId,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName,
|
||||
CheckPersonId = x.CheckPerson,
|
||||
CheckPersonName = db.Sys_User.First(u => u.UserId == x.CheckPerson).UserName,
|
||||
CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime),
|
||||
DaySummary = x.DaySummary,
|
||||
PartInUnitIds = x.PartInUnits,
|
||||
PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits),
|
||||
PartInPersonIds = x.PartInPersonIds,
|
||||
PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds),
|
||||
PartInPersonNames2 = x.PartInPersonNames,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId,"1"),
|
||||
|
||||
ResponsibleUnit = x.ResponsibleUnit,
|
||||
ResponsibleUnitName = UnitService.GetUnitNameByUnitId(x.ResponsibleUnit),
|
||||
WorkAreaId = x.WorkAreaId,
|
||||
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
|
||||
QuestionType = x.QuestionType,
|
||||
QuestionTypeName = UnitService.GetQuestionTypeId(x.QuestionType),
|
||||
|
||||
ResponsibleMan = x.ResponsibleMan,
|
||||
ReceiveMan = x.ReceiveMan,
|
||||
ReceiveManName = UserService.getUserNamesUserIds(x.ReceiveMan)
|
||||
|
||||
};
|
||||
return getInfo.FirstOrDefault();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
@ -56,12 +115,14 @@ namespace BLL
|
|||
/// <param name="projectId"></param>
|
||||
/// <param name="states"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.CheckSpecialItem> getCheckSpecialList(string projectId, string states)
|
||||
public static List<Model.CheckSpecialItem> getCheckSpecialList(string projectId, string states,string userid)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getCheckSpecial = from x in db.Check_CheckSpecial
|
||||
where x.ProjectId == projectId && x.States ==states
|
||||
//当前保存人、审核人、确认人能看到
|
||||
&&(x.CompileMan==userid || x.ResponsibleMan==userid || userid.Split(',').Contains(x.ReceiveMan))
|
||||
orderby x.CheckSpecialCode descending
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
|
@ -85,6 +146,8 @@ namespace BLL
|
|||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
ReceiveMan=x.ReceiveMan,
|
||||
ReceiveManName= UserService.getUserNamesUserIds(x.ReceiveMan)
|
||||
};
|
||||
return getCheckSpecial.ToList();
|
||||
}
|
||||
|
@ -117,18 +180,39 @@ namespace BLL
|
|||
PartInPersons = UserService.getUserNamesUserIds(newItem.PartInPersonIds),
|
||||
PartInPersonNames = newItem.PartInPersonNames2,
|
||||
CompileMan = newItem.CompileManId,
|
||||
States = Const.State_0,
|
||||
States = newItem.States,
|
||||
|
||||
ResponsibleUnit=newItem.ResponsibleUnit,
|
||||
WorkAreaId=newItem.WorkAreaId,
|
||||
QuestionType=newItem.QuestionType,
|
||||
//审核人
|
||||
ResponsibleMan=newItem.ResponsibleMan,
|
||||
ReceiveMan=newItem.ReceiveMan
|
||||
};
|
||||
//if (newItem.States != Const.State_1)
|
||||
//{
|
||||
// newCheckSpecial.States = Const.State_0;
|
||||
//}
|
||||
|
||||
if (newItem.CheckSpecialDetailItems == null || newItem.CheckSpecialDetailItems.Count() == 0)
|
||||
//if (newItem.CheckSpecialDetailItems == null || newItem.CheckSpecialDetailItems.Count() == 0)
|
||||
//{
|
||||
// if (newItem.States == Const.State_1)
|
||||
// {
|
||||
// newCheckSpecial.States = Const.State_2;
|
||||
// }
|
||||
//}
|
||||
|
||||
//如果审核状态不为空
|
||||
if (!string.IsNullOrEmpty(newItem.AuditState))
|
||||
{
|
||||
if (newItem.States == Const.State_1)
|
||||
//不同意的话
|
||||
if (newItem.AuditState=="0")
|
||||
{
|
||||
newCheckSpecial.States = Const.State_2;
|
||||
newCheckSpecial.States = "0";
|
||||
}
|
||||
else if (newItem.AuditState=="1")
|
||||
{
|
||||
newCheckSpecial.States = "2";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,31 +251,32 @@ namespace BLL
|
|||
SaveCheckSpecialDetail(item);
|
||||
}
|
||||
//// 单据完成后 系统自动按照单位 整改要求生成隐患整改单
|
||||
if (newItem.States == Const.State_1)
|
||||
{
|
||||
var getC = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false);
|
||||
if (getC == null)
|
||||
{
|
||||
newCheckSpecial.States = Const.State_2;
|
||||
Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
|
||||
}
|
||||
else
|
||||
{
|
||||
var getNA = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false && (x.HandleStep== null || x.HandleStep==""));
|
||||
if (getNA == null)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message += "存在待整改,没有处理措施的记录!";
|
||||
}
|
||||
}
|
||||
}
|
||||
///五环不需要
|
||||
//if (newItem.States == Const.State_1)
|
||||
//{
|
||||
// var getC = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false);
|
||||
// if (getC == null)
|
||||
// {
|
||||
// newCheckSpecial.States = Const.State_2;
|
||||
// Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var getNA = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false && (x.HandleStep== null || x.HandleStep==""));
|
||||
// if (getNA == null)
|
||||
// {
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// message += "存在待整改,没有处理措施的记录!";
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
@ -204,42 +289,83 @@ namespace BLL
|
|||
/// </summary>
|
||||
/// <param name="checkSpecialId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.CheckSpecialDetailItem> getCheckSpecialDetailList(string checkSpecialId)
|
||||
public static List<Model.CheckSpecialDetailItem> getCheckSpecialDetailList(string checkSpecialId,string CompleteStatus="0")
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getInfo = from x in db.Check_CheckSpecialDetail
|
||||
where x.CheckSpecialId == checkSpecialId
|
||||
orderby x.SortIndex
|
||||
select new Model.CheckSpecialDetailItem
|
||||
{
|
||||
CheckSpecialDetailId = x.CheckSpecialDetailId,
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
CheckItemSetId = x.CheckItem,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItem).CheckItemName,
|
||||
CheckContent = x.CheckContent,
|
||||
SortIndex = x.SortIndex,
|
||||
Unqualified = x.Unqualified,
|
||||
Suggestions = x.Suggestions,
|
||||
WorkArea = db.WBS_UnitWork.First(y=>y.UnitWorkId ==x.CheckArea).UnitWorkName,
|
||||
WorkAreaId=x.CheckArea,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
HandleStep = x.HandleStep,
|
||||
HandleStepName = getNames(x.HandleStep),
|
||||
HiddenHazardType = x.HiddenHazardType,
|
||||
HiddenHazardTypeName = x.HiddenHazardType == "3" ? "重大" : (x.HiddenHazardType == "2" ? "较大" : "一般"),
|
||||
LimitedDate = string.Format("{0:yyyy-MM-dd}", x.LimitedDate),
|
||||
CompleteStatus = x.CompleteStatus,
|
||||
CompleteStatusName = x.CompleteStatus == true ? "已整改" : "待整改",
|
||||
CompletedDate = string.Format("{0:yyyy-MM-dd}", x.CompletedDate),
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null),
|
||||
if (CompleteStatus == "0")
|
||||
{
|
||||
var getInfo = from x in db.Check_CheckSpecialDetail
|
||||
where x.CheckSpecialId == checkSpecialId
|
||||
orderby x.SortIndex
|
||||
select new Model.CheckSpecialDetailItem
|
||||
{
|
||||
CheckSpecialDetailId = x.CheckSpecialDetailId,
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
CheckItemSetId = x.CheckItem,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItem).CheckItemName,
|
||||
CheckContent = x.CheckContent,
|
||||
SortIndex = x.SortIndex,
|
||||
Unqualified = x.Unqualified,
|
||||
Suggestions = x.Suggestions,
|
||||
WorkArea = db.WBS_UnitWork.First(y => y.UnitWorkId == x.CheckArea).UnitWorkName,
|
||||
WorkAreaId = x.CheckArea,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
HandleStep = x.HandleStep,
|
||||
HandleStepName = getNames(x.HandleStep),
|
||||
HiddenHazardType = x.HiddenHazardType,
|
||||
HiddenHazardTypeName = x.HiddenHazardType == "3" ? "重大" : (x.HiddenHazardType == "2" ? "较大" : "一般"),
|
||||
LimitedDate = string.Format("{0:yyyy-MM-dd}", x.LimitedDate),
|
||||
CompleteStatus = x.CompleteStatus,
|
||||
CompleteStatusName = x.CompleteStatus == true ? "已整改" : "待整改",
|
||||
CompletedDate = string.Format("{0:yyyy-MM-dd}", x.CompletedDate),
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null),
|
||||
|
||||
CheckItemDetailSetId = x.CheckItemSetId,
|
||||
CheckItemDetailContent = x.CheckItemSetContent,
|
||||
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
|
||||
CheckOpinions = x.CheckOpinions,
|
||||
};
|
||||
return getInfo.ToList();
|
||||
}
|
||||
else {
|
||||
//查询不合格子项
|
||||
var getInfo = from x in db.Check_CheckSpecialDetail
|
||||
where x.CheckSpecialId == checkSpecialId && x.CompleteStatus==false
|
||||
orderby x.SortIndex
|
||||
select new Model.CheckSpecialDetailItem
|
||||
{
|
||||
CheckSpecialDetailId = x.CheckSpecialDetailId,
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
CheckItemSetId = x.CheckItem,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItem).CheckItemName,
|
||||
CheckContent = x.CheckContent,
|
||||
SortIndex = x.SortIndex,
|
||||
Unqualified = x.Unqualified,
|
||||
Suggestions = x.Suggestions,
|
||||
WorkArea = db.WBS_UnitWork.First(y => y.UnitWorkId == x.CheckArea).UnitWorkName,
|
||||
WorkAreaId = x.CheckArea,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
HandleStep = x.HandleStep,
|
||||
HandleStepName = getNames(x.HandleStep),
|
||||
HiddenHazardType = x.HiddenHazardType,
|
||||
HiddenHazardTypeName = x.HiddenHazardType == "3" ? "重大" : (x.HiddenHazardType == "2" ? "较大" : "一般"),
|
||||
LimitedDate = string.Format("{0:yyyy-MM-dd}", x.LimitedDate),
|
||||
CompleteStatus = x.CompleteStatus,
|
||||
CompleteStatusName = x.CompleteStatus == true ? "已整改" : "待整改",
|
||||
CompletedDate = string.Format("{0:yyyy-MM-dd}", x.CompletedDate),
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null),
|
||||
|
||||
CheckItemDetailSetId = x.CheckItemSetId,
|
||||
CheckItemDetailContent = x.CheckItemSetContent,
|
||||
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
|
||||
CheckOpinions = x.CheckOpinions,
|
||||
};
|
||||
return getInfo.ToList();
|
||||
}
|
||||
|
||||
CheckItemDetailSetId = x.CheckItemSetId,
|
||||
CheckItemDetailContent = x.CheckItemSetContent,
|
||||
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
|
||||
};
|
||||
return getInfo.ToList();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -290,6 +416,7 @@ namespace BLL
|
|||
CheckItemDetailSetId=x.CheckItemSetId,
|
||||
CheckItemDetailContent=x.CheckItemSetContent,
|
||||
Rectification_Date= string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
|
||||
CheckOpinions=x.CheckOpinions
|
||||
};
|
||||
return getInfo.First();
|
||||
}
|
||||
|
@ -316,7 +443,7 @@ namespace BLL
|
|||
UnitId = newDetail.UnitId,
|
||||
HandleStep = newDetail.HandleStep,
|
||||
HiddenHazardType = newDetail.HiddenHazardType,
|
||||
CompleteStatus = newDetail.CompleteStatus ?? false,
|
||||
CompleteStatus = newDetail.CompleteStatus,
|
||||
RectifyNoticeId = newDetail.RectifyNoticeId,
|
||||
LimitedDate = Funs.GetNewDateTime(newDetail.LimitedDate),
|
||||
CompletedDate = Funs.GetNewDateTime(newDetail.CompletedDate),
|
||||
|
@ -325,10 +452,11 @@ namespace BLL
|
|||
CheckArea = newDetail.WorkAreaId,
|
||||
CheckContent = newDetail.CheckContent,
|
||||
|
||||
//整改日期、检查内容、检查内容id
|
||||
//整改日期、检查内容、检查内容id、处理意见
|
||||
CheckItemSetId= newDetail.CheckItemDetailSetId,
|
||||
CheckItemSetContent= newDetail.CheckItemDetailContent,
|
||||
Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date)
|
||||
Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date),
|
||||
CheckOpinions=newDetail.CheckOpinions,
|
||||
};
|
||||
if (newCheckSpecialDetail.CompleteStatus == false && newCheckSpecialDetail.HandleStep.Contains("1") && string.IsNullOrEmpty(newCheckSpecialDetail.HiddenHazardType))
|
||||
{
|
||||
|
@ -371,10 +499,11 @@ namespace BLL
|
|||
updateDetail.CheckArea = newCheckSpecialDetail.CheckArea;
|
||||
updateDetail.CheckContent = newCheckSpecialDetail.CheckContent;
|
||||
|
||||
//整改日期、检查内容、检查内容id
|
||||
//整改日期、检查内容、检查内容id、处理意见
|
||||
updateDetail.CheckItemSetId = newDetail.CheckItemDetailSetId;
|
||||
updateDetail.CheckItemSetContent = newDetail.CheckItemDetailContent;
|
||||
updateDetail.Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date);
|
||||
updateDetail.CheckOpinions = newDetail.CheckOpinions;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
////保存附件
|
||||
|
|
|
@ -0,0 +1,148 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EmitMapper;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class APIGeneralEquipmentQualityService
|
||||
{
|
||||
#region 根据equipmentQualityId获取机具设备信息
|
||||
/// <summary>
|
||||
/// 根据equipmentQualityId获取机具设备信息
|
||||
/// </summary>
|
||||
/// <param name="equipmentQualityId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.EquipmentQualityItem getEquipmentQualityByEquipmentQualityIdFactoryCode(string equipmentQualityId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getEquipmentQuality = (from x in db.View_QualityAudit_GeneralEquipmentQuality
|
||||
where x.GeneralEquipmentQualityId == equipmentQualityId
|
||||
select new Model.EquipmentQualityItem
|
||||
{
|
||||
EquipmentQualityId = x.GeneralEquipmentQualityId,
|
||||
ProjectId = x.ProjectId,
|
||||
EquipmentQualityCode = x.GeneralEquipmentQualityCode,
|
||||
EquipmentCount = x.EquipmentCount.HasValue? x.EquipmentCount.Value.ToString():"",
|
||||
UnitId = x.UnitId,
|
||||
IsQualified =x.IsQualified.HasValue? x.IsQualified.Value?"是":"否":"",
|
||||
UnitName = x.UnitName,
|
||||
SpecialEquipmentName = x.SpecialEquipmentName,
|
||||
InDate = string.Format("{0:yyyy-MM-dd}", x.InDate),
|
||||
Remark = x.Remark,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = x.CompileManName,
|
||||
CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate),
|
||||
AttachUrl = x.AttachUrl.Replace('\\', '/')
|
||||
}); ;
|
||||
return getEquipmentQuality.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取机具设备列表信息
|
||||
/// <summary>
|
||||
/// 获取机具设备列表信息
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="strParam"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.EquipmentQualityItem> getEquipmentQualityList(string projectId, string unitId, string strParam)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getEquipmentQuality = from x in db.View_QualityAudit_GeneralEquipmentQuality
|
||||
where x.ProjectId == projectId && (x.UnitId == unitId || unitId == null)
|
||||
&& (strParam == null || x.SpecialEquipmentName.Contains(strParam) )
|
||||
orderby x.GeneralEquipmentQualityCode descending
|
||||
select new Model.EquipmentQualityItem
|
||||
{
|
||||
EquipmentQualityId = x.GeneralEquipmentQualityId,
|
||||
ProjectId = x.ProjectId,
|
||||
EquipmentQualityCode = x.GeneralEquipmentQualityCode,
|
||||
EquipmentCount = x.EquipmentCount.HasValue ? x.EquipmentCount.Value.ToString() : "",
|
||||
UnitId = x.UnitId,
|
||||
IsQualified = x.IsQualified.HasValue ? x.IsQualified.Value ? "是" : "否" : "",
|
||||
UnitName = x.UnitName,
|
||||
SpecialEquipmentName = x.SpecialEquipmentName,
|
||||
InDate = string.Format("{0:yyyy-MM-dd}", x.InDate),
|
||||
Remark = x.Remark,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = x.CompileManName,
|
||||
CompileDate = string.Format("{0:yyyy-MM-dd}", x.CompileDate),
|
||||
AttachUrl = x.AttachUrl.Replace('\\', '/')
|
||||
};
|
||||
return getEquipmentQuality.ToList();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存QualityAudit_EquipmentQuality
|
||||
/// <summary>
|
||||
/// 保存QualityAudit_EquipmentQuality
|
||||
/// </summary>
|
||||
/// <param name="newItem">机具设备资质</param>
|
||||
/// <returns></returns>
|
||||
public static void SaveEquipmentQuality(Model.EquipmentQualityItem newItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.QualityAudit_GeneralEquipmentQuality newEquipmentQuality = new Model.QualityAudit_GeneralEquipmentQuality
|
||||
{
|
||||
GeneralEquipmentQualityId = newItem.EquipmentQualityId,
|
||||
ProjectId = newItem.ProjectId,
|
||||
GeneralEquipmentQualityCode = newItem.EquipmentQualityCode,
|
||||
UnitId = newItem.UnitId,
|
||||
SpecialEquipmentId = newItem.SpecialEquipmentId,
|
||||
InDate = Funs.GetNewDateTime(newItem.InDate),
|
||||
Remark = newItem.Remark,
|
||||
CompileMan = newItem.CompileManId,
|
||||
};
|
||||
if (!string.IsNullOrEmpty(newItem.IsQualified))
|
||||
{
|
||||
if ("1".Equals(newItem.IsQualified))
|
||||
{
|
||||
newEquipmentQuality.IsQualified = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
newEquipmentQuality.IsQualified = false;
|
||||
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(newItem.EquipmentCount))
|
||||
{
|
||||
try
|
||||
{
|
||||
newEquipmentQuality.EquipmentCount = int.Parse(newItem.EquipmentCount);
|
||||
}
|
||||
catch (Exception e) { }
|
||||
}
|
||||
var updateEquipmentQuality = db.QualityAudit_GeneralEquipmentQuality.FirstOrDefault(x => x.GeneralEquipmentQualityId == newItem.EquipmentQualityId);
|
||||
if (updateEquipmentQuality == null)
|
||||
{
|
||||
newEquipmentQuality.CompileDate = DateTime.Now;
|
||||
newEquipmentQuality.GeneralEquipmentQualityId = SQLHelper.GetNewID();
|
||||
newEquipmentQuality.GeneralEquipmentQualityCode = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.GeneralEquipmentQualityMenuId, newItem.ProjectId, newItem.UnitId);
|
||||
GeneralEquipmentQualityService.AddGeneralEquipmentQuality(newEquipmentQuality);
|
||||
}
|
||||
else
|
||||
{
|
||||
GeneralEquipmentQualityService.UpdateGeneralEquipmentQuality(newEquipmentQuality);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(newItem.AttachUrl))
|
||||
{
|
||||
////保存附件
|
||||
UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl, 10, null), newItem.AttachUrl, Const.GeneralEquipmentQualityMenuId, newEquipmentQuality.GeneralEquipmentQualityId);
|
||||
}
|
||||
else
|
||||
{
|
||||
CommonService.DeleteAttachFileById(newEquipmentQuality.GeneralEquipmentQualityId);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -357,22 +357,42 @@ namespace BLL
|
|||
/// <param name="supTypeId"></param>
|
||||
/// <param name="checkType">1-checkType;2-专项检查;3-综合检查</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ResourcesItem> getCheckItemSetListBySupCheckItemId(string supTypeId, string checkType)
|
||||
public static List<Model.ResourcesItem> getCheckItemSetListBySupCheckItemId(string supTypeId, string checkType,string supName="")
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = from x in db.Technique_CheckItemSet
|
||||
where x.CheckType == checkType && (x.SupCheckItem == supTypeId || (supTypeId == null && x.SupCheckItem == "0"))
|
||||
orderby x.SortIndex
|
||||
select new Model.ResourcesItem
|
||||
{
|
||||
ResourcesId = x.CheckItemSetId,
|
||||
ResourcesCode = x.MapCode,
|
||||
ResourcesName = x.CheckItemName,
|
||||
SupResourcesId = x.SupCheckItem,
|
||||
IsEndLever = x.IsEndLever,
|
||||
};
|
||||
return getDataLists.ToList();
|
||||
if (!string.IsNullOrEmpty(supName))
|
||||
{
|
||||
var getDataLists = from x in db.Technique_CheckItemSet
|
||||
where x.CheckType == checkType && (x.SupCheckItem == supTypeId || (supTypeId == null && x.SupCheckItem == "0"))
|
||||
&& x.CheckItemName.Contains(supName)
|
||||
orderby x.SortIndex
|
||||
select new Model.ResourcesItem
|
||||
{
|
||||
ResourcesId = x.CheckItemSetId,
|
||||
ResourcesCode = x.MapCode,
|
||||
ResourcesName = x.CheckItemName,
|
||||
SupResourcesId = x.SupCheckItem,
|
||||
IsEndLever = x.IsEndLever,
|
||||
};
|
||||
return getDataLists.ToList();
|
||||
}
|
||||
else {
|
||||
var getDataLists = from x in db.Technique_CheckItemSet
|
||||
where x.CheckType == checkType && (x.SupCheckItem == supTypeId || (supTypeId == null && x.SupCheckItem == "0"))
|
||||
orderby x.SortIndex
|
||||
select new Model.ResourcesItem
|
||||
{
|
||||
ResourcesId = x.CheckItemSetId,
|
||||
ResourcesCode = x.MapCode,
|
||||
ResourcesName = x.CheckItemName,
|
||||
SupResourcesId = x.SupCheckItem,
|
||||
IsEndLever = x.IsEndLever,
|
||||
};
|
||||
return getDataLists.ToList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
<Compile Include="API\HJGL\APIPreWeldingDailyService.cs" />
|
||||
<Compile Include="API\HJGL\APIReportQueryService.cs" />
|
||||
<Compile Include="API\HJGL\APITestPackageService.cs" />
|
||||
<Compile Include="API\HSSE\APIGeneralEquipmentQualityService.cs" />
|
||||
<Compile Include="API\HSSE\APIPageDataService.cs" />
|
||||
<Compile Include="API\HSSE\APIChartAnalysisService.cs" />
|
||||
<Compile Include="API\HSSE\APICheckSpecialService.cs" />
|
||||
|
@ -174,6 +175,7 @@
|
|||
<Compile Include="Common\CommonService.cs" />
|
||||
<Compile Include="Common\CreateQRCodeService.cs" />
|
||||
<Compile Include="Common\IDCardValid.cs" />
|
||||
<Compile Include="Common\NPOIExcel.cs" />
|
||||
<Compile Include="Common\NPOIHelper.cs" />
|
||||
<Compile Include="Common\PrinterDocService.cs" />
|
||||
<Compile Include="Common\ProjectDataFlowSetService.cs" />
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -244,7 +244,8 @@ namespace BLL
|
|||
{
|
||||
Model.RectifyNoticesItemItem newRItem = new Model.RectifyNoticesItemItem
|
||||
{
|
||||
WrongContent = item.Unqualified
|
||||
//WrongContent = item.Unqualified
|
||||
WrongContent = item.CheckItemSetContent
|
||||
};
|
||||
if (string.IsNullOrEmpty(rectifyNotices.CheckSpecialDetailId))
|
||||
{
|
||||
|
@ -298,7 +299,8 @@ namespace BLL
|
|||
foreach (var item in getUnitDItem)
|
||||
{
|
||||
Model.PunishNoticeItemItem newPItem = new Model.PunishNoticeItemItem();
|
||||
newPItem.PunishContent = item.Unqualified;
|
||||
//newPItem.PunishContent = item.Unqualified;
|
||||
newPItem.PunishContent = item.CheckItemSetContent;
|
||||
newPItem.SortIndex = item.SortIndex;
|
||||
punishNotice.PunishNoticeItemItem.Add(newPItem);
|
||||
if (string.IsNullOrEmpty(punishNotice.CheckSpecialDetailId))
|
||||
|
@ -335,7 +337,8 @@ namespace BLL
|
|||
foreach (var item in getUnitDItem)
|
||||
{
|
||||
Model.RectifyNoticesItemItem newRItem = new Model.RectifyNoticesItemItem();
|
||||
pauseNotice.ThirdContent += item.Unqualified;
|
||||
//pauseNotice.ThirdContent += item.Unqualified;
|
||||
pauseNotice.ThirdContent += item.CheckItemSetContent;
|
||||
string checkAreaName= UnitWorkService.GetNameById(item.CheckArea);
|
||||
if (!string.IsNullOrEmpty(checkAreaName))
|
||||
{
|
||||
|
|
|
@ -138,6 +138,8 @@
|
|||
HJProjectCode = project.HJProjectCode,
|
||||
KZProjectCode = project.KZProjectCode,
|
||||
Progress = project.Progress,
|
||||
ProjType = project.ProjType,
|
||||
ProjPhase = project.ProjPhase,
|
||||
};
|
||||
db.Base_Project.InsertOnSubmit(newProject);
|
||||
db.SubmitChanges();
|
||||
|
@ -186,6 +188,8 @@
|
|||
newProject.HJProjectCode = project.HJProjectCode;
|
||||
newProject.KZProjectCode = project.KZProjectCode;
|
||||
newProject.Progress = project.Progress;
|
||||
newProject.ProjType = project.ProjType;
|
||||
newProject.ProjPhase = project.ProjPhase;
|
||||
db.SubmitChanges();
|
||||
HSEDataCollectService.ProjectHSEDataCollectSubmission(newProject);
|
||||
}
|
||||
|
|
|
@ -761,5 +761,21 @@ namespace BLL
|
|||
return q;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取问题类型名称
|
||||
/// </summary>
|
||||
/// <param name="UnitId"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetQuestionTypeId(string RegisterTypesId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
var unit = Funs.DB.HSSE_Hazard_HazardRegisterTypes.FirstOrDefault(x => x.RegisterTypesId == RegisterTypesId);
|
||||
if (unit != null)
|
||||
{
|
||||
name = unit.RegisterTypesName;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3193,3 +3193,25 @@ IP地址:::1
|
|||
|
||||
出错时间:09/26/2023 18:55:14
|
||||
|
||||
|
||||
错误信息开始=====>
|
||||
错误类型:JsonReaderException
|
||||
错误信息:Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 1, position 1.
|
||||
错误堆栈:
|
||||
在 Newtonsoft.Json.Linq.JArray.Load(JsonReader reader, JsonLoadSettings settings)
|
||||
在 Newtonsoft.Json.Linq.JArray.Parse(String json, JsonLoadSettings settings)
|
||||
在 Newtonsoft.Json.Linq.JArray.Parse(String json)
|
||||
在 FineUIPro.Web.ProjectData.Installation.btnMenuDown_Click(Object sender, EventArgs e) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\Installation.aspx.cs:行号 257
|
||||
在 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)
|
||||
出错时间:10/07/2023 16:42:46
|
||||
出错文件:http://localhost:8579/ProjectData/Installation.aspx
|
||||
IP地址:::1
|
||||
操作人员:JT
|
||||
|
||||
出错时间:10/07/2023 16:42:46
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
专项检查
|
||||
项目名称: 编号:
|
||||
|
||||
|检查类别 | |检查日期 | |
|
||||
|参检人员 | |
|
||||
|
||||
|
||||
序号 |单位工程 |受检单位 |问题描述 |问题类型 |处理结果 |隐患类别 | |
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Aspose.Words;
|
||||
using Aspose.Words.Tables;
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -45,7 +46,7 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
Technique_CheckItemSetService.InitCheckItemSetDropDownList(this.drpSupCheckItemSet, "2", "0", true);
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
btnNew.OnClientClick = Window1.GetShowReference("CheckSpecialEdit.aspx") + "return false;";
|
||||
//btnNew.OnClientClick = Window1.GetShowReference("CheckSpecialEdit.aspx") + "return false;";
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
|
@ -203,7 +204,9 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckSpecialEdit.aspx?CheckSpecialId={0}", CheckSpecialId, "编辑 - ")));
|
||||
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckSpecialEdit.aspx?CheckSpecialId={0}", CheckSpecialId, "编辑 - ")));
|
||||
//pc端只有台账
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckSpecialView.aspx?CheckSpecialId={0}", CheckSpecialId, "查看 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +257,7 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
//this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
|
@ -357,7 +360,7 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
initTemplatePath = "File\\Word\\HSSE\\专项检查.doc";
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc");
|
||||
filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf");
|
||||
//filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf");
|
||||
if (File.Exists(newUrl)) {
|
||||
File.Delete(newUrl);
|
||||
}
|
||||
|
@ -427,6 +430,65 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
}
|
||||
|
||||
}
|
||||
Bookmark bookmarkWorkAreaName = doc.Range.Bookmarks["WorkAreaName"];
|
||||
if (bookmarkWorkAreaName != null)
|
||||
{
|
||||
if (checkSpecial != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(checkSpecial.WorkAreaId))
|
||||
{
|
||||
bookmarkWorkAreaName.Text = UnitWorkService.GetUnitWorkName(checkSpecial.WorkAreaId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Bookmark bookmarkResponsibleName = doc.Range.Bookmarks["ResponsibleName"];
|
||||
if (bookmarkResponsibleName != null)
|
||||
{
|
||||
if (checkSpecial != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(checkSpecial.ResponsibleUnit))
|
||||
{
|
||||
bookmarkResponsibleName.Text = UnitService.GetUnitNameByUnitId(checkSpecial.ResponsibleUnit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Bookmark bookmarkQuestionName = doc.Range.Bookmarks["QuestionName"];
|
||||
if (bookmarkQuestionName != null)
|
||||
{
|
||||
if (checkSpecial != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(checkSpecial.QuestionType))
|
||||
{
|
||||
bookmarkQuestionName.Text = UnitService.GetQuestionTypeId(checkSpecial.QuestionType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Bookmark bookmarkPartInPersonNames = doc.Range.Bookmarks["PartInPersonNames"];
|
||||
if (bookmarkPartInPersonNames != null)
|
||||
{
|
||||
if (checkSpecial != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(checkSpecial.PartInPersonNames))
|
||||
{
|
||||
bookmarkPartInPersonNames.Text = checkSpecial.PartInPersonNames;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//WorkAreaName
|
||||
// ResponsibleName
|
||||
// QuestionName
|
||||
// PartInPersonNames
|
||||
//专项检查列表
|
||||
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("tab");
|
||||
|
@ -443,6 +505,57 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
int num = 1;
|
||||
#region 插入表头
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 40;
|
||||
builder.Write("序号");
|
||||
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 100;
|
||||
builder.Write("问题描述");
|
||||
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 250;
|
||||
builder.CellFormat.WrapText = true;
|
||||
builder.Write("检查内容");
|
||||
|
||||
//builder.InsertCell();
|
||||
//builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
//builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
//builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
//builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
//builder.CellFormat.Width = 60;
|
||||
//builder.Write("处理结果");
|
||||
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 60;
|
||||
builder.Write("整改期限");
|
||||
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 60;
|
||||
builder.Write("处理措施");
|
||||
builder.EndRow();
|
||||
#endregion
|
||||
foreach (Model.View_CheckSpecialDetail detail in checkSpecialDetails)
|
||||
{
|
||||
//序号
|
||||
|
@ -451,80 +564,89 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 20;
|
||||
builder.CellFormat.Width = 40;
|
||||
builder.Write(num.ToString());
|
||||
//单位工程
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 55;
|
||||
builder.Write(string.IsNullOrEmpty(detail.CheckAreaName) ? "" : detail.CheckAreaName);
|
||||
//单位
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 120;
|
||||
builder.Write(string.IsNullOrEmpty(detail.UnitName) ? "" : detail.UnitName);
|
||||
////单位工程
|
||||
//builder.InsertCell();
|
||||
//builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
//builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
//builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
//builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
//builder.CellFormat.Width = 60;
|
||||
//builder.Write(string.IsNullOrEmpty(detail.CheckAreaName) ? "" : detail.CheckAreaName);
|
||||
////单位
|
||||
//builder.InsertCell();
|
||||
//builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
//builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
//builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
//builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
//builder.CellFormat.Width = 120;
|
||||
//builder.Write(string.IsNullOrEmpty(detail.UnitName) ? "" : detail.UnitName);
|
||||
//问题描述
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 40;
|
||||
builder.Write(string.IsNullOrEmpty(detail.Unqualified) ? "" : detail.Unqualified);
|
||||
//问题类型
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 100;
|
||||
builder.Write(string.IsNullOrEmpty(detail.CheckItemName)?"": detail.CheckItemName);
|
||||
builder.Write(string.IsNullOrEmpty(detail.Unqualified) ? "" : detail.Unqualified);
|
||||
//问题内容
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;//水平居中对齐
|
||||
builder.CellFormat.Width = 250;
|
||||
builder.CellFormat.WrapText = true;
|
||||
builder.Write(string.IsNullOrEmpty(detail.CheckItemSetContent)?"": detail.CheckItemSetContent);
|
||||
|
||||
//处理结果
|
||||
////处理结果
|
||||
//builder.InsertCell();
|
||||
//builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
//builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
//builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
//builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
//builder.CellFormat.Width = 60;
|
||||
//builder.Write(string.IsNullOrEmpty(detail.CompleteStatusName) ? "" : detail.CompleteStatusName);
|
||||
//整改期限
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 50;
|
||||
builder.Write(string.IsNullOrEmpty(detail.CompleteStatusName) ? "" : detail.CompleteStatusName);
|
||||
builder.CellFormat.Width = 60;
|
||||
builder.Write(string.Format("{0:yyyy-MM-dd}", detail.Rectification_Date));
|
||||
//隐患类别
|
||||
builder.InsertCell();
|
||||
builder.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
|
||||
builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First;
|
||||
builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐
|
||||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐
|
||||
builder.CellFormat.Width = 50;
|
||||
builder.Write(string.IsNullOrEmpty(detail.HiddenHazardTypeName) ? "" : detail.HiddenHazardTypeName);
|
||||
builder.CellFormat.Width = 60;
|
||||
builder.Write(string.IsNullOrEmpty(detail.HandleStepLink) ? "" : detail.HandleStepLink);
|
||||
builder.EndRow();
|
||||
num++;
|
||||
}
|
||||
builder.EndTable();
|
||||
doc.Save(newUrl);
|
||||
//生成PDF文件
|
||||
string pdfUrl = newUrl.Replace(".doc", ".pdf");
|
||||
//string pdfUrl = newUrl.Replace(".doc", ".pdf");
|
||||
Document doc1 = new Aspose.Words.Document(newUrl);
|
||||
//验证参数
|
||||
if (doc1 == null) { throw new Exception("Word文件无效"); }
|
||||
doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
|
||||
string fileName = Path.GetFileName(filePath);
|
||||
FileInfo info = new FileInfo(pdfUrl);
|
||||
//if (doc1 == null) { throw new Exception("Word文件无效"); }
|
||||
//doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
|
||||
string fileName = Path.GetFileName(newUrl);
|
||||
FileInfo info = new FileInfo(newUrl);
|
||||
long fileSize = info.Length;
|
||||
Response.Clear();
|
||||
Response.ContentType = "application/x-zip-compressed";
|
||||
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
Response.TransmitFile(pdfUrl, 0, fileSize);
|
||||
Response.TransmitFile(newUrl, 0, fileSize);
|
||||
Response.Flush();
|
||||
Response.Close();
|
||||
File.Delete(newUrl);
|
||||
File.Delete(pdfUrl);
|
||||
//File.Delete(pdfUrl);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -33,6 +33,18 @@
|
|||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtResponsibleUnit" runat="server" Label="受检单位" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtWorkAreaId" runat="server" Label="单位工程" Readonly="true" Width="200px">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtQuestionType" runat="server" Label="问题类型" Readonly="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtPartInPersons" runat="server" Label="参检人员" Readonly="true" MaxLength="200">
|
||||
|
@ -50,26 +62,26 @@
|
|||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
|
||||
TextAlign="Center" />
|
||||
<f:RenderField Width="130px" ColumnID="CheckAreaName" DataField="CheckAreaName" SortField="CheckAreaName"
|
||||
<%-- <f:RenderField Width="130px" ColumnID="CheckAreaName" DataField="CheckAreaName" SortField="CheckAreaName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="单位工程">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="240px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
|
||||
</f:RenderField>--%>
|
||||
<%-- <f:RenderField Width="240px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="受检单位">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Unqualified" DataField="Unqualified" SortField="Unqualified"
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField Width="200px" ColumnID="Unqualified" DataField="Unqualified" SortField="Unqualified"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题描述" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="160px" ColumnID="CheckItemName" DataField="CheckItemName" SortField="CheckItemName"
|
||||
<%-- <f:RenderField Width="160px" ColumnID="CheckItemName" DataField="CheckItemName" SortField="CheckItemName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="问题类型">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="CheckItemSetContent" DataField="CheckItemSetContent" SortField="CheckItemSetContent"
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField Width="650px" ColumnID="CheckItemSetContent" DataField="CheckItemSetContent" SortField="CheckItemSetContent"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="检查内容">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="160px" ColumnID="Rectification_Date" DataField="Rectification_Date" SortField="Rectification_Date"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改期限">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField Width="80px" ColumnID="CompleteStatusName" DataField="CompleteStatusName" SortField="CompleteStatusName"
|
||||
<f:RenderField Width="80px" ColumnID="CompleteStatusName" DataField="CompleteStatusName" SortField="CompleteStatusName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="处理结果">
|
||||
</f:RenderField>
|
||||
<f:LinkButtonField Width="150px" ColumnID="HandleStepLink" DataTextField="HandleStepLink" DataToolTipField="HandleStepLink" HeaderText="处理措施"
|
||||
|
|
|
@ -66,6 +66,10 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
where x.CheckSpecialId == this.CheckSpecialId
|
||||
orderby x.UnitName, x.SortIndex
|
||||
select x).ToList();
|
||||
//新增加的三项
|
||||
this.txtResponsibleUnit.Text = UnitService.GetUnitNameByUnitId(checkSpecial.ResponsibleUnit);
|
||||
this.txtWorkAreaId.Text = UnitWorkService.GetUnitWorkName(checkSpecial.WorkAreaId);
|
||||
this.txtQuestionType.Text = UnitService.GetQuestionTypeId(checkSpecial.QuestionType);
|
||||
}
|
||||
Grid1.DataSource = checkSpecialDetails;
|
||||
Grid1.DataBind();
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Check {
|
||||
namespace FineUIPro.Web.HSSE.Check
|
||||
{
|
||||
|
||||
|
||||
public partial class CheckSpecialView {
|
||||
public partial class CheckSpecialView
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
@ -75,6 +77,33 @@ namespace FineUIPro.Web.HSSE.Check {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtResponsibleUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtResponsibleUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtWorkAreaId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWorkAreaId;
|
||||
|
||||
/// <summary>
|
||||
/// txtQuestionType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtQuestionType;
|
||||
|
||||
/// <summary>
|
||||
/// txtPartInPersons 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -59,37 +59,66 @@ namespace FineUIPro.Web.HSSE.InformationAnalysis
|
|||
dtCheck.Columns.Add("检查类型", typeof(string));
|
||||
dtCheck.Columns.Add("数量", typeof(string));
|
||||
|
||||
List<Model.SpResourceCollection> newCheckAnalyseView = new List<Model.SpResourceCollection>();
|
||||
var checkAnalyseView = from x in Funs.DB.View_CheckAnalysis
|
||||
where x.ProjectId == this.ProjectId
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(this.txtStarTime.Text))
|
||||
{
|
||||
checkAnalyseView = checkAnalyseView.Where(x => x.CheckTime >= Funs.GetNewDateTime(this.txtStarTime.Text));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text))
|
||||
{
|
||||
checkAnalyseView = checkAnalyseView.Where(x => x.CheckTime <= Funs.GetNewDateTime(this.txtEndTime.Text));
|
||||
}
|
||||
if (checkAnalyseView.Count() > 0)
|
||||
{
|
||||
foreach (var item in checkAnalyseView)
|
||||
{
|
||||
Model.SpResourceCollection view = new Model.SpResourceCollection
|
||||
{
|
||||
UnitName = BLL.Check_ProjectCheckItemSetService.ConvertCheckItemType(item.CheckItem),
|
||||
TotalCount = 1
|
||||
};
|
||||
newCheckAnalyseView.Add(view);
|
||||
}
|
||||
}
|
||||
//List<Model.SpResourceCollection> newCheckAnalyseView = new List<Model.SpResourceCollection>();
|
||||
//var checkAnalyseView = from x in Funs.DB.View_CheckAnalysis
|
||||
// where x.ProjectId == this.ProjectId
|
||||
// select x;
|
||||
//if (!string.IsNullOrEmpty(this.txtStarTime.Text))
|
||||
//{
|
||||
// checkAnalyseView = checkAnalyseView.Where(x => x.CheckTime >= Funs.GetNewDateTime(this.txtStarTime.Text));
|
||||
//}
|
||||
//if (!string.IsNullOrEmpty(this.txtEndTime.Text))
|
||||
//{
|
||||
// checkAnalyseView = checkAnalyseView.Where(x => x.CheckTime <= Funs.GetNewDateTime(this.txtEndTime.Text));
|
||||
//}
|
||||
//if (checkAnalyseView.Count() > 0)
|
||||
//{
|
||||
// foreach (var item in checkAnalyseView)
|
||||
// {
|
||||
// Model.SpResourceCollection view = new Model.SpResourceCollection
|
||||
// {
|
||||
// UnitName = BLL.Check_ProjectCheckItemSetService.ConvertCheckItemType(item.CheckItem),
|
||||
// TotalCount = 1
|
||||
// };
|
||||
// newCheckAnalyseView.Add(view);
|
||||
// }
|
||||
//}
|
||||
|
||||
var checkType = newCheckAnalyseView.Select(x => x.UnitName).Distinct();
|
||||
foreach (var itemType in checkType)
|
||||
//var checkType = newCheckAnalyseView.Select(x => x.UnitName).Distinct();
|
||||
string[] TypeArray = { "HSE巡检", "专项检查", "综合检查", "开工前检查", "季节性/节假日前检查" };
|
||||
#region 加载各项数据的子数据
|
||||
var count1 = Funs.DB.View_Hazard_HazardRegister.Where(x => x.ProjectId == this.ProjectId).ToList().Count();
|
||||
|
||||
var count2 = (from x in Funs.DB.Check_CheckSpecialDetail
|
||||
join y in Funs.DB.Check_CheckSpecial on x.CheckSpecialId equals y.CheckSpecialId
|
||||
select x).ToList().Count();
|
||||
|
||||
var count3 = (from x in Funs.DB.Check_CheckColligationDetail
|
||||
join y in Funs.DB.Check_CheckColligation on x.CheckColligationId equals y.CheckColligationId
|
||||
where y.ProjectId == this.ProjectId
|
||||
select x).ToList().Count();
|
||||
|
||||
var count4 = (from x in Funs.DB.Check_CheckWorkDetail
|
||||
join y in Funs.DB.Check_CheckWork on x.CheckWorkId equals y.CheckWorkId
|
||||
where y.ProjectId == this.ProjectId
|
||||
select x).ToList().Count;
|
||||
|
||||
var count5 = (from x in Funs.DB.Check_CheckHolidayDetail
|
||||
join y in Funs.DB.Check_CheckHoliday on x.CheckHolidayId equals y.CheckHolidayId
|
||||
select x).ToList().Count();
|
||||
|
||||
List<CheckAnalysisModel> list = new List<CheckAnalysisModel>();
|
||||
list.Add(new CheckAnalysisModel() { itemType = TypeArray[0], count = count1 });
|
||||
list.Add(new CheckAnalysisModel() { itemType = TypeArray[1], count = count2 });
|
||||
list.Add(new CheckAnalysisModel() { itemType = TypeArray[2], count = count3 });
|
||||
list.Add(new CheckAnalysisModel() { itemType = TypeArray[3], count = count4 });
|
||||
list.Add(new CheckAnalysisModel() { itemType = TypeArray[4], count = count5 });
|
||||
#endregion
|
||||
foreach (var itemType in list)
|
||||
{
|
||||
DataRow rowUnit = dtCheck.NewRow();
|
||||
rowUnit["检查类型"] = itemType;
|
||||
rowUnit["数量"] = newCheckAnalyseView.Where(x => x.UnitName == itemType).Count();
|
||||
rowUnit["检查类型"] = itemType.itemType;
|
||||
rowUnit["数量"] = itemType.count;
|
||||
dtCheck.Rows.Add(rowUnit);
|
||||
}
|
||||
|
||||
|
@ -97,6 +126,11 @@ namespace FineUIPro.Web.HSSE.InformationAnalysis
|
|||
this.gvCheck.DataBind();
|
||||
this.ChartCostTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtCheck, "危险因素分析", this.drpChartType.SelectedValue, 1150, 450, this.ckbShow.Checked));
|
||||
}
|
||||
|
||||
public class CheckAnalysisModel {
|
||||
public string itemType { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 统计查询
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" Hidden="true"
|
||||
runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="btnQR" runat="server" ToolTip="导出二维码" EnableAjax="false" EnableAjaxLoading="false" Icon="ArrowInout" OnClick="btnQR_Click"></f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
using BLL;
|
||||
using BLL.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ThoughtWorks.QRCode.Codec;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
|
@ -294,5 +297,120 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void btnQR_Click(object sender, EventArgs e)
|
||||
{
|
||||
string strSql = @"SELECT EquipmentQuality.EquipmentQualityId, CodeRecords.Code AS EquipmentQualityCode,
|
||||
EquipmentQuality.FactoryCode ,EquipmentQuality.QRCodeAttachUrl
|
||||
FROM QualityAudit_EquipmentQuality AS EquipmentQuality
|
||||
LEFT JOIN Sys_CodeRecords AS CodeRecords ON EquipmentQuality.EquipmentQualityId = CodeRecords.DataId
|
||||
LEFT JOIN Base_SpecialEquipment AS SpecialEquipment ON SpecialEquipment.SpecialEquipmentId = EquipmentQuality.SpecialEquipmentId WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
strSql += " AND EquipmentQuality.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEquipmentQualityCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND EquipmentQualityCode LIKE @EquipmentQualityCode";
|
||||
listStr.Add(new SqlParameter("@EquipmentQualityCode", "%" + this.txtEquipmentQualityCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND EquipmentQuality.UnitId = @UnitId";
|
||||
listStr.Add(new SqlParameter("@UnitId", this.drpUnitId.SelectedValue.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSpecialEquipmentName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND SpecialEquipmentName LIKE @SpecialEquipmentName";
|
||||
listStr.Add(new SqlParameter("@SpecialEquipmentName", "%" + this.txtSpecialEquipmentName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
NPOIExcel excel = new NPOIExcel();
|
||||
excel.SetColumnWidth(0, 50);
|
||||
excel.SetColumnWidth(1, 50);
|
||||
excel.SetColumnWidth(2, 50);
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
if (i % 3 == 0)
|
||||
{
|
||||
excel.SetRowHeight(2 * (int)(i / 3), 200);
|
||||
}
|
||||
string QRCodeAttachUrl = tb.Rows[i]["QRCodeAttachUrl"].ToString();
|
||||
string EquipmentQualityCode = tb.Rows[i]["EquipmentQualityCode"].ToString();
|
||||
if (string.IsNullOrEmpty(QRCodeAttachUrl))
|
||||
{
|
||||
try
|
||||
{
|
||||
var equipmentQuality = Funs.DB.QualityAudit_EquipmentQuality.FirstOrDefault(x => x.EquipmentQualityId == tb.Rows[i]["EquipmentQualityId"].ToString());
|
||||
equipmentQuality.QRCodeAttachUrl = CreateCode_Simple("equipment$" + tb.Rows[i]["FactoryCode"].ToString());
|
||||
QRCodeAttachUrl = equipmentQuality.QRCodeAttachUrl;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
catch (Exception e1) { }
|
||||
|
||||
}
|
||||
//add picture data to this workbook.
|
||||
excel.SetPicValue(2 * (int)(i / 3), i % 3, Server.MapPath("~/") + QRCodeAttachUrl);
|
||||
excel.SetValue(2 * (int)(i / 3) + 1, i % 3, EquipmentQualityCode);
|
||||
}
|
||||
string initTemplatePath = Const.ExcelUrl + Funs.GetNewFileName() + ".xls";
|
||||
string uploadfilepath = Server.MapPath("~/") + initTemplatePath;
|
||||
string fileName = Path.GetFileName(initTemplatePath);
|
||||
excel.Save(uploadfilepath);
|
||||
FileInfo info = new FileInfo(uploadfilepath);
|
||||
|
||||
long fileSize = info.Length;
|
||||
Response.ClearContent();
|
||||
Response.ContentType = "application/x-zip-compressed";
|
||||
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
Response.TransmitFile(uploadfilepath, 0, fileSize);
|
||||
Response.Flush();
|
||||
Response.End();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private string CreateCode_Simple(string nr)
|
||||
{
|
||||
try
|
||||
{
|
||||
string imageUrl = string.Empty;
|
||||
QRCodeEncoder qrCodeEncoder = new QRCodeEncoder
|
||||
{
|
||||
QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE,
|
||||
QRCodeScale = nr.Length,
|
||||
QRCodeVersion = 0,
|
||||
QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M
|
||||
};
|
||||
System.Drawing.Image image = qrCodeEncoder.Encode(nr, Encoding.UTF8);
|
||||
string filepath = Server.MapPath("~/") + UploadFileService.QRCodeImageFilePath;
|
||||
//如果文件夹不存在,则创建
|
||||
if (!Directory.Exists(filepath))
|
||||
{
|
||||
Directory.CreateDirectory(filepath);
|
||||
}
|
||||
string filename = DateTime.Now.ToString("yyyymmddhhmmssfff").ToString() + ".jpg";
|
||||
imageUrl = filepath + filename;
|
||||
FileStream fs = new FileStream(imageUrl, FileMode.OpenOrCreate, FileAccess.Write);
|
||||
image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
fs.Close();
|
||||
image.Dispose();
|
||||
return UploadFileService.QRCodeImageFilePath + filename;
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
|
||||
{
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit {
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
{
|
||||
|
||||
|
||||
public partial class EquipmentQuality {
|
||||
public partial class EquipmentQuality
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
@ -102,6 +104,15 @@ namespace FineUIPro.Web.HSSE.QualityAudit {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnQR 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQR;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" Hidden="true"
|
||||
runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID = "btnQR" runat="server" ToolTip="导出二维码" EnableAjax="false" EnableAjaxLoading="false" Icon="ArrowInout" OnClick="btnQR_Click"></f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
using BLL;
|
||||
using BLL.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ThoughtWorks.QRCode.Codec;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
|
@ -265,11 +268,134 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
|||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("一般机具设备资质" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = this.Grid1.RecordCount;
|
||||
this.Grid1.PageSize = this.Grid1.RecordCount;
|
||||
BindGrid();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected void btnQR_Click(object sender, EventArgs e)
|
||||
{
|
||||
string strSql = @"SELECT GeneralEquipmentQuality.GeneralEquipmentQualityId,"
|
||||
+ @"CodeRecords.Code AS GeneralEquipmentQualityCode,"
|
||||
+ @"GeneralEquipmentQuality.GeneralEquipmentQualityCode,"
|
||||
+ @"GeneralEquipmentQuality.QRCodeAttachUrl,"
|
||||
+ @"SpecialEquipment.SpecialEquipmentName"
|
||||
+ @" FROM QualityAudit_GeneralEquipmentQuality AS GeneralEquipmentQuality "
|
||||
+ @" LEFT JOIN Base_SpecialEquipment AS SpecialEquipment ON SpecialEquipment.SpecialEquipmentId = GeneralEquipmentQuality.SpecialEquipmentId "
|
||||
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON GeneralEquipmentQuality.GeneralEquipmentQualityId = CodeRecords.DataId WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
strSql += " AND GeneralEquipmentQuality.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
}
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
|
||||
{
|
||||
strSql += " AND GeneralEquipmentQuality.UnitId = @UnitId"; ///状态为已完成
|
||||
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtGeneralEquipmentQualityCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND GeneralEquipmentQualityCode LIKE @GeneralEquipmentQualityCode";
|
||||
listStr.Add(new SqlParameter("@GeneralEquipmentQualityCode", "%" + this.txtGeneralEquipmentQualityCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtUnitName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND UnitName LIKE @UnitName";
|
||||
listStr.Add(new SqlParameter("@UnitName", "%" + this.txtUnitName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSpecialEquipmentName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND SpecialEquipmentName LIKE @SpecialEquipmentName";
|
||||
listStr.Add(new SqlParameter("@SpecialEquipmentName", "%" + this.txtSpecialEquipmentName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
NPOIExcel excel = new NPOIExcel();
|
||||
excel.SetColumnWidth(0, 50);
|
||||
excel.SetColumnWidth(1, 50);
|
||||
excel.SetColumnWidth(2, 50);
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
if (i % 3 == 0)
|
||||
{
|
||||
excel.SetRowHeight(2 * (int)(i / 3), 200);
|
||||
}
|
||||
string QRCodeAttachUrl = tb.Rows[i]["QRCodeAttachUrl"].ToString();
|
||||
string GeneralEquipmentQualityCode = tb.Rows[i]["GeneralEquipmentQualityCode"].ToString();
|
||||
if (string.IsNullOrEmpty(QRCodeAttachUrl))
|
||||
{
|
||||
try
|
||||
{
|
||||
var equipmentQuality = Funs.DB.QualityAudit_GeneralEquipmentQuality.FirstOrDefault(x => x.GeneralEquipmentQualityId == tb.Rows[i]["GeneralEquipmentQualityId"].ToString());
|
||||
equipmentQuality.QRCodeAttachUrl = CreateCode_Simple("equipments$" + tb.Rows[i]["GeneralEquipmentQualityId"].ToString());
|
||||
QRCodeAttachUrl = equipmentQuality.QRCodeAttachUrl;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
catch (Exception e1) { }
|
||||
}
|
||||
//add picture data to this workbook.
|
||||
excel.SetPicValue(2 * (int)(i / 3), i % 3, Server.MapPath("~/") + QRCodeAttachUrl);
|
||||
excel.SetValue(2 * (int)(i / 3) + 1, i % 3, GeneralEquipmentQualityCode);
|
||||
}
|
||||
string initTemplatePath = Const.ExcelUrl + Funs.GetNewFileName() + ".xls";
|
||||
string uploadfilepath = Server.MapPath("~/") + initTemplatePath;
|
||||
string fileName = Path.GetFileName(initTemplatePath);
|
||||
excel.Save(uploadfilepath);
|
||||
FileInfo info = new FileInfo(uploadfilepath);
|
||||
|
||||
long fileSize = info.Length;
|
||||
Response.ClearContent();
|
||||
Response.ContentType = "application/x-zip-compressed";
|
||||
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
Response.TransmitFile(uploadfilepath, 0, fileSize);
|
||||
Response.Flush();
|
||||
Response.End();
|
||||
|
||||
|
||||
|
||||
}
|
||||
private string CreateCode_Simple(string nr)
|
||||
{
|
||||
try
|
||||
{
|
||||
string imageUrl = string.Empty;
|
||||
QRCodeEncoder qrCodeEncoder = new QRCodeEncoder
|
||||
{
|
||||
QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE,
|
||||
QRCodeScale = nr.Length,
|
||||
QRCodeVersion = 0,
|
||||
QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M
|
||||
};
|
||||
System.Drawing.Image image = qrCodeEncoder.Encode(nr, Encoding.UTF8);
|
||||
string filepath = Server.MapPath("~/") + UploadFileService.QRCodeImageFilePath;
|
||||
//如果文件夹不存在,则创建
|
||||
if (!Directory.Exists(filepath))
|
||||
{
|
||||
Directory.CreateDirectory(filepath);
|
||||
}
|
||||
string filename = DateTime.Now.ToString("yyyymmddhhmmssfff").ToString() + ".jpg";
|
||||
imageUrl = filepath + filename;
|
||||
FileStream fs = new FileStream(imageUrl, FileMode.OpenOrCreate, FileAccess.Write);
|
||||
image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
fs.Close();
|
||||
image.Dispose();
|
||||
return UploadFileService.QRCodeImageFilePath + filename;
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
|
||||
{
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit {
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
{
|
||||
|
||||
|
||||
public partial class GeneralEquipmentQuality {
|
||||
public partial class GeneralEquipmentQuality
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
@ -102,6 +104,15 @@ namespace FineUIPro.Web.HSSE.QualityAudit {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnQR 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQR;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -215,7 +215,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
|||
this.SaveData(false);
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/Controls/SeeQRImage.aspx?GeneralEquipmentQualityId={0}&strCode={1}", this.GeneralEquipmentQualityId, "equipment$" + this.GeneralEquipmentQualityId), "二维码查看", 400, 400));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/Controls/SeeQRImage.aspx?GeneralEquipmentQualityId={0}&strCode={1}", this.GeneralEquipmentQualityId, "equipments$" + this.GeneralEquipmentQualityId), "二维码查看", 400, 400));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -249,384 +249,401 @@ namespace FineUIPro.Web.ProjectData
|
|||
}
|
||||
Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
||||
string contenttype = "application/json;charset=utf-8";
|
||||
var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/GetConstructionWbsList?ProjId=" + project.KZProjectCode, "GET", contenttype, null, null);
|
||||
if (!string.IsNullOrEmpty(returndata))
|
||||
var returndata0 = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/GetProjectList?Code=" + project.KZProjectCode, "GET", contenttype, null, null);
|
||||
//string returndata0 = "{'result':{'items':[{'code':'22373','name':'甘肃能化金昌能源化工开发有限公司低阶煤高效利用制氢及50万吨尿基复合肥项目','shortName':'金昌能化50万吨尿基复合肥项目','projTypeId':1,'projType':'工程咨询','projPhaseId':65,'projPhase':'工程咨询','ownerName':'甘肃能化金昌能源化工开发有限公司','address':'境内','nature':'新建','level':'3级','productId':0,'productName':'','productSize':'','initiationDate':'2023-01-19T00:00:00','planStart':'2023-01-19T00:00:00','planFinish':'2023-02-10T00:00:00','realStart':null,'realFinish':null,'contractAmount':0.0000,'contractNumber':'','basicProcess':'','remark':'','isFinished':false,'communityArea':'2亿Nm3/年氢气,30万吨/年合成氨,50万吨/年尿基复合肥','isBreakdown':false,'isSpecial':false,'isKey':false,'status':'COMPLETION','guid':'73c4f36d-1ed2-41ba-9c6e-04619de214de','createdAt':'2023-01-19T09:21:20.213','updatedAt':'2023-01-19T09:21:20.213','id':34961},{'code':'22373','name':'甘肃能化金昌能源化工开发有限公司低阶煤高效利用制氢及50万吨尿基复合肥项目','shortName':'低阶煤高效利用制氢及50 万吨/年高浓度尿基复合肥项目','projTypeId':5,'projType':'工程总承包','projPhaseId':14,'projPhase':'EPC','ownerName':'甘肃能化金昌能源化工开发有限公司','address':'境内','nature':'新建','level':'1级','productId':0,'productName':'合成氨、尿素(中间产品)、尿基复合肥、氢气','productSize':'合成氨40万吨/年; 尿素30万吨/年; 氢气2亿m3/年; 尿基复合肥50万吨/年','initiationDate':'2023-04-23T00:00:00','planStart':'2023-04-23T00:00:00','planFinish':'2025-06-30T00:00:00','realStart':null,'realFinish':null,'contractAmount':0.0000,'contractNumber':'','basicProcess':'氨合成采用南京聚拓专利,尿素装置采用中国五环自有尿素专利技术。','remark':'','isFinished':false,'communityArea':'1.总体院;\n2.40万吨/年合成氨装置:合成气压缩、冷冻、氨合成、氨回收、PSA制氢(2亿m3/年氢气)、尾气压缩、输煤CO2压缩、尿素CO2压缩;\n3.30万吨/年尿素装置:主装置、原料贮运、成品包装贮运;\n4.50万吨/年尿基复合肥装置;\n5.公用工程:循环水、脱盐水、污水、中水回用、零排放、变电所、机柜间、中控室、综合泵站、生产消防水池等;\n6.辅助生产设施:生产分析室、维修车间、综合仓库、危废暂存库、化学品库、火炬等;\n7.储运系统:液氨常压罐、事故甲醇罐、液氨球罐、装车栈台、泡沫站等。','isBreakdown':true,'isSpecial':false,'isKey':false,'status':'EXECUTION','guid':'10142090-f850-47ae-be6c-43597e6dc4d1','createdAt':'2023-04-23T14:39:53.98','updatedAt':'2023-08-16T18:45:05.997','id':35120},{'code':'22373','name':'甘肃能化金昌能源化工开发有限公司低阶煤高效利用制氢及50万吨尿基复合肥项目','shortName':'甘肃能化金昌能化阶煤高效利用制氢及尿基复合肥项目','projTypeId':6,'projType':'投标','projPhaseId':18,'projPhase':'EPC投标','ownerName':'甘肃能化金昌能源化工开发有限公司','address':'境内','nature':'新建','level':'','productId':0,'productName':'合成氨及尿基复合肥','productSize':'合成氨30万吨/年(其中17.4万吨生产尿素)、尿素30万吨/年(中间产品)、尿基复合肥50万吨/年','initiationDate':'2023-02-01T00:00:00','planStart':'2023-02-01T00:00:00','planFinish':'2023-04-15T00:00:00','realStart':null,'realFinish':null,'contractAmount':0.0000,'contractNumber':'','basicProcess':'合成氨采用国有专利,尿素采用五环公司高效合成、低能耗尿素工艺技术。\n','remark':'','isFinished':true,'communityArea':'一、气化采用航天粉煤气化技术,生产氢气2亿Nm3/年、合成氨30万吨/年(其中17.4万吨生产尿素)、尿素30万吨/年、尿基复合肥50万吨/年、硫磺2.24万吨/年。\n二、本次投标范围为:空分装置,净化装置,合成氨装置,罐区,尿素装置,尿基复合肥装置,硫回收装置,锅炉装置(2x220t/h循环流化床锅炉)、水处理系统装置等全厂公辅,全厂总图、外线、地管、道路、控制室、变电所等,总体院。','isBreakdown':false,'isSpecial':false,'isKey':false,'status':'COMPLETION','guid':'9ffcd266-7196-4df1-9432-b818a5c91a6f','createdAt':'2023-02-01T15:30:18.013','updatedAt':'2023-07-27T16:58:14.37','id':34964}]},'targetUrl':null,'success':true,'error':null,'unAuthorizedRequest':false,'__abp':true}";
|
||||
if (!string.IsNullOrEmpty(returndata0))
|
||||
{
|
||||
JObject obj = JObject.Parse(returndata);
|
||||
JArray arr = JArray.Parse(obj["result"].ToString());
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
//专业
|
||||
var cnProfessionInits = from x in db.WBS_CnProfessionInit select x;
|
||||
//单位工程及子单位工程
|
||||
var unitProjectInits = from x in db.Wbs_UnitProjectInit orderby x.SuperUnitProject select x;
|
||||
//分部/子分部/分项/子分项
|
||||
var wbsSetInits = (from x in db.WBS_WbsSetInit orderby x.SuperWbsSetCode select x).ToList();
|
||||
//费用清单对应关系
|
||||
var wbsSetMatchCostControlInits = from x in db.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
|
||||
//费用清单项
|
||||
var totalCostControlInits = from x in db.WBS_CostControlInit orderby x.CostControlInitCode select x;
|
||||
string sgId = string.Empty;
|
||||
foreach (var item in arr)
|
||||
JObject obj0 = JObject.Parse(returndata0);
|
||||
JArray arr0 = JArray.Parse(obj0["result"]["items"].ToString());
|
||||
string proId = string.Empty;
|
||||
foreach (var item in arr0)
|
||||
{
|
||||
string id = item["id"].ToString(); //记录Id,主键
|
||||
string parentId = item["parentId"].ToString(); //上一级记录Id
|
||||
string code = item["code"].ToString(); //WBS编码
|
||||
string name = item["name"].ToString(); //WBS名称
|
||||
string level = item["level"].ToString(); //级别,0-7依次表示:项目、阶段(施工)、装置、工序、主项、专业、分部工程、分项工程
|
||||
string isLeaf = item["isLeaf"].ToString(); //是否末级
|
||||
string ppsId = item["ppsId"].ToString(); //阶段ID,3代表施工
|
||||
string projId = item["projId"].ToString(); //项目ID
|
||||
string planStart = item["planStart"].ToString(); //计划开始日期
|
||||
string planFinish = item["planFinish"].ToString(); //计划完成日期
|
||||
string remark = item["remark"].ToString(); //备注
|
||||
if (level == "0" || level == "1" || level == "2" || level == "3" || level == "4")
|
||||
string projType = item["projType"].ToString();
|
||||
string projPhase = item["projPhase"].ToString();
|
||||
if (project.ProjType == projType && project.ProjPhase == projPhase)
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = parentId == "-1" ? "0" : parentId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = Convert.ToBoolean(isLeaf);
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
if (name == "施工")
|
||||
{
|
||||
sgId = id;
|
||||
}
|
||||
}
|
||||
else if (level == "5")
|
||||
{
|
||||
var cn = cnProfessionInits.FirstOrDefault(x => x.CnProfessionName.Contains(name.Substring(0, 2)));
|
||||
//拷贝专业
|
||||
if (cn != null)
|
||||
{
|
||||
if (cn.CnProfessionName != "防腐绝热" && cn.CnProfessionName != "地勘" && cn.CnProfessionName != "全厂地下主管网" && cn.CnProfessionName != "临时设施" && cn.CnProfessionName != "总图")
|
||||
{
|
||||
Model.WBS_CnProfession cnProfession = new Model.WBS_CnProfession();
|
||||
cnProfession.CnProfessionId = id;
|
||||
cnProfession.CnProfessionName = cn.CnProfessionName;
|
||||
cnProfession.CnProfessionCode = cn.CnProfessionCode;
|
||||
cnProfession.InstallationId = parentId;
|
||||
cnProfession.ProjectId = this.CurrUser.LoginProjectId;
|
||||
cnProfession.StartDate = Funs.GetNewDateTime(planStart);
|
||||
cnProfession.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
cnProfession.OldId = cn.CnProfessionId;
|
||||
db.WBS_CnProfession.InsertOnSubmit(cnProfession);
|
||||
db.SubmitChanges();
|
||||
//单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
unitProject.InstallationId = parentId;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.CnProfessionId = id;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//分部分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = parentId;
|
||||
wbsSet.CnProfessionId = id;
|
||||
wbsSet.UnitProjectId = (from x in db.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.CnProfessionId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in db.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == parentId && x.CnProfessionId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldInstallation = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationName == name);
|
||||
if (oldInstallation == null)
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = sgId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = true;
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
// 拷贝总图等专业下WBS内容
|
||||
//拷贝单位工程及子单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
if (unitProjectInit.SuperUnitProject == null)
|
||||
{
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProject.SuperUnitProjectId = (from x in Funs.DB.Wbs_UnitProject
|
||||
where x.UnitProjectCode == unitProjectInit.SuperUnitProject && x.InstallationId == id
|
||||
select x.UnitProjectId).FirstOrDefault();
|
||||
}
|
||||
unitProject.InstallationId = id;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//拷贝分部/子分部/分项/子分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = id;
|
||||
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in Funs.DB.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (level == "6" || level == "7")
|
||||
{
|
||||
if (name.Contains("防腐绝热") || name.Contains("地勘") || name.Contains("全厂地下主管网") || name.Contains("临时设施") || name.Contains("总图"))
|
||||
{
|
||||
var cn = cnProfessionInits.FirstOrDefault(x => x.CnProfessionName.Contains(name.Substring(0, 2)));
|
||||
if (cn != null)
|
||||
{
|
||||
var oldInstallation = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationName == name);
|
||||
if (oldInstallation == null)
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = sgId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = true;
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
// 拷贝总图等专业下WBS内容
|
||||
//拷贝单位工程及子单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
if (unitProjectInit.SuperUnitProject == null)
|
||||
{
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProject.SuperUnitProjectId = (from x in Funs.DB.Wbs_UnitProject
|
||||
where x.UnitProjectCode == unitProjectInit.SuperUnitProject && x.InstallationId == id
|
||||
select x.UnitProjectId).FirstOrDefault();
|
||||
}
|
||||
unitProject.InstallationId = id;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//拷贝分部/子分部/分项/子分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = id;
|
||||
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in Funs.DB.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
proId= item["id"].ToString();
|
||||
}
|
||||
}
|
||||
ShowNotify("抽取成功!", MessageBoxIcon.Success);
|
||||
InitTreeMenu();
|
||||
var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/GetConstructionWbsList?ProjId=" + proId, "GET", contenttype, null, null);
|
||||
if (!string.IsNullOrEmpty(returndata))
|
||||
{
|
||||
JObject obj = JObject.Parse(returndata);
|
||||
JArray arr = JArray.Parse(obj["result"].ToString());
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
//专业
|
||||
var cnProfessionInits = from x in db.WBS_CnProfessionInit select x;
|
||||
//单位工程及子单位工程
|
||||
var unitProjectInits = from x in db.Wbs_UnitProjectInit orderby x.SuperUnitProject select x;
|
||||
//分部/子分部/分项/子分项
|
||||
var wbsSetInits = (from x in db.WBS_WbsSetInit orderby x.SuperWbsSetCode select x).ToList();
|
||||
//费用清单对应关系
|
||||
var wbsSetMatchCostControlInits = from x in db.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
|
||||
//费用清单项
|
||||
var totalCostControlInits = from x in db.WBS_CostControlInit orderby x.CostControlInitCode select x;
|
||||
string sgId = string.Empty;
|
||||
foreach (var item in arr)
|
||||
{
|
||||
string id = item["id"].ToString(); //记录Id,主键
|
||||
string parentId = item["parentId"].ToString(); //上一级记录Id
|
||||
string code = item["code"].ToString(); //WBS编码
|
||||
string name = item["name"].ToString(); //WBS名称
|
||||
string level = item["level"].ToString(); //级别,0-7依次表示:项目、阶段(施工)、装置、工序、主项、专业、分部工程、分项工程
|
||||
string isLeaf = item["isLeaf"].ToString(); //是否末级
|
||||
string ppsId = item["ppsId"].ToString(); //阶段ID,3代表施工
|
||||
string projId = item["projId"].ToString(); //项目ID
|
||||
string planStart = item["planStart"].ToString(); //计划开始日期
|
||||
string planFinish = item["planFinish"].ToString(); //计划完成日期
|
||||
string remark = item["remark"].ToString(); //备注
|
||||
if (level == "0" || level == "1" || level == "2" || level == "3" || level == "4")
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = parentId == "-1" ? "0" : parentId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = Convert.ToBoolean(isLeaf);
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
if (name == "施工")
|
||||
{
|
||||
sgId = id;
|
||||
}
|
||||
}
|
||||
else if (level == "5")
|
||||
{
|
||||
var cn = cnProfessionInits.FirstOrDefault(x => x.CnProfessionName.Contains(name.Substring(0, 2)));
|
||||
//拷贝专业
|
||||
if (cn != null)
|
||||
{
|
||||
if (cn.CnProfessionName != "防腐绝热" && cn.CnProfessionName != "地勘" && cn.CnProfessionName != "全厂地下主管网" && cn.CnProfessionName != "临时设施" && cn.CnProfessionName != "总图")
|
||||
{
|
||||
Model.WBS_CnProfession cnProfession = new Model.WBS_CnProfession();
|
||||
cnProfession.CnProfessionId = id;
|
||||
cnProfession.CnProfessionName = cn.CnProfessionName;
|
||||
cnProfession.CnProfessionCode = cn.CnProfessionCode;
|
||||
cnProfession.InstallationId = parentId;
|
||||
cnProfession.ProjectId = this.CurrUser.LoginProjectId;
|
||||
cnProfession.StartDate = Funs.GetNewDateTime(planStart);
|
||||
cnProfession.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
cnProfession.OldId = cn.CnProfessionId;
|
||||
db.WBS_CnProfession.InsertOnSubmit(cnProfession);
|
||||
db.SubmitChanges();
|
||||
//单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
unitProject.InstallationId = parentId;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.CnProfessionId = id;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//分部分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = parentId;
|
||||
wbsSet.CnProfessionId = id;
|
||||
wbsSet.UnitProjectId = (from x in db.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.CnProfessionId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in db.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == parentId && x.CnProfessionId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldInstallation = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationName == name);
|
||||
if (oldInstallation == null)
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = sgId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = true;
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
// 拷贝总图等专业下WBS内容
|
||||
//拷贝单位工程及子单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
if (unitProjectInit.SuperUnitProject == null)
|
||||
{
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProject.SuperUnitProjectId = (from x in Funs.DB.Wbs_UnitProject
|
||||
where x.UnitProjectCode == unitProjectInit.SuperUnitProject && x.InstallationId == id
|
||||
select x.UnitProjectId).FirstOrDefault();
|
||||
}
|
||||
unitProject.InstallationId = id;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//拷贝分部/子分部/分项/子分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = id;
|
||||
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in Funs.DB.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (level == "6" || level == "7")
|
||||
{
|
||||
if (name.Contains("防腐绝热") || name.Contains("地勘") || name.Contains("全厂地下主管网") || name.Contains("临时设施") || name.Contains("总图"))
|
||||
{
|
||||
var cn = cnProfessionInits.FirstOrDefault(x => x.CnProfessionName.Contains(name.Substring(0, 2)));
|
||||
if (cn != null)
|
||||
{
|
||||
var oldInstallation = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationName == name);
|
||||
if (oldInstallation == null)
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = sgId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = true;
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
// 拷贝总图等专业下WBS内容
|
||||
//拷贝单位工程及子单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
if (unitProjectInit.SuperUnitProject == null)
|
||||
{
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProject.SuperUnitProjectId = (from x in Funs.DB.Wbs_UnitProject
|
||||
where x.UnitProjectCode == unitProjectInit.SuperUnitProject && x.InstallationId == id
|
||||
select x.UnitProjectId).FirstOrDefault();
|
||||
}
|
||||
unitProject.InstallationId = id;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//拷贝分部/子分部/分项/子分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = id;
|
||||
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in Funs.DB.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ShowNotify("抽取成功!", MessageBoxIcon.Success);
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -147,6 +147,12 @@
|
|||
<f:TextBox ID="txtKZProjectCode" runat="server" Label="控制软件项目编号" LabelWidth="150px" MaxLength="50" ></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtProjType" runat="server" Label="控制软件项目类型" LabelWidth="150px" MaxLength="50" ></f:TextBox>
|
||||
<f:TextBox ID="txtProjPhase" runat="server" Label="控制软件项目阶段" LabelWidth="150px" MaxLength="50" ></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" ID="txtProgress" Label="项目进度(%)" NoNegative="true" ></f:NumberBox>
|
||||
|
|
|
@ -168,6 +168,8 @@ namespace FineUIPro.Web.ProjectData
|
|||
this.txtEnglishRemark.Text = project.EnglishRemark;
|
||||
this.txtHJProjectCode.Text = project.HJProjectCode;
|
||||
this.txtKZProjectCode.Text = project.KZProjectCode;
|
||||
this.txtProjType.Text = project.ProjType;
|
||||
this.txtProjPhase.Text = project.ProjPhase;
|
||||
if (project.Progress != null)
|
||||
{
|
||||
this.txtProgress.Text = project.Progress.ToString();
|
||||
|
@ -209,6 +211,8 @@ namespace FineUIPro.Web.ProjectData
|
|||
City = this.txtCity.Text.Trim(),
|
||||
EnglishRemark = this.txtEnglishRemark.Text.Trim(),
|
||||
Progress = Funs.GetNewDecimal(this.txtProgress.Text),
|
||||
ProjType = this.txtProjType.Text.Trim(),
|
||||
ProjPhase = this.txtProjPhase.Text.Trim(),
|
||||
};
|
||||
if (string.IsNullOrEmpty(project.JTProjectCode))
|
||||
{
|
||||
|
|
|
@ -7,12 +7,10 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ProjectData
|
||||
{
|
||||
namespace FineUIPro.Web.ProjectData {
|
||||
|
||||
|
||||
public partial class ProjectSetSave
|
||||
{
|
||||
public partial class ProjectSetSave {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
@ -329,6 +327,24 @@ namespace FineUIPro.Web.ProjectData
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtKZProjectCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtProjType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtProjType;
|
||||
|
||||
/// <summary>
|
||||
/// txtProjPhase 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtProjPhase;
|
||||
|
||||
/// <summary>
|
||||
/// txtProgress 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -106,6 +106,12 @@
|
|||
<f:TextBox ID="txtKZProjectCode" runat="server" Label="控制软件项目编号" LabelWidth="150px" MaxLength="50" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtProjType" runat="server" Label="控制软件项目类型" LabelWidth="150px" MaxLength="50" Readonly="true"></f:TextBox>
|
||||
<f:TextBox ID="txtProjPhase" runat="server" Label="控制软件项目阶段" LabelWidth="150px" MaxLength="50" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtEnglishRemark" runat="server" Label="英文简称" Readonly="true"></f:TextBox>
|
||||
|
|
|
@ -102,6 +102,8 @@ namespace FineUIPro.Web.ProjectData
|
|||
this.txtEnglishRemark.Text = project.EnglishRemark;
|
||||
this.txtHJProjectCode.Text = project.HJProjectCode;
|
||||
this.txtKZProjectCode.Text = project.KZProjectCode;
|
||||
this.txtProjType.Text = project.ProjType;
|
||||
this.txtProjPhase.Text = project.ProjPhase;
|
||||
if (project.Progress != null)
|
||||
{
|
||||
this.txtProgress.Text = project.Progress.ToString();
|
||||
|
|
|
@ -300,6 +300,24 @@ namespace FineUIPro.Web.ProjectData {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtKZProjectCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtProjType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtProjType;
|
||||
|
||||
/// <summary>
|
||||
/// txtProjPhase 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtProjPhase;
|
||||
|
||||
/// <summary>
|
||||
/// txtEnglishRemark 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -203,5 +203,9 @@ namespace Model
|
|||
/// </summary>
|
||||
public string Rectification_Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理意见
|
||||
/// </summary>
|
||||
public string CheckOpinions { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,5 +180,71 @@ namespace Model
|
|||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 受检单位
|
||||
/// </summary>
|
||||
public string ResponsibleUnit
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 受检单位
|
||||
/// </summary>
|
||||
public string ResponsibleUnitName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 单位工程ID
|
||||
/// </summary>
|
||||
public string WorkAreaId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 单位工程ID
|
||||
/// </summary>
|
||||
public string WorkAreaName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 问题类型
|
||||
/// </summary>
|
||||
public string QuestionType
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 问题类型
|
||||
/// </summary>
|
||||
public string QuestionTypeName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核人
|
||||
/// </summary>
|
||||
public string ResponsibleMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核状态
|
||||
/// </summary>
|
||||
public string AuditState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 接收人
|
||||
/// </summary>
|
||||
public string ReceiveMan { get; set; }
|
||||
|
||||
public string ReceiveManName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,5 +95,13 @@ namespace Model
|
|||
/// 附件
|
||||
/// </summary>
|
||||
public string AttachUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 是否合格
|
||||
/// </summary>
|
||||
public string IsQualified { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public string EquipmentCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9179,6 +9179,14 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<View_QualityAudit_GeneralEquipmentQuality> View_QualityAudit_GeneralEquipmentQuality
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<View_QualityAudit_GeneralEquipmentQuality>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<View_QualityAudit_PersonQuality> View_QualityAudit_PersonQuality
|
||||
{
|
||||
get
|
||||
|
@ -25021,6 +25029,10 @@ namespace Model
|
|||
|
||||
private string _ProjectAttribute;
|
||||
|
||||
private string _ProjType;
|
||||
|
||||
private string _ProjPhase;
|
||||
|
||||
private EntitySet<Accident_AccidentHandle> _Accident_AccidentHandle;
|
||||
|
||||
private EntitySet<Accident_AccidentPersonRecord> _Accident_AccidentPersonRecord;
|
||||
|
@ -25675,6 +25687,10 @@ namespace Model
|
|||
partial void OnCLProjectCodeChanged();
|
||||
partial void OnProjectAttributeChanging(string value);
|
||||
partial void OnProjectAttributeChanged();
|
||||
partial void OnProjTypeChanging(string value);
|
||||
partial void OnProjTypeChanged();
|
||||
partial void OnProjPhaseChanging(string value);
|
||||
partial void OnProjPhaseChanged();
|
||||
#endregion
|
||||
|
||||
public Base_Project()
|
||||
|
@ -26699,6 +26715,46 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjType", DbType="NVarChar(50)")]
|
||||
public string ProjType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ProjType;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ProjType != value))
|
||||
{
|
||||
this.OnProjTypeChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ProjType = value;
|
||||
this.SendPropertyChanged("ProjType");
|
||||
this.OnProjTypeChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjPhase", DbType="NVarChar(50)")]
|
||||
public string ProjPhase
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ProjPhase;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ProjPhase != value))
|
||||
{
|
||||
this.OnProjPhaseChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ProjPhase = value;
|
||||
this.SendPropertyChanged("ProjPhase");
|
||||
this.OnProjPhaseChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Accident_AccidentHandle_Base_Project", Storage="_Accident_AccidentHandle", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
|
||||
public EntitySet<Accident_AccidentHandle> Accident_AccidentHandle
|
||||
{
|
||||
|
@ -59583,6 +59639,16 @@ namespace Model
|
|||
|
||||
private string _CheckItemSetId;
|
||||
|
||||
private string _ResponsibleUnit;
|
||||
|
||||
private string _WorkAreaId;
|
||||
|
||||
private string _QuestionType;
|
||||
|
||||
private string _ResponsibleMan;
|
||||
|
||||
private string _ReceiveMan;
|
||||
|
||||
private EntityRef<Base_Project> _Base_Project;
|
||||
|
||||
private EntityRef<Technique_CheckItemSet> _Technique_CheckItemSet;
|
||||
|
@ -59623,6 +59689,16 @@ namespace Model
|
|||
partial void OnPartInPersonNamesChanged();
|
||||
partial void OnCheckItemSetIdChanging(string value);
|
||||
partial void OnCheckItemSetIdChanged();
|
||||
partial void OnResponsibleUnitChanging(string value);
|
||||
partial void OnResponsibleUnitChanged();
|
||||
partial void OnWorkAreaIdChanging(string value);
|
||||
partial void OnWorkAreaIdChanged();
|
||||
partial void OnQuestionTypeChanging(string value);
|
||||
partial void OnQuestionTypeChanged();
|
||||
partial void OnResponsibleManChanging(string value);
|
||||
partial void OnResponsibleManChanged();
|
||||
partial void OnReceiveManChanging(string value);
|
||||
partial void OnReceiveManChanged();
|
||||
#endregion
|
||||
|
||||
public Check_CheckSpecial()
|
||||
|
@ -59960,6 +60036,106 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResponsibleUnit", DbType="NVarChar(50)")]
|
||||
public string ResponsibleUnit
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ResponsibleUnit;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ResponsibleUnit != value))
|
||||
{
|
||||
this.OnResponsibleUnitChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ResponsibleUnit = value;
|
||||
this.SendPropertyChanged("ResponsibleUnit");
|
||||
this.OnResponsibleUnitChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaId", DbType="NVarChar(50)")]
|
||||
public string WorkAreaId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WorkAreaId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._WorkAreaId != value))
|
||||
{
|
||||
this.OnWorkAreaIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._WorkAreaId = value;
|
||||
this.SendPropertyChanged("WorkAreaId");
|
||||
this.OnWorkAreaIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QuestionType", DbType="NVarChar(50)")]
|
||||
public string QuestionType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._QuestionType;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._QuestionType != value))
|
||||
{
|
||||
this.OnQuestionTypeChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._QuestionType = value;
|
||||
this.SendPropertyChanged("QuestionType");
|
||||
this.OnQuestionTypeChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResponsibleMan", DbType="NVarChar(50)")]
|
||||
public string ResponsibleMan
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ResponsibleMan;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ResponsibleMan != value))
|
||||
{
|
||||
this.OnResponsibleManChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ResponsibleMan = value;
|
||||
this.SendPropertyChanged("ResponsibleMan");
|
||||
this.OnResponsibleManChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReceiveMan", DbType="NVarChar(2000)")]
|
||||
public string ReceiveMan
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ReceiveMan;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ReceiveMan != value))
|
||||
{
|
||||
this.OnReceiveManChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ReceiveMan = value;
|
||||
this.SendPropertyChanged("ReceiveMan");
|
||||
this.OnReceiveManChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_CheckSpecial_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
|
||||
public Base_Project Base_Project
|
||||
{
|
||||
|
@ -60099,6 +60275,8 @@ namespace Model
|
|||
|
||||
private System.Nullable<System.DateTime> _Rectification_Date;
|
||||
|
||||
private string _CheckOpinions;
|
||||
|
||||
private EntityRef<Base_Unit> _Base_Unit;
|
||||
|
||||
private EntityRef<WBS_UnitWork> _WBS_UnitWork;
|
||||
|
@ -60151,6 +60329,8 @@ namespace Model
|
|||
partial void OnCheckItemSetContentChanged();
|
||||
partial void OnRectification_DateChanging(System.Nullable<System.DateTime> value);
|
||||
partial void OnRectification_DateChanged();
|
||||
partial void OnCheckOpinionsChanging(string value);
|
||||
partial void OnCheckOpinionsChanged();
|
||||
#endregion
|
||||
|
||||
public Check_CheckSpecialDetail()
|
||||
|
@ -60608,6 +60788,26 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckOpinions", DbType="NVarChar(2000)")]
|
||||
public string CheckOpinions
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._CheckOpinions;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._CheckOpinions != value))
|
||||
{
|
||||
this.OnCheckOpinionsChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._CheckOpinions = value;
|
||||
this.SendPropertyChanged("CheckOpinions");
|
||||
this.OnCheckOpinionsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_CheckSpecialDetail_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)]
|
||||
public Base_Unit Base_Unit
|
||||
{
|
||||
|
@ -392840,6 +393040,303 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_QualityAudit_GeneralEquipmentQuality")]
|
||||
public partial class View_QualityAudit_GeneralEquipmentQuality
|
||||
{
|
||||
|
||||
private string _GeneralEquipmentQualityId;
|
||||
|
||||
private string _ProjectId;
|
||||
|
||||
private string _GeneralEquipmentQualityCode;
|
||||
|
||||
private string _UnitId;
|
||||
|
||||
private string _UnitName;
|
||||
|
||||
private string _SpecialEquipmentId;
|
||||
|
||||
private string _SpecialEquipmentName;
|
||||
|
||||
private System.Nullable<bool> _IsQualified;
|
||||
|
||||
private System.Nullable<int> _EquipmentCount;
|
||||
|
||||
private System.Nullable<System.DateTime> _InDate;
|
||||
|
||||
private string _Remark;
|
||||
|
||||
private string _CompileMan;
|
||||
|
||||
private string _CompileManName;
|
||||
|
||||
private System.Nullable<System.DateTime> _CompileDate;
|
||||
|
||||
private string _QRCodeAttachUrl;
|
||||
|
||||
private string _AttachUrl;
|
||||
|
||||
public View_QualityAudit_GeneralEquipmentQuality()
|
||||
{
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeneralEquipmentQualityId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string GeneralEquipmentQualityId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._GeneralEquipmentQualityId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._GeneralEquipmentQualityId != value))
|
||||
{
|
||||
this._GeneralEquipmentQualityId = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ProjectId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ProjectId != value))
|
||||
{
|
||||
this._ProjectId = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeneralEquipmentQualityCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string GeneralEquipmentQualityCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._GeneralEquipmentQualityCode;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._GeneralEquipmentQualityCode != value))
|
||||
{
|
||||
this._GeneralEquipmentQualityCode = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string UnitId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._UnitId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._UnitId != value))
|
||||
{
|
||||
this._UnitId = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitName", DbType="NVarChar(200)")]
|
||||
public string UnitName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._UnitName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._UnitName != value))
|
||||
{
|
||||
this._UnitName = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecialEquipmentId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string SpecialEquipmentId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._SpecialEquipmentId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._SpecialEquipmentId != value))
|
||||
{
|
||||
this._SpecialEquipmentId = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecialEquipmentName", DbType="NVarChar(50)")]
|
||||
public string SpecialEquipmentName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._SpecialEquipmentName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._SpecialEquipmentName != value))
|
||||
{
|
||||
this._SpecialEquipmentName = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsQualified", DbType="Bit")]
|
||||
public System.Nullable<bool> IsQualified
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._IsQualified;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._IsQualified != value))
|
||||
{
|
||||
this._IsQualified = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EquipmentCount", DbType="Int")]
|
||||
public System.Nullable<int> EquipmentCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._EquipmentCount;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._EquipmentCount != value))
|
||||
{
|
||||
this._EquipmentCount = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InDate", DbType="DateTime")]
|
||||
public System.Nullable<System.DateTime> InDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._InDate;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._InDate != value))
|
||||
{
|
||||
this._InDate = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")]
|
||||
public string Remark
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Remark;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Remark != value))
|
||||
{
|
||||
this._Remark = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")]
|
||||
public string CompileMan
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._CompileMan;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._CompileMan != value))
|
||||
{
|
||||
this._CompileMan = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileManName", DbType="NVarChar(50)")]
|
||||
public string CompileManName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._CompileManName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._CompileManName != value))
|
||||
{
|
||||
this._CompileManName = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")]
|
||||
public System.Nullable<System.DateTime> CompileDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._CompileDate;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._CompileDate != value))
|
||||
{
|
||||
this._CompileDate = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QRCodeAttachUrl", DbType="NVarChar(200)")]
|
||||
public string QRCodeAttachUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._QRCodeAttachUrl;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._QRCodeAttachUrl != value))
|
||||
{
|
||||
this._QRCodeAttachUrl = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttachUrl", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
|
||||
public string AttachUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._AttachUrl;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._AttachUrl != value))
|
||||
{
|
||||
this._AttachUrl = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_QualityAudit_PersonQuality")]
|
||||
public partial class View_QualityAudit_PersonQuality
|
||||
{
|
||||
|
|
|
@ -16,12 +16,12 @@ namespace WebAPI.Controllers
|
|||
/// </summary>
|
||||
/// <param name="CheckSpecialId"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getCheckSpecialById(string CheckSpecialId)
|
||||
public Model.ResponeData getCheckSpecialById(string CheckSpecialId,string state="0")
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APICheckSpecialService.getCheckSpecialById(CheckSpecialId);
|
||||
responeData.data = APICheckSpecialService.getCheckSpecialById(CheckSpecialId, state);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -41,12 +41,12 @@ namespace WebAPI.Controllers
|
|||
/// <param name="states"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getCheckSpecialList(string projectId, string states, int pageIndex)
|
||||
public Model.ResponeData getCheckSpecialList(string projectId, string states, int pageIndex,string userid)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getDataList = APICheckSpecialService.getCheckSpecialList(projectId, states);
|
||||
var getDataList = APICheckSpecialService.getCheckSpecialList(projectId, states, userid);
|
||||
int pageCount = getDataList.Count();
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
|
@ -133,5 +133,24 @@ namespace WebAPI.Controllers
|
|||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 加载措施
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getGroup_HandleStep()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = ConstValue.drpConstItemList(BLL.ConstValue.Group_HandleStep);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,160 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 一般机具设备资质
|
||||
/// </summary>
|
||||
public class GeneralEquipmentQualityController : ApiController
|
||||
{
|
||||
#region 根据equipmentQualityId获取机具设备资质信息
|
||||
/// <summary>
|
||||
/// 根据equipmentQualityId获取机具设备资质信息
|
||||
/// </summary>
|
||||
/// <param name="equipmentQualityId"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getEquipmentQualityByEquipmentQualityId(string equipmentQualityId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIGeneralEquipmentQualityService.getEquipmentQualityByEquipmentQualityIdFactoryCode(equipmentQualityId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 根据projectId、unitid获取机具设备资质信息
|
||||
/// <summary>
|
||||
/// 根据projectId、unitid获取机具设备资质信息
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getEquipmentQualityByProjectIdUnitId(string projectId, string unitId, int pageIndex)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getDataList = APIGeneralEquipmentQualityService.getEquipmentQualityList(projectId, unitId, null);
|
||||
int pageCount = getDataList.Count();
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
getDataList = getDataList.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||
}
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据projectId、unitid获取机具设备资质信息-查询
|
||||
/// <summary>
|
||||
/// 根据projectId、unitid获取机具设备资质信息
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="strParam">查询条件</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getEquipmentQualityByProjectIdUnitIdQuery(string projectId, string unitId, string strParam, int pageIndex)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getDataList = APIGeneralEquipmentQualityService.getEquipmentQualityList(projectId, unitId, strParam);
|
||||
int pageCount = getDataList.Count();
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
getDataList = getDataList.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||
}
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据projectId、unitid获取特岗机具设备资质资质各状态数
|
||||
/// <summary>
|
||||
/// 根据projectId、unitid获取特岗机具设备资质资质各状态数
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getEquipmentQualityCount(string projectId, string unitId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getDataList = new Model.SGGLDB(Funs.ConnString).QualityAudit_GeneralEquipmentQuality.Where(x => x.ProjectId == projectId);
|
||||
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(projectId, unitId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.UnitId == unitId);
|
||||
}
|
||||
////总数
|
||||
int tatalCount = getDataList.Count();
|
||||
|
||||
responeData.data = new { tatalCount };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 保存QualityAudit_EquipmentQuality
|
||||
/// <summary>
|
||||
/// 保存QualityAudit_EquipmentQuality
|
||||
/// </summary>
|
||||
/// <param name="newitem">机具设备资质</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData SaveEquipmentQuality([FromBody] Model.EquipmentQualityItem newitem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
APIGeneralEquipmentQualityService.SaveEquipmentQuality(newitem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -1083,5 +1083,28 @@ namespace WebAPI.Controllers
|
|||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 二维码扫码获取人员
|
||||
/// <summary>
|
||||
/// 二维码扫码获取人员
|
||||
/// </summary>
|
||||
/// <param name="personId"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getPersonByPersonIdQrcode(string personId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIPersonService.getPersonByPersonIdQrcode(personId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -153,6 +153,7 @@
|
|||
<Compile Include="Controllers\FaceController.cs" />
|
||||
<Compile Include="Controllers\DoorServerController.cs" />
|
||||
<Compile Include="Controllers\HJGL\GetHJDataController.cs" />
|
||||
<Compile Include="Controllers\HSSE\GeneralEquipmentQualityController.cs" />
|
||||
<Compile Include="Controllers\HSSE\HSSELogController.cs" />
|
||||
<Compile Include="Controllers\HSSE\TestingController.cs" />
|
||||
<Compile Include="Controllers\Person\PersonCheckController.cs" />
|
||||
|
|
Loading…
Reference in New Issue