20240419 NCR附件修改

This commit is contained in:
毕文静 2024-04-19 10:13:37 +08:00
parent 0829c2c559
commit 016ea897dc
18 changed files with 1352 additions and 780 deletions

View File

@ -0,0 +1,3 @@
alter table Comprehensive_SpecialEquipment add PositionNum nvarchar(50)
go

View File

@ -518,5 +518,15 @@ namespace BLL
db.SubmitChanges(); db.SubmitChanges();
} }
} }
/// <summary>
/// 根据项目Id获取专项检查
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.Check_JointCheck> GetDriverPlanByProjectId(string projectId)
{
return (from x in Funs.DB.Check_JointCheck where x.ProjectId == projectId select x).ToList();
}
} }
} }

View File

@ -105,6 +105,7 @@ namespace BLL
newEquipment.MonitoringReportNumber = SpecialEquipment.MonitoringReportNumber; newEquipment.MonitoringReportNumber = SpecialEquipment.MonitoringReportNumber;
newEquipment.CompileMan = SpecialEquipment.CompileMan; newEquipment.CompileMan = SpecialEquipment.CompileMan;
newEquipment.Status = SpecialEquipment.Status; newEquipment.Status = SpecialEquipment.Status;
newEquipment.PositionNum = SpecialEquipment.PositionNum;
db.Comprehensive_SpecialEquipment.InsertOnSubmit(newEquipment); db.Comprehensive_SpecialEquipment.InsertOnSubmit(newEquipment);
db.SubmitChanges(); db.SubmitChanges();
} }
@ -127,6 +128,7 @@ namespace BLL
newEquipment.SubmitDataNumber = SpecialEquipment.SubmitDataNumber; newEquipment.SubmitDataNumber = SpecialEquipment.SubmitDataNumber;
newEquipment.MonitoringReportNumber = SpecialEquipment.MonitoringReportNumber; newEquipment.MonitoringReportNumber = SpecialEquipment.MonitoringReportNumber;
newEquipment.Status = SpecialEquipment.Status; newEquipment.Status = SpecialEquipment.Status;
newEquipment.PositionNum = SpecialEquipment.PositionNum;
db.SubmitChanges(); db.SubmitChanges();
} }
} }

View File

@ -3250,6 +3250,11 @@ namespace BLL
/// 培训记录导入模板原始虚拟路径 /// 培训记录导入模板原始虚拟路径
/// </summary> /// </summary>
public const string CQMS_TrainingRecordsTemplateUrl= "File\\Excel\\DataIn\\培训记录导入模板.xlsx"; public const string CQMS_TrainingRecordsTemplateUrl= "File\\Excel\\DataIn\\培训记录导入模板.xlsx";
/// <summary>
/// 质量专项检查模板文件原始虚拟路径
/// </summary>
public const string JointCheckTempUrl = "File\\Excel\\CQMS\\质量专项检查模版.xlsx";
#endregion #endregion
#region #region

View File

