diff --git a/DataBase/版本日志/SGGLDB_WH_2024-02-21-lpf.sql b/DataBase/版本日志/SGGLDB_WH_2024-02-21-lpf.sql new file mode 100644 index 00000000..191d8e05 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2024-02-21-lpf.sql @@ -0,0 +1,35 @@ + +alter table dbo.DriverSub_DriverSubContact + add State int +go + +exec sp_addextendedproperty 'MS_Description', N'分包状态', 'SCHEMA', 'dbo', 'TABLE', 'DriverSub_DriverSubContact', + 'COLUMN', 'State' +go + + +alter table dbo.DriverSub_DriverSub + add SubContractName nvarchar(100) +go + +exec sp_addextendedproperty 'MS_Description', N'开车分包名称', 'SCHEMA', 'dbo', 'TABLE', 'DriverSub_DriverSub', + 'COLUMN', 'SubContractName' +go + +alter table dbo.DriverSub_DriverSub + add DriverContractCode nvarchar(100) +go + +exec sp_addextendedproperty 'MS_Description', N'开车合同号', 'SCHEMA', 'dbo', 'TABLE', 'DriverSub_DriverSub', 'COLUMN', + 'DriverContractCode' +go + +alter table dbo.DriverSub_DriverSub + add Evaluator nvarchar(100) +go + +exec sp_addextendedproperty 'MS_Description', N'评价人', 'SCHEMA', 'dbo', 'TABLE', 'DriverSub_DriverSub', 'COLUMN', + 'Evaluator' +go + + diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 372cebec..af7de356 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -47,6 +47,9 @@ ..\..\..\SGGL_CWCEC\SGGL\BLL\bin\Debug\Apache.NMS.ActiveMQ.dll + + ..\FineUIPro\Reference BLL\Aspose.Words.dll + False ..\FineUIPro\FineUIPro.dll diff --git a/SGGL/BLL/TestRun/DriverSub/DriverSubContactService.cs b/SGGL/BLL/TestRun/DriverSub/DriverSubContactService.cs index cc2e4d1d..9aea23db 100644 --- a/SGGL/BLL/TestRun/DriverSub/DriverSubContactService.cs +++ b/SGGL/BLL/TestRun/DriverSub/DriverSubContactService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using System.Net.NetworkInformation; using FineUIPro; using Model; @@ -45,6 +46,7 @@ namespace BLL newDriverSubContact.DriverSubContractorsId = DriverSubContact.DriverSubContractorsId; newDriverSubContact.SubcontractingType = DriverSubContact.SubcontractingType; newDriverSubContact.IsBidirectional = DriverSubContact.IsBidirectional; + newDriverSubContact.State= DriverSubContact.State; Funs.DB.DriverSub_DriverSubContact.InsertOnSubmit(newDriverSubContact); Funs.DB.SubmitChanges(); } @@ -64,6 +66,7 @@ namespace BLL newDriverSubContact.DriverSubContractorsId = DriverSubContact.DriverSubContractorsId; newDriverSubContact.SubcontractingType = DriverSubContact.SubcontractingType; newDriverSubContact.IsBidirectional = DriverSubContact.IsBidirectional; + newDriverSubContact.State = DriverSubContact.State; Funs.DB.SubmitChanges(); } } @@ -154,10 +157,36 @@ namespace BLL } Funs.DB.SubmitChanges(); } - - - - + /// + /// 确定分包商状态 + /// + /// + /// + /// + public static void SetState(string driverSubPlanId, string driverSubContractorsId, string state) + { + if (string.IsNullOrEmpty(state)) + { + return; + } + var list = Funs.DB.DriverSub_DriverSubContact.Where(e => e.DriverSubPlanId == driverSubPlanId && e.DriverSubContractorsId == driverSubContractorsId).ToList(); + foreach (var item in list) + { + item.State =int.Parse( state); + } + Funs.DB.SubmitChanges(); + } + /// + /// 分包状态下拉框 + /// + /// + public static void InitDriverSubPlanState( DropDownList dropDownList) + { + dropDownList.DataSource = DropListService.drpDriverSubPlanStateList(); + dropDownList.DataTextField = "Text"; + dropDownList.DataValueField = "Value"; + dropDownList.DataBind(); ; + } } } diff --git a/SGGL/BLL/TestRun/DriverSub/DriverSubService.cs b/SGGL/BLL/TestRun/DriverSub/DriverSubService.cs index 3adfda9d..4fe89d3e 100644 --- a/SGGL/BLL/TestRun/DriverSub/DriverSubService.cs +++ b/SGGL/BLL/TestRun/DriverSub/DriverSubService.cs @@ -1,8 +1,12 @@ using System; using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using Aspose.Words; namespace BLL { @@ -20,8 +24,9 @@ namespace BLL { return Funs.DB.DriverSub_DriverSub.FirstOrDefault(e => e.DriverSubId == DriverSubId); } + /// - /// 根据 + /// 根据分包计划和分包商获取开车分包管理信息 /// /// /// @@ -31,6 +36,89 @@ namespace BLL { return Funs.DB.DriverSub_DriverSub.FirstOrDefault(e => e.DriverSubPlanId == DriverSubPlanId&& e.DriverSubContractorsId==DriverSubContractorsId); } + + /// + /// DriverSubPlanId和DriverSubContractorsId 获取对象的EvaluationData信息,将json数据EvaluationData 转换成List + /// + /// + /// + /// + public static List GetDriverSubEvaluationData(string DriverSubPlanId, + string DriverSubContractorsId) + { + List list = new List(); + Model.DriverSub_DriverSub data = Funs.DB.DriverSub_DriverSub.FirstOrDefault(e => e.DriverSubPlanId == DriverSubPlanId && e.DriverSubContractorsId == DriverSubContractorsId); + if (data != null) + { + list = Newtonsoft.Json.JsonConvert.DeserializeObject>(data.EvaluationData); + } + return list; + } + + /// + /// 将List DriverSubEvaluationData转换成json数据 + /// + /// + /// + public static string GetDriverSubEvaluationDataJson(List list) + { + return Newtonsoft.Json.JsonConvert.SerializeObject(list); + } + + /// + /// 根据分包类别获取初始化数据List + /// + /// + public static List GetDriverSubEvaluationData(string type ) + { + + List list = new List(); + switch (type) + { + case "1"://催化剂装填 + list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "方案编制", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "催化剂装填准备", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "人员配合", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "催化剂装填实施", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "装填结果认定", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "收尾处理", Grade = "" }); + // list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "其他", Grade = "" }); + break; + case "2"://烘炉 + list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "方案编制", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "烘炉准备", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "人员配合", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "烘炉实施", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "烘炉结果认定", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "收尾处理", Grade = "" }); + // list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "其他", Grade = "" }); + break; + case "3"://化学清洗 + list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "方案编制", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "化学清洗准备", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "人员配合", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "化学清洗实施", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "清洗结果认定", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "收尾处理", Grade = "" }); + // list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "其他", Grade = "" }); + break; + case "4"://开车队 + list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "业主人员培训", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "编制技术方案", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "预试车", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "联动试车", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "投料试车", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "生产试运行", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "性能考核", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 8, Matter = "生产安全", Grade = "" }); + list.Add(new Model.DriverSubEvaluationData() { Number = 9, Matter = "试车进度", Grade = "" }); + // list.Add(new Model.DriverSubEvaluationData() { Number = 10, Matter = "其他", Grade = "" }); + break; + } + + return list; + } + /// /// 添加开车分包管理信息 /// @@ -45,6 +133,9 @@ namespace BLL newDriverSub.DriverSubPlanId= DriverSub.DriverSubPlanId; newDriverSub.DriverSubContractorsId = DriverSub.DriverSubContractorsId; newDriverSub.EvaluationData = DriverSub.EvaluationData; + newDriverSub.DriverContractCode= DriverSub.DriverContractCode; + newDriverSub.SubContractName = DriverSub.SubContractName; + newDriverSub.Evaluator= DriverSub.Evaluator; Funs.DB.DriverSub_DriverSub.InsertOnSubmit(newDriverSub); Funs.DB.SubmitChanges(); } @@ -63,9 +154,91 @@ namespace BLL newDriverSub.DriverSubPlanId = DriverSub.DriverSubPlanId; newDriverSub.DriverSubContractorsId = DriverSub.DriverSubContractorsId; newDriverSub.EvaluationData = DriverSub.EvaluationData; + newDriverSub.DriverContractCode = DriverSub.DriverContractCode; + newDriverSub.SubContractName = DriverSub.SubContractName; + newDriverSub.Evaluator = DriverSub.Evaluator; Funs.DB.SubmitChanges(); } } + + public static Document Print(string driverSubPlanId, string driverSubContractorsId) + { + string rootPath = Funs.RootPath; + + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + initTemplatePath = "File\\Word\\TestRun\\履约情况评价表.doc"; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + + //定义实体 + var model = GetDriverSubBySubPlanIdAndTractorsId(driverSubPlanId,driverSubContractorsId);//分包管理实体 + var subContractorsModel = DriversubcontractorsService.GetDriverSub_DriverSubContractorsById(driverSubContractorsId);//分包商实体 + var evaluationData = GetDriverSubEvaluationData(driverSubPlanId, driverSubContractorsId);//打分数据 + var projectModel = ProjectService.GetProjectByProjectId(model.ProjectId);//项目实体 + + string subcontractingType = BLL.DriverSubPlanService.GetSubcontractingTypeNames(subContractorsModel.SubcontractingType);//分包类别名称 + + + //打分数数据绑定 + DataTable tb= Funs.LINQToDataTable(evaluationData); + tb.TableName = "Table"; + Document doc = new Aspose.Words.Document(newUrl); + doc.MailMerge.ExecuteWithRegions(tb); + + Dictionary Dic_File = new Dictionary(); + Dic_File.Add("txtSubcontractingType", subcontractingType); + Dic_File.Add("txtProjectCode", projectModel.ProjectCode); + Dic_File.Add("txtSubContractName", model.SubContractName); + Dic_File.Add("txtDriverContractCode", model.DriverContractCode); + Dic_File.Add("txtSubUnitName",subContractorsModel.SubUnitName); + Dic_File.Add("txtEvaluator", model.Evaluator); + foreach (var item in Dic_File) + { + string[] key = { item.Key }; + object[] value = { item.Value }; + doc.MailMerge.Execute(key, value); + + } + doc.Save(newUrl); + Document doc1 = new Aspose.Words.Document(newUrl); + File.Delete(newUrl); + return doc1; + } + public static void PrintFile(string driverSubPlanId, string driverSubContractorsId) + { + string rootPath = Funs.RootPath; + + string newUrl = string.Empty; + newUrl = rootPath + "File\\Word\\TestRun\\履约情况评价表.doc"; + newUrl = newUrl.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + var doc = Print(driverSubPlanId,driverSubContractorsId); + doc.Save(newUrl); + + //验证参数 + if (doc == null) { throw new Exception("Word文件无效"); } + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(newUrl, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(newUrl); + } /// /// 根据主键删除开车分包管理 @@ -80,25 +253,12 @@ namespace BLL Funs.DB.SubmitChanges(); } } - //DriverSubPlanId和DriverSubContractorsId 获取对象的EvaluationData信息,将json数据EvaluationData 转换成List - public static List GetDriverSubEvaluationData(string DriverSubPlanId, - string DriverSubContractorsId) - { - List list = new List(); - Model.DriverSub_DriverSub data = Funs.DB.DriverSub_DriverSub.FirstOrDefault(e => e.DriverSubPlanId == DriverSubPlanId && e.DriverSubContractorsId == DriverSubContractorsId); - if (data != null) - { - list = Newtonsoft.Json.JsonConvert.DeserializeObject>(data.EvaluationData); - } - return list; - } - //将List转换成json数据 - public static string GetDriverSubEvaluationDataJson(List list) - { - return Newtonsoft.Json.JsonConvert.SerializeObject(list); - } - //DriverSubPlanId和DriverSubContractorsId 删除数据 + /// + /// DriverSubPlanId和DriverSubContractorsId 删除数据 + /// + /// + /// public static void DeleteDriverSubEvaluationData(string DriverSubPlanId, string DriverSubContractorsId) { Model.DriverSub_DriverSub data = Funs.DB.DriverSub_DriverSub.FirstOrDefault(e => e.DriverSubPlanId == DriverSubPlanId && e.DriverSubContractorsId == DriverSubContractorsId); @@ -108,6 +268,7 @@ namespace BLL Funs.DB.SubmitChanges(); } } + /// /// 根据DriverSubPlanId删除实体 /// @@ -129,61 +290,5 @@ namespace BLL Funs.DB.SubmitChanges(); } } - - - /// - /// 获取初始化数据List - /// - /// - public static List GetDriverSubEvaluationData(string type ) - { - - List list = new List(); - switch (type) - { - case "1"://催化剂装填 - list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "方案编制", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "催化剂装填准备", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "人员配合", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "催化剂装填实施", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "装填结果认定", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "收尾处理", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "其他", Grade = "" }); - break; - case "2"://烘炉 - list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "方案编制", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "烘炉准备", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "人员配合", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "烘炉实施", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "烘炉结果认定", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "收尾处理", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "其他", Grade = "" }); - break; - case "3"://化学清洗 - list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "方案编制", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "化学清洗准备", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "人员配合", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "化学清洗实施", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "清洗结果认定", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "收尾处理", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "其他", Grade = "" }); - break; - case "4"://开车队 - list.Add(new Model.DriverSubEvaluationData() { Number = 1, Matter = "业主人员培训", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 2, Matter = "编制技术方案", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 3, Matter = "预试车", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 4, Matter = "联动试车", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 5, Matter = "投料试车", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 6, Matter = "生产试运行", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 7, Matter = "性能考核", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 8, Matter = "生产安全", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 9, Matter = "试车进度", Grade = "" }); - list.Add(new Model.DriverSubEvaluationData() { Number = 10, Matter = "其他", Grade = "" }); - break; - } - - return list; - } - } } diff --git a/SGGL/FineUIPro.Web/File/Word/TestRun/履约情况评价表.doc b/SGGL/FineUIPro.Web/File/Word/TestRun/履约情况评价表.doc new file mode 100644 index 00000000..7e7fe1d9 --- /dev/null +++ b/SGGL/FineUIPro.Web/File/Word/TestRun/履约情况评价表.doc @@ -0,0 +1,20 @@ + +| |中国五环 |«txtSubcontractingType»履约情况评 |项目号|«txtProjectC| +| |工程有限公司 |价表 | |ode» | +| | | |-顺序号-年份码 | +| | | +|开车合作单位:«txtSubUnitName» |评价人:«txtEvaluator» | +|履约情况评价 | +|事项 |评分 | +|装置 |煤气化 | +| |合成氨 | +| |尿素 | +| |水系统 | +|«TableStart|«Grade»«TableEnd:Table» | +|:Table»«Mat| | +|ter» | | +|其他: | + + +填表说明:以百分制进行评价,60分以下为履约差,60~80分为履约一般,80~100分为履 +约优秀。 diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index a1b0442b..27733777 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1765,6 +1765,7 @@ + @@ -15901,6 +15902,13 @@ DriverSubSetContactorEdit.aspx + + DriverSubSetProgressEdit.aspx + ASPXCodeBehind + + + DriverSubSetProgressEdit.aspx + CompleteSummary.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user index 63ca13cc..9e91deff 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true false diff --git a/SGGL/FineUIPro.Web/TestRun/DriverSub/DriverSub.aspx b/SGGL/FineUIPro.Web/TestRun/DriverSub/DriverSub.aspx index fe45b0b2..a3f8cf37 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverSub/DriverSub.aspx +++ b/SGGL/FineUIPro.Web/TestRun/DriverSub/DriverSub.aspx @@ -28,6 +28,7 @@ + @@ -66,7 +67,7 @@