diff --git a/SGGL/BLL/CQMS/Comprehensive/DataReceivingDocService.cs b/SGGL/BLL/CQMS/Comprehensive/DataReceivingDocService.cs index d199e432..05c1201f 100644 --- a/SGGL/BLL/CQMS/Comprehensive/DataReceivingDocService.cs +++ b/SGGL/BLL/CQMS/Comprehensive/DataReceivingDocService.cs @@ -19,18 +19,7 @@ namespace BLL public static Model.Comprehensive_DataReceivingDoc GetDataReceivingDocById(string dataReceivingDocId) { return Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(e => e.DataReceivingDocId == dataReceivingDocId); - } - - /// - /// 根据编号和名称获取资料收发文登记记录 - /// - /// - /// - /// - public static Model.Comprehensive_DataReceivingDoc GetDataReceivingDocByCodeAndName(string fileCode, string fileName) - { - return Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(e => e.FileCode == fileCode && e.FileName == fileName); - } + } /// /// 添加资料收发文登记记录 @@ -103,6 +92,7 @@ namespace BLL newDoc.CompileDate = doc.CompileDate; newDoc.Status = doc.Status; newDoc.AuditMan = doc.AuditMan; + newDoc.RemarkCode = doc.RemarkCode; Funs.DB.SubmitChanges(); } } diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index feaed4ac..976bce8e 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3322,11 +3322,6 @@ namespace BLL /// public const string InspectionMachineTempUrl = "File\\Excel\\CQMS\\机具报验模板.xls"; - /// - /// 资料收发文登记记录模板文件原始虚拟路径 - /// - public const string DataReceivingDocTempUrl = "File\\Excel\\CQMS\\资料收发文登记记录模板.xls"; - /// /// 培训记录模板文件原始虚拟路径 /// diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDoc.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDoc.aspx.cs index 082d5b54..8c7227fe 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDoc.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDoc.aspx.cs @@ -330,7 +330,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive protected void btnOut_Click(object sender, EventArgs e) { string rootPath = Server.MapPath("~/"); - string initTemplatePath = Const.DataReceivingDocTempUrl; + string initTemplatePath = Const.CQMS_DataReceivingDocTempUrl; string uploadfilepath = string.Empty; string newUrl = string.Empty; uploadfilepath = rootPath + initTemplatePath; @@ -346,10 +346,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive { lists = lists.Where(x => x.FileName.Contains(this.stxtFileName.Text.Trim())); } - lists = lists.OrderBy(x => x.FileCode); + lists = lists.OrderBy(x => x.RemarkCode); if (lists != null) { - newUrl = uploadfilepath.Replace("资料收发文登记记录模板.xls", "资料收发文登记记录.xls"); + string projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); + newUrl = uploadfilepath.Replace("资料收发文登记记录导入模板", "资料收发文登记记录(" + projectName + "" + DateTime.Now.ToString("yyyyMMdd") + ")"); File.Copy(uploadfilepath, newUrl); // 第一步:读取文件流 NPOI.SS.UserModel.IWorkbook workbook; @@ -384,7 +385,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0); NPOI.SS.UserModel.IRow row = sheet.GetRow(0); NPOI.SS.UserModel.ICell cell; - int i = 1; + int i = 3; foreach (var item in lists) { // 第二步:创建新数据行 @@ -511,6 +512,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive } cell.SetCellValue(isO);//是否存档 + cell = row.CreateCell(19); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.RemarkCode);//标志编号 + i++; } // 第三步:写入文件流 diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs index 23d81ee1..443dbc9c 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs @@ -172,7 +172,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive var cns = from x in Funs.DB.Base_CNProfessional select x; - for (int i = 0; i < ir; i++) + for (int i = 2; i < ir; i++) { string row0 = pds.Rows[i][0].ToString(); if (string.IsNullOrEmpty(row0)) @@ -263,7 +263,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive string row9 = pds.Rows[i][9].ToString(); if (string.IsNullOrEmpty(row9)) { - result += (i + 2).ToString() + "," + "发出日期" + "," + "此项为必填项!" + "|"; + result += (i + 2).ToString() + "," + "上报日期" + "," + "此项为必填项!" + "|"; } else { @@ -273,7 +273,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive } catch (Exception) { - result += (i + 2).ToString() + "," + "发出日期" + "," + "格式错误!" + "|"; + result += (i + 2).ToString() + "," + "上报日期" + "," + "格式错误!" + "|"; } } @@ -286,7 +286,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive var unit = units.Where(x => x.UnitName == u.Trim()).FirstOrDefault(); if (unit == null) { - result += (i + 2).ToString() + "," + "接收单位" + "," + "[" + u.Trim() + "]不存在!" + "|"; + result += (i + 2).ToString() + "," + "上报接收单位" + "," + "[" + u.Trim() + "]不存在!" + "|"; } } } @@ -511,7 +511,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive var cns = from x in Funs.DB.Base_CNProfessional select x; - for (int i = 0; i < ir; i++) + for (int i = 2; i < ir; i++) { Model.Comprehensive_DataReceivingDoc oldViewInfo = new Model.Comprehensive_DataReceivingDoc(); var cn = cns.Where(y => y.ProfessionalName == pds.Rows[i][4].ToString().Trim()).FirstOrDefault(); diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx index 5036a3d4..781bbfe9 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx @@ -60,10 +60,10 @@ - - + @@ -115,6 +115,13 @@ + + + + + + + <%-- diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.cs index fbb814f9..578a207b 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.cs @@ -72,6 +72,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive this.txtIssueCopies.Readonly = true; this.txtIssueUnitReceiver.Readonly = true; this.rblIsOnFile.Readonly = true; + this.txtRemarkCode.Readonly = true; //this.drpAudit.Readonly = true; //this.btnAttach.Enabled = false; } @@ -152,6 +153,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive this.rblIsOnFile.SelectedValue = "false"; } } + this.txtRemarkCode.Text = dataReceivingDoc.RemarkCode; //var currApprove = DataReceivingDocApproveService.GetCurrentApprove(dataReceivingDoc.DataReceivingDocId); //if (currApprove != null) @@ -210,6 +212,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning); return; } + var q = Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(x => x.RemarkCode == this.txtRemarkCode.Text.Trim() && (x.DataReceivingDocId != this.DataReceivingDocId || (this.DataReceivingDocId == null && x.DataReceivingDocId != null))); + if (q != null) + { + Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning); + return; + } + Model.Comprehensive_DataReceivingDoc dataReceivingDoc = new Model.Comprehensive_DataReceivingDoc(); dataReceivingDoc.ProjectId = this.CurrUser.LoginProjectId; dataReceivingDoc.FileCode = this.txtFileCode.Text.Trim(); @@ -265,6 +274,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive { dataReceivingDoc.IsOnFile = Convert.ToBoolean(this.rblIsOnFile.SelectedValue); } + dataReceivingDoc.RemarkCode = this.txtRemarkCode.Text.Trim(); //if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue)) //{ // dataReceivingDoc.AuditMan = drpAudit.SelectedValue; diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.designer.cs index fce3da22..ca61470e 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocEdit.aspx.designer.cs @@ -264,6 +264,33 @@ namespace FineUIPro.Web.CQMS.Comprehensive { /// protected global::FineUIPro.RadioButtonList rblIsOnFile; + /// + /// txtRemarkCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRemarkCode; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label3; + /// /// Toolbar1 控件。 /// diff --git a/SGGL/FineUIPro.Web/File/Excel/CQMS/资料收发文登记记录模板.xls b/SGGL/FineUIPro.Web/File/Excel/CQMS/资料收发文登记记录模板.xls deleted file mode 100644 index aff72b94..00000000 Binary files a/SGGL/FineUIPro.Web/File/Excel/CQMS/资料收发文登记记录模板.xls and /dev/null differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/资料收发文登记记录导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/资料收发文登记记录导入模板.xls index ef556487..9646a912 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/资料收发文登记记录导入模板.xls and b/SGGL/FineUIPro.Web/File/Excel/DataIn/资料收发文登记记录导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index eafda425..9fc55c34 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -77,7 +77,7 @@ - +