@ -75,6 +75,9 @@
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server" <f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
Hidden="true"> Hidden="true">
</f:Button> </f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items> </Items>
</f:Toolbar> </f:Toolbar>

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.IO;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using System.Web.UI; using System.Web.UI;
@ -401,5 +402,188 @@ namespace FineUIPro.Web.CQMS.Check
txtEndTime.Text = ""; txtEndTime.Text = "";
bindata(); bindata();
} }
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = Const.JointCheckTempUrl;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
uploadfilepath = rootPath + initTemplatePath;
var lists = BLL.JointCheckService.GetDriverPlanByProjectId(this.CurrUser.LoginProjectId);
if (lists != null)
{
newUrl = uploadfilepath.Replace("质量专项检查模版.xlsx", "质量专项检查.xlsx");
File.Copy(uploadfilepath, newUrl);
// 第一步:读取文件流
NPOI.SS.UserModel.IWorkbook workbook;
using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read))
{
workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);
}
// 创建单元格样式
NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle();
cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
var font = workbook.CreateFont();
font.FontHeightInPoints = 11;
cellStyle.SetFont(font);
NPOI.SS.UserModel.ICellStyle cellStyle0 = workbook.CreateCellStyle();
cellStyle0.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
cellStyle0.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
var font0 = workbook.CreateFont();
font0.FontHeightInPoints = 12;
font0.IsBold = true;
cellStyle0.SetFont(font0);
// 第二步:创建新数据行
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
NPOI.SS.UserModel.ICell cell;
int i = 1;
foreach (var item in lists)
{
// 第二步:创建新数据行
row = sheet.CreateRow(i);
// 添加数据
cell = row.CreateCell(0);
cell.CellStyle = cellStyle;
cell.SetCellValue(i.ToString());//序号
cell = row.CreateCell(1);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.JointCheckCode);
cell = row.CreateCell(2);
cell.CellStyle = cellStyle;
cell.SetCellValue(BLL.UnitService.GetUnitNameByUnitId(item.UnitId));
cell = row.CreateCell(3);
cell.CellStyle = cellStyle;
string checkName = string.Empty;
if (item.CheckType == "1")
{
checkName = "周检查";
}
else if (item.CheckType == "2")
{
checkName = "月检查";
}
else if (item.CheckType == "3")
{
checkName = "不定期检查";
}
else if (item.CheckType == "4")
{
checkName = "专业检查";
}
cell.SetCellValue(checkName);
cell = row.CreateCell(4);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.CheckName);
cell = row.CreateCell(5);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.CheckDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.CheckDate) : "");
cell = row.CreateCell(6);
cell.CellStyle = cellStyle;
cell.SetCellValue(BLL.UserService.GetUserNameByUserId(item.CheckMan));
cell = row.CreateCell(7);
cell.CellStyle = cellStyle;
string state = string.Empty;
if (item.State.ToString() == BLL.Const.JointCheck_ReCompile)
{
state = "重新编制";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Compile)
{
state = "编制";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Audit1)
{
state = "分包专工回复";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Audit2)
{
state = "分包负责人审批";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Audit3)
{
state = "总包专工回复";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Audit4)
{
state = "总包负责人审批";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Complete)
{
state = "审批完成";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Z)
{
state = "整改中";
}
else if (item.State.ToString() == BLL.Const.JointCheck_Audit1R)
{
state = "分包专工重新回复";
}
cell.SetCellValue(state);
cell = row.CreateCell(8);
cell.CellStyle = cellStyle;
string userNames = string.Empty;
List<Model.Check_JointCheckApprove> list = BLL.JointCheckApproveService.GetJointCheckApprovesByJointCheckId(item.JointCheckId);
foreach (var a in list)
{
if (a != null)
{
if (a.ApproveMan != null)
{
if (!userNames.Contains(BLL.UserService.GetUserByUserId(a.ApproveMan).UserName))
{
userNames += UserService.GetUserByUserId(a.ApproveMan).UserName + ",";
}
}
}
}
if (!string.IsNullOrEmpty(userNames))
{
userNames = userNames.Substring(0, userNames.LastIndexOf(","));
}
cell.SetCellValue(userNames);
i++;
}
// 第三步:写入文件流
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
{
workbook.Write(stream);
workbook.Close();
}
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(newUrl, 0, fileSize);
Response.Flush();
Response.Close();
File.Delete(newUrl);
}
else
{
Alert.ShowInTop("当前无记录,无法导出!", MessageBoxIcon.Warning);
}
}
#endregion
} }
} }

View File

