From a8c8955f73e0b36ab5843220f4b9921003f576ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=9C=B2=E5=B0=A7?= Date: Mon, 26 Jun 2023 10:14:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ewide.Application/Entity/BsHouseCode.cs | 52 --- .../Entity/BsHouseCompany.cs | 36 -- .../Ewide.Application/Entity/BsHouseInfo.cs | 378 ------------------ .../Ewide.Application/Entity/BsHouseLog.cs | 46 --- .../Entity/BsHouseMemberRelation.cs | 26 -- .../Entity/BsHouseProjectInfo.cs | 38 -- .../Ewide.Application/Entity/BsHouseTask.cs | 266 ------------ .../Entity/BsHouseTaskCheckRecord.cs | 36 -- .../Entity/BsHouseTaskOptions.cs | 60 --- .../Ewide.Application/Enum/HouseLog.cs | 43 -- .../Enum/HouseManagerRole.cs | 36 -- .../Ewide.Application.csproj | 1 + .../HouseCode/Dto/HouseCodeInput.cs | 65 --- .../HouseCode/Dto/HouseCodeOutput.cs | 43 -- .../HouseSafety/HouseCode/HouseCodeService.cs | 123 ------ .../HouseCode/IHouseCodeService.cs | 13 - .../HouseCompany/Dto/HouseCompanyInput.cs | 61 --- .../HouseCompany/Dto/HouseCompanyOutput.cs | 33 -- .../HouseCompany/HouseCompanyService.cs | 101 ----- .../HouseCompany/IHouseCompanyService.cs | 19 - .../HouseInfo/Dto/HouseInfoInput.cs | 239 ----------- .../HouseInfo/Dto/HouseInfoOutput.cs | 239 ----------- .../HouseSafety/HouseInfo/HouseInfoService.cs | 208 ---------- .../HouseInfo/IHouseInfoService.cs | 13 - .../HouseSafety/HouseLog/Dto/HouseLogInput.cs | 15 - .../HouseLog/Dto/HouseLogOutput.cs | 20 - .../HouseSafety/HouseLog/HouseLogService.cs | 209 ---------- .../HouseSafety/HouseLog/IHouseLogService.cs | 24 -- .../HouseMember/Dto/HouseMemberInput.cs | 16 - .../HouseMember/Dto/HouseMemberOutput.cs | 13 - .../HouseMember/HouseMemberService.cs | 326 --------------- .../HouseMember/IHouseMemberService.cs | 22 - .../Dto/HouseProjectInfoInput.cs | 52 --- .../Dto/HouseProjectOutput.cs | 19 - .../HouseProjectInfoService.cs | 147 ------- .../IHouseProjectInfoService.cs | 24 -- .../HouseQuery/Dto/HouseQueryInput.cs | 21 - .../HouseQuery/Dto/HouseQueryOutput.cs | 12 - .../HouseQuery/HouseQueryService.cs | 110 ----- .../HouseQuery/IHouseQueryService.cs | 12 - .../HouseSelector/Dto/HouseSelectorInput.cs | 24 -- .../HouseSelector/Dto/HouseSelectorOutput.cs | 12 - .../HouseSelector/HouseSelectorService.cs | 225 ----------- .../HouseSelector/IHouseSelectorService.cs | 18 - .../HouseTask/Dto/HouseTaskInput.cs | 171 -------- .../HouseTask/Dto/HouseTaskOutput.cs | 173 -------- .../HouseSafety/HouseTask/HouseTaskService.cs | 102 ----- .../HouseTask/IHouseTaskService.cs | 13 - .../Dto/HouseTaskCheckRecordInput.cs | 46 --- .../Dto/HouseTaskCheckRecordOutput.cs | 12 - .../HouseZone/Dto/HouseZoneInput.cs | 41 -- .../HouseZone/Dto/HouseZoneOutput.cs | 12 - .../HouseSafety/HouseZone/HouseZoneService.cs | 175 -------- .../HouseZone/IHouseZoneService.cs | 15 - 20220330_Vote/Ewide.Web.Entry/Program.cs | 15 +- .../Properties/launchSettings.json | 2 +- 56 files changed, 16 insertions(+), 4257 deletions(-) delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseCode.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseCompany.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseInfo.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseLog.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseMemberRelation.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseProjectInfo.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseTask.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseTaskCheckRecord.cs delete mode 100644 20220330_Vote/Ewide.Application/Entity/BsHouseTaskOptions.cs delete mode 100644 20220330_Vote/Ewide.Application/Enum/HouseLog.cs delete mode 100644 20220330_Vote/Ewide.Application/Enum/HouseManagerRole.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/IHouseCodeService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/HouseCompanyService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/IHouseCompanyService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/IHouseInfoService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/HouseLogService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/IHouseLogService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/IHouseMemberService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectInfoInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/IHouseQueryService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/IHouseSelectorService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/IHouseTaskService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneInput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneOutput.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs delete mode 100644 20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/IHouseZoneService.cs diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseCode.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseCode.cs deleted file mode 100644 index ded5654..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseCode.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Ewide.Application -{ - [Table("bs_house_code")] - [Comment("房屋编码表")] - public class BsHouseCode : Core.DEntityBase - { - [Comment("系统中唯一的房屋编码,生成即不再变更")] - [MaxLength(50)] - [Required] - public string HouseCode { get; set; } - - [Comment("编号")] - [MaxLength(3)] - [Required] - public int No { get; set; } - - [Comment("项目ID")] - [MaxLength(36)] - [Required] - public string ProjectId { get; set; } - - [Comment("片区ID")] - [MaxLength(36)] - [Required] - public string ZoneId { get; set; } - - [Comment("详细地址")] - [MaxLength(500)] - [Required] - public string Address { get; set; } - - [Comment("性质")] - [Required] - public int Type { get; set; } - - [Comment("所属行业")] - [Required] - public int Industry { get; set; } - - [Comment("坐标-经度")] - [MaxLength(50)] - public string Lng { get; set; } - - [Comment("坐标-纬度")] - [MaxLength(50)] - public string Lat { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseCompany.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseCompany.cs deleted file mode 100644 index 0849cdc..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseCompany.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - [Table("bs_house_company")] - [Comment("房屋相关单位表")] - public class BsHouseCompany : Core.DEntityBase - { - /// - /// 单位类型,多选 - /// - [Comment("单位类型,多选")] - [MaxLength(20)] - public string Type { get; set; } - - /// - /// 单位名称 - /// - [Comment("单位名称")] - [MaxLength(200)] - public string Name { get; set; } - - /// - /// 信息 - /// - [Comment("信息")] - public string Info { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseInfo.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseInfo.cs deleted file mode 100644 index f7c8ea8..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseInfo.cs +++ /dev/null @@ -1,378 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - [Table("bs_house_info")] - [Comment("房屋信息表")] - public class BsHouseInfo : Core.DEntityBase - { - /// - /// HouseCode主键ID - /// - [Comment("bs_house_code主键Id")] - [MaxLength(36)] - [Required] - public string HouseCodeId { get; set; } - - /// - /// 幢名称 - /// - [Comment("幢名称")] - [MaxLength(255)] - public string BuildingName { get; set; } - - /// - /// 土地性质 - /// - [Comment("土地性质")] - public int? LandAttribute { get; set; } - - /// - /// 结构类型 - /// - [Comment("结构类型")] - public int? StructureType { get; set; } - - /// - /// 基础情况 - /// - [Comment("基础情况")] - public int? BaseInfo { get; set; } - - /// - /// 抗震等级 - /// - [Comment("抗震等级")] - public int? SeismicGrade { get; set; } - - /// - /// 竣工日期 - /// - [Comment("竣工日期")] - public DateTime? CompletedDate { get; set; } - - /// - /// 设计使用年限 - /// - [Comment("设计使用年限")] - public int? UsefulYear { get; set; } - - /// - /// 总层数 - /// - [Comment("总层数")] - public int? TotalFloor { get; set; } - - /// - /// 地上层数 - /// - [Comment("地上层数")] - public int? LandFloorCount { get; set; } - - /// - /// 地上商业层数开始 - /// - [Comment("地上商业层数开始")] - public int? LandBsFloorStart { get; set; } - - /// - /// 地上商业层数结束 - /// - [Comment("地上商业层数结束")] - public int? LandBsFloorEnd { get; set; } - - /// - /// 地上车棚层开始 - /// - [Comment("地上车棚层开始")] - public int? LandBikeFloorStart { get; set; } - - /// - /// 地上住宅层开始 - /// - [Comment("地上住宅层开始")] - public int? LandResidenceFloorStart { get; set; } - - /// - /// 地上住宅层结束 - /// - [Comment("地上住宅层结束")] - public int? LandResidenceFloorEnd { get; set; } - - /// - /// 地下层数 - /// - [Comment("地下层数")] - public int? UnderFloorCount { get; set; } - - /// - /// 总建筑面积 - /// - [Comment("总建筑面积")] - public float? TotalArea { get; set; } - - /// - /// 有无建筑幕墙 - /// - [Comment("有无建筑幕墙")] - public int? CurtainWall { get; set; } - - /// - /// 有无面砖 - /// - [Comment("有无面砖")] - public int? FaceBrick { get; set; } - - /// - /// 有无涂料 - /// - [Comment("有无涂料")] - public int? Coating { get; set; } - - /// - /// 有无粉刷 - /// - [Comment("有无粉刷")] - public int? Painting { get; set; } - - /// - /// 电梯 - /// - [Comment("电梯")] - [MaxLength(20)] - public string Elevator { get; set; } - - /// - /// 总户数(户) - /// - [Comment("总户数(户)")] - public int? HouseHolds { get; set; } - - /// - /// 房屋单元数 - /// - [Comment("房屋单元数")] - public int? Units { get; set; } - - /// - /// 各单元每层户数(户) - /// - [Comment("各单元每层户数(户)")] - public int? UnitFloorHolds { get; set; } - - /// - /// 建设单位ID - /// - [Comment("建设单位ID")] - [MaxLength(36)] - public string BuildingUnitId { get; set; } - - /// - /// 设计单位ID - /// - [Comment("设计单位ID")] - [MaxLength(36)] - public string DesingerUnitId { get; set; } - - /// - /// 施工单位ID - /// - [Comment("施工单位ID")] - [MaxLength(36)] - public string ConstructionUnitId { get; set; } - - /// - /// 监理单位ID - /// - [Comment("监理单位ID")] - [MaxLength(36)] - public string MonitorUnitId { get; set; } - - /// - /// 产权性质 - /// - [Comment("产权性质")] - [MaxLength(100)] - public string PropertyRights { get; set; } - - /// - /// 总共套数 - /// - [Comment("总共套数")] - public int? HouseCount { get; set; } - - /// - /// 直管公房套数 - /// - [Comment("直管公房套数")] - public int? StraightHouseCount { get; set; } - - /// - /// 自管公房套数 - /// - [Comment("自管公房套数")] - public int? SelfHouseCount { get; set; } - - /// - /// 私房套数 - /// - [Comment("私房套数")] - public int? PrivateHouseCount { get; set; } - - /// - /// 商品房套数 - /// - [Comment("商品房套数")] - public int? BusinessCount { get; set; } - - /// - /// 房改房套数 - /// - [Comment("房改房套数")] - public int? ChangeHouseCount { get; set; } - - /// - /// 拆迁安置房套数 - /// - [Comment("拆迁安置房套数")] - public int? ResettlementHouseCount { get; set; } - - /// - /// 其它套数 - /// - [Comment("其它套数")] - public int? OtherCount { get; set; } - - /// - /// 产权单位ID - /// - [Comment("产权单位ID")] - [MaxLength(36)] - public string PropertyUnitId { get; set; } - - /// - /// 物业单位ID - /// - [Comment("物业单位ID")] - [MaxLength(36)] - public string WuYeUnitId { get; set; } - - /// - /// 图纸资料存档处 - /// - [Comment("图纸资料存档处")] - [MaxLength(50)] - public string DrawingMaterial { get; set; } - - /// - /// 其他图纸存档 - /// - [Comment("其他图纸存档")] - [MaxLength(100)] - public string DrawingMaterialText { get; set; } - - /// - /// 立项文件 - /// - [Comment("立项文件")] - [MaxLength(2000)] - public string AnEntryDocument { get; set; } - - /// - /// 规划许可 - /// - [Comment("规划许可")] - [MaxLength(2000)] - public string PlanningPermission { get; set; } - - /// - /// 竣工验收备案 - /// - [Comment("竣工验收备案")] - [MaxLength(2000)] - public string CompletionRecord { get; set; } - - /// - /// 监理资料 - /// - [Comment("监理资料")] - [MaxLength(2000)] - public string MonitorDocument { get; set; } - - /// - /// 鉴定报告 - /// - [Comment("鉴定报告")] - [MaxLength(2000)] - public string IdentificationReport { get; set; } - - /// - /// 其它资料 - /// - [Comment("其它资料")] - [MaxLength(2000)] - public string OtherDocument { get; set; } - - /// - /// 外立面照片 - /// - [Comment("外立面照片")] - [MaxLength(2000)] - public string FacadePhoto { get; set; } - - /// - /// 房屋等级 1,2,3,4,C,d - /// - [Comment("房屋等级 1,2,3,4,C,d")] - public int? HouseGrade { get; set; } - - /// - /// 房屋使用状态 - /// - [Comment("房屋使用状态")] - public int? HouseUsedStatus { get; set; } - - /// - /// -1 退回(审核被退回的数据) 1、待建档(需要建档的数据未暂存未保存的)2、暂存(点击了暂存的数据)3、待提交(点击了保存的数据) 5、审核中6、审核通过 - /// - [Comment("-1 退回(审核被退回的数据) 1、待建档(需要建档的数据未暂存未保存的)2、暂存(点击了暂存的数据)3、待提交(点击了保存的数据) 5、审核中6、审核通过")] - [Required] - public int State { get; set; } - - /// - /// 调查登记机构 - /// - [Comment("调查登记机构")] - [MaxLength(100)] - public string InvestigateAgency { get; set; } - - /// - /// 纸质资料调查人 - /// - [Comment("纸质资料调查人")] - [MaxLength(50)] - public string InvestigateUser { get; set; } - - /// - /// 纸质资料审核人 - /// - [Comment("纸质资料审核人")] - [MaxLength(50)] - public string OfflineAuditor { get; set; } - - /// - /// 主管部门 - /// - [Comment("主管部门")] - [MaxLength(50)] - public string CompetentDepartment { get; set; } - - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseLog.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseLog.cs deleted file mode 100644 index bdcd8bd..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseLog.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - [Table("bs_house_log")] - [Comment("房屋流转日志")] - public class BsHouseLog : Core.DEntityBase - { - [Comment("房屋编码Id")] - [MaxLength(36)] - public string HouseCodeId { get; set; } - - [Comment("目标处理人Id,可多个")] - public string TargetUserIds { get; set; } - - [Comment("步骤类型")] - public HouseLogType Type { get; set; } - - [Comment("状态")] - public HouseLogStatus Status { get; set; } - - [Comment("备注信息")] - public string Remark { get; set; } - - [Comment("完成时间")] - public DateTime? FinishedTime { get; set; } - - [Comment("完成者Id")] - [MaxLength(36)] - public string FinishedUserId { get; set; } - - [Comment("完成者名称")] - [MaxLength(20)] - public string FinishedUserName { get; set; } - - [Comment("排序")] - public int Sort { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseMemberRelation.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseMemberRelation.cs deleted file mode 100644 index 98e42e2..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseMemberRelation.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - [Table("bs_house_member_relation")] - [Comment("房屋与人员关联表")] - public class BsHouseMemberRelation : Core.DEntityBase - { - [Comment("sys_user主键Id")] - [MaxLength(36)] - [Required] - public string SysUserId { get; set; } - - [Comment("bs_house_code主键Id")] - [MaxLength(36)] - [Required] - public string HouseCodeId { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseProjectInfo.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseProjectInfo.cs deleted file mode 100644 index 1f294e2..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseProjectInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Entity -{ - [Table("bs_house_projectinfo")] - [Comment("项目表")] - public class BsHouseProjectInfo : Core.DEntityBase - { - [Comment("名称")] - [MaxLength(100)] - [Required] - public string Name { get; set; } - - [Comment("备注")] - [MaxLength(1000)] - public string Note { get; set; } - - [Comment("排序")] - [Required] - public int Sort { get; set; } - - [Comment("区域ID")] - [MaxLength(36)] - [Required] - public string AreaCode { get; set; } - - [Comment("类型")] - [Required] - public int Type { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseTask.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseTask.cs deleted file mode 100644 index fde1073..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseTask.cs +++ /dev/null @@ -1,266 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Ewide.Application -{ - [Table("bs_house_task")] - [Comment("房屋巡查任务表")] - public class BsHouseTask : Core.DEntityBase - { - /// - /// bs_house_code主键Id - /// - [Comment("bs_house_code主键Id")] - [MaxLength(36)] - [Required] - public string HouseCodeId { get; set; } - - /// - /// 巡查日期 - /// - [Comment("巡查日期")] - public DateTime? PatrolDate { get; set; } - - /// - /// 巡查人姓名 - /// - [Comment("巡查人姓名")] - [MaxLength(50)] - public string PatrolUser { get; set; } - - /// - /// 沉降倾斜 - /// - [Comment("沉降倾斜")] - [MaxLength(1000)] - public string SettlementTilt { get; set; } - - /// - /// 沉降倾斜附件 - /// - [Comment("沉降倾斜附件")] - [MaxLength(2000)] - public string SettlementTiltFiles { get; set; } - - /// - /// 其他情况 - /// - [Comment("其他情况")] - [MaxLength(1000)] - public string OtherInfo { get; set; } - - /// - /// 其他情况附件 - /// - [Comment("其他情况附件")] - [MaxLength(2000)] - public string OtherInfoFiles { get; set; } - - /// - /// 初始等级 - /// - [Comment("初始等级")] - public int? InitGrade { get; set; } - - /// - /// 损坏等级 - /// - [Comment("损坏等级")] - public int? DamageGrade { get; set; } - - /// - /// 综合等级 - /// - [Comment("综合等级")] - public int? ComprehensiveGrade { get; set; } - - /// - /// 房屋场地 - /// - [Comment("房屋场地")] - [MaxLength(100)] - public string HouseSite { get; set; } - - /// - /// 相邻施工 - /// - [Comment("相邻施工")] - [MaxLength(100)] - public string AdjacentConstruction { get; set; } - - /// - /// 化学侵蚀 - /// - [Comment("化学侵蚀")] - [MaxLength(100)] - public string ChemicalErosion { get; set; } - - /// - /// 结构拆改 - /// - [Comment("结构拆改")] - public int? StructuralDismantling { get; set; } - - /// - /// 加层改造 - /// - [Comment("加层改造")] - public int? AddingLayer { get; set; } - - /// - /// 修缮加固 - /// - [Comment("修缮加固")] - [MaxLength(100)] - public string RepairAndReinforce { get; set; } - - /// - /// 历史灾害 - /// - [Comment("历史灾害")] - [MaxLength(100)] - public string HistoricalCalamity { get; set; } - - /// - /// 使用功能变更 - /// - [Comment("使用功能变更")] - [MaxLength(100)] - public string FunctionalChange { get; set; } - - /// - /// 其他调查内容 - /// - [Comment("其他调查内容")] - [MaxLength(1000)] - public string OtherContents { get; set; } - - /// - /// 主要安全隐患综述 - /// - [Comment("主要安全隐患综述")] - [MaxLength(1000)] - public string MainSafety { get; set; } - - /// - /// 处理意见 - /// - [Comment("处理意见")] - public int? HandlingOpinion { get; set; } - - /// - /// 处理意见备注 - /// - [Comment("处理意见备注")] - [MaxLength(1000)] - public string HandlingOpinionRemark { get; set; } - - /// - /// 整改情况 - /// - [Comment("整改情况")] - public int? RectifyAndReform { get; set; } - - /// - /// 整改情况备注 - /// - [Comment("整改情况备注")] - [MaxLength(1000)] - public string RectifyAndReformRemark { get; set; } - - /// - /// 巡查结果:1正常,-1异常 - /// - [Comment("巡查结果:1正常,-1异常")] - public int? PatrolResult { get; set; } - - /// - /// 巡查异常描述 - /// - [Comment("巡查异常描述")] - [MaxLength(1000)] - public string PatrolResultRemark { get; set; } - - /// - /// 任务人员ID - /// - [Comment("任务人员ID")] - [MaxLength(36)] - public string UserID { get; set; } - - /// - /// 任务截止时间 - /// - [Comment("任务截止时间")] - public DateTime? EndTime { get; set; } - - /// - /// 是否过期 - /// - [Comment("是否过期")] - public bool? IsDelay { get; set; } - - /// - /// -1:退回0:待处理1:保存待提交2:待审核3:审核通过 - /// - [Comment("-1:退回0:待处理1:保存待提交2:待审核6:审核通过")] - public int Status { get; set; } = 0; - - /// - /// 0:建档任务1:系统派发的巡查任务2:主动巡查任务 - /// - [Comment("0:建档任务1:系统派发的巡查任务2:主动巡查任务")] - public int? TaskType { get; set; } - - /// - /// 上报街道 - /// - [Comment("上报街道")] - public int? ReportRoad { get; set; } - - /// - /// 上报街道时间 - /// - [Comment("上报街道时间")] - public DateTime? ReportRoadTime { get; set; } - - /// - /// 上报区住建 - /// - [Comment("上报区住建")] - public int? ReportArea { get; set; } - - /// - /// 上报区住建时间 - /// - [Comment("上报区住建时间")] - public DateTime? ReportAreaTime { get; set; } - - /// - /// 上报备注 - /// - [Comment("上报备注")] - [MaxLength(1000)] - public string ReportRemark { get; set; } - - /// - /// 提交时间 - /// - [Comment("提交时间")] - public DateTime? SubmitTime { get; set; } - - /// - /// 最后提交时间 - /// - [Comment("最后提交时间")] - public DateTime? LastSubmitTime { get; set; } - - /// - /// 是否有效 - /// - [Comment("是否有效")] - public bool IsEnabled { get; set; } = true; - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseTaskCheckRecord.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseTaskCheckRecord.cs deleted file mode 100644 index 5fdf4e1..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseTaskCheckRecord.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Ewide.Application -{ - [Table("bs_house_task_check_record")] - [Comment("房屋任务审核记录表")] - public class BsHouseTaskCheckRecord : Core.DEntityBase - { - /// - /// 任务Id - /// - [Comment("任务Id")] - [MaxLength(36)] - public string TaskId { get; set; } - - /// - /// 通过1;退回-1 - /// - [Comment("通过3;退回-1")] - public int PassOrBack { get; set; } - - /// - /// 审核内容 - /// - [Comment("审核内容")] - [MaxLength(500)] - public string Content { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Entity/BsHouseTaskOptions.cs b/20220330_Vote/Ewide.Application/Entity/BsHouseTaskOptions.cs deleted file mode 100644 index c279a1b..0000000 --- a/20220330_Vote/Ewide.Application/Entity/BsHouseTaskOptions.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -namespace Ewide.Application -{ - [Table("bs_house_task_options")] - [Comment("房屋巡查任务选项表")] - public class BsHouseTaskOptions : Core.DEntityBase - { - /// - /// bs_house_code主键Id - /// - [Comment("bs_house_code主键Id")] - [MaxLength(36)] - [Required] - public string TaskId { get; set; } - - /// - /// 字典类型 - /// - [Comment("字典类型")] - [MaxLength(50)] - public string DictType { get; set; } - - /// - /// 字典code - /// - [Comment("字典code")] - [MaxLength(50)] - public string DictCode { get; set; } - - /// - /// 字典值 - /// - [Comment("字典值")] - [MaxLength(100)] - public string DictValue { get; set; } - - /// - /// 备注 - /// - [Comment("备注")] - [MaxLength(500)] - public string Remark { get; set; } - - /// - /// 附件 - /// - [Comment("附件")] - [MaxLength(2000)] - public string File { get; set; } - - /// - /// 是否选中 - /// - [Comment("是否选中")] - public bool? Checked { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Enum/HouseLog.cs b/20220330_Vote/Ewide.Application/Enum/HouseLog.cs deleted file mode 100644 index 29d707f..0000000 --- a/20220330_Vote/Ewide.Application/Enum/HouseLog.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public enum HouseLogType - { - [Description("创建房屋编码")] - CreateCode = 1, - - [Description("人员选房")] - SelectMember = 2, - - [Description("房屋建档")] - CreateInfo = 3, - - [Description("审核")] - Check = 4, - - [Description("审核通过")] - Agree = 5, - - [Description("审核退回")] - Disagree = 6 - - } - - public enum HouseLogStatus - { - [Description("待处理")] - Handle = 0, - - [Description("正在处理")] - Handling = 1, - - [Description("已处理")] - Handled = 2, - } -} diff --git a/20220330_Vote/Ewide.Application/Enum/HouseManagerRole.cs b/20220330_Vote/Ewide.Application/Enum/HouseManagerRole.cs deleted file mode 100644 index bb0909b..0000000 --- a/20220330_Vote/Ewide.Application/Enum/HouseManagerRole.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public enum HouseManagerRole - { - /// - /// 市住建部门 - /// - CityManager, - - /// - /// 区住建部门 - /// - AreaManager, - - /// - /// 街道管理员 - /// - RoadManager, - - /// - /// 片区监管员 - /// - ZoneManager, - - /// - /// 房屋安全管理员 - /// - HouseSecurityManager - } -} diff --git a/20220330_Vote/Ewide.Application/Ewide.Application.csproj b/20220330_Vote/Ewide.Application/Ewide.Application.csproj index 95dd765..eab5b69 100644 --- a/20220330_Vote/Ewide.Application/Ewide.Application.csproj +++ b/20220330_Vote/Ewide.Application/Ewide.Application.csproj @@ -22,6 +22,7 @@ + diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeInput.cs deleted file mode 100644 index d105eda..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeInput.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Ewide.Core; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseCodeInput - { - } - - public class AddHouseCodeInput : PageInputBase - { - public string HouseCode { get; set; } - [Required(ErrorMessage = "行政区域编码不能为空")] - public string AreaCode { get; set; } - [Required(ErrorMessage = "项目Id不能为空")] - public string ProjectId { get; set; } - [Required(ErrorMessage = "房屋编号不能为空")] - public int No { get; set; } - [Required(ErrorMessage = "片区Id不能为空")] - public string ZoneId { get; set; } - [Required(ErrorMessage = "房屋地址不能为空")] - public string Address { get; set; } - [Required(ErrorMessage = "房屋性质不能为空")] - public int Type { get; set; } - [Required(ErrorMessage = "所属行业不能为空")] - public int Industry { get; set; } - [Required(ErrorMessage = "经度不能为空")] - public string Lng { get; set; } - [Required(ErrorMessage = "纬度不能为空")] - public string Lat { get; set; } - } - - public class EditHouseCodeInput : AddHouseCodeInput - { - [Required(ErrorMessage = "房屋编码Id不能为空")] - public string Id { get; set; } - } - - public class DeleteHouseCodeInput - { - [Required(ErrorMessage = "房屋编码ID不可为空")] - public string Id { get; set; } - } - - public class QueryHouseCodeInput : PageInputBase - { - public string HouseCode { get; set; } - public int? No { get; set; } - public string Address { get; set; } - public string ProjectId { get; set; } - public string ZoonId { get; set; } - public int Type { get; set; } - } - - public class GetHouseCodeInput - { - [Required(ErrorMessage = "房屋编码ID不可为空")] - public string Id { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs deleted file mode 100644 index bb691f8..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Ewide.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseCodeOutput - { - public string Id { get; set; } - public string Address { get; set; } - public string ProjectId { get; set; } - public string ZoneId { get; set; } - public int Type { get; set; } - public string AreaName { get; set; } - public string RoadName { get; set; } - public string CommName { get; set; } - public string ZoneName { get; set; } - public string ProjectNote { get; set; } - public string FullProjName { get; set; } - public string HouseCode { get; set; } - public int No { get; set; } - public string Lng { get; set; } - public string Lat { get; set; } - } - - public class GetHouseCodeOutput - { - public string Id { get; set; } - public string HouseCode { get; set; } - public int Type { get; set; } - public int Industry { get; set; } - public string AreaCode { get; set; } - public string ProjectId { get; set; } - public int No { get; set; } - public string ZoneId { get; set; } - public string Address { get; set; } - public string Lng { get; set; } - public string Lat { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs deleted file mode 100644 index 8175ddd..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs +++ /dev/null @@ -1,123 +0,0 @@ -using Ewide.Application.Entity; -using Ewide.Core; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Furion.FriendlyException; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System.Threading.Tasks; -using Dapper; -using Ewide.Core.Extension; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Collections.Generic; - -namespace Ewide.Application.Service.HouseCode -{ - /// - /// 房屋编码相关 - /// - [ApiDescriptionSettings(Name = "HouseCode", Order = 180)] - public class HouseCodeService : IHouseCodeService, IDynamicApiController, ITransient - { - private readonly IRepository _houseCodeRep; - private readonly IDapperRepository _dapperRepository; - - private readonly IUserManager _userManager; - private readonly IHouseLogService _houseLogService; - - public HouseCodeService(IRepository HouseCodeRep, IDapperRepository dapperRepository, IUserManager userManager, IHouseLogService houseLogService) - { - _houseCodeRep = HouseCodeRep; - _dapperRepository = dapperRepository; - - _userManager = userManager; - _houseLogService = houseLogService; - } - - [HttpPost("/houseCode/add")] - [UnitOfWork] - public async Task AddHouseCode(AddHouseCodeInput input) - { - var houseProjectInfoRep = Db.GetRepository(); - var houseProject = await houseProjectInfoRep.FirstOrDefaultAsync(p => p.Id == input.ProjectId); - if (houseProject == null) throw Oops.Oh("项目参数有误,添加失败"); - - var areaCodeRep = Db.GetRepository(); - var areaCode = await areaCodeRep.DetachedEntities.FirstOrDefaultAsync(a => a.Code == input.AreaCode && a.LevelType == 4); - if(areaCode == null) throw Oops.Oh("区域编码有误,添加失败"); - input.HouseCode = areaCode.AdCode + houseProject.Sort.ToString().PadLeft(3, '0') + input.No.ToString().PadLeft(3, '0'); - var id = System.Guid.NewGuid().ToString().ToLower(); - var houseCode = input.Adapt(); - houseCode.Id = id; - var isExist = await _houseCodeRep.AnyAsync(p => p.HouseCode == houseCode.HouseCode); - if (isExist) throw Oops.Oh("房屋编码已存在,不可重复添加"); - await houseCode.InsertAsync(); - - // 添加到流转日志 - var sort = await _houseLogService.AddThenDone(id, _userManager.User, HouseLogType.CreateCode); - sort = await _houseLogService.Add(id, _userManager.User, HouseLogType.SelectMember, sort: sort); - } - - [HttpPost("/houseCode/edit")] - public async Task EditHouseCode(EditHouseCodeInput input) - { - var houseCode = input.Adapt(); - await houseCode.UpdateExcludeAsync(new[] { nameof(BsHouseCode.HouseCode) }, true); - } - - [HttpPost("/houseCode/delete")] - public async Task DeleteHouseCode(DeleteHouseCodeInput input) - { - var houseCode = _houseCodeRep.FirstOrDefault(p => p.Id == input.Id); - await houseCode.DeleteNowAsync(); - } - - [HttpPost("/houseCode/page")] - public async Task QueryPage([FromBody] QueryHouseCodeInput input) - { - var sql = @"SELECT -HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName -FROM bs_house_code HC -LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId -LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode -LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) -LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) "; - return await _dapperRepository.QueryPageDataDynamic(sql, input, filterFields: new string[] {"Type", "Address", "HouseCode","AreaCode"}); - } - - [HttpGet("/houseCode/detail")] - public async Task GetHouserCode([FromQuery] GetHouseCodeInput input) - { - var houseCode = await _houseCodeRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.Id); - var areaCode = (await Db.GetRepository().DetachedEntities.FirstOrDefaultAsync(p => p.Id == houseCode.ProjectId)).AreaCode; - var result = houseCode.Adapt(); - result.AreaCode = areaCode; - return result; - } - - /// - /// 获取同一区域下的下一个编号 - /// - /// - /// - [HttpGet("/houseCode/getNextNoByCode")] - public async Task GetNextNoByFullNumber([Required] string projectId) - { - var areaCodeRep = Db.GetRepository(); - var houseProjectInfoRep = Db.GetRepository(); - var houseProject = await houseProjectInfoRep.FirstOrDefaultAsync(p => p.Id == projectId); - if(houseProject == null) throw Oops.Oh("项目参数有误,房屋编码生成失败"); - //取到社区编码 - var commAreaCode = await areaCodeRep.FirstOrDefaultAsync(a => a.Code == houseProject.AreaCode && a.LevelType == 4); - if(commAreaCode == null) throw Oops.Oh("项目区域编码有误,房屋编码生成失败"); - var maxNo = await _houseCodeRep.DetachedEntities - .Where(h => h.HouseCode.Contains(commAreaCode.AdCode + houseProject.Sort.ToString().PadLeft(3, '0'))) - .MaxAsync(h => (int?)h.No); - return maxNo.GetValueOrDefault(0) + 1; - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/IHouseCodeService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/IHouseCodeService.cs deleted file mode 100644 index c1e1e4f..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCode/IHouseCodeService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseCode -{ - public interface IHouseCodeService - { - Task AddHouseCode(AddHouseCodeInput input); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyInput.cs deleted file mode 100644 index 95fcd6e..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyInput.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Ewide.Core; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseCompanyInput - { - [Required(ErrorMessage = "Id不能为空")] - public string Id { get; set; } - } - - public class HouseCompanyInfoInput - { - [Required(ErrorMessage = "信息名称不能为空")] - public string Name { get; set; } - [Required(ErrorMessage = "信息内容不能为空")] - public string Value { get; set; } - } - - public class HouseCompanyPageInput : PageInputBase {} - - public class HouseCompanyAddInput - { - [Required(ErrorMessage = "名称不能为空")] - public virtual string Name { get; set; } - - private string _Type { get; set; } - - [Required(ErrorMessage = "类型不能为空")] - public virtual string Type - { - get - { - return _Type; - } - set - { - _Type = String.Join(",", value.Split(',').Select(p => $"[{p}]")); - } - } - - public virtual List Info { get; set; } - } - - public class HouseCompanyEditInput : HouseCompanyAddInput - { - [Required(ErrorMessage = "Id不能为空")] - public string Id { get; set; } - } - - public class HouseCompanyListInput - { - [Required(ErrorMessage = "类型不能为空")] - public string Type { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyOutput.cs deleted file mode 100644 index 8692722..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/Dto/HouseCompanyOutput.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseCompanyInfoOutput - { - public string Name { get; set; } - public string Value { get; set; } - } - - public class HouseCompanyDetailOutput - { - public string Id { get; set; } - public string Name { get; set; } - private string _Type { get; set; } - public string Type - { - get - { - return _Type; - } - set - { - _Type = String.Join(",", value.Split(',').Select(p => p.Replace("[", "").Replace("]", ""))); - } - } - public List Info { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/HouseCompanyService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/HouseCompanyService.cs deleted file mode 100644 index dc99898..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/HouseCompanyService.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Ewide.Core.Extension; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - [ApiDescriptionSettings(Name = "HouseCompany")] - public class HouseCompanyService : IHouseCompanyService, IDynamicApiController, ITransient - { - private readonly IRepository _bsHouseCompanyRep; - - public HouseCompanyService(IRepository bsHouseCompanyRep) - { - _bsHouseCompanyRep = bsHouseCompanyRep; - } - - [HttpPost("/houseCompany/page")] - public async Task Page([FromBody] HouseCompanyPageInput input) - { - var config = new TypeAdapterConfig().ForType() - .Map(target => target.Info, src => JsonConvert.DeserializeObject>(src.Info)) - .Config; - return await _bsHouseCompanyRep.DetachedEntities.ToPageData(input, config); - } - - [HttpPost("/houseCompany/add")] - public async Task Add([FromBody] HouseCompanyAddInput input) - { - var info = JsonConvert.SerializeObject(input.Info); - var config = new TypeAdapterConfig().ForType() - .Map(target => target.Info, src => JsonConvert.SerializeObject(src.Info)) - .Config; - var company = input.Adapt(config); - await company.InsertAsync(); - } - - [HttpPost("/houseCompany/edit")] - public async Task Edit([FromBody] HouseCompanyEditInput input) - { - var config = new TypeAdapterConfig().ForType() - .Map(target => target.Info, src => JsonConvert.SerializeObject(src.Info)) - .Config; - var company = input.Adapt(config); - await company.UpdateAsync(); - } - - [HttpPost("/houseCompany/delete")] - public async Task Delete([FromBody] HouseCompanyInput input) - { - var company = await _bsHouseCompanyRep.FirstOrDefaultAsync(p => p.Id.Equals(input.Id)); - await company.DeleteAsync(); - } - - [HttpGet("/houseCompany/detail")] - public async Task Detail([FromQuery] HouseCompanyInput input) - { - var company = await _bsHouseCompanyRep.FirstOrDefaultAsync(p => p.Id.Equals(input.Id)); - var config = new TypeAdapterConfig().ForType() - .Map(target => target.Info, src => JsonConvert.DeserializeObject>(src.Info)) - .Config; - var output = company.Adapt(config); - return output; - } - - [HttpGet("/houseCompany/list")] - public async Task List([FromQuery] HouseCompanyListInput input) - { - var types = input.Type.Split(','); - var result = new List(); - var config = new TypeAdapterConfig().ForType() - .Map(target => target.Info, src => JsonConvert.DeserializeObject>(src.Info)) - .Config; - foreach (var type in types) - { - var list = (await _bsHouseCompanyRep.DetachedEntities - .Where(p => EF.Functions.Like(p.Type, $"%[{type.Trim()}]%")) - .OrderBy(p => p.Name) - .ToListAsync()) - .Select(p => - { - var output = p.Adapt(config); - return output; - }); - result.AddRange(list); - } - - return result.Distinct(); - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/IHouseCompanyService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/IHouseCompanyService.cs deleted file mode 100644 index 94eac4e..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseCompany/IHouseCompanyService.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public interface IHouseCompanyService - { - Task Page([FromBody] HouseCompanyPageInput input); - Task Add([FromBody] HouseCompanyAddInput input); - Task Edit([FromBody] HouseCompanyEditInput input); - Task Delete([FromBody] HouseCompanyInput input); - Task Detail([FromQuery] HouseCompanyInput input); - Task List([FromQuery] HouseCompanyListInput input); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoInput.cs deleted file mode 100644 index 6977a3f..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoInput.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseInfoInput - { - #region 建筑物基本信息building - public string BuildingName { get; set; } - - public int? LandAttribute { get; set; } - - public int? StructureType { get; set; } - - public int? SeismicGrade { get; set; } - - public int? BaseInfo { get; set; } - - public string InsulationMaterial { get; set; } - - public string WallMaterial { get; set; } - - public string FireproofGrade { get; set; } - public int? CurtainWall { get; set; } - public int? FaceBrick { get; set; } - public int? WhiteWash { get; set; } - public int? Coating { get; set; } - public string Elevator { get; set; } - public DateTime? CompletedDate { get; set; } - public int? UsefulYear { get; set; } - /// - /// 总建筑面积 - /// - public float? TotalArea { get; set; } - /// - /// 总户数(户) - /// - public int? HouseHolds { get; set; } - - /// - /// 房屋单元数 - /// - public int? Units { get; set; } - - /// - /// 各单元每层户数(户) - /// - public int? UnitFloorHolds { get; set; } - - /// - /// 总层数 - /// - public int? TotalFloor { get; set; } - - /// - /// 地上层数 - /// - public int? LandFloorCount { get; set; } - - /// - /// 地上商业层数开始 - /// - public int? LandBsFloorStart { get; set; } - - /// - /// 地上商业层数结束 - /// - public int? LandBsFloorEnd { get; set; } - - /// - /// 地上车棚层开始 - /// - public int? LandBikeFloorStart { get; set; } - - /// - /// 地上住宅层开始 - /// - public int? LandResidenceFloorStart { get; set; } - - /// - /// 地上住宅层结束 - /// - public int? LandResidenceFloorEnd { get; set; } - - /// - /// 地下层数 - /// - public int? UnderFloorCount { get; set; } - #endregion - #region 权属情况ownership - /// - /// 产权性质 - /// - public string PropertyRights { get; set; } - - /// - /// 总共套数 - /// - public int? HouseCount { get; set; } - /// - /// 直管公房套数 - /// - public int? StraightHouseCount { get; set; } - - /// - /// 自管公房套数 - /// - public int? SelfHouseCount { get; set; } - - /// - /// 私房套数 - /// - public int? PrivateHouseCount { get; set; } - - /// - /// 商品房套数 - /// - public int? BusinessCount { get; set; } - - /// - /// 房改房套数 - /// - public int? ChangeHouseCount { get; set; } - - /// - /// 拆迁安置房套数 - /// - public int? ResettlementHouseCount { get; set; } - - /// - /// 其它套数 - /// - public int? OtherCount { get; set; } - - #endregion - #region 管理情况manager - #endregion - - #region 鉴定治理identification - - /// - /// 房屋等级 1,2,3,4,C,d - /// - public int? HouseGrade { get; set; } - - /// - /// 房屋使用状态 - /// - public int? HouseUsedStatus { get; set; } - #endregion - - #region 图纸资料存档处drawing - - /// - /// 图纸资料存档处 - /// - public string DrawingMaterial { get; set; } - - /// - /// 其他图纸存档 - /// - public string DrawingMaterialText { get; set; } - #endregion - - #region 相关附件资料attachments - /// - /// 立项文件 - /// - public string AnEntryDocument { get; set; } - - /// - /// 规划许可 - /// - public string PlanningPermission { get; set; } - - /// - /// 竣工验收备案 - /// - public string CompletionRecord { get; set; } - - /// - /// 监理资料 - /// - public string MonitorDocument { get; set; } - - /// - /// 鉴定报告 - /// - public string IdentificationReport { get; set; } - - /// - /// 其它资料 - /// - public string OtherDocument { get; set; } - #endregion - - #region 建筑概貌aspect - /// - /// 外立面照片 - /// - public string FacadePhoto { get; set; } - #endregion - - #region 调查单位unit - /// - /// 调查登记机构 - /// - public string InvestigateAgency { get; set; } - - /// - /// 纸质资料调查人 - /// - public string InvestigateUser { get; set; } - - /// - /// 纸质资料审核人 - /// - public string OfflineAuditor { get; set; } - - /// - /// 主管部门 - /// - public string CompetentDepartment { get; set; } - #endregion - - public int State { get; set; } - } - - public class HouseInfoInputSave - { - public HouseCodeOutput houseCode { get; set; } - public HouseInfoInput houseInfo { get; set; } - public EditHouseTaskInput PatrolInfo { get; set; } - public HouseTaskCheckRecordInput TaskCheckRecord { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoOutput.cs deleted file mode 100644 index 104f44d..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/Dto/HouseInfoOutput.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseInfoOutput - { - #region 建筑物基本信息building - public string BuildingName { get; set; } - - public int? LandAttribute { get; set; } - - public int? StructureType { get; set; } - - public int? SeismicGrade { get; set; } - - public int? BaseInfo { get; set; } - - public string InsulationMaterial { get; set; } - - public string WallMaterial { get; set; } - - public string FireproofGrade { get; set; } - public int? CurtainWall { get; set; } - public int? FaceBrick { get; set; } - public int? WhiteWash { get; set; } - public int? Coating { get; set; } - public string Elevator { get; set; } - public DateTime? CompletedDate { get; set; } - public int? UsefulYear { get; set; } - /// - /// 总建筑面积 - /// - public float? TotalArea { get; set; } - /// - /// 总户数(户) - /// - public int? HouseHolds { get; set; } - - /// - /// 房屋单元数 - /// - public int? Units { get; set; } - - /// - /// 各单元每层户数(户) - /// - public int? UnitFloorHolds { get; set; } - - /// - /// 总层数 - /// - public int? TotalFloor { get; set; } - - /// - /// 地上层数 - /// - public int? LandFloorCount { get; set; } - - /// - /// 地上商业层数开始 - /// - public int? LandBsFloorStart { get; set; } - - /// - /// 地上商业层数结束 - /// - public int? LandBsFloorEnd { get; set; } - - /// - /// 地上车棚层开始 - /// - public int? LandBikeFloorStart { get; set; } - - /// - /// 地上住宅层开始 - /// - public int? LandResidenceFloorStart { get; set; } - - /// - /// 地上住宅层结束 - /// - public int? LandResidenceFloorEnd { get; set; } - - /// - /// 地下层数 - /// - public int? UnderFloorCount { get; set; } - #endregion - #region 权属情况ownership - /// - /// 产权性质 - /// - public string PropertyRights { get; set; } - - /// - /// 总共套数 - /// - public int? HouseCount { get; set; } - /// - /// 直管公房套数 - /// - public int? StraightHouseCount { get; set; } - - /// - /// 自管公房套数 - /// - public int? SelfHouseCount { get; set; } - - /// - /// 私房套数 - /// - public int? PrivateHouseCount { get; set; } - - /// - /// 商品房套数 - /// - public int? BusinessCount { get; set; } - - /// - /// 房改房套数 - /// - public int? ChangeHouseCount { get; set; } - - /// - /// 拆迁安置房套数 - /// - public int? ResettlementHouseCount { get; set; } - - /// - /// 其它套数 - /// - public int? OtherCount { get; set; } - - #endregion - #region 管理情况manager - #endregion - - #region 鉴定治理identification - - /// - /// 房屋等级 1,2,3,4,C,d - /// - public int? HouseGrade { get; set; } - - /// - /// 房屋使用状态 - /// - public int? HouseUsedStatus { get; set; } - #endregion - - #region 图纸资料存档处drawing - - /// - /// 图纸资料存档处 - /// - public string DrawingMaterial { get; set; } - - /// - /// 其他图纸存档 - /// - public string DrawingMaterialText { get; set; } - #endregion - - #region 相关附件资料attachments - /// - /// 立项文件 - /// - public string AnEntryDocument { get; set; } - - /// - /// 规划许可 - /// - public string PlanningPermission { get; set; } - - /// - /// 竣工验收备案 - /// - public string CompletionRecord { get; set; } - - /// - /// 监理资料 - /// - public string MonitorDocument { get; set; } - - /// - /// 鉴定报告 - /// - public string IdentificationReport { get; set; } - - /// - /// 其它资料 - /// - public string OtherDocument { get; set; } - #endregion - - #region 建筑概貌aspect - /// - /// 外立面照片 - /// - public string FacadePhoto { get; set; } - #endregion - public int State { get; set; } - #region 调查单位unit - /// - /// 调查登记机构 - /// - public string InvestigateAgency { get; set; } - - /// - /// 纸质资料调查人 - /// - public string InvestigateUser { get; set; } - - /// - /// 纸质资料审核人 - /// - public string OfflineAuditor { get; set; } - - /// - /// 主管部门 - /// - public string CompetentDepartment { get; set; } - #endregion - } - - public class HouseInfoOutputForDetailPage - { - #region header - public HouseCodeOutput HouseCode { get; set; } - #endregion - - public HouseInfoOutput HouseInfo { get; set; } - public HouseTaskOutput PatrolInfo { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs deleted file mode 100644 index a5b2d5e..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs +++ /dev/null @@ -1,208 +0,0 @@ -using Dapper; -using Ewide.Core; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Furion.FriendlyException; -using Mapster; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseSafety.HouseInfo -{ - /// - /// 房屋详细信息 - /// - [ApiDescriptionSettings(Name = "HouseInfo", Order = 200)] - public class HouseInfoService : IHouseInfoService, IDynamicApiController, ITransient - { - - private readonly IRepository _houseCodeRep; - private readonly IRepository _houseInfoRep; - private readonly IRepository _houseTaskRep; - private readonly IRepository _sysUserRep; - private readonly IUserManager _userManager; - private readonly IDapperRepository _dapperRepository; - - private readonly IHouseLogService _houseLogService; - - - public HouseInfoService( - IRepository HouseCodeRep, - IRepository HouseInfoRep, - IRepository HouseTaskRep, - IRepository sysUserRep, - IUserManager userManager, IDapperRepository dapperRepository, IHouseLogService houseLogService) - { - _houseCodeRep = HouseCodeRep; - _houseInfoRep = HouseInfoRep; - _houseTaskRep = HouseTaskRep; - _sysUserRep = sysUserRep; - _userManager = userManager; - _dapperRepository = dapperRepository; - - _houseLogService = houseLogService; - } - - [HttpPost("/houseInfo/save")] - [UnitOfWork] - [AllowAnonymous] - public async Task Save([FromBody] HouseInfoInputSave input) - { - await InputDataProcess(input, DataStatus.Saved); - } - - [HttpPost("/houseInfo/submitToCheck")] - [UnitOfWork] - [AllowAnonymous] - public async Task SubmitToCheck([FromBody] HouseInfoInputSave input) - { - await InputDataProcess(input,DataStatus.Submited); - } - - [HttpPost("/houseInfo/check")] - [UnitOfWork] - public async Task Check([FromBody] HouseInfoInputSave input) - { - await InputDataProcess(input, input.TaskCheckRecord.PassOrBackDataStatus ); - } - - [HttpGet("/houseInfo/getByTaskId")] - [UnitOfWork] - public async Task GetByTaskId([Required] string taskId) - { - //获取任务实体 - var houseTask = await _houseTaskRep.DetachedEntities.FirstOrDefaultAsync(t=>t.Id == taskId); - if(houseTask == null) throw Oops.Oh("任务不存在"); - - //获取房屋编码信息 - var houseCodeOutputAsync = await _dapperRepository.QueryAsync( - @"SELECT -HC.Id,HC.Address,HC.ProjectId,HC.ZoneId,HC.Type,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,O.Name ZoneName,Proj.Note ProjectNote,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName,HC.HouseCode,HC.Lng,HC.Lat,HC.No -FROM bs_house_code HC -LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId -LEFT JOIN sys_org O ON HC.ZoneId = O.Id -LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode -LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) -LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) -WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId } - ); - var houseCodeOutput= houseCodeOutputAsync.SingleOrDefault(); - if (houseCodeOutput == null) throw Oops.Oh("任务已失效:房屋编码不存在,请重新加载任务列表"); - - //获取当前登录账号 - var currentUser = await _userManager.CheckUserAsync(); - - //查询房屋详细信息是否存在 - var houseInfo = await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(h => h.HouseCodeId == houseTask.HouseCodeId); - var houseInfoOutputForDetailPage = new HouseInfoOutputForDetailPage - { - HouseCode = houseCodeOutput - }; - - var taskOutput = houseTask.Adapt(); - taskOutput.PatrolDate = houseTask.PatrolDate.GetValueOrDefault(DateTime.Now); - taskOutput.PatrolUser = String.IsNullOrEmpty(houseTask.PatrolUser) ? currentUser.Name : houseTask.PatrolUser; - houseInfoOutputForDetailPage.PatrolInfo = taskOutput; - - if (houseInfo == null || houseInfo.State <= (int)DataStatus.Submited) - { - // 未建档或者当前数据未提交时打开,标记为已读 - await _houseLogService.Read(houseCodeOutput.Id); - } - - if (houseInfo == null) - { - houseInfoOutputForDetailPage.HouseInfo = new HouseInfoOutput(); - return houseInfoOutputForDetailPage; - } - - var houseInfoOutput = (await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.HouseCodeId == houseTask.HouseCodeId)).Adapt(); - houseInfoOutputForDetailPage.HouseInfo = houseInfoOutput; - - return houseInfoOutputForDetailPage; - } - - [NonAction] - [UnitOfWork] - public async Task InputDataProcess(HouseInfoInputSave input,DataStatus dataStatus = DataStatus.Init) - { - //房屋编码地址/坐标单独更新 - var houseCode = input.houseCode.Adapt(); - await houseCode.UpdateIncludeAsync(new[] { nameof(BsHouseCode.Address), nameof(BsHouseCode.Lng), nameof(BsHouseCode.Lat) }, true); - - //获取房屋详情实体,判断是新增还是更新 - var houseEntity = await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(h => h.HouseCodeId == input.houseCode.Id); - - //建档审核通过的房屋数据修改时,对应的建档任务Task不处理 - var houseTask = await _houseTaskRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.PatrolInfo.Id); - if (houseEntity == null || houseEntity.State != 6) - { - var _houseTask = input.PatrolInfo.Adapt(); - _houseTask.HouseCodeId = input.houseCode.Id; - //任务没有暂存状态,其他状态与HouseInfo的State一致 - _houseTask.Status = dataStatus == DataStatus.TempSaved ? (int)DataStatus.Saved : (int)dataStatus; - await _houseTask.UpdateExcludeAsync(new string[] { nameof(BsHouseTask.TaskType) }, ignoreNullValues: true); - } - //判断房屋建档状态 - //dataStatus == DataStatus.Saved 若是保存操作 则判断是新增/更新 - //判断是新增/更新 根据传入参数dataStatus确定 - input.houseInfo.State = dataStatus == DataStatus.Saved ? (houseEntity == null ? (int)DataStatus.Saved : houseEntity.State) : (int)dataStatus; - var houseInfo = input.houseInfo.Adapt(); - houseInfo.HouseCodeId = input.houseCode.Id; - - if (houseEntity == null) - { - houseInfo.Id = Guid.NewGuid().ToString(); - await houseInfo.InsertAsync(); - } - else - { - houseInfo.Id = houseEntity.Id; - await houseInfo.UpdateExcludeAsync(new[] { nameof(BsHouseInfo.HouseGrade) }, true); - } - - int? logSort = null; - - if (dataStatus == DataStatus.Submited) - { - await _houseLogService.Done(input.houseCode.Id); - - var org = await _userManager.GetUserOrgInfo(); - - var _sysEmpRep = Db.GetRepository(); - var _sysUserRoleRep = Db.GetRepository(); - var _sysRoleRep = Db.GetRepository(); - var zoneManagerList = await (from u in _sysUserRep.DetachedEntities - join e in _sysEmpRep.DetachedEntities on u.Id equals e.Id - join ur in _sysUserRoleRep.DetachedEntities on u.Id equals ur.SysUserId - join r in _sysRoleRep.DetachedEntities on ur.SysRoleId equals r.Id - where e.OrgId == org.Id && r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase() - select u).ToListAsync(); - - logSort = await _houseLogService.Add(input.houseCode.Id, zoneManagerList, HouseLogType.Check); - } - //审核操作则新增一条审核记录 - if (dataStatus == DataStatus.Back || dataStatus == DataStatus.Passed) - { - var checkRecord = input.TaskCheckRecord.Adapt(); - await checkRecord.InsertAsync(); - await _houseLogService.Done(input.houseCode.Id); - logSort = await _houseLogService.AddThenDone(input.houseCode.Id, _userManager.User, dataStatus == DataStatus.Passed ? HouseLogType.Agree : HouseLogType.Disagree, remark: checkRecord.Content, sort: logSort); - if (dataStatus == DataStatus.Back) - { - var user = await _sysUserRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(houseTask.UserID)); - logSort = await _houseLogService.Add(input.houseCode.Id, user, HouseLogType.CreateInfo, sort: logSort); - } - } - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/IHouseInfoService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/IHouseInfoService.cs deleted file mode 100644 index 14dda5f..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseInfo/IHouseInfoService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public interface IHouseInfoService - { - Task GetByTaskId(string taskId); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogInput.cs deleted file mode 100644 index 356d221..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogInput.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseLogInput - { - [Required(ErrorMessage = "Id不能为空")] - public string Id { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogOutput.cs deleted file mode 100644 index fdd2831..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogOutput.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseLogOutput - { - public string Id { get; set; } - public string TargetUserNames { get; set; } - public int Type { get; set; } - public int Status { get; set; } - public string Remark { get; set; } - public DateTime? FinishedTime { get; set; } - public string FinishedUserId { get; set; } - public string FinishedUserName { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/HouseLogService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/HouseLogService.cs deleted file mode 100644 index 85cf06f..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/HouseLogService.cs +++ /dev/null @@ -1,209 +0,0 @@ -using Dapper; -using Ewide.Core; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - /// - /// 房屋流转日志 - /// - [ApiDescriptionSettings(Name = "HouseLog", Order = 210)] - public class HouseLogService : IHouseLogService, IDynamicApiController, ITransient - { - private readonly IDapperRepository _dapperRep; - - private readonly IUserManager _userManager; - - private readonly IRepository _bsHouseLogRep; - - public HouseLogService(IDapperRepository dapperRep, IUserManager userManager, IRepository bsHouseLogRep) - { - _dapperRep = dapperRep; - _userManager = userManager; - _bsHouseLogRep = bsHouseLogRep; - } - - [NonAction] - [UnitOfWork] - public async Task Add(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null) - { - return await Add(houseCodeId, new List { targetUser }, type, remark, sort); - } - - [NonAction] - [UnitOfWork] - public async Task Add(string houseCodeId, List targetUsers, HouseLogType type, string remark = null, int? sort = null) - { - if (!sort.HasValue) - { - sort = await _bsHouseLogRep.DetachedEntities.Where(p => p.HouseCodeId.Equals(houseCodeId)).MaxAsync(p => p.Sort); - } - var _sort = sort.GetValueOrDefault(1) + 1; - await new BsHouseLog - { - Id = Guid.NewGuid().ToString(), - HouseCodeId = houseCodeId, - TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)), - Type = type, - Status = HouseLogStatus.Handle, - Remark = remark, - Sort = _sort - }.InsertAsync(); - - return _sort; - } - - [NonAction] - [UnitOfWork] - public async Task Read(string houseCodeId) - { - var log = await _bsHouseLogRep - .Where(p => p.HouseCodeId.Equals(houseCodeId) && p.Status.Equals(HouseLogStatus.Handle)) - .OrderByDescending(p => p.CreatedTime) - .FirstOrDefaultAsync(); - if (log != null) - { - log.Status = HouseLogStatus.Handling; - await log.UpdateAsync(); - } - } - - [NonAction] - [UnitOfWork] - public async Task Done(string houseCodeId) - { - var log = await _bsHouseLogRep - .Where(p => p.HouseCodeId.Equals(houseCodeId) && !p.Status.Equals(HouseLogStatus.Handled)) - .OrderByDescending(p => p.CreatedTime) - .FirstOrDefaultAsync(); - if (log != null) - { - log.Status = HouseLogStatus.Handled; - log.FinishedTime = DateTime.Now; - log.FinishedUserId = _userManager.UserId; - log.FinishedUserName = _userManager.User.Account; - await log.UpdateAsync(); - } - } - - [NonAction] - [UnitOfWork] - public async Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null) - { - return await AddThenRead(houseCodeId, new List { targetUser }, type, remark, sort); - } - - [NonAction] - [UnitOfWork] - public async Task AddThenRead(string houseCodeId, List targetUsers, HouseLogType type, string remark = null, int? sort = null) - { - if (!sort.HasValue) - { - sort = await _bsHouseLogRep.DetachedEntities.Where(p => p.HouseCodeId.Equals(houseCodeId)).MaxAsync(p => p.Sort); - } - var _sort = sort.GetValueOrDefault(1) + 1; - await new BsHouseLog - { - Id = Guid.NewGuid().ToString(), - HouseCodeId = houseCodeId, - TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)), - Type = type, - Status = HouseLogStatus.Handling, - Remark = remark, - Sort = _sort - }.InsertAsync(); - - return _sort; - } - - [NonAction] - [UnitOfWork] - public async Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null) - { - return await AddThenDone(houseCodeId, new List { targetUser }, type, remark, sort); - } - - [NonAction] - [UnitOfWork] - public async Task AddThenDone(string houseCodeId, List targetUsers, HouseLogType type, string remark = null, int? sort = null) - { - if (!sort.HasValue) - { - sort = await _bsHouseLogRep.DetachedEntities.Where(p => p.HouseCodeId.Equals(houseCodeId)).MaxAsync(p => p.Sort); - } - var _sort = sort.GetValueOrDefault(1) + 1; - await new BsHouseLog - { - Id = Guid.NewGuid().ToString(), - HouseCodeId = houseCodeId, - TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)), - Type = type, - Status = HouseLogStatus.Handled, - Remark = remark, - FinishedTime = DateTime.Now, - FinishedUserId = _userManager.UserId, - FinishedUserName = _userManager.User.Account, - Sort = _sort - }.InsertAsync(); - - return _sort; - } - - [HttpGet("/houseLog/list")] - public async Task List([FromQuery] HouseLogInput input) - { - var sql = @"SELECT - HL.Id, - HL.Type, - HL.`Status`, - HL.Remark, - HL.FinishedTime, - HL.FinishedUserId, - IFNULL(NickName, `Name`) FinishedUserName, -(SELECT GROUP_CONCAT(IFNULL(NickName,`Name`)) FROM sys_user - WHERE Id IN ( - SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(_HL.TargetUserIds,',',HT.help_topic_id + 1),',',-1) - FROM bs_house_log _HL - JOIN mysql.help_topic HT ON HT.help_topic_id < (LENGTH(_HL.TargetUserIds) - LENGTH(REPLACE(_HL.TargetUserIds,',','')) + 1) - WHERE _HL.Id = HL.Id - ) -) TargetUserNames -FROM bs_house_log HL -LEFT JOIN sys_user SU ON HL.FinishedUserId = SU.Id -WHERE HouseCodeId = @HouseCodeId -ORDER BY Sort DESC"; - - return await _dapperRep.QueryAsync(sql, new { houseCodeId = input.Id }); - } - - [HttpGet("/houseLog/listByInfoId")] - public async Task ListByInfoId([FromQuery] HouseLogInput input) - { - var info = await Db.GetRepository().DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.Id)); - return await List(new HouseLogInput - { - Id = info.HouseCodeId - }); - } - - [HttpGet("/houseLog/listByTaskId")] - public async Task ListByTaskId([FromQuery] HouseLogInput input) - { - var task = await Db.GetRepository().DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.Id)); - return await List(new HouseLogInput - { - Id = task.HouseCodeId - }); - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/IHouseLogService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/IHouseLogService.cs deleted file mode 100644 index 056db2b..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseLog/IHouseLogService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Ewide.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public interface IHouseLogService - { - Task Add(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null); - Task Add(string houseCodeId, List targetUsers, HouseLogType type, string remark = null, int? sort = null); - Task Read(string houseCodeId); - Task Done(string houseCodeId); - Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null); - Task AddThenRead(string houseCodeId, List targetUsers, HouseLogType type, string remark = null, int? sort = null); - Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null); - Task AddThenDone(string houseCodeId, List targetUsers, HouseLogType type, string remark = null, int? sort = null); - Task List(HouseLogInput input); - Task ListByInfoId(HouseLogInput input); - Task ListByTaskId(HouseLogInput input); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberInput.cs deleted file mode 100644 index e3634ea..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberInput.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Ewide.Core.Service; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public class AddHouseMemberInput : AddUserInput - { - [Required(ErrorMessage = "角色不能为空")] - public string RoleId { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberOutput.cs deleted file mode 100644 index 73d2395..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/Dto/HouseMemberOutput.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Ewide.Core.Service; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public class HouseMemberOutput - { - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs deleted file mode 100644 index a77a0b5..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs +++ /dev/null @@ -1,326 +0,0 @@ -using Dapper; -using Ewide.Core; -using Ewide.Core.Extension; -using Ewide.Core.Service; -using Furion.DatabaseAccessor; -using Furion.DataEncryption; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Furion.FriendlyException; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System; - -namespace Ewide.Application.Service -{ - [ApiDescriptionSettings(Name = "HouseMember")] - public class HouseMemberService : IHouseMemberService, IDynamicApiController, ITransient - { - private readonly IDapperRepository _dapperRepository; - - private readonly IRepository _sysUserRep; // 用户表仓储 - private readonly IUserManager _userManager; - private readonly ISysUserService _sysUserService; - private readonly ISysEmpService _sysEmpService; - - public HouseMemberService( - IDapperRepository dapperRepository, - IRepository sysUserRep, - IUserManager userManager, - ISysUserService sysUserService, - ISysEmpService sysEmpService - ) - { - _dapperRepository = dapperRepository; - _sysUserRep = sysUserRep; - _userManager = userManager; - _sysUserService = sysUserService; - _sysEmpService = sysEmpService; - } - - /// - /// 分页查询用户 - /// - /// - /// - [HttpPost("/houseMember/page")] - public async Task QueryMemberPageList([FromBody] UserInput input) - { - var dataScopes = await _userManager.GetUserAllDataScopeList(); - - var sql = @"SELECT -SU.*, -SO.Name OrgName, -SUR.RoleName, -SUR.RoleCode -FROM sys_user SU -LEFT JOIN sys_emp SE ON SU.Id = SE.Id -LEFT JOIN sys_org SO ON SE.OrgId = SO.Id -LEFT JOIN ( - SELECT - SUR.SysUserId, - GROUP_CONCAT(SR.Name) RoleName, - GROUP_CONCAT(SR.Code) RoleCode - FROM sys_user_role SUR - LEFT JOIN sys_role SR ON SUR.SysRoleId = SR.Id - GROUP BY SUR.SysUserId -) SUR ON SU.Id = SUR.SysUserId -WHERE 1=1"; - var param = new DynamicParameters(); - - if (!string.IsNullOrEmpty(input.SearchValue)) - { - sql += @" AND (SU.Account Like @SearchValue - OR SU.Name Like @SearchValue - OR SU.Phone Like @SearchValue)"; - param.Add("SearchValue", "%" + input.SearchValue + "%"); - } - - if (!string.IsNullOrEmpty(input.SysEmpParam.OrgId)) - { - var filter = " AND (SO.Id = @OrgId {0}) "; - filter = String.Format(filter, input.TreeNodeDataScope.GetValueOrDefault(1) == 2 ? " OR SO.Pids Like CONCAT('%[', @OrgId, ']%') " : ""); - sql += filter; - param.Add("OrgId", input.SysEmpParam.OrgId); - } - - if (input.SearchStatus >= 0) - { - sql += " AND SU.Status = @Status"; - param.Add("Status", input.SearchStatus); - } - - if (!_userManager.SuperAdmin) - { - sql += " AND SU.AdminType <> @AdminType"; - param.Add("AdminType", AdminType.SuperAdmin); - - sql += " AND SU.Id <> @UserId"; - param.Add("UserId", _userManager.UserId); - - if (dataScopes.Count > 0) - { - sql += " AND SO.Id IN @OrgIds"; - param.Add("OrgIds", dataScopes.ToArray()); - } - } - - var users = await _dapperRepository.QueryPageData(sql, input, param); - - //foreach (var user in users.Items) - //{ - // user.SysEmpInfo = await _sysEmpService.GetEmpInfo(user.Id); - //} - return PageDataResult.PageResult(users); - } - - /// - /// 增加用户 - /// - /// - /// - [HttpPost("/houseMember/add")] - [UnitOfWork] - public async Task AddUser(AddHouseMemberInput input) - { - var id = await _sysUserService.AddUser(input); - var grantRoleInput = input.Adapt(); - grantRoleInput.Id = id; - - // 添加角色 - grantRoleInput.GrantRoleIdList.Add(input.RoleId); - await _sysUserService.GrantUserRole(grantRoleInput); - } - - /// - /// 获取角色 - /// - /// - /// - [HttpGet("/houseMember/defaultRole")] - public async Task DefaultRole([FromQuery] string orgId) - { - return (await GetDefaultRole(orgId)).Adapt(); - } - - /// - /// 获取用户拥有角色 - /// - /// - /// - [HttpGet("/houseMember/ownRole")] - public async Task GetUserOwnRole([FromQuery] QueryUserInput input) - { - return await _sysUserService.GetUserOwnRole(input); - } - - [HttpGet("/houseMember/defaultRoleRange")] - public async Task DefaultRoleRange() - { - return (await GetRoleRange()).Select(p => p.Adapt()).ToList(); - } - - /// - /// 删除用户 - /// - /// - /// - [HttpPost("/houseMember/delete")] - [UnitOfWork] - public async Task DeleteUser(DeleteUserInput input) - { - /* - * 未处理逻辑 - * 片区监管员在本片区已有安全员的情况下无法删除 - */ - - await _sysUserService.DeleteUser(input); - } - - /// - /// 更新用户 - /// - /// - /// - [HttpPost("/houseMember/edit")] - [UnitOfWork] - public async Task UpdateUser(UpdateUserInput input) - { - /* - * 未处理逻辑 - * 如果移动组织架构,会产生以下几种逻辑 - * 片区1监管员(无安全员或有其他监管员)=>片区2,直接成功 - * 片区1监管员(有安全员并且无其他监管员)=>片区2,无法移动 - * 片区1安全员=>片区2(有监管员),直接成功 - * 片区1安全员=>片区2(无监管员),无法移动,需要创建监管员 - */ - - await _sysUserService.UpdateUser(input); - } - - /// - /// 查看用户 - /// - /// - /// - [HttpGet("/houseMember/detail")] - public async Task GetUser([FromQuery] QueryUserInput input) - { - var sql = @"SELECT -SU.*, -SO.Name OrgName, -SUR.RoleName, -SUR.RoleCode -FROM sys_user SU -LEFT JOIN sys_emp SE ON SU.Id = SE.Id -LEFT JOIN sys_org SO ON SE.OrgId = SO.Id -LEFT JOIN ( - SELECT - SUR.SysUserId, - GROUP_CONCAT(SR.Name) RoleName, - GROUP_CONCAT(SR.Code) RoleCode - FROM sys_user_role SUR - LEFT JOIN sys_role SR ON SUR.SysRoleId = SR.Id - GROUP BY SUR.SysUserId -) SUR ON SU.Id = SUR.SysUserId -WHERE SU.Id=@Id"; - var user = (await _dapperRepository.QueryAsync(sql, new { input.Id })).SingleOrDefault(); - if (user != null) - { - user.SysEmpInfo = await _sysEmpService.GetEmpInfo(user.Id); - } - return user; - } - - /// - /// 修改用户状态 - /// - /// - /// - [HttpPost("/houseMember/changeStatus")] - public async Task ChangeUserStatus(UpdateUserInput input) - { - await _sysUserService.ChangeUserStatus(input); - } - - /// - /// 授权用户数据范围 - /// - /// - /// - [HttpPost("/houseMember/grantData")] - public async Task GrantUserData(UpdateUserInput input) - { - await _sysUserService.GrantUserData(input); - } - - /// - /// 获取用户拥有数据 - /// - /// - /// - [HttpGet("/houseMember/ownData")] - public async Task GetUserOwnData([FromQuery] QueryUserInput input) - { - return await _sysUserService.GetUserOwnData(input); - } - - /// - /// 获取当前机构中所创建的默认角色 - /// 片区中的第一个帐号必定为片区监管员 - /// - /// - /// - [NonAction] - private async Task GetDefaultRole(string orgId) - { - var roles = await GetRoleRange(); - if (roles.Count < 2) throw Oops.Oh("未配置正确的角色"); - - var _sysOrgRep = Db.GetRepository(); - var org = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == orgId); - // 如果当前组织为街道, 则直接返回安全员 - if (org == null || org.Type <= (int)OrgType.乡镇街道办事处) - { - return roles.LastOrDefault(); - } - - var _sysEmpRep = Db.GetRepository(); - var _sysUserRoleRep = Db.GetRepository(); - var userIds = await _sysEmpRep.DetachedEntities.Where(p => p.OrgId == orgId).Select(p => p.Id).ToListAsync(); - var roleIds = await _sysUserRoleRep.DetachedEntities.Where(p => userIds.Contains(p.SysUserId)).Select(p => p.SysRoleId).ToListAsync(); - - var _sysRoleRep = Db.GetRepository(); - var isExistZoneManager = await _sysRoleRep.DetachedEntities.AnyAsync(p => roleIds.Contains(p.Id) && p.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()); - // 存在片区监管员,返回安全员, 否则返回监管员 - if (isExistZoneManager) - { - return roles.LastOrDefault(); - } - - return roles.FirstOrDefault(); - } - - /// - /// 获取可创建的角色列表 - /// - /// - [NonAction] - private async Task> GetRoleRange() - { - var codes = (new[] { - Enum.GetName(HouseManagerRole.ZoneManager), - Enum.GetName(HouseManagerRole.HouseSecurityManager), - }).Select(p => p.ToUnderScoreCase()); - - var _sysRoleRep = Db.GetRepository(); - var roles = await _sysRoleRep.DetachedEntities.Where(p => codes.Contains(p.Code)).ToListAsync(); - - return roles; - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/IHouseMemberService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/IHouseMemberService.cs deleted file mode 100644 index 76ea0f5..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseMember/IHouseMemberService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Ewide.Core.Service; -using Microsoft.AspNetCore.Mvc; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public interface IHouseMemberService - { - Task QueryMemberPageList([FromBody] UserInput input); - Task AddUser(AddHouseMemberInput input); - Task DefaultRole([FromQuery] string orgId); - Task DeleteUser(DeleteUserInput input); - Task UpdateUser(UpdateUserInput input); - Task GetUser([FromQuery] QueryUserInput input); - Task ChangeUserStatus(UpdateUserInput input); - Task GetUserOwnRole([FromQuery] QueryUserInput input); - Task GrantUserData(UpdateUserInput input); - Task GetUserOwnData([FromQuery] QueryUserInput input); - Task DefaultRoleRange(); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectInfoInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectInfoInput.cs deleted file mode 100644 index b2e4e17..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectInfoInput.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Ewide.Core; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseProjectInfo.Dto -{ - public class HouseProjectInfoInput : InputBase - { - public string Name { get; set; } - public string Note { get; set; } - public int Sort { get; set; } - public string AreaCode { get; set; } - public int Type { get; set; } - } - public class AddProjectInput : HouseProjectInfoInput - { - - } - public class UpdateProjectInput : HouseProjectInfoInput - { - [Required(ErrorMessage = "项目ID不可为空")] - public string Id { get; set; } - } - - public class DeleteProjectInput - { - [Required(ErrorMessage = "项目ID不可为空")] - public string Id { get; set; } - } - - public class QueryProjectInput : UpdateProjectInput - { - - } - - public class PageProjectInput: HouseProjectInfoInput - { - public string pid { get; set; } - } - - public class ListHouseProjectInfoInput - { - [Required(ErrorMessage = "区域编码不可为空")] - public string AreaCode { get; set; } - [Required(ErrorMessage = "性质不可为空")] - public int Type { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectOutput.cs deleted file mode 100644 index 307b548..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/Dto/HouseProjectOutput.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseProjectInfo.Dto -{ - public class HouseProjectOutput - { - public string Id { get; set; } - public string Name { get; set; } - public string Note { get; set; } - public int Sort { get; set; } - public string AreaCode { get; set; } - public string AreaName { get; set; } - public int Type { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs deleted file mode 100644 index d0f8112..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs +++ /dev/null @@ -1,147 +0,0 @@ -using Ewide.Application.Entity; -using Ewide.Application.Service.HouseProjectInfo.Dto; -using Ewide.Core; -using Ewide.Core.Service; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Furion.FriendlyException; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Data; -using System.Linq; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseProjectInfo -{ - /// - /// 项目管理相关服务 - /// - [ApiDescriptionSettings(Name = "HouseProjectInfo", Order = 170)] - public class HouseProjectInfoService : IHouseProjectInfoService, ITransient, IDynamicApiController - { - private readonly IRepository _houseProjectInfoRep; - - public HouseProjectInfoService(IRepository houseProjectInfoRep) - { - _houseProjectInfoRep = houseProjectInfoRep; - } - - /// - /// 添加项目 - /// - /// - /// - [HttpPost("/houseProjectInfo/add")] - public async Task AddProject(AddProjectInput input) - { - await _houseProjectInfoRep.InsertNowAsync(input.Adapt()); - } - - /// - /// 删除项目 - /// - /// - /// - [HttpPost("/houseProjectInfo/delete")] - public async Task DeleteProject(DeleteProjectInput input) - { - var project = _houseProjectInfoRep.FirstOrDefault(p => p.Id == input.Id); - await project.DeleteNowAsync(); - } - - /// - /// 编辑项目 - /// - /// - /// - [HttpPost("/houseProjectInfo/edit")] - public async Task UpdateProject(UpdateProjectInput input) - { - var project = input.Adapt(); - await project.UpdateExcludeAsync(new[] { nameof(BsHouseProjectInfo.AreaCode) }, true); - } - - /// - /// 通过ID获取项目 - /// - /// - /// - [HttpGet("/houseProjectInfo/getById")] - public async Task GetById([Required] string projectId) - { - return await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == projectId); - } - - /// - /// 分页查询 - /// - /// - /// - [HttpPost("/houseProjectInfo/page")] - public async Task QueryProjectPageList([FromBody] PageProjectInput input) - { - var areaCodeRep = Db.GetRepository(); - var projects = await _houseProjectInfoRep.DetachedEntities - .Join(areaCodeRep.DetachedEntities, p => p.AreaCode, a => a.Code, (p, a) => new { p, AreaName = a.Name }) - .Where(input.Type>0, x => x.p.Type == input.Type) - .Where(!string.IsNullOrEmpty(input.Name), x => x.p.Name.Contains(input.Name)) - .Where(!string.IsNullOrEmpty(input.Note), x => x.p.Note.Contains(input.Note)) - .Where(!string.IsNullOrEmpty(input.AreaCode), x => x.p.AreaCode == input.AreaCode) - .Where(!string.IsNullOrEmpty(input.pid) , x=> x.p.AreaCode.Contains(input.pid)) - .Select(x => new { x.p.Id, x.p.Name, x.p.Note, x.p.Sort, x.p.AreaCode, x.AreaName, x.p.Type }.Adapt()).ToPagedListAsync(input.PageIndex, input.PageSize); - return PageDataResult.PageResult(projects); - } - - /// - /// - /// - /// - /// - [HttpGet("/houseProjectInfo/detail")] - public async Task GetProject([FromQuery] QueryProjectInput input) - { - var user = await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.Id); - var userDto = user.Adapt(); - - return userDto; - } - - [HttpGet("/houseProjectInfo/nextSort")] - public async Task GetNextProjectSortByAreaCode([FromQuery] ListHouseProjectInfoInput input) - { - //var projects = await _houseProjectInfoRep.DetachedEntities - // .Where(p => p.AreaCode == input.AreaCode && p.Type == input.Type) - // .Select(p => p.Sort) - // .DefaultIfEmpty() - // .MaxAsync(); - if (input.Type > 2 || input.Type < 1) - { - throw Oops.Oh("类型参数异常"); - } - var p = await _houseProjectInfoRep.DetachedEntities - .Where(p => p.AreaCode == input.AreaCode && p.Type == input.Type) - .MaxAsync(p => (int?)p.Sort); - - return p.GetValueOrDefault(0) + 1; - } - - /// - /// 获取项目下拉列表 - /// - /// - /// - [HttpGet("houseProjectInfo/list")] - public async Task GetProjectList([FromQuery] ListHouseProjectInfoInput input) - { - return await _houseProjectInfoRep.DetachedEntities - .Where(p => p.AreaCode == input.AreaCode && p.Type == input.Type) - .OrderBy(p => p.Sort) - .ToListAsync(); - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs deleted file mode 100644 index e8b05c6..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Ewide.Application.Entity; -using Ewide.Application.Service.HouseProjectInfo.Dto; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseProjectInfo -{ - public interface IHouseProjectInfoService - { - Task AddProject(AddProjectInput input); - Task DeleteProject(DeleteProjectInput input); - Task UpdateProject(UpdateProjectInput input); - Task GetById([FromRoute] string projectId); - Task GetProject([FromQuery] QueryProjectInput input); - Task QueryProjectPageList([FromQuery] PageProjectInput input); - - Task GetNextProjectSortByAreaCode([FromQuery] ListHouseProjectInfoInput input); - Task GetProjectList([FromQuery] ListHouseProjectInfoInput input); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs deleted file mode 100644 index 096f601..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Ewide.Core; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseQueryInput: PageInputBase - { - - } - - public class HouseQueryDetailInput - { - [Required(ErrorMessage = "Id不能为空")] - public string Id { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryOutput.cs deleted file mode 100644 index a4464e1..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryOutput.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseQueryOutput - { - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs deleted file mode 100644 index 5800149..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs +++ /dev/null @@ -1,110 +0,0 @@ -using Dapper; -using Ewide.Core.Extension; -using Furion.DatabaseAccessor; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseSafety.HouseQuery -{ - /// - /// 住宅查询 - /// - [ApiDescriptionSettings(Name = "HouseQuery", Order = 210)] - public class HouseQueryService : IHouseQueryService, IDynamicApiController, ITransient - { - private readonly IRepository _houseCodeRep; - private readonly IRepository _houseInfoRep; - private readonly IRepository _houseTaskRep; - private readonly IDapperRepository _dapperRepository; - - public HouseQueryService(IRepository HouseCodeRep, IRepository HouseInfoRep, IRepository HouseTaskRep, IDapperRepository dapperRepository) - { - _houseCodeRep = HouseCodeRep; - _houseInfoRep = HouseInfoRep; - _houseTaskRep = HouseTaskRep; - _dapperRepository = dapperRepository; - } - - [HttpPost("/houseQuery/page")] - public async Task QueryPage([FromBody] HouseQueryInput input) - { - var sql = @"SELECT - HC.ID, - HC.HouseCode, - AA.Name AreaName, - RA.Name RoadName, - CA.Name CommName, - Proj.AreaCode, - Proj.Note, - Proj.Name, - CONCAT(Proj.Name,'(',Proj.Note,')') FullProjName, - HC.Address, - IFNULL(HI.BuildingName,'') BuildingName, - IFNULL(HI.TotalFloor,0) TotalFloor, - IFNULL(HI.TotalArea,0) TotalArea, - HI.LandAttribute, - IFNULL(HI.HouseGrade,0) HouseGrade, - HC.Type, - HC.No, - HI.State, - HI.CompletedDate, - HI.CreatedTime -FROM bs_house_code HC -LEFT JOIN bs_house_info HI ON HI.HouseCodeId = HC.Id -LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId -LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode -LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) -LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) -WHERE 1=1"; - - return await _dapperRepository.QueryPageDataDynamic(sql, input, filterFields: new string[] { - "HouseCode", - "Address", - "BuildingName", - "State", - "AreaCode", - "LandAttribute", - "HouseGrade", - "CompletedDate", - "CreatedTime", - "TotalArea", - "TotalFloor" - }); - } - - [HttpGet("/houseQuery/detail")] - public async Task Detail([FromQuery] HouseQueryDetailInput input) - { - var houseCodeOutputAsync = await _dapperRepository.QueryAsync( - @"SELECT HC.Id,HC.Address,HC.ProjectId,HC.ZoneId,HC.Type,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,O.Name ZoneName,Proj.Note ProjectNote,CONCAT(Proj.Name,'(',Proj.Note,')') ProjectFullName,HC.HouseCode,HC.Lng,HC.Lat,HC.No FROM bs_house_code HC -LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId -LEFT JOIN sys_org O ON HC.ZoneId = O.Id -LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode -LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) -LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) -WHERE HC.Id=@Id", new { input.Id } - ); - - var houseCodeOutput = houseCodeOutputAsync.SingleOrDefault(); - - - var houseInfoOutputForDetailPage = new HouseInfoOutputForDetailPage - { - HouseCode = houseCodeOutput - }; - - var houseInfoOutput = (await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.HouseCodeId == houseCodeOutput.Id)).Adapt(); - houseInfoOutputForDetailPage.HouseInfo = houseInfoOutput; - - return houseInfoOutputForDetailPage; - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/IHouseQueryService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/IHouseQueryService.cs deleted file mode 100644 index aa1e217..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseQuery/IHouseQueryService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseSafety.HouseQuery -{ - public interface IHouseQueryService - { - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorInput.cs deleted file mode 100644 index 0001eff..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorInput.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseSelectInput - { - [Required(ErrorMessage = "用户Id不能为空")] - public string UserId { get; set; } - - [Required(ErrorMessage = "房屋编码Id不能为空")] - public string[] Ids { get; set; } - } - - public class QueryHouseSelectorInput : QueryHouseCodeInput - { - [Required(ErrorMessage = "用户Id不能为空")] - public string UserId { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorOutput.cs deleted file mode 100644 index 43fd2e9..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/Dto/HouseSelectorOutput.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseSelectorOutput - { - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs deleted file mode 100644 index df04bd2..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs +++ /dev/null @@ -1,225 +0,0 @@ -using Dapper; -using Ewide.Core; -using Ewide.Core.Extension; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Furion.FriendlyException; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - /// - /// 选房相关 - /// - [ApiDescriptionSettings(Name = "HouseSelector", Order = 180)] - public class HouseSelectorService : IHouseSelectorService, IDynamicApiController, ITransient - { - private readonly IUserManager _userManager; - private readonly IDapperRepository _dapperRep; - - private readonly IRepository _bsHouseMemberRelationRep; - private readonly IRepository _bsHouseCodeRep; - private readonly IRepository _bsHouseTaskRep; - private readonly IRepository _sysUserRep; - private readonly IHouseZoneService _houseZoneService; - - private readonly IHouseLogService _houseLogService; - - public HouseSelectorService( - IUserManager userManager, - IDapperRepository dapperRep, - IRepository bsHouseMemberRelationRep, - IRepository bsHouseCodeRep, - IRepository bsHouseTaskRep, - IRepository sysUserRep, - IHouseZoneService houseZoneService, - IHouseLogService houseLogService - ) - { - _userManager = userManager; - - _dapperRep = dapperRep; - _bsHouseMemberRelationRep = bsHouseMemberRelationRep; - _bsHouseCodeRep = bsHouseCodeRep; - _bsHouseTaskRep = bsHouseTaskRep; - _sysUserRep = sysUserRep; - _houseZoneService = houseZoneService; - - _houseLogService = houseLogService; - } - - /// - /// 获取人员允许绑定的房屋编码列表 - /// - /// - /// - [HttpPost("/houseSelector/selectorPage")] - public async Task HouseSelectorList([FromBody] QueryHouseSelectorInput input) - { - var sql = @"SELECT - HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName -FROM bs_house_code HC -LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId -LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode -LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) -LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) -LEFT JOIN bs_house_member_relation HM ON HC.Id = HM.HouseCodeId -INNER JOIN (SELECT * FROM sys_emp WHERE Id = @UserId) E ON HC.ZoneId = E.OrgId -WHERE HM.Id IS NULL"; - return await _dapperRep.QueryPageDataDynamic(sql, input, param: new - { - input.UserId - }, filterFields: new[] { - nameof(BsHouseCode.Address) , - nameof(BsHouseCode.CreatedTime) - }); - } - - /// - /// 获取人员已经绑定的房屋编码列表 - /// - /// - /// - [HttpPost("/houseSelector/selectedPage")] - public async Task HouseSelectedList([FromBody] QueryHouseSelectorInput input) - { - var sql = @"SELECT - HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName -FROM bs_house_code HC -LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId -LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode -LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) -LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) -INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM ON HC.Id = HM.HouseCodeId"; - return await _dapperRep.QueryPageDataDynamic(sql, input, param: new - { - input.UserId - }, filterFields: new[] { - nameof(BsHouseCode.Address) , - nameof(BsHouseCode.CreatedTime) - }); - } - - /// - /// 从人员选择房屋 - /// - /// - /// - [HttpPost("/houseSelector/select")] - [UnitOfWork] - public async Task Select([FromBody] HouseSelectInput input) - { - #region 验证房屋是否在当前用户可选范围内 - - var ids = input.Ids.Distinct().ToList(); - if (ids.Count == 0) throw Oops.Oh("没有选中任何房屋"); - - // 验证当前用户是否安全员 **须补充 - - // 已经被选中的房屋,从ids中剔除 - var houseSelected = await _bsHouseMemberRelationRep.DetachedEntities - .Where(p => ids.Contains(p.HouseCodeId)) - .Select(p => p.HouseCodeId) - .ToListAsync(); - if (houseSelected.Count > 0) - { - houseSelected.ForEach(p => - { - var index = ids.IndexOf(p); - if (index > -1) - { - ids.RemoveAt(index); - } - }); - } - - if (ids.Count == 0) throw Oops.Oh("当前房屋在此之前已经全部被选中,请确认"); - - var selectedUser = await _sysUserRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.UserId)); - - // 从用户所在片区中过滤房屋 - var zoneId = await _houseZoneService.GetZoneByUser(selectedUser.Id); - var house = await _bsHouseCodeRep.DetachedEntities.Where(p => ids.Contains(p.Id) && p.ZoneId == zoneId).Select(p => p.Id).ToListAsync(); - - if (house.Count == 0) throw Oops.Oh("选中的房屋错误"); - - #endregion - - // 选定房屋 - house.ForEach(async p => - { - var originalTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t => t.HouseCodeId == p && t.TaskType == 0 && t.IsEnabled); - if (originalTask == null) - { - new BsHouseTask - { - Id = System.Guid.NewGuid().ToString(), - HouseCodeId = p, - UserID = selectedUser.Id, - EndTime = System.DateTime.Now.AddMonths(1), - Status = 0, - TaskType = 0 - }.Insert(); - - await _houseLogService.Done(p); - await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo); - } - else - { - var sort = await _houseLogService.AddThenDone(p, _userManager.User, HouseLogType.SelectMember); - if (originalTask.Status != 6)//建档未完成,生成新建档任务分配给新的人员;原建档任务数据保留,有效性设置为false,取消巡查关系 - { - var newTask = originalTask.Adapt(); - newTask.Id = System.Guid.NewGuid().ToString(); - newTask.UserID = input.UserId; - newTask.EndTime = System.DateTime.Now.AddMonths(1); - newTask.Insert(); - - originalTask.IsEnabled = false; - originalTask.Update(); - - sort = await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo, sort: sort); - }//已建档完成,不再分配建档任务,仅更换巡查关系 - else - { - var originalRelation = _bsHouseMemberRelationRep.DetachedEntities.FirstOrDefault(r => r.HouseCodeId == p && r.SysUserId == originalTask.UserID); - originalRelation.Delete(); - } - } - - new BsHouseMemberRelation - { - SysUserId = selectedUser.Id, - HouseCodeId = p - }.Insert(); - }); - } - - [HttpPost("/houseSelector/revoke")] - [UnitOfWork] - public async Task Revoke([FromBody] HouseSelectInput input) - { - var ids = input.Ids.Distinct().ToList(); - if (ids.Count == 0) throw Oops.Oh("没有选中任何房屋"); - - var selected = await _bsHouseMemberRelationRep.Where(p => ids.Contains(p.HouseCodeId) && p.SysUserId == input.UserId).ToListAsync(); - - selected.ForEach(p => - { - p.Delete(); - }); - } - - public async Task SelectMember() - { - - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/IHouseSelectorService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/IHouseSelectorService.cs deleted file mode 100644 index df71ac7..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseSelector/IHouseSelectorService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public interface IHouseSelectorService - { - Task HouseSelectorList([FromQuery] QueryHouseSelectorInput input); - Task HouseSelectedList([FromQuery] QueryHouseSelectorInput input); - Task Select([FromBody] HouseSelectInput input); - Task Revoke([FromBody] HouseSelectInput input); - Task SelectMember(); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskInput.cs deleted file mode 100644 index 53bdf4b..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskInput.cs +++ /dev/null @@ -1,171 +0,0 @@ -using Ewide.Core; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseTaskInput - { - [Required(ErrorMessage = "巡查日期不能为空")] - public DateTime PatrolDate { get; set; } - - [Required(ErrorMessage = "巡查人员/单位不能为空")] - public string PatrolUser { get; set; } - - /// - /// 沉降倾斜 - /// - public string SettlementTilt { get; set; } - - /// - /// 沉降倾斜附件 - /// - public string SettlementTiltFiles { get; set; } - - /// - /// 其他情况 - /// - public string OtherInfo { get; set; } - - /// - /// 其他情况附件 - /// - public string OtherInfoFiles { get; set; } - - //[Required(ErrorMessage = "巡查初始等级不能为空")] - public int InitGrade { get; set; } - //[Required(ErrorMessage = "巡查损坏等级不能为空")] - public int DamageGrade { get; set; } - //[Required(ErrorMessage = "巡查综合等级不能为空")] - public int ComprehensiveGrade { get; set; } - #region 调查情况investigation - /// - /// 房屋场地 - /// - public string HouseSite { get; set; } - - /// - /// 相邻施工 - /// - public string AdjacentConstruction { get; set; } - - /// - /// 化学侵蚀 - /// - public string ChemicalErosion { get; set; } - - /// - /// 结构拆改 - /// - public int? StructuralDismantling { get; set; } - - /// - /// 加层改造 - /// - public int? AddingLayer { get; set; } - - /// - /// 修缮加固 - /// - public string RepairAndReinforce { get; set; } - - /// - /// 历史灾害 - /// - public string HistoricalCalamity { get; set; } - - /// - /// 使用功能变更 - /// - public string FunctionalChange { get; set; } - - /// - /// 其他调查内容 - /// - public string OtherContents { get; set; } - #endregion - /// - /// 主要安全隐患综述 - /// - public string MainSafety { get; set; } - - /// - /// 处理意见 - /// - public int? HandlingOpinion { get; set; } - - /// - /// 处理意见备注 - /// - public string HandlingOpinionRemark { get; set; } - - /// - /// 整改情况 - /// - public int? RectifyAndReform { get; set; } - - /// - /// 整改情况备注 - /// - public string RectifyAndReformRemark { get; set; } - - /// - /// 巡查结果:1正常,-1异常 - /// - //[Required(ErrorMessage = "巡查结果不能为空")] - public int PatrolResult { get; set; } - - public string PatrolResultRemark { get; set; } - - /// - /// 上报街道 - /// - public int? ReportRoad { get; set; } - - /// - /// 上报街道时间 - /// - public DateTime? ReportRoadTime { get; set; } - - /// - /// 上报区住建 - /// - public int? ReportArea { get; set; } - - /// - /// 上报区住建时间 - /// - public DateTime? ReportAreaTime { get; set; } - - /// - /// 上报备注 - /// - public string ReportRemark { get; set; } - } - - public class AddHouseTaskInput : HouseTaskInput - { - - } - - public class EditHouseTaskInput : HouseTaskInput - { - [Required(ErrorMessage = "任务Id不能为空")] - public string Id { get; set; } - } - - public class SubmitHouseTaskInput - { - [Required(ErrorMessage = "任务Id不能为空")] - public string TaskId { get; set; } - } - - public class QueryHouseTaskInput : PageInputBase - { - - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs deleted file mode 100644 index b5f1df0..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseTaskOutput - { - public DateTime? PatrolDate { get; set; } - public string PatrolUser { get; set; } - - /// - /// 沉降倾斜 - /// - public string SettlementTilt { get; set; } - - /// - /// 沉降倾斜附件 - /// - public string SettlementTiltFiles { get; set; } - - /// - /// 其他情况 - /// - public string OtherInfo { get; set; } - - /// - /// 其他情况附件 - /// - public string OtherInfoFiles { get; set; } - - /// - /// 初始等级 - /// - public int? InitGrade { get; set; } - - /// - /// 损坏等级 - /// - public int? DamageGrade { get; set; } - - /// - /// 综合等级 - /// - public int? ComprehensiveGrade { get; set; } - - #region 调查情况investigation - /// - /// 房屋场地 - /// - public string HouseSite { get; set; } - - /// - /// 相邻施工 - /// - public string AdjacentConstruction { get; set; } - - /// - /// 化学侵蚀 - /// - public string ChemicalErosion { get; set; } - - /// - /// 结构拆改 - /// - public int? StructuralDismantling { get; set; } - - /// - /// 加层改造 - /// - public int? AddingLayer { get; set; } - - /// - /// 修缮加固 - /// - public string RepairAndReinforce { get; set; } - - /// - /// 历史灾害 - /// - public string HistoricalCalamity { get; set; } - - /// - /// 使用功能变更 - /// - public string FunctionalChange { get; set; } - - /// - /// 其他调查内容 - /// - public string OtherContents { get; set; } - #endregion - - /// - /// 主要安全隐患综述 - /// - public string MainSafety { get; set; } - - /// - /// 处理意见 - /// - public int? HandlingOpinion { get; set; } - - /// - /// 处理意见备注 - /// - public string HandlingOpinionRemark { get; set; } - - /// - /// 整改情况 - /// - public int? RectifyAndReform { get; set; } - - /// - /// 整改情况备注 - /// - public string RectifyAndReformRemark { get; set; } - - /// - /// 巡查结果:1正常,-1异常 - /// - public int? PatrolResult { get; set; } - - /// - /// 巡查异常描述 - /// - public string PatrolResultRemark { get; set; } - - /// - /// 上报街道 - /// - public int? ReportRoad { get; set; } - - /// - /// 上报街道时间 - /// - public DateTime? ReportRoadTime { get; set; } - - /// - /// 上报区住建 - /// - public int? ReportArea { get; set; } - - /// - /// 上报区住建时间 - /// - public DateTime? ReportAreaTime { get; set; } - - /// - /// 上报备注 - /// - public string ReportRemark { get; set; } - - public int Status { get; set; } - - /// - /// 提交时间 - /// - public DateTime? SubmitTime { get; set; } - - /// - /// 最后提交时间 - /// - public DateTime? LastSubmitTime { get; set; } - - /// - /// 是否有效 - /// - public bool IsEnabled { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs deleted file mode 100644 index 6337437..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Dapper; -using Ewide.Core; -using Ewide.Core.Extension; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Furion.FriendlyException; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - /// - /// 房屋任务(巡查任务/建档任务) - /// - [ApiDescriptionSettings(Name = "HouseTask", Order = 190)] - public class HouseTaskService : IHouseTaskService, IDynamicApiController, ITransient - { - private readonly IRepository _houseTaskRep; - private readonly IRepository _houseInfoRep; - private readonly IDapperRepository _dapperRepository; - private readonly IUserManager _userManager; - - private readonly IHouseLogService _houseLogService; - - public HouseTaskService(IRepository HouseTaskRep, IRepository HouseInfoRep, IDapperRepository dapperRepository, IUserManager userManager, IHouseLogService houseLogService) - { - _houseTaskRep = HouseTaskRep; - _houseInfoRep = HouseInfoRep; - _dapperRepository = dapperRepository; - _userManager = userManager; - - _houseLogService = houseLogService; - } - - [HttpPost("/houseTask/page")] - public async Task QueryPage([FromBody] QueryHouseTaskInput input) - { - var sql = @"SELECT T.Id,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,Proj.Name,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName,HC.HouseCode,HC.Address,T.EndTime,HC.Type,HC.Industry,HC.No,T.Status,IFNULL(HI.State,0) State FROM `bs_house_task` T -LEFT JOIN bs_house_code HC ON T.HouseCodeId = HC.Id -LEFT JOIN bs_house_info HI ON HI.HouseCodeId = T.HouseCodeId -LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId -LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode -LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) -LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) -WHERE T.IsEnabled = 1 {0}"; - var user = await _userManager.CheckUserAsync(); - if (user == null) throw Oops.Oh("登录信息丢失"); - - var userRoles = await _userManager.GetUserRoleList(); - var userOrg = await _userManager.GetUserOrgInfo(); - var param = new DynamicParameters(); - if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.HouseSecurityManager).ToUnderScoreCase()).Any()) - { - sql = String.Format(sql, " AND T.UserID=@UserID "); - param.Add("UserID", user.Id); - } - - if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()).Any()) - { - sql = String.Format(sql, " AND (T.Status=3 OR T.Status=6) AND HC.ZoneId = @ZoneId "); - param.Add("ZoneId", userOrg.Id); - } - - return await _dapperRepository.QueryPageDataDynamic(sql, input, param, filterFields: new string[] { "Type", "Address", "HouseCode", "Status","State" }); - } - - [HttpPost("/houseTask/submit")] - [UnitOfWork] - [AllowAnonymous] - public async Task Submit([FromBody] SubmitHouseTaskInput input) - { - //获取任务实体 - var houseTask = await _houseTaskRep.DetachedEntities.FirstOrDefaultAsync(t => t.Id == input.TaskId); - if (houseTask == null) throw Oops.Oh("任务不存在"); - houseTask.Status = 2; - houseTask.LastSubmitTime = DateTime.Now; - if (!houseTask.SubmitTime.HasValue) houseTask.SubmitTime = houseTask.LastSubmitTime; - await houseTask.UpdateExcludeAsync(new string[] { nameof(BsHouseTask.TaskType) }, ignoreNullValues: true); - - if(houseTask.TaskType == 0) - { - var houseInfo = await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(h => h.HouseCodeId == houseTask.HouseCodeId); - if (houseInfo == null) throw Oops.Oh("提交审核失败:请先保存后再提交"); - - houseInfo.State = 5; - await houseInfo.UpdateExcludeAsync(new[] { nameof(BsHouseInfo.HouseGrade) }, true); - } - - // 提交时流转日志 - await _houseLogService.Done(houseTask.HouseCodeId); - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/IHouseTaskService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/IHouseTaskService.cs deleted file mode 100644 index 75b2d3d..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTask/IHouseTaskService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public interface IHouseTaskService - { - Task QueryPage(QueryHouseTaskInput input); - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordInput.cs deleted file mode 100644 index 497a3a7..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordInput.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseTaskCheckRecordInput - { - /// - /// 任务Id - /// - [Required(ErrorMessage = "任务参数有误")] - public string TaskId { get; set; } - - /// - /// 通过3;退回-1 - /// - [Required(ErrorMessage = "审核结果不能为空")] - public int PassOrBack { get; set; } - - public DataStatus PassOrBackDataStatus - { - get - { - return PassOrBack switch - { - -1 => DataStatus.Back, - 1 => DataStatus.TempSaved, - 2 => DataStatus.Saved, - 3 => DataStatus.Submited, - 6 => DataStatus.Passed, - _ => DataStatus.Init, - }; - } - } - - /// - /// 审核内容 - /// - [Required(ErrorMessage = "审核内容不能为空")] - public string Content { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordOutput.cs deleted file mode 100644 index bdfa2ab..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseTaskCheckRecord/Dto/HouseTaskCheckRecordOutput.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service.HouseSafety.HouseTaskCheckRecord.Dto -{ - public class HouseTaskCheckRecordOutput - { - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneInput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneInput.cs deleted file mode 100644 index 1d69b94..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneInput.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Ewide.Core.Service; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - public class HouseZoneInput - { - [Required(ErrorMessage = "区域编码不可为空")] - [MinLength(9, ErrorMessage = "区域编码长度必须为9位及以上")] - public string AreaCode { get; set; } - } - - public class AddHouseZoneInput : OrgInput - { - /// - /// 所属街道 - /// - [Required(ErrorMessage = "所属街道不能为空")] - public override string Pid { get; set; } - /// - /// 名称 - /// - [Required(ErrorMessage = "片区名称不能为空")] - public override string Name { get; set; } - - } - - public class UpdateHouseZoneInput : AddHouseZoneInput - { - /// - /// 机构Id - /// - [Required(ErrorMessage = "片区Id不能为空")] - public string Id { get; set; } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneOutput.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneOutput.cs deleted file mode 100644 index d95ac21..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/Dto/HouseZoneOutput.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application -{ - class HouseZoneOutput - { - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs deleted file mode 100644 index 791374b..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs +++ /dev/null @@ -1,175 +0,0 @@ -using Ewide.Core; -using Ewide.Core.Extension; -using Ewide.Core.Service; -using Furion.DatabaseAccessor; -using Furion.DatabaseAccessor.Extensions; -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using Furion.FriendlyException; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - /// - /// 片区相关 - /// - [ApiDescriptionSettings(Name = "HouseZone", Order = 180)] - public class HouseZoneService : IHouseZoneService, IDynamicApiController, ITransient - { - private readonly IUserManager _userManager; - private readonly IRepository _sysOrgRep; - private readonly IRepository _sysEmpRep; - private readonly ISysOrgService _sysOrgService; - - public HouseZoneService( - IUserManager userManager, - IRepository sysOrgRep, - IRepository sysEmpRep, - ISysOrgService sysOrgService - ) - { - _userManager = userManager; - _sysOrgRep = sysOrgRep; - _sysEmpRep = sysEmpRep; - _sysOrgService = sysOrgService; - } - - /// - /// 获取片区列表 - /// - /// - /// - [HttpGet("/houseZone/list")] - public async Task GetHouseZoneList([FromQuery] HouseZoneInput input) - { - var areaCode = input.AreaCode.Substring(0, 9); - var road = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.AreaCode == areaCode); - if (road == null) throw Oops.Oh("未在组织机构中配置街道"); - return await _sysOrgRep.DetachedEntities - .Where(p => p.Pid == road.Id) - .Where(p => p.Type == (int)OrgType.片区) - .OrderBy(p => p.Sort) - .Select(p => new - { - p.Id, - p.Name - }) - .ToListAsync(); - } - - [HttpGet("/houseZone/getById")] - public async Task GetById([Required] string zoneId) - { - return await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == zoneId); - } - - /// - /// 分页查询片区 - /// - /// - /// - [HttpPost("/houseZone/page")] - public async Task QueryZonePageList([FromBody] PageOrgInput input) - { - var dataScopeList = _sysOrgService.GetDataScopeList(await _userManager.GetUserAllDataScopeList()); - - var name = !string.IsNullOrEmpty(input.Name?.Trim()); - var id = !string.IsNullOrEmpty(input.Id?.Trim()); - var pId = !string.IsNullOrEmpty(input.Pid?.Trim()); - var orgs = await _sysOrgRep.DetachedEntities - .Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")), // 根据机构名称模糊查询 - (id, u => u.Id == input.Id.Trim()), // 根据机构id查询 - (pId, u => EF.Functions.Like(u.Pids, $"%[{input.Pid.Trim()}]%") - || u.Id == input.Pid.Trim())) // 根据父机构id查询 - .Where(dataScopeList.Count > 0, u => dataScopeList.Contains(u.Id)) // 非管理员范围限制 - .Where(u => u.Status != CommonStatus.DELETED) - .Where(u => u.Type == (int)OrgType.片区) - .OrderBy(u => u.Sort) - .ToPageData(input); - return PageDataResult.PageResult(orgs); - } - - /// - /// 根据用户Id获取所在片区的Id - /// - /// - /// - [HttpGet("/houseZone/getByUser")] - public async Task GetZoneByUser([FromQuery][Required(ErrorMessage = "用户Id不能为空")] string userId) - { - var data = await _sysEmpRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == userId); - if(data == null) throw Oops.Oh("用户不在组织机构中"); - var org = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == data.OrgId && p.Type == (int)OrgType.片区); - if(org == null) throw Oops.Oh("用户不在片区中"); - return org.Id; - } - - [HttpGet("/houseZone/autoIncrement")] - public async Task AutoIncrement([FromQuery] string roadId) - { - var road = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == roadId && p.Type == 3); - if (road == null) throw Oops.Oh("组织机构错误"); - return await AutoIncrement(road); - } - - [NonAction] - public async Task AutoIncrement(SysOrg road) - { - var maxZone = (await _sysOrgRep.DetachedEntities.Where(p => p.Pid == road.Id && p.Type == (int)OrgType.片区).MaxAsync(p => p.Code)) ?? "000"; - return Convert.ToInt32(maxZone[^3..]) + 1; - } - - [HttpPost("/houseZone/add")] - public async Task AddZone(AddHouseZoneInput input) - { - /* - * 区县市限定所属区域/上级机构是否为当前区 - * 街道自动获取所属区域/上级机构 - * 自动生成唯一编码, 街道Code+三位编号 - * - * 机构类型默认为片区 - */ - - var org = await _userManager.GetUserOrgInfo(); - - var areaManager = Enum.GetName(HouseManagerRole.AreaManager).ToUnderScoreCase(); - var roadManager = Enum.GetName(HouseManagerRole.RoadManager).ToUnderScoreCase(); - var roles = await _userManager.GetUserRoleList(); - if (roles.Any(p => p.Code == areaManager)) - { - var road = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.Pid); - if (!road.Pids.Contains(org.Id)) throw Oops.Oh("当前用户组织机构错误"); - - input.AreaCode = road.AreaCode; - input.Code = road.Code + (await AutoIncrement(road)).ToString().PadLeft(3, '0'); - } - else if (roles.Any(p => p.Code == roadManager)) - { - input.AreaCode = org.AreaCode; - - input.Code = org.Code + (await AutoIncrement(org)).ToString().PadLeft(3, '0'); - } - - input.Type = (int)OrgType.片区; - - AddOrgInput addOrgInput = input.Adapt(); - await _sysOrgService.AddOrg(addOrgInput); - } - - [HttpPost("/houseZone/edit")] - public async Task EditZone(UpdateHouseZoneInput input) - { - var zone = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(z => z.Id == input.Id); - if(zone == null) throw Oops.Oh("修改失败:数据有误,刷新列表后再尝试修改"); - zone.Remark = input.Remark; - await zone.UpdateIncludeAsync(new[] { nameof(SysOrg.Remark) }, true); - } - } -} diff --git a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/IHouseZoneService.cs b/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/IHouseZoneService.cs deleted file mode 100644 index 9c0b138..0000000 --- a/20220330_Vote/Ewide.Application/Service/HouseSafety/HouseZone/IHouseZoneService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ewide.Application.Service -{ - public interface IHouseZoneService - { - Task GetHouseZoneList([FromQuery] HouseZoneInput input); - Task GetZoneByUser([FromQuery] string userId); - } -} diff --git a/20220330_Vote/Ewide.Web.Entry/Program.cs b/20220330_Vote/Ewide.Web.Entry/Program.cs index 7f7ce45..4954069 100644 --- a/20220330_Vote/Ewide.Web.Entry/Program.cs +++ b/20220330_Vote/Ewide.Web.Entry/Program.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; @@ -15,11 +16,23 @@ namespace Ewide.Web.Entry .ConfigureWebHostDefaults(webBuilder => { webBuilder.Inject() - .UseStartup(); + .UseStartup() //.UseKestrel(options => //{ // options.Limits.MaxRequestBodySize = null; // null Dzƣֵ M //}); + .UseKestrel(option => + { + option.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(20); + option.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(20); + }) + .UseIIS() + // option => + //{ + // option.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(20); + // option.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(20); + //}) + ; }) .UseSerilogDefault(); } diff --git a/20220330_Vote/Ewide.Web.Entry/Properties/launchSettings.json b/20220330_Vote/Ewide.Web.Entry/Properties/launchSettings.json index f64b3d6..62c9aec 100644 --- a/20220330_Vote/Ewide.Web.Entry/Properties/launchSettings.json +++ b/20220330_Vote/Ewide.Web.Entry/Properties/launchSettings.json @@ -15,7 +15,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "Ewide.Web.Entry": { + "Yongjiangbei_Vote": { "commandName": "Project", "launchBrowser": true, "environmentVariables": {