diff --git a/20220330_Vote/Ewide.Web.Entry/Ewide.Web.Entry.csproj b/20220330_Vote/Ewide.Web.Entry/Ewide.Web.Entry.csproj index a9e17b4..cfe0886 100644 --- a/20220330_Vote/Ewide.Web.Entry/Ewide.Web.Entry.csproj +++ b/20220330_Vote/Ewide.Web.Entry/Ewide.Web.Entry.csproj @@ -15,6 +15,15 @@ + + Always + + + Always + + + Always + diff --git a/20220330_Vote/Ewide.Web.Entry/appsettings.json b/20220330_Vote/Ewide.Web.Entry/appsettings.json index 0195494..2eac478 100644 --- a/20220330_Vote/Ewide.Web.Entry/appsettings.json +++ b/20220330_Vote/Ewide.Web.Entry/appsettings.json @@ -63,6 +63,6 @@ "GetHouseInfoCitysByCommunity": "http://sjk.test.ky.com/housesafety/statistics/GetHouseInfoCitysByCommunity?communityID={0}" }, "UserScore": { - "ExpertNumber": 8 + "ExpertNumber": 17 } } \ No newline at end of file diff --git a/20220330_Vote/Ewide.Web.Entry/wwwroot/ExcelTemplate/2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目投票结果.xlsx b/20220330_Vote/Ewide.Web.Entry/wwwroot/ExcelTemplate/2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目投票结果.xlsx new file mode 100644 index 0000000..49487c0 Binary files /dev/null and b/20220330_Vote/Ewide.Web.Entry/wwwroot/ExcelTemplate/2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目投票结果.xlsx differ diff --git a/20220330_Vote/Ewide.Web.Entry/wwwroot/html/Manage/Login.html b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/Manage/Login.html index dd49c0b..83acfdc 100644 --- a/20220330_Vote/Ewide.Web.Entry/wwwroot/html/Manage/Login.html +++ b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/Manage/Login.html @@ -106,7 +106,8 @@ //location = '/gb/yjb/manage/VoteResult' //location = '/gb/yjb/manage/nbczResult' //location = '/202307/html/outsidewall/result.html' - location = '../yjbvote2025/voteresult.html'; + // location = '../yjbvote2025/voteresult.html'; + location = '../yjbvote20251222/voteresult.html'; } } _this.loading = false; diff --git a/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/Expert.html b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/Expert.html new file mode 100644 index 0000000..6a2e6f8 --- /dev/null +++ b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/Expert.html @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + +
+

2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目 专家投票情况

+ + + + + + + +

+ 刷新数据 + 查看项目投票情况 + 新增专家 +

+ +
+ + 确定 +
+
+ + + +
+ + + + + \ No newline at end of file diff --git a/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/VoteResult.html b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/VoteResult.html new file mode 100644 index 0000000..7007a8c --- /dev/null +++ b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/VoteResult.html @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + +
+

2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目 选票结果

+ + + + + + + + + + + + +

+ 刷新数据 + 导出Excel + 查看专家投票情况 +

+
+ + + + + \ No newline at end of file diff --git a/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/index.html b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/index.html new file mode 100644 index 0000000..7dd44a3 --- /dev/null +++ b/20220330_Vote/Ewide.Web.Entry/wwwroot/html/yjbvote20251222/index.html @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + +
+

2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目汇总表

(按总分从高到低排序)

+ + + + {{project.serial_number}}:{{project.name}} + {{project.remark}} + + + + + + +

+ +

+

+ 重置 + 提交 +