@ -129,6 +129,15 @@ namespace FineUIPro.Web.CQMS.Check {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button btnNew; protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary> /// <summary>
/// lblPageIndex 控件。 /// lblPageIndex 控件。
/// </summary> /// </summary>

View File

@ -88,7 +88,7 @@
<Items> <Items>
<f:Panel ID="Panel2" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server"> <f:Panel ID="Panel2" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server">
<Items> <Items>
<f:Label ID="Label1" ShowRedStar="true" runat="server" Label="上传附件" <f:Label ID="Label1" runat="server" Label="上传附件"
LabelAlign="Right" LabelWidth="130px"> LabelAlign="Right" LabelWidth="130px">
</f:Label> </f:Label>
<f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="附件" runat="server" OnClick="btnAttach_Click"> <f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="附件" runat="server" OnClick="btnAttach_Click">

View File

@ -275,12 +275,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
nCRManagement.NCRManagementId = SQLHelper.GetNewID(typeof(Model.Comprehensive_NCRManagement)); nCRManagement.NCRManagementId = SQLHelper.GetNewID(typeof(Model.Comprehensive_NCRManagement));
this.hdAttachUrl.Text = nCRManagement.NCRManagementId; this.hdAttachUrl.Text = nCRManagement.NCRManagementId;
} }
var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == nCRManagement.NCRManagementId); //var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == nCRManagement.NCRManagementId);
if (sour == null || string.IsNullOrEmpty(sour.AttachUrl)) //if (sour == null || string.IsNullOrEmpty(sour.AttachUrl))
{ //{
Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning); // Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning);
return; // return;
} //}
nCRManagement.CompileMan = this.CurrUser.UserId; nCRManagement.CompileMan = this.CurrUser.UserId;
nCRManagement.Status = BLL.Const.Comprehensive_Compile; nCRManagement.Status = BLL.Const.Comprehensive_Compile;
BLL.NCRManagementService.AddNCRManagement(nCRManagement); BLL.NCRManagementService.AddNCRManagement(nCRManagement);
@ -288,12 +288,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
else else
{ {
nCRManagement.NCRManagementId = this.NCRManagementId; nCRManagement.NCRManagementId = this.NCRManagementId;
var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == this.NCRManagementId); //var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == this.NCRManagementId);
if (sour == null || string.IsNullOrEmpty(sour.AttachUrl)) //if (sour == null || string.IsNullOrEmpty(sour.AttachUrl))
{ //{
Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning); // Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning);
return; // return;
} //}
var model = Funs.DB.Comprehensive_NCRManagement.Where(u => u.NCRManagementId == this.NCRManagementId).FirstOrDefault(); var model = Funs.DB.Comprehensive_NCRManagement.Where(u => u.NCRManagementId == this.NCRManagementId).FirstOrDefault();
if (model != null) if (model != null)
{ {

View File

@ -48,6 +48,9 @@
<f:RenderField ColumnID="SpecialEquipmentName" DataField="SpecialEquipmentName" FieldType="String" HeaderText="设备名称" TextAlign="Center" <f:RenderField ColumnID="SpecialEquipmentName" DataField="SpecialEquipmentName" FieldType="String" HeaderText="设备名称" TextAlign="Center"
HeaderTextAlign="Center" Width="200px"> HeaderTextAlign="Center" Width="200px">
</f:RenderField> </f:RenderField>
<f:RenderField ColumnID="PositionNum" DataField="PositionNum" FieldType="String" HeaderText="位号" TextAlign="Center"
HeaderTextAlign="Center" Width="200px">
</f:RenderField>
<f:RenderField ColumnID="SunNumber" DataField="SunNumber" FieldType="String" HeaderText="总数量" TextAlign="Center" <f:RenderField ColumnID="SunNumber" DataField="SunNumber" FieldType="String" HeaderText="总数量" TextAlign="Center"
HeaderTextAlign="Center" Width="160px"> HeaderTextAlign="Center" Width="160px">
</f:RenderField> </f:RenderField>

View File

@ -32,7 +32,7 @@ namespace FineUIPro.Web.Comprehensive
public void BindGrid() public void BindGrid()
{ {
string strSql = @"select C.SpecialEquipmentId, ProjectId,C.EquipmentId, SunNumber, Status, string strSql = @"select C.SpecialEquipmentId, ProjectId,C.EquipmentId, SunNumber, Status,
InformNumber, SubmitDataNumber, MonitoringReportNumber, CompileMan,U.UnitName,eq.SpecialEquipmentName InformNumber, SubmitDataNumber, MonitoringReportNumber, CompileMan,U.UnitName,eq.SpecialEquipmentName,PositionNum
from Comprehensive_SpecialEquipment C from Comprehensive_SpecialEquipment C
left join Base_Unit U on C.UnitId=U.UnitId left join Base_Unit U on C.UnitId=U.UnitId
left join Base_SpecialEquipment eq on eq.SpecialEquipmentId = C.EquipmentId left join Base_SpecialEquipment eq on eq.SpecialEquipmentId = C.EquipmentId

View File

@ -33,6 +33,7 @@
</f:FormRow> </f:FormRow>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtPositionNum" runat="server" Label="位号" LabelWidth="130px" LabelAlign="Right"></f:TextBox>
<f:Panel ID="Panel2" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server"> <f:Panel ID="Panel2" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server">
<Items> <Items>
<f:Label ID="Label1" runat="server" Label="上传附件" <f:Label ID="Label1" runat="server" Label="上传附件"

View File

@ -57,6 +57,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{ {
this.drpEquipmentId.SelectedValue = specialEquipment.EquipmentId; this.drpEquipmentId.SelectedValue = specialEquipment.EquipmentId;
} }
this.txtPositionNum.Text = specialEquipment.PositionNum;
this.txtInformNumber.Text = specialEquipment.InformNumber.HasValue ? specialEquipment.InformNumber.ToString() : ""; this.txtInformNumber.Text = specialEquipment.InformNumber.HasValue ? specialEquipment.InformNumber.ToString() : "";
this.txtMonitoringReportNumber.Text = specialEquipment.MonitoringReportNumber.HasValue ? specialEquipment.MonitoringReportNumber.ToString() : ""; this.txtMonitoringReportNumber.Text = specialEquipment.MonitoringReportNumber.HasValue ? specialEquipment.MonitoringReportNumber.ToString() : "";
this.txtSubmitDataNumber.Text = specialEquipment.SubmitDataNumber.HasValue ? specialEquipment.SubmitDataNumber.ToString() : ""; this.txtSubmitDataNumber.Text = specialEquipment.SubmitDataNumber.HasValue ? specialEquipment.SubmitDataNumber.ToString() : "";
@ -121,6 +122,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
this.txtSunNumber.Readonly = true; this.txtSunNumber.Readonly = true;
this.drpEquipmentId.Readonly = true; this.drpEquipmentId.Readonly = true;
this.drpUnit.Readonly = true; this.drpUnit.Readonly = true;
this.txtPositionNum.Readonly = true;
this.drpAudit.Readonly = true; this.drpAudit.Readonly = true;
@ -199,6 +201,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{ {
specialEquipment.ReportTime = Convert.ToDateTime(this.txtReportTime.Text); specialEquipment.ReportTime = Convert.ToDateTime(this.txtReportTime.Text);
} }
specialEquipment.PositionNum = this.txtPositionNum.Text.Trim();
if (string.IsNullOrEmpty(this.SpecialEquipmentId)) if (string.IsNullOrEmpty(this.SpecialEquipmentId))
{ {
@ -273,6 +276,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{ {
specialEquipment.ReportTime = Convert.ToDateTime(this.txtReportTime.Text); specialEquipment.ReportTime = Convert.ToDateTime(this.txtReportTime.Text);
} }
specialEquipment.PositionNum = this.txtPositionNum.Text.Trim();
if (string.IsNullOrEmpty(this.SpecialEquipmentId)) if (string.IsNullOrEmpty(this.SpecialEquipmentId))
{ {
if (!string.IsNullOrEmpty(this.hdAttachUrl.Text)) if (!string.IsNullOrEmpty(this.hdAttachUrl.Text))

View File

@ -7,12 +7,10 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.Comprehensive namespace FineUIPro.Web.CQMS.Comprehensive {
{
public partial class SpecialEquipmentEdit public partial class SpecialEquipmentEdit {
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -95,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive
/// </remarks> /// </remarks>
protected global::FineUIPro.NumberBox txtMonitoringReportNumber; protected global::FineUIPro.NumberBox txtMonitoringReportNumber;
/// <summary>
/// txtPositionNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPositionNum;
/// <summary> /// <summary>
/// Panel2 控件。 /// Panel2 控件。
/// </summary> /// </summary>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress>false</Use64BitIISExpress> <Use64BitIISExpress>false</Use64BitIISExpress>
<IISExpressSSLPort /> <IISExpressSSLPort />

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />