小程序
This commit is contained in:
@@ -0,0 +1,349 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Linq.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class QualityAssuranceService
|
||||
{
|
||||
#region 设计交底
|
||||
public class Comprehensive_DesignDetailsDto : Model.Comprehensive_DesignDetails {
|
||||
/// <summary>
|
||||
/// 专业名称
|
||||
/// </summary>
|
||||
public string ProfessionalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位工程名称
|
||||
/// </summary>
|
||||
public string UnitWorkNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位名称
|
||||
/// </summary>
|
||||
public string UnitNames { get; set; }
|
||||
|
||||
public string DetailsDates { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设计交底列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Comprehensive_DesignDetailsDto> getDesignDetailsList(string projectId,string cNProfessionalId="") {
|
||||
var list = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
join y in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals y.CNProfessionalId
|
||||
where x.ProjectId == projectId
|
||||
select new Comprehensive_DesignDetailsDto()
|
||||
{
|
||||
DesignDetailsId=x.DesignDetailsId,
|
||||
CNProfessionalId=x.CNProfessionalId,
|
||||
ProfessionalName = y.ProfessionalName,
|
||||
DesignDetailsCode=x.DesignDetailsCode,
|
||||
DetailsMan=x.DetailsMan,
|
||||
DetailsDates = string.Format("{0:yyyy-MM-dd}", x.DetailsDate),
|
||||
UnitWorkNames= ConvertUnitWork(x.UnitWorkId),
|
||||
UnitNames= ConvertCarryUnit(x.UnitName),
|
||||
}).ToList();
|
||||
if (!string.IsNullOrEmpty(cNProfessionalId))
|
||||
{
|
||||
list = list.Where(x => x.CNProfessionalId == cNProfessionalId).ToList();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static Comprehensive_DesignDetailsDto getDesignDetails(string Id)
|
||||
{
|
||||
var list = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
join y in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals y.CNProfessionalId
|
||||
where x.DesignDetailsId == Id
|
||||
select new Comprehensive_DesignDetailsDto()
|
||||
{
|
||||
DesignDetailsId = x.DesignDetailsId,
|
||||
ProfessionalName = y.ProfessionalName,
|
||||
DesignDetailsCode = x.DesignDetailsCode,
|
||||
DetailsMan = x.DetailsMan,
|
||||
DetailsDates = string.Format("{0:yyyy-MM-dd}", x.DetailsDate),
|
||||
UnitWorkNames = ConvertUnitWork(x.UnitWorkId),
|
||||
UnitNames = ConvertCarryUnit(x.UnitName),
|
||||
JoinPersonNum=x.JoinPersonNum,
|
||||
RemarCode = x.RemarCode,
|
||||
AttachUrl = APIUpLoadFileService.getFileUrl(x.DesignDetailsId, null),
|
||||
}).First();
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单位工程名称
|
||||
/// </summary>
|
||||
/// <param name="CarryUnitWorks"></param>
|
||||
/// <returns></returns>
|
||||
protected static string ConvertUnitWork(object CarryUnitWorks)
|
||||
{
|
||||
string CarryUnitWorkName = string.Empty;
|
||||
if (CarryUnitWorks != null)
|
||||
{
|
||||
string[] Ids = CarryUnitWorks.ToString().Split(',');
|
||||
foreach (string t in Ids)
|
||||
{
|
||||
var UnitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(t);
|
||||
if (UnitWork != null)
|
||||
{
|
||||
CarryUnitWorkName += UnitWork.UnitWorkName + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CarryUnitWorkName != string.Empty)
|
||||
{
|
||||
return CarryUnitWorkName.Substring(0, CarryUnitWorkName.Length - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单位名称
|
||||
/// </summary>
|
||||
/// <param name="CarryUnitIds"></param>
|
||||
/// <returns></returns>
|
||||
protected static string ConvertCarryUnit(object CarryUnitIds)
|
||||
{
|
||||
string CarryUnitName = string.Empty;
|
||||
if (CarryUnitIds != null)
|
||||
{
|
||||
string[] Ids = CarryUnitIds.ToString().Split(',');
|
||||
foreach (string t in Ids)
|
||||
{
|
||||
var type = BLL.UnitService.GetUnitByUnitId(t);
|
||||
if (type != null)
|
||||
{
|
||||
CarryUnitName += type.UnitName + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CarryUnitName != string.Empty)
|
||||
{
|
||||
return CarryUnitName.Substring(0, CarryUnitName.Length - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 图纸会审
|
||||
public class Comprehensive_ReviewDrawingsDto : Model.Comprehensive_ReviewDrawings {
|
||||
public string ProfessionalName { get; set; }
|
||||
|
||||
public string ReviewDates { get; set; }
|
||||
|
||||
public string UnitWorkNames { get; set; }
|
||||
|
||||
public string ReceiveUnitss { get; set; }
|
||||
|
||||
public string AttachUrl { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 图纸会审列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="cNProfessionalId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Comprehensive_ReviewDrawingsDto> getReviewDrawingsList(string projectId, string cNProfessionalId = "")
|
||||
{
|
||||
var list = (from x in Funs.DB.Comprehensive_ReviewDrawings
|
||||
join y in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals y.CNProfessionalId
|
||||
where x.ProjectId == projectId
|
||||
select new Comprehensive_ReviewDrawingsDto
|
||||
{
|
||||
Id = x.Id,
|
||||
CNProfessionalId = x.CNProfessionalId,
|
||||
ProfessionalName = y.ProfessionalName,
|
||||
DraCode = x.DraCode,
|
||||
UnitWorkNames = ConvertUnitWork(x.UnitWorkId),
|
||||
ReceiveUnitss = ConvertCarryUnit(x.ReceiveUnits),
|
||||
ReviewDates = string.Format("{0:yyyy-MM-dd}", x.ReviewDate),
|
||||
}).ToList();
|
||||
if (!string.IsNullOrEmpty(cNProfessionalId))
|
||||
{
|
||||
list = list.Where(x => x.CNProfessionalId == cNProfessionalId).ToList();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 图纸会审详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Comprehensive_ReviewDrawingsDto getReviewDrawings(string Id) {
|
||||
var list = (from x in Funs.DB.Comprehensive_ReviewDrawings
|
||||
join y in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals y.CNProfessionalId
|
||||
where x.Id == Id
|
||||
select new Comprehensive_ReviewDrawingsDto
|
||||
{
|
||||
Id = x.Id,
|
||||
CNProfessionalId = x.CNProfessionalId,
|
||||
ProfessionalName = y.ProfessionalName,
|
||||
DraCode=x.DraCode,
|
||||
UnitWorkNames = ConvertUnitWork(x.UnitWorkId),
|
||||
ReceiveUnitss = ConvertCarryUnit(x.ReceiveUnits),
|
||||
ReviewDates = string.Format("{0:yyyy-MM-dd}", x.ReviewDate),
|
||||
RemarkCode=x.RemarkCode,
|
||||
Remarks=x.Remarks,
|
||||
AttachUrl= APIUpLoadFileService.getFileUrl(x.Id, null),
|
||||
}).First();
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 技术交底
|
||||
public class Comprehensive_ConTechnologyDisclosureDto : Model.Comprehensive_ConTechnologyDisclosure {
|
||||
public string ProfessionalName { get; set; }
|
||||
|
||||
public string UnitName { get; set; }
|
||||
|
||||
public string UnitWorkNames { get; set; }
|
||||
|
||||
public string DisclosureDates { get; set; }
|
||||
}
|
||||
|
||||
public static List<Comprehensive_ConTechnologyDisclosureDto> getConTechnologyDisclosureList(string projectId, string cNProfessionalId = "") {
|
||||
var list = (from x in Funs.DB.Comprehensive_ConTechnologyDisclosure
|
||||
join y in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals y.CNProfessionalId
|
||||
join z in Funs.DB.Base_Unit on x.UnitId equals z.UnitId
|
||||
where x.ProjectId == projectId
|
||||
select new Comprehensive_ConTechnologyDisclosureDto
|
||||
{
|
||||
ConTechnologyDisclosureId=x.ConTechnologyDisclosureId,
|
||||
ProfessionalName = y.ProfessionalName,
|
||||
DisclosureCode=x.DisclosureCode,
|
||||
DisclosureName=x.DisclosureName,
|
||||
UnitName=z.UnitName,
|
||||
DisclosureMan=x.DisclosureMan,
|
||||
DisclosureDates = string.Format("{0:yyyy-MM-dd}", x.DisclosureDate),
|
||||
UnitWorkNames= ConvertUnitWork(x.UnitWorkId),
|
||||
AttendMan=x.AttendMan,
|
||||
|
||||
}).ToList();
|
||||
if (!string.IsNullOrEmpty(cNProfessionalId))
|
||||
{
|
||||
list = list.Where(x => x.CNProfessionalId == cNProfessionalId).ToList();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static Comprehensive_ConTechnologyDisclosureDto getConTechnologyDisclosure(string Id) {
|
||||
var list = (from x in Funs.DB.Comprehensive_ConTechnologyDisclosure
|
||||
join y in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals y.CNProfessionalId
|
||||
join z in Funs.DB.Base_Unit on x.UnitId equals z.UnitId
|
||||
where x.ConTechnologyDisclosureId == Id
|
||||
select new Comprehensive_ConTechnologyDisclosureDto
|
||||
{
|
||||
ConTechnologyDisclosureId = x.ConTechnologyDisclosureId,
|
||||
ProfessionalName = y.ProfessionalName,
|
||||
DisclosureCode = x.DisclosureCode,
|
||||
DisclosureName = x.DisclosureName,
|
||||
UnitName = z.UnitName,
|
||||
DisclosureMan = x.DisclosureMan,
|
||||
DisclosureDates = string.Format("{0:yyyy-MM-dd}", x.DisclosureDate),
|
||||
UnitWorkNames = ConvertUnitWork(x.UnitWorkId),
|
||||
RemarkCode=x.RemarkCode,
|
||||
AttendMan = x.AttendMan,
|
||||
}).First();
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 人员报验
|
||||
public class Comprehensive_InspectionPersonDto : Model.Comprehensive_InspectionPerson {
|
||||
public string UnitName { get; set; }
|
||||
|
||||
public string ProfessionalName { get; set; }
|
||||
|
||||
public string UnitWorkNames { get; set; }
|
||||
|
||||
public string PostName { get; set; }
|
||||
|
||||
public string ValidityDates { get; set; }
|
||||
|
||||
public string ApprovalTimes { get; set; }
|
||||
|
||||
public string DepartureTimes { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 人员报验列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="searchText"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Comprehensive_InspectionPersonDto> getInspectionPersonList(string projectId, string searchText = "") {
|
||||
var list = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join Cn in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals Cn.CNProfessionalId
|
||||
join z in Funs.DB.Base_Post on x.PostId equals z.PostId
|
||||
where x.ProjectId==projectId
|
||||
select new Comprehensive_InspectionPersonDto
|
||||
{
|
||||
|
||||
}).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Comprehensive_InspectionPersonDto getInspectionPerson(string Id)
|
||||
{
|
||||
var list = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
join Cn in Funs.DB.Base_CNProfessional on x.CNProfessionalId equals Cn.CNProfessionalId
|
||||
join z in Funs.DB.Base_Post on x.PostId equals z.PostId
|
||||
where x.InspectionPersonId ==Id
|
||||
select new Comprehensive_InspectionPersonDto
|
||||
{
|
||||
|
||||
}).First();
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 材料报验
|
||||
|
||||
#endregion
|
||||
|
||||
#region 机具报验
|
||||
|
||||
#endregion
|
||||
|
||||
#region 设计变更
|
||||
|
||||
#endregion
|
||||
|
||||
#region 共捡数据
|
||||
|
||||
#endregion
|
||||
|
||||
#region 无损检测
|
||||
|
||||
#endregion
|
||||
|
||||
#region 压力管道
|
||||
|
||||
#endregion
|
||||
|
||||
#region 特种设备
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user