+
+ + + + + \ No newline at end of file diff --git a/20220330_Vote/Vote.Services/ApiController/ProjectsService.cs b/20220330_Vote/Vote.Services/ApiController/ProjectsService.cs index d989c83..2d0506d 100644 --- a/20220330_Vote/Vote.Services/ApiController/ProjectsService.cs +++ b/20220330_Vote/Vote.Services/ApiController/ProjectsService.cs @@ -32,7 +32,10 @@ namespace Vote.Services.ApiController private readonly IRepository rep_VoteRecords2021; private readonly IRepository rep_Projects2022; private readonly IRepository rep_VoteRecords2022; - public ProjectsService(IRepository _rep_Projects, IRepository _rep_Experts, IRepository _rep_VoteRecords, IRepository _rep_Projects2021, IRepository _rep_VoteRecords2021, IRepository _rep_Projects2022, IRepository _rep_VoteRecords2022) + + public ProjectsService(IRepository _rep_Projects, IRepository _rep_Experts, IRepository _rep_VoteRecords, + IRepository _rep_Projects2021, IRepository _rep_VoteRecords2021, + IRepository _rep_Projects2022, IRepository _rep_VoteRecords2022) { rep_Projects = _rep_Projects; rep_Experts = _rep_Experts; @@ -51,7 +54,7 @@ namespace Vote.Services.ApiController [Microsoft.AspNetCore.Authorization.AllowAnonymous] public async Task List(ProjectsInput args) { - var typeList = new List { "房建工程", "市政工程", "轨道交通工程" };//, "电力工程", "交通工程", "水利工程" }; + var typeList = new List { "房屋建筑工程", "市政基础设施工程", "轨道交通工程", "电力工程" }; //, "交通工程", "水利工程" }; var data = await rep_Projects.DetachedEntities.Where(p => !p.IsDeleted) .Where(args.type != null, a => (int)a.type == args.type) .ProjectToType() @@ -110,24 +113,27 @@ namespace Vote.Services.ApiController }); return true; } + private async Task> GetVoteData() { var query = from a in rep_Projects.DetachedEntities - join b in rep_VoteRecords.DetachedEntities - on a.Id equals b.project_id into grouping - from p in grouping.DefaultIfEmpty() - group new { a, p } by new { a.Id, a.name, a.serial_number, a.type } into pp - select new ProjectsList2Output - { - serial_number = pp.Key.serial_number, - id = pp.Key.Id, - name = pp.Key.name, - yes_count = pp.Where(a => a.p.is_agree).Count(), - no_count = pp.Where(a => !a.p.is_agree).Count(), - type = pp.Key.type - }; + join b in rep_VoteRecords.DetachedEntities + on a.Id equals b.project_id into grouping + from p in grouping.DefaultIfEmpty() + group new { a, p } by new { a.Id, a.name, a.serial_number, a.type } + into pp + select new ProjectsList2Output + { + serial_number = pp.Key.serial_number, + id = pp.Key.Id, + name = pp.Key.name, + yes_count = pp.Where(a => a.p.is_agree).Count(), + no_count = pp.Where(a => !a.p.is_agree).Count(), + type = pp.Key.type + }; return await query.OrderBy(a => a.serial_number).ToListAsync(); } + /// /// 列表 /// @@ -135,7 +141,6 @@ namespace Vote.Services.ApiController [HttpPost] public async Task List2() { - //var data = rep_Projects.DetachedEntities.Where(p => !p.IsDeleted) // //.Where(args.type != null, a => (int)a.type == args.type) // .Join(rep_VoteRecords.DetachedEntities, a => a.Id, a => a.project_id, (a, b) => @@ -167,9 +172,10 @@ namespace Vote.Services.ApiController // data4, // data5 //}; - var typeList = new List { "房建工程", "市政工程", "轨道交通工程" };//, "电力工程", "交通工程", "水利工程" }; + var typeList = new List { "房建工程", "市政工程", "轨道交通工程", "电力工程" }; //, "电力工程", "交通工程", "水利工程" }; return new { data, typeList }; } + /// /// /// @@ -178,10 +184,11 @@ namespace Vote.Services.ApiController { var data = await GetVoteData(); //var filepath = Tools.ExcelHelper.WriteTemplate(data, 4, "C"); - string template_name = "2024年度宁波市结构优质认定项目投票结果.xlsx"; - var filepath = Tools.ExcelHelper.WriteTemplate(template_name, data, 5, "C"); + string template_name = "2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目投票结果.xlsx"; + var filepath = Tools.ExcelHelper.WriteTemplate(template_name, data, 4, "D"); return new FileStreamResult(new FileStream(filepath, FileMode.Open), "application/octet-stream") { FileDownloadName = filepath }; } + /// /// /// @@ -204,8 +211,6 @@ namespace Vote.Services.ApiController // is_vote = tt == null // }; //return await query.ToListAsync(); - - } /// @@ -229,7 +234,8 @@ namespace Vote.Services.ApiController CreatedTime = DateTime.Now }); } + await rep_Experts.InsertAsync(list); } } -} +} \ No newline at end of file diff --git a/20220330_Vote/Vote.Services/Dto/ProjectsInput.cs b/20220330_Vote/Vote.Services/Dto/ProjectsInput.cs index a0a0869..c1ec09e 100644 --- a/20220330_Vote/Vote.Services/Dto/ProjectsInput.cs +++ b/20220330_Vote/Vote.Services/Dto/ProjectsInput.cs @@ -15,42 +15,49 @@ namespace Vote.Services.Dto /// 项目类型 /// public int? type { get; set; } + public int? is_no_inspection { get; set; } } + public class ProjectsOutput { /// /// /// public string id { get; set; } + /// /// 项目序号 /// public int serial_number { get; set; } + /// /// 工程名称 /// public string name { get; set; } + /// /// 项目类型 /// public EnumProjectType type { get; set; } + /// /// 项目类型 /// public string type_title { - get - { - return type.GetEnumDescription(); - } + get { return type.GetEnumDescription(); } } + /// /// /// public bool vote { get; set; } = false; + + public string remark { get; set; } public int is_no_inspection { get; set; } } + public class CheckSubmitCodeInput { /// @@ -59,6 +66,7 @@ namespace Vote.Services.Dto [Required] public string code { get; set; } } + public class SubmitInput { /// @@ -66,8 +74,8 @@ namespace Vote.Services.Dto /// [Required] public string code { get; set; } - [Required] - public List projects { get; set; } + + [Required] public List projects { get; set; } } public class ProjectsList2Output @@ -76,10 +84,12 @@ namespace Vote.Services.Dto /// /// public string id { get; set; } + /// /// 项目序号 /// public int serial_number { get; set; } + /// /// 工程名称 /// @@ -95,29 +105,29 @@ namespace Vote.Services.Dto { get { - return yes_count > 15; + return yes_count >= 11; // return (yes_count / (yes_count + no_count)) >= (2.0 / 3.0); } } + /// /// 项目类型 /// public EnumProjectType type { get; set; } + /// /// 项目类型 /// public string type_title { - get - { - return type.GetEnumDescription(); - } + get { return type.GetEnumDescription(); } } + public class AddExpertInput { - [Required] - public int expertnum { get; set; } + [Required] public int expertnum { get; set; } } + public int is_no_inspection { get; set; } } -} +} \ No newline at end of file diff --git a/20220330_Vote/Vote.Services/Entities/Projects.cs b/20220330_Vote/Vote.Services/Entities/Projects.cs index 87d3afe..6fced83 100644 --- a/20220330_Vote/Vote.Services/Entities/Projects.cs +++ b/20220330_Vote/Vote.Services/Entities/Projects.cs @@ -29,6 +29,7 @@ namespace Vote.Services.Entities /// [Comment("工程名称")] public string name { get; set; } + public string remark { get; set; } /// /// 项目类型 ///