合并最新

This commit is contained in:
2022-12-20 09:32:32 +08:00
parent 844e9f1488
commit 1abdaa9476
654 changed files with 73563 additions and 9746 deletions
@@ -60,7 +60,7 @@ namespace FineUIPro.Web.CQMS.Check
//权限按钮方法
UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpSponsorUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
btnNew.OnClientClick = Window1.GetShowReference("CheckFineListEdit.aspx") + "return false;";
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
@@ -70,12 +70,12 @@ namespace FineUIPro.Web.CQMS.Check
}
}
#endregion
public Task<DataTable> data()
{
Task<DataTable> task = new Task<DataTable>(() =>
@@ -87,7 +87,7 @@ namespace FineUIPro.Web.CQMS.Check
}
protected DataTable ChecklistData()
{
string strSql = @"SELECT Fee,chec.CheckFineId,chec.CheckControlCode,chec.ProjectId,chec.unitId,
string strSql = @"SELECT Fee,chec.CheckFineId,chec.CheckControlCode,chec.ProjectId,chec.unitId,chec.QuestionDef,
chec.checkman,chec.CheckDate,chec.DocCode,chec.state,
unit.UnitName,unitWork.UnitWorkName+(case unitWork.ProjectType when '1' then '(建筑)' else '(安装)' end) as UnitWorkName,u.userName
FROM Check_CheckFine chec
@@ -110,9 +110,9 @@ namespace FineUIPro.Web.CQMS.Check
strSql += " AND chec.unitworkId=@unitworkId";
listStr.Add(new SqlParameter("@unitworkId", drpUnitWork.SelectedValue));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
return tb;
@@ -136,12 +136,13 @@ namespace FineUIPro.Web.CQMS.Check
{
IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(registrationId.ToString(), BLL.Const.CheckFineListMenuId);
if (sourlist != null&& sourlist.Count>0)
if (sourlist != null && sourlist.Count > 0)
{
string AttachUrl = "";
foreach(var item in sourlist)
{ if(!string.IsNullOrEmpty(item.AttachUrl)&& item.AttachUrl.ToLower().EndsWith(".jpg")|| item.AttachUrl.ToLower().EndsWith(".jpeg")|| item.AttachUrl.ToLower().EndsWith(".png"))
AttachUrl += item.AttachUrl.TrimEnd(',')+",";
foreach (var item in sourlist)
{
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
}
url = BLL.UploadAttachmentService.ShowImage("../../", AttachUrl.TrimEnd(','));
}
@@ -153,7 +154,7 @@ namespace FineUIPro.Web.CQMS.Check
string url = string.Empty;
if (registrationId != null)
{
IList<Model.AttachFile> sourlist = AttachFileService.Getfilelist(registrationId.ToString()+"r", BLL.Const.CheckListMenuId);
IList<Model.AttachFile> sourlist = AttachFileService.Getfilelist(registrationId.ToString() + "r", BLL.Const.CheckListMenuId);
if (sourlist != null && sourlist.Count > 0)
{
@@ -168,8 +169,8 @@ namespace FineUIPro.Web.CQMS.Check
}
return url;
}
/// <summary>
@@ -190,7 +191,7 @@ namespace FineUIPro.Web.CQMS.Check
Grid1.DataSource = table;
Grid1.DataBind();
}
@@ -291,12 +292,37 @@ namespace FineUIPro.Web.CQMS.Check
if (checks != null)
{
if (checks.CheckMan.Equals(Const.CheckControl_Complete))
if (checks.CheckMan.Equals(Const.CheckFine_Complete))
{
Alert.ShowInTop("记录已审批完成!", MessageBoxIcon.Warning);
return;
}
Model.Check_CheckFineApprove approve = BLL.CheckFineApproveService.GetCheckFineApproveByCheckFineId(codes);
if (approve != null)
{
if (!string.IsNullOrEmpty(approve.ApproveMan))
{
if (this.CurrUser.UserId == approve.ApproveMan || CurrUser.UserId == Const.sysglyId)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckFineListEdit.aspx?CheckFineId={0}", codes, "编辑 - ")));
}
else
{
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckFineListEdit.aspx?CheckFineId={0}", codes, "编辑 - ")));
return;
}
@@ -304,6 +330,24 @@ namespace FineUIPro.Web.CQMS.Check
#endregion
#region
protected void btnMenuView_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string codes = Grid1.SelectedRowID.Split(',')[0];
var checks = BLL.CheckFineService.CheckFine(codes);
if (checks != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckFineListView.aspx?CheckFineId={0}", codes, "查看 - ")));
}
}
#endregion
#region
/// <summary>
/// 批量删除
@@ -320,7 +364,7 @@ namespace FineUIPro.Web.CQMS.Check
}
string codes = Grid1.SelectedRowID.Split(',')[0];
var checks = BLL.CheckFineService.CheckFine(codes);
BLL.CheckFineApproveService.DeleteCheckFineApprovesByCheckFineId(codes);
BLL.CheckFineService.DeleteCheckList(codes);
BLL.LogService.AddSys_Log(this.CurrUser, checks.DocCode, codes, BLL.Const.CheckListMenuId, "删除质量罚款单记录");
Grid1.DataBind();
@@ -359,7 +403,7 @@ namespace FineUIPro.Web.CQMS.Check
}
}
#endregion
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
//if (checkControl.State.Equals("5") || checkControl.State.Equals("6"))
@@ -381,21 +425,6 @@ namespace FineUIPro.Web.CQMS.Check
//}
}
protected void btnMenuView_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string codes = Grid1.SelectedRowID.Split(',')[0];
var checks = BLL.CheckControlService.GetCheckControl(codes);
if (checks != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckListView.aspx?CheckFineId={0}", codes, "查看 - ")));
}
}
protected void btnMenuNotice_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
@@ -429,8 +458,8 @@ namespace FineUIPro.Web.CQMS.Check
if (project != null)
{
bookmarkProjectName.Text = string.IsNullOrEmpty(project.ShortName) ? project.ProjectName : project.ShortName;
//bookmarkProjectName.Text = string.IsNullOrEmpty(project.ShortName) ? project.ProjectName : project.ShortName;
bookmarkProjectName.Text = project.ProjectName;
}
}
if (bookmarkProjectCode != null)
@@ -473,14 +502,7 @@ namespace FineUIPro.Web.CQMS.Check
bookmarkWorkArea.Text = unitWork.UnitWorkCode + "-" + unitWork.UnitWorkName;
}
}
Bookmark bookmarkCheckDate = doc.Range.Bookmarks["CheckDate"];
if (bookmarkCheckDate != null)
{
if (checkControl.CheckDate.HasValue)
{
bookmarkCheckDate.Text = checkControl.CheckDate.Value.ToString("yyyy年MM月dd日");
}
}
Bookmark bookmarkFine = doc.Range.Bookmarks["Fine"];
if (bookmarkFine != null)
{
@@ -531,129 +553,189 @@ namespace FineUIPro.Web.CQMS.Check
bookmarkCheckMan.Text = user.UserName;
}
}
IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(checkControl.CheckFineId, BLL.Const.CheckFineListMenuId);
if (sourlist != null && sourlist.Count > 0)
Bookmark bookmarkCheckDate = doc.Range.Bookmarks["CheckDate"];
if (bookmarkCheckDate != null)
{
int indexPic = 1;
string AttachUrl = "";
foreach (var item in sourlist)
if (checkControl.CheckDate.HasValue)
{
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
{
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
}
bookmarkCheckDate.Text = checkControl.CheckDate.Value.ToString("yyyy年MM月dd日");
}
string[] pics = AttachUrl.Split(',');
foreach (string item in pics)
}
Model.Check_CheckFineApprove approve1 = BLL.CheckFineApproveService.GetAudit1(codes);
if (approve1 != null)
{
Bookmark bookmarkOpinions1 = doc.Range.Bookmarks["Opinions1"];
if (bookmarkOpinions1 != null)
{
switch (indexPic)
bookmarkOpinions1.Text = approve1.ApproveIdea;
}
Bookmark bookmarkApproveMan1 = doc.Range.Bookmarks["ApproveMan1"];
if (bookmarkApproveMan1 != null)
{
var user = UserService.GetUserByUserId(approve1.ApproveMan);
if (user != null)
{
case 1:
{
string url = rootPath + item.TrimEnd(',');
//查找书签
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("Pic1");
if (!string.IsNullOrEmpty(url))
{
System.Drawing.Size JpgSize;
float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
double i = 1;
i = JpgSize.Width / 180.0;
if (File.Exists(url))
{
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
}
}
indexPic++;
}
break;
case 2:
{
string url = rootPath + item.TrimEnd(',');
//查找书签
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("Pic2");
if (!string.IsNullOrEmpty(url))
{
System.Drawing.Size JpgSize;
float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
double i = 1;
i = JpgSize.Width / 180.0;
if (File.Exists(url))
{
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
}
}
indexPic++;
}
break;
case 3:
{
string url = rootPath + item.TrimEnd(',');
//查找书签
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("Pic3");
if (!string.IsNullOrEmpty(url))
{
System.Drawing.Size JpgSize;
float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
double i = 1;
i = JpgSize.Width / 180.0;
if (File.Exists(url))
{
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
}
}
indexPic++;
}
break;
case 4:
{
string url = rootPath + item.TrimEnd(',');
//查找书签
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("Pic4");
if (!string.IsNullOrEmpty(url))
{
System.Drawing.Size JpgSize;
float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
double i = 1;
i = JpgSize.Width / 180.0;
if (File.Exists(url))
{
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
}
}
indexPic++;
}
break;
bookmarkApproveMan1.Text = user.UserName;
}
}
Bookmark bookmarkApproveDate1 = doc.Range.Bookmarks["ApproveDate1"];
if (bookmarkApproveDate1 != null)
{
if (approve1.ApproveDate.HasValue)
{
bookmarkApproveDate1.Text = approve1.ApproveDate.Value.ToString("yyyy年MM月dd日");
}
}
}
Model.Check_CheckFineApprove approve2 = BLL.CheckFineApproveService.GetAudit2(codes);
if (approve2 != null)
{
Bookmark bookmarkOpinions2 = doc.Range.Bookmarks["Opinions2"];
if (bookmarkOpinions2 != null)
{
bookmarkOpinions2.Text = approve2.ApproveIdea;
}
Bookmark bookmarkApproveMan2 = doc.Range.Bookmarks["ApproveMan2"];
if (bookmarkApproveMan2 != null)
{
var user = UserService.GetUserByUserId(approve2.ApproveMan);
if (user != null)
{
bookmarkApproveMan2.Text = user.UserName;
}
}
Bookmark bookmarkApproveDate2 = doc.Range.Bookmarks["ApproveDate2"];
if (bookmarkApproveDate2 != null)
{
if (approve2.ApproveDate.HasValue)
{
bookmarkApproveDate2.Text = approve2.ApproveDate.Value.ToString("yyyy年MM月dd日");
}
}
}
//IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(checkControl.CheckFineId, BLL.Const.CheckFineListMenuId);
//if (sourlist != null && sourlist.Count > 0)
//{
// int indexPic = 1;
// string AttachUrl = "";
// foreach (var item in sourlist)
// {
// if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
// {
// AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
// }
// }
// string[] pics = AttachUrl.Split(',');
// foreach (string item in pics)
// {
// switch (indexPic)
// {
// case 1:
// {
// string url = rootPath + item.TrimEnd(',');
// //查找书签
// DocumentBuilder builder = new DocumentBuilder(doc);
// builder.MoveToBookmark("Pic1");
// if (!string.IsNullOrEmpty(url))
// {
// System.Drawing.Size JpgSize;
// float Wpx;
// float Hpx;
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
// double i = 1;
// i = JpgSize.Width / 180.0;
// if (File.Exists(url))
// {
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
// }
// }
// indexPic++;
// }
// break;
// case 2:
// {
// string url = rootPath + item.TrimEnd(',');
// //查找书签
// DocumentBuilder builder = new DocumentBuilder(doc);
// builder.MoveToBookmark("Pic2");
// if (!string.IsNullOrEmpty(url))
// {
// System.Drawing.Size JpgSize;
// float Wpx;
// float Hpx;
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
// double i = 1;
// i = JpgSize.Width / 180.0;
// if (File.Exists(url))
// {
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
// }
// }
// indexPic++;
// }
// break;
// case 3:
// {
// string url = rootPath + item.TrimEnd(',');
// //查找书签
// DocumentBuilder builder = new DocumentBuilder(doc);
// builder.MoveToBookmark("Pic3");
// if (!string.IsNullOrEmpty(url))
// {
// System.Drawing.Size JpgSize;
// float Wpx;
// float Hpx;
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
// double i = 1;
// i = JpgSize.Width / 180.0;
// if (File.Exists(url))
// {
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
// }
// }
// indexPic++;
// }
// break;
// case 4:
// {
// string url = rootPath + item.TrimEnd(',');
// //查找书签
// DocumentBuilder builder = new DocumentBuilder(doc);
// builder.MoveToBookmark("Pic4");
// if (!string.IsNullOrEmpty(url))
// {
// System.Drawing.Size JpgSize;
// float Wpx;
// float Hpx;
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
// double i = 1;
// i = JpgSize.Width / 180.0;
// if (File.Exists(url))
// {
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
// }
// }
// indexPic++;
// }
// break;
// }
// }
//}
@@ -723,7 +805,7 @@ namespace FineUIPro.Web.CQMS.Check
if (bookmarkSendDate != null)
{
if (checks.CheckDate.HasValue != null)
{
bookmarkSendDate.Text = checks.CheckDate.Value.ToString("yyyy年MM月dd日");
@@ -736,7 +818,7 @@ namespace FineUIPro.Web.CQMS.Check
bookmarkNoticeNum.Text = checks.DocCode;
}
Bookmark bookmarkUnit = doc.Range.Bookmarks["Unit"];
if (bookmarkUnit != null)
@@ -788,7 +870,7 @@ namespace FineUIPro.Web.CQMS.Check
}
Bookmark bookmarkCheckDate = doc.Range.Bookmarks["CheckDate"];
if (bookmarkCheckDate != null)
{
@@ -822,7 +904,7 @@ namespace FineUIPro.Web.CQMS.Check
bookmarkCheckMan.Text = sysUser.UserName;
}
}
Bookmark bookmarkResponseMan = doc.Range.Bookmarks["ResponseMan"];
Bookmark bookmarkResponseDate = doc.Range.Bookmarks["ResponseDate"];
if (bookmarkResponseMan != null)
@@ -992,7 +1074,7 @@ namespace FineUIPro.Web.CQMS.Check
}
IList<Model.AttachFile> reSourlist = AttachFileService.GetBeforeFileList(checks.CheckControlCode+"r", BLL.Const.CheckListMenuId);
IList<Model.AttachFile> reSourlist = AttachFileService.GetBeforeFileList(checks.CheckControlCode + "r", BLL.Const.CheckListMenuId);
if (reSourlist != null && reSourlist.Count > 0)
{
@@ -1169,5 +1251,66 @@ namespace FineUIPro.Web.CQMS.Check
txtEndTime.Text = "";
BindGrid();
}
/// <summary>
/// 把状态转换代号为文字形式
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected string ConvertState(object state)
{
if (state != null)
{
if (state.ToString() == BLL.Const.CheckFine_ReCompile)
{
return "重新编制";
}
else if (state.ToString() == BLL.Const.CheckFine_Compile)
{
return "编制";
}
else if (state.ToString() == BLL.Const.CheckFine_Audit1)
{
return "现场质量经理审核";
}
else if (state.ToString() == BLL.Const.CheckFine_Audit2)
{
return "现场经理/施工经理审批";
}
else if (state.ToString() == BLL.Const.CheckFine_Complete)
{
return "审批完成";
}
else
{
return "";
}
}
return "";
}
//<summary>
//获取办理人姓名
//</summary>
//<param name="state"></param>
//<returns></returns>
protected string ConvertMan(object CheckFineId)
{
if (CheckFineId != null)
{
Model.Check_CheckFineApprove a = BLL.CheckFineApproveService.GetCheckFineApproveByCheckFineId(CheckFineId.ToString());
if (a != null)
{
if (a.ApproveMan != null)
{
return BLL.UserService.GetUserByUserId(a.ApproveMan).UserName;
}
}
else
{
return "";
}
}
return "";
}
}
}