fix:质量检查
This commit is contained in:
@@ -107,7 +107,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
protected DataTable ChecklistData()
|
||||
{
|
||||
string strSql = @"SELECT chec.CheckControlCode,chec.CheckSite,chec.ProjectId,chec.unitId,cNProfessional.ProfessionalName,"
|
||||
+ @" QualityQuestionType.QualityQuestionType as QuestionType,chec.LimitDate,"
|
||||
+ @" QualityQuestionType.QualityQuestionType as QuestionType,chec.LimitDate,chec.QuestionDef,chec.RectifyOpinion,"
|
||||
+ @" chec.checkman,chec.CheckDate,chec.DocCode,chec.submitman,chec.state,chec.CNProfessionalCode,"
|
||||
+ @" unit.UnitName,unitWork.UnitWorkName,u.userName "
|
||||
+ @" FROM Check_CheckControl chec"
|
||||
@@ -337,15 +337,17 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
if (checks.State.Equals(Const.CheckControl_Complete))
|
||||
{
|
||||
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
|
||||
Alert.ShowInTop("当前数据已闭环,无法编辑,请右键查看!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//验证当前登录人是否是质量经理/施工经理
|
||||
bool isAuthenticated = authenticatedUser();
|
||||
Model.Check_CheckControlApprove approve = BLL.CheckControlApproveService.GetCheckControlApproveByCheckControlId(codes);
|
||||
if (approve != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(approve.ApproveMan))
|
||||
{
|
||||
if (this.CurrUser.UserId == approve.ApproveMan || CurrUser.UserId == Const.sysglyId)
|
||||
if (this.CurrUser.UserId == approve.ApproveMan || CurrUser.UserId == Const.sysglyId || CurrUser.UserId == Const.hfnbdId || isAuthenticated)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckListEdit.aspx?CheckControlCode={0}", codes, "编辑 - ")));
|
||||
return;
|
||||
@@ -374,6 +376,11 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
}
|
||||
|
||||
}
|
||||
else if (isAuthenticated)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckListEdit.aspx?CheckControlCode={0}", codes, "编辑 - ")));
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
|
||||
@@ -386,7 +393,57 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 验证当前登录人是否是质量经理/施工经理
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool authenticatedUser()
|
||||
{
|
||||
bool isAuthenticated = false;
|
||||
var query = (from pu in Funs.DB.Project_ProjectUser
|
||||
join u in Funs.DB.Sys_User on pu.UserId equals u.UserId into userGroup
|
||||
from u in userGroup.DefaultIfEmpty()
|
||||
join projectUnit in Funs.DB.Project_ProjectUnit on new { pu.UnitId, pu.ProjectId }
|
||||
equals new { projectUnit.UnitId, projectUnit.ProjectId } into projectUnitJoin
|
||||
from projectUnit in projectUnitJoin.DefaultIfEmpty()
|
||||
join person in Funs.DB.SitePerson_Person on new { pu.ProjectId, u.IdentityCard } equals new
|
||||
{ person.ProjectId, person.IdentityCard } into personGroup
|
||||
from person in personGroup.DefaultIfEmpty()
|
||||
join wp in Funs.DB.Base_WorkPost on person.WorkPostId equals wp.WorkPostId into workPostGroup
|
||||
from wp in workPostGroup.DefaultIfEmpty()
|
||||
join sysConst in Funs.DB.Sys_Const on new
|
||||
{ GroupId = "ProjectUnitType", ConstValue = projectUnit.UnitType } equals new
|
||||
{ sysConst.GroupId, sysConst.ConstValue } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where pu.ProjectId == this.ProjectId && pu.UserId == this.CurrUser.UserId && sysConst.ConstText == "总包"
|
||||
select new
|
||||
{
|
||||
pu.RoleId,
|
||||
wp.WorkPostName,
|
||||
}).FirstOrDefault();
|
||||
List<string> names = new List<string>();
|
||||
if (query != null)
|
||||
{
|
||||
string roleIds = query.RoleId;
|
||||
List<string> ids = roleIds.Split(',').ToList();
|
||||
ids.ForEach(id =>
|
||||
{
|
||||
string name = Funs.DB.Sys_Role.Where(r2 => r2.RoleId == id).Select(r2 => r2.RoleName).FirstOrDefault();
|
||||
names.Add(name);
|
||||
});
|
||||
var RoleName = string.Join(",", names);
|
||||
|
||||
if (RoleName.Contains("质量") || RoleName.Contains("施工") )
|
||||
{
|
||||
isAuthenticated = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isAuthenticated;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
@@ -796,5 +853,45 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 获取整改前图片(放于Img中)
|
||||
/// </summary>
|
||||
/// <param name="CheckControlCode"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertImageUrlByImage(object CheckControlCode)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (CheckControlCode != null)
|
||||
{
|
||||
var registration = AttachFileService.GetAttachFile(CheckControlCode.ToString(), BLL.Const.CheckListMenuId);
|
||||
if (registration != null)
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage("../../", registration.AttachUrl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取整改后图片(放于Img中)
|
||||
/// </summary>
|
||||
/// <param name="CheckControlCode"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertImgUrlByImage(object CheckControlCode)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (CheckControlCode != null)
|
||||
{
|
||||
var registration = AttachFileService.GetAttachFile(CheckControlCode.ToString() + "r", BLL.Const.CheckListMenuId);
|
||||
|
||||
if (registration != null)
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage("../../", registration.AttachUrl);
|
||||
}
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user