.
This commit is contained in:
52
Api/Ewide.Application/Entity/BsHouseCode.cs
Normal file
52
Api/Ewide.Application/Entity/BsHouseCode.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
36
Api/Ewide.Application/Entity/BsHouseCompany.cs
Normal file
36
Api/Ewide.Application/Entity/BsHouseCompany.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 单位类型,多选
|
||||
/// </summary>
|
||||
[Comment("单位类型,多选")]
|
||||
[MaxLength(20)]
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位名称
|
||||
/// </summary>
|
||||
[Comment("单位名称")]
|
||||
[MaxLength(200)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 信息
|
||||
/// </summary>
|
||||
[Comment("信息")]
|
||||
public string Info { get; set; }
|
||||
}
|
||||
}
|
||||
378
Api/Ewide.Application/Entity/BsHouseInfo.cs
Normal file
378
Api/Ewide.Application/Entity/BsHouseInfo.cs
Normal file
@@ -0,0 +1,378 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// HouseCode主键ID
|
||||
/// </summary>
|
||||
[Comment("bs_house_code主键Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string HouseCodeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 幢名称
|
||||
/// </summary>
|
||||
[Comment("幢名称")]
|
||||
[MaxLength(255)]
|
||||
public string BuildingName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 土地性质
|
||||
/// </summary>
|
||||
[Comment("土地性质")]
|
||||
public int? LandAttribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结构类型
|
||||
/// </summary>
|
||||
[Comment("结构类型")]
|
||||
public int? StructureType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 基础情况
|
||||
/// </summary>
|
||||
[Comment("基础情况")]
|
||||
public int? BaseInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 抗震等级
|
||||
/// </summary>
|
||||
[Comment("抗震等级")]
|
||||
public int? SeismicGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 竣工日期
|
||||
/// </summary>
|
||||
[Comment("竣工日期")]
|
||||
public DateTime? CompletedDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设计使用年限
|
||||
/// </summary>
|
||||
[Comment("设计使用年限")]
|
||||
public int? UsefulYear { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总层数
|
||||
/// </summary>
|
||||
[Comment("总层数")]
|
||||
public int? TotalFloor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上层数
|
||||
/// </summary>
|
||||
[Comment("地上层数")]
|
||||
public int? LandFloorCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上商业层数开始
|
||||
/// </summary>
|
||||
[Comment("地上商业层数开始")]
|
||||
public int? LandBsFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上商业层数结束
|
||||
/// </summary>
|
||||
[Comment("地上商业层数结束")]
|
||||
public int? LandBsFloorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上车棚层开始
|
||||
/// </summary>
|
||||
[Comment("地上车棚层开始")]
|
||||
public int? LandBikeFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上住宅层开始
|
||||
/// </summary>
|
||||
[Comment("地上住宅层开始")]
|
||||
public int? LandResidenceFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上住宅层结束
|
||||
/// </summary>
|
||||
[Comment("地上住宅层结束")]
|
||||
public int? LandResidenceFloorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地下层数
|
||||
/// </summary>
|
||||
[Comment("地下层数")]
|
||||
public int? UnderFloorCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总建筑面积
|
||||
/// </summary>
|
||||
[Comment("总建筑面积")]
|
||||
public float? TotalArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有无建筑幕墙
|
||||
/// </summary>
|
||||
[Comment("有无建筑幕墙")]
|
||||
public int? CurtainWall { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有无面砖
|
||||
/// </summary>
|
||||
[Comment("有无面砖")]
|
||||
public int? FaceBrick { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有无涂料
|
||||
/// </summary>
|
||||
[Comment("有无涂料")]
|
||||
public int? Coating { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有无粉刷
|
||||
/// </summary>
|
||||
[Comment("有无粉刷")]
|
||||
public int? Painting { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电梯
|
||||
/// </summary>
|
||||
[Comment("电梯")]
|
||||
[MaxLength(20)]
|
||||
public string Elevator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总户数(户)
|
||||
/// </summary>
|
||||
[Comment("总户数(户)")]
|
||||
public int? HouseHolds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋单元数
|
||||
/// </summary>
|
||||
[Comment("房屋单元数")]
|
||||
public int? Units { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 各单元每层户数(户)
|
||||
/// </summary>
|
||||
[Comment("各单元每层户数(户)")]
|
||||
public int? UnitFloorHolds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 建设单位ID
|
||||
/// </summary>
|
||||
[Comment("建设单位ID")]
|
||||
[MaxLength(36)]
|
||||
public string BuildingUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设计单位ID
|
||||
/// </summary>
|
||||
[Comment("设计单位ID")]
|
||||
[MaxLength(36)]
|
||||
public string DesingerUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 施工单位ID
|
||||
/// </summary>
|
||||
[Comment("施工单位ID")]
|
||||
[MaxLength(36)]
|
||||
public string ConstructionUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 监理单位ID
|
||||
/// </summary>
|
||||
[Comment("监理单位ID")]
|
||||
[MaxLength(36)]
|
||||
public string MonitorUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产权性质
|
||||
/// </summary>
|
||||
[Comment("产权性质")]
|
||||
[MaxLength(100)]
|
||||
public string PropertyRights { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总共套数
|
||||
/// </summary>
|
||||
[Comment("总共套数")]
|
||||
public int? HouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直管公房套数
|
||||
/// </summary>
|
||||
[Comment("直管公房套数")]
|
||||
public int? StraightHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自管公房套数
|
||||
/// </summary>
|
||||
[Comment("自管公房套数")]
|
||||
public int? SelfHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 私房套数
|
||||
/// </summary>
|
||||
[Comment("私房套数")]
|
||||
public int? PrivateHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品房套数
|
||||
/// </summary>
|
||||
[Comment("商品房套数")]
|
||||
public int? BusinessCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房改房套数
|
||||
/// </summary>
|
||||
[Comment("房改房套数")]
|
||||
public int? ChangeHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拆迁安置房套数
|
||||
/// </summary>
|
||||
[Comment("拆迁安置房套数")]
|
||||
public int? ResettlementHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其它套数
|
||||
/// </summary>
|
||||
[Comment("其它套数")]
|
||||
public int? OtherCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产权单位ID
|
||||
/// </summary>
|
||||
[Comment("产权单位ID")]
|
||||
[MaxLength(36)]
|
||||
public string PropertyUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物业单位ID
|
||||
/// </summary>
|
||||
[Comment("物业单位ID")]
|
||||
[MaxLength(36)]
|
||||
public string WuYeUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图纸资料存档处
|
||||
/// </summary>
|
||||
[Comment("图纸资料存档处")]
|
||||
[MaxLength(50)]
|
||||
public string DrawingMaterial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他图纸存档
|
||||
/// </summary>
|
||||
[Comment("其他图纸存档")]
|
||||
[MaxLength(100)]
|
||||
public string DrawingMaterialText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 立项文件
|
||||
/// </summary>
|
||||
[Comment("立项文件")]
|
||||
[MaxLength(2000)]
|
||||
public string AnEntryDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规划许可
|
||||
/// </summary>
|
||||
[Comment("规划许可")]
|
||||
[MaxLength(2000)]
|
||||
public string PlanningPermission { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 竣工验收备案
|
||||
/// </summary>
|
||||
[Comment("竣工验收备案")]
|
||||
[MaxLength(2000)]
|
||||
public string CompletionRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 监理资料
|
||||
/// </summary>
|
||||
[Comment("监理资料")]
|
||||
[MaxLength(2000)]
|
||||
public string MonitorDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定报告
|
||||
/// </summary>
|
||||
[Comment("鉴定报告")]
|
||||
[MaxLength(2000)]
|
||||
public string IdentificationReport { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其它资料
|
||||
/// </summary>
|
||||
[Comment("其它资料")]
|
||||
[MaxLength(2000)]
|
||||
public string OtherDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外立面照片
|
||||
/// </summary>
|
||||
[Comment("外立面照片")]
|
||||
[MaxLength(2000)]
|
||||
public string FacadePhoto { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋等级 1,2,3,4,C,d
|
||||
/// </summary>
|
||||
[Comment("房屋等级 1,2,3,4,C,d")]
|
||||
public int? HouseGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋使用状态
|
||||
/// </summary>
|
||||
[Comment("房屋使用状态")]
|
||||
public int? HouseUsedStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// -1 退回(审核被退回的数据) 1、待建档(需要建档的数据未暂存未保存的)2、暂存(点击了暂存的数据)3、待提交(点击了保存的数据) 5、审核中6、审核通过
|
||||
/// </summary>
|
||||
[Comment("-1 退回(审核被退回的数据) 1、待建档(需要建档的数据未暂存未保存的)2、暂存(点击了暂存的数据)3、待提交(点击了保存的数据) 5、审核中6、审核通过")]
|
||||
[Required]
|
||||
public int State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 调查登记机构
|
||||
/// </summary>
|
||||
[Comment("调查登记机构")]
|
||||
[MaxLength(100)]
|
||||
public string InvestigateAgency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 纸质资料调查人
|
||||
/// </summary>
|
||||
[Comment("纸质资料调查人")]
|
||||
[MaxLength(50)]
|
||||
public string InvestigateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 纸质资料审核人
|
||||
/// </summary>
|
||||
[Comment("纸质资料审核人")]
|
||||
[MaxLength(50)]
|
||||
public string OfflineAuditor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主管部门
|
||||
/// </summary>
|
||||
[Comment("主管部门")]
|
||||
[MaxLength(50)]
|
||||
public string CompetentDepartment { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
46
Api/Ewide.Application/Entity/BsHouseLog.cs
Normal file
46
Api/Ewide.Application/Entity/BsHouseLog.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
26
Api/Ewide.Application/Entity/BsHouseMemberRelation.cs
Normal file
26
Api/Ewide.Application/Entity/BsHouseMemberRelation.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
38
Api/Ewide.Application/Entity/BsHouseProjectInfo.cs
Normal file
38
Api/Ewide.Application/Entity/BsHouseProjectInfo.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
266
Api/Ewide.Application/Entity/BsHouseTask.cs
Normal file
266
Api/Ewide.Application/Entity/BsHouseTask.cs
Normal file
@@ -0,0 +1,266 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// bs_house_code主键Id
|
||||
/// </summary>
|
||||
[Comment("bs_house_code主键Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string HouseCodeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡查日期
|
||||
/// </summary>
|
||||
[Comment("巡查日期")]
|
||||
public DateTime? PatrolDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡查人姓名
|
||||
/// </summary>
|
||||
[Comment("巡查人姓名")]
|
||||
[MaxLength(50)]
|
||||
public string PatrolUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 沉降倾斜
|
||||
/// </summary>
|
||||
[Comment("沉降倾斜")]
|
||||
[MaxLength(1000)]
|
||||
public string SettlementTilt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 沉降倾斜附件
|
||||
/// </summary>
|
||||
[Comment("沉降倾斜附件")]
|
||||
[MaxLength(2000)]
|
||||
public string SettlementTiltFiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他情况
|
||||
/// </summary>
|
||||
[Comment("其他情况")]
|
||||
[MaxLength(1000)]
|
||||
public string OtherInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他情况附件
|
||||
/// </summary>
|
||||
[Comment("其他情况附件")]
|
||||
[MaxLength(2000)]
|
||||
public string OtherInfoFiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始等级
|
||||
/// </summary>
|
||||
[Comment("初始等级")]
|
||||
public int? InitGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 损坏等级
|
||||
/// </summary>
|
||||
[Comment("损坏等级")]
|
||||
public int? DamageGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 综合等级
|
||||
/// </summary>
|
||||
[Comment("综合等级")]
|
||||
public int? ComprehensiveGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋场地
|
||||
/// </summary>
|
||||
[Comment("房屋场地")]
|
||||
[MaxLength(100)]
|
||||
public string HouseSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 相邻施工
|
||||
/// </summary>
|
||||
[Comment("相邻施工")]
|
||||
[MaxLength(100)]
|
||||
public string AdjacentConstruction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 化学侵蚀
|
||||
/// </summary>
|
||||
[Comment("化学侵蚀")]
|
||||
[MaxLength(100)]
|
||||
public string ChemicalErosion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结构拆改
|
||||
/// </summary>
|
||||
[Comment("结构拆改")]
|
||||
public int? StructuralDismantling { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 加层改造
|
||||
/// </summary>
|
||||
[Comment("加层改造")]
|
||||
public int? AddingLayer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修缮加固
|
||||
/// </summary>
|
||||
[Comment("修缮加固")]
|
||||
[MaxLength(100)]
|
||||
public string RepairAndReinforce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 历史灾害
|
||||
/// </summary>
|
||||
[Comment("历史灾害")]
|
||||
[MaxLength(100)]
|
||||
public string HistoricalCalamity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用功能变更
|
||||
/// </summary>
|
||||
[Comment("使用功能变更")]
|
||||
[MaxLength(100)]
|
||||
public string FunctionalChange { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他调查内容
|
||||
/// </summary>
|
||||
[Comment("其他调查内容")]
|
||||
[MaxLength(1000)]
|
||||
public string OtherContents { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主要安全隐患综述
|
||||
/// </summary>
|
||||
[Comment("主要安全隐患综述")]
|
||||
[MaxLength(1000)]
|
||||
public string MainSafety { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理意见
|
||||
/// </summary>
|
||||
[Comment("处理意见")]
|
||||
public int? HandlingOpinion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理意见备注
|
||||
/// </summary>
|
||||
[Comment("处理意见备注")]
|
||||
[MaxLength(1000)]
|
||||
public string HandlingOpinionRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改情况
|
||||
/// </summary>
|
||||
[Comment("整改情况")]
|
||||
public int? RectifyAndReform { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改情况备注
|
||||
/// </summary>
|
||||
[Comment("整改情况备注")]
|
||||
[MaxLength(1000)]
|
||||
public string RectifyAndReformRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡查结果:1正常,-1异常
|
||||
/// </summary>
|
||||
[Comment("巡查结果:1正常,-1异常")]
|
||||
public int? PatrolResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡查异常描述
|
||||
/// </summary>
|
||||
[Comment("巡查异常描述")]
|
||||
[MaxLength(1000)]
|
||||
public string PatrolResultRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务人员ID
|
||||
/// </summary>
|
||||
[Comment("任务人员ID")]
|
||||
[MaxLength(36)]
|
||||
public string UserID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务截止时间
|
||||
/// </summary>
|
||||
[Comment("任务截止时间")]
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否过期
|
||||
/// </summary>
|
||||
[Comment("是否过期")]
|
||||
public bool? IsDelay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// -1:退回0:待处理1:保存待提交2:待审核3:审核通过
|
||||
/// </summary>
|
||||
[Comment("-1:退回0:待处理1:保存待提交2:待审核6:审核通过")]
|
||||
public int Status { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 0:建档任务1:系统派发的巡查任务2:主动巡查任务
|
||||
/// </summary>
|
||||
[Comment("0:建档任务1:系统派发的巡查任务2:主动巡查任务")]
|
||||
public int? TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报街道
|
||||
/// </summary>
|
||||
[Comment("上报街道")]
|
||||
public int? ReportRoad { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报街道时间
|
||||
/// </summary>
|
||||
[Comment("上报街道时间")]
|
||||
public DateTime? ReportRoadTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报区住建
|
||||
/// </summary>
|
||||
[Comment("上报区住建")]
|
||||
public int? ReportArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报区住建时间
|
||||
/// </summary>
|
||||
[Comment("上报区住建时间")]
|
||||
public DateTime? ReportAreaTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报备注
|
||||
/// </summary>
|
||||
[Comment("上报备注")]
|
||||
[MaxLength(1000)]
|
||||
public string ReportRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交时间
|
||||
/// </summary>
|
||||
[Comment("提交时间")]
|
||||
public DateTime? SubmitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后提交时间
|
||||
/// </summary>
|
||||
[Comment("最后提交时间")]
|
||||
public DateTime? LastSubmitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
[Comment("是否有效")]
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
}
|
||||
}
|
||||
36
Api/Ewide.Application/Entity/BsHouseTaskCheckRecord.cs
Normal file
36
Api/Ewide.Application/Entity/BsHouseTaskCheckRecord.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务Id
|
||||
/// </summary>
|
||||
[Comment("任务Id")]
|
||||
[MaxLength(36)]
|
||||
public string TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 通过1;退回-1
|
||||
/// </summary>
|
||||
[Comment("通过3;退回-1")]
|
||||
public int PassOrBack { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核内容
|
||||
/// </summary>
|
||||
[Comment("审核内容")]
|
||||
[MaxLength(500)]
|
||||
public string Content { get; set; }
|
||||
}
|
||||
}
|
||||
60
Api/Ewide.Application/Entity/BsHouseTaskOptions.cs
Normal file
60
Api/Ewide.Application/Entity/BsHouseTaskOptions.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// bs_house_code主键Id
|
||||
/// </summary>
|
||||
[Comment("bs_house_code主键Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
/// </summary>
|
||||
[Comment("字典类型")]
|
||||
[MaxLength(50)]
|
||||
public string DictType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典code
|
||||
/// </summary>
|
||||
[Comment("字典code")]
|
||||
[MaxLength(50)]
|
||||
public string DictCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典值
|
||||
/// </summary>
|
||||
[Comment("字典值")]
|
||||
[MaxLength(100)]
|
||||
public string DictValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
[MaxLength(500)]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
[Comment("附件")]
|
||||
[MaxLength(2000)]
|
||||
public string File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否选中
|
||||
/// </summary>
|
||||
[Comment("是否选中")]
|
||||
public bool? Checked { get; set; }
|
||||
}
|
||||
}
|
||||
26
Api/Ewide.Application/Entity/BsInspectionMemberRelation.cs
Normal file
26
Api/Ewide.Application/Entity/BsInspectionMemberRelation.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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_inspection_member_relation")]
|
||||
[Comment("鉴定机构人员表")]
|
||||
public class BsInspectionMemberRelation : Core.DEntityBase
|
||||
{
|
||||
[Comment("sys_user主键Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string SysUserId { get; set; }
|
||||
|
||||
[Comment("bs_inspection_org主键Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string InspectionOrgId { get; set; }
|
||||
}
|
||||
}
|
||||
72
Api/Ewide.Application/Entity/BsInspectionOrg.cs
Normal file
72
Api/Ewide.Application/Entity/BsInspectionOrg.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
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_inspection_org")]
|
||||
[Comment("鉴定机构表")]
|
||||
public class BsInspectionOrg : Core.DEntityBase
|
||||
{
|
||||
[Comment("名称")]
|
||||
[MaxLength(100)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Comment("机构备案编号(YYYYNNN,如2021001)")]
|
||||
[MaxLength(10)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[Comment("社会统一信用代码")]
|
||||
[MaxLength(50)]
|
||||
public string CreditCode { get; set; }
|
||||
|
||||
[Comment("地址")]
|
||||
public string Address { get; set; }
|
||||
|
||||
[Comment("联系人")]
|
||||
[MaxLength(50)]
|
||||
public string Contacts { get; set; }
|
||||
|
||||
[Comment("联系人手机号")]
|
||||
[MaxLength(50)]
|
||||
public string ContactsPhone { get; set; }
|
||||
|
||||
[Comment("法人代表")]
|
||||
[MaxLength(50)]
|
||||
public string LegalPerson { get; set; }
|
||||
|
||||
[Comment("固定电话")]
|
||||
[MaxLength(50)]
|
||||
public string OrgTelephone { get; set; }
|
||||
|
||||
[Comment("名录申请表")]
|
||||
public string ApplicationFormFiles { get; set; }
|
||||
|
||||
[Comment("机构营业执照和法人证书")]
|
||||
public string OrgBusinessLicenseFiles { get; set; }
|
||||
|
||||
[Comment("建设工程质量检测资质证书或检验检测机构资质认定证书")]
|
||||
public string InspectionQualificationCertificateFiles { get; set; }
|
||||
|
||||
[Comment("办公场所资料(房产证、不动产登记证或房屋租赁合同等)")]
|
||||
public string OfficeInformationFiles { get; set; }
|
||||
|
||||
[Comment("符合条件的从业人员职称证明、学历证明、劳动合同、社保证明等")]
|
||||
public string EmployeeCertificateFiles { get; set; }
|
||||
|
||||
[Comment("开展房屋安全鉴定工作必要的设备计量检定证书、校准证书")]
|
||||
public string CalibrationCertificateFiles { get; set; }
|
||||
|
||||
[Comment("其他资料")]
|
||||
public string OtherFiles { get; set; }
|
||||
|
||||
[Comment("状态 0登记中 1正常 -1已撤销 -2因红牌撤销")]
|
||||
public InspectionOrgStatus Status { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
34
Api/Ewide.Application/Entity/BsInspectionOrgDirDetail.cs
Normal file
34
Api/Ewide.Application/Entity/BsInspectionOrgDirDetail.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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_inspection_org_dir_detail")]
|
||||
[Comment("名录详情")]
|
||||
public class BsInspectionOrgDirDetail : Core.DEntityBase
|
||||
{
|
||||
[Comment("名录Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string StageId { get; set; }
|
||||
|
||||
[Comment("机构Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string OrgId { get; set; }
|
||||
|
||||
[Comment("评分")]
|
||||
[Required]
|
||||
public int Score { get; set; }
|
||||
|
||||
[Comment("评分结果 1优秀 2合格 3警告 4除名")]
|
||||
[Required]
|
||||
public int ScoreResult { get; set; }
|
||||
}
|
||||
}
|
||||
40
Api/Ewide.Application/Entity/BsInspectionOrgDirStage.cs
Normal file
40
Api/Ewide.Application/Entity/BsInspectionOrgDirStage.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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_inspection_org_dir_stage")]
|
||||
[Comment("名录期数")]
|
||||
public class BsInspectionOrgDirStage : Core.DEntityBase
|
||||
{
|
||||
[Comment("名录期数")]
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string No { get; set; }
|
||||
|
||||
[Comment("名录包含机构数量(冗余)")]
|
||||
[Required]
|
||||
public int OrgAmount { get; set; }
|
||||
|
||||
[Comment("被除名机构数量(冗余)")]
|
||||
[Required]
|
||||
public int RemovedOrgAmount { get; set; }
|
||||
|
||||
[Comment("同比上一年新入或回归机构数量(冗余)")]
|
||||
[Required]
|
||||
public int NewOrgAmount { get; set; }
|
||||
|
||||
[Comment("状态 0未发布 1已发布")]
|
||||
[Required]
|
||||
public int Status { get; set; }
|
||||
|
||||
[Comment("发布时间")]
|
||||
public DateTime? PublishTime { get; set; }
|
||||
}
|
||||
}
|
||||
54
Api/Ewide.Application/Entity/BsInspectionOrgSetting.cs
Normal file
54
Api/Ewide.Application/Entity/BsInspectionOrgSetting.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
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_inspection_org_setting")]
|
||||
[Comment("鉴定机构相关设置")]
|
||||
public class BsInspectionOrgSetting : Core.DEntityBase
|
||||
{
|
||||
[Comment("设置类型 1申报时间范围")]
|
||||
public InspectionOrgSettingType Type { get; set; }
|
||||
|
||||
[Comment("设置")]
|
||||
[Required]
|
||||
public string Setting { get; set; }
|
||||
}
|
||||
|
||||
public class BsInspectionOrgSetting_DateRange
|
||||
{
|
||||
private DateTime _BeginDate { get; set; }
|
||||
public DateTime BeginDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return _BeginDate;
|
||||
}
|
||||
set
|
||||
{
|
||||
var date = new DateTime(DateTime.Now.Year, value.Month, value.Day);
|
||||
_BeginDate = date;
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime _EndDate { get; set; }
|
||||
public DateTime EndDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return _EndDate;
|
||||
}
|
||||
set
|
||||
{
|
||||
var date = new DateTime(DateTime.Now.Year, value.Month, value.Day);
|
||||
_EndDate = date;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
82
Api/Ewide.Application/Entity/BsInspectionOrgUpdate.cs
Normal file
82
Api/Ewide.Application/Entity/BsInspectionOrgUpdate.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录鉴定机构申请及修改, 在申请/修改时, 只记录在当前表内, 待审核通过将此表内容冗余到主表
|
||||
/// </summary>
|
||||
[Table("bs_inspection_org_update")]
|
||||
[Comment("鉴定机构修改记录表")]
|
||||
public class BsInspectionOrgUpdate : Core.DEntityBase
|
||||
{
|
||||
[Comment("机构Id")]
|
||||
[MaxLength(36)]
|
||||
[Required]
|
||||
public string OrgId { get; set; }
|
||||
|
||||
[Comment("名称")]
|
||||
[MaxLength(100)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Comment("社会统一信用代码")]
|
||||
[MaxLength(50)]
|
||||
public string CreditCode { get; set; }
|
||||
|
||||
[Comment("地址")]
|
||||
[Required]
|
||||
public string Address { get; set; }
|
||||
|
||||
[Comment("联系人")]
|
||||
[MaxLength(50)]
|
||||
public string Contacts { get; set; }
|
||||
|
||||
[Comment("联系人手机号")]
|
||||
[MaxLength(50)]
|
||||
public string ContactsPhone { get; set; }
|
||||
|
||||
[Comment("法人代表")]
|
||||
[MaxLength(50)]
|
||||
public string LegalPerson { get; set; }
|
||||
|
||||
[Comment("固定电话")]
|
||||
[MaxLength(50)]
|
||||
public string OrgTelephone { get; set; }
|
||||
|
||||
[Comment("名录申请表")]
|
||||
public string ApplicationFormFiles { get; set; }
|
||||
|
||||
[Comment("机构营业执照和法人证书")]
|
||||
public string OrgBusinessLicenseFiles { get; set; }
|
||||
|
||||
[Comment("建设工程质量检测资质证书或检验检测机构资质认定证书")]
|
||||
public string InspectionQualificationCertificateFiles { get; set; }
|
||||
|
||||
[Comment("办公场所资料(房产证、不动产登记证或房屋租赁合同等)")]
|
||||
public string OfficeInformationFiles { get; set; }
|
||||
|
||||
[Comment("符合条件的从业人员职称证明、学历证明、劳动合同、社保证明等")]
|
||||
public string EmployeeCertificateFiles { get; set; }
|
||||
|
||||
[Comment("开展房屋安全鉴定工作必要的设备计量检定证书、校准证书")]
|
||||
public string CalibrationCertificateFiles { get; set; }
|
||||
|
||||
[Comment("其他资料")]
|
||||
public string OtherFiles { get; set; }
|
||||
|
||||
[Comment("记录类型 1登记/回归 2修改")]
|
||||
public InspectionOrgUpdateType Type { get; set; }
|
||||
|
||||
[Comment("状态 -2放弃 -1退回 1审核中 2审核通过")]
|
||||
public InspectionOrgUpdateStatus Status { get; set; }
|
||||
|
||||
[Comment("退回理由/备注")]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
1
Api/Ewide.Application/Entity/README.md
Normal file
1
Api/Ewide.Application/Entity/README.md
Normal file
@@ -0,0 +1 @@
|
||||
/** 您的业务实体文件写在此文件夹下面 **/
|
||||
48
Api/Ewide.Application/Enum/DataStatus.cs
Normal file
48
Api/Ewide.Application/Enum/DataStatus.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
public enum DataStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 审核退回
|
||||
/// </summary>
|
||||
[Description("审核退回")]
|
||||
Back = -1,
|
||||
|
||||
/// <summary>
|
||||
/// 初始未处理
|
||||
/// </summary>
|
||||
[Description("初始未处理")]
|
||||
Init = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 暂存
|
||||
/// </summary>
|
||||
[Description("暂存")]
|
||||
TempSaved = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 已保存,待提交
|
||||
/// </summary>
|
||||
[Description("已保存,待提交")]
|
||||
Saved = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 已提交,待审核
|
||||
/// </summary>
|
||||
[Description("已提交,待审核")]
|
||||
Submited = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 审核通过
|
||||
/// </summary>
|
||||
[Description("审核通过")]
|
||||
Passed = 6
|
||||
}
|
||||
}
|
||||
43
Api/Ewide.Application/Enum/HouseLog.cs
Normal file
43
Api/Ewide.Application/Enum/HouseLog.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
36
Api/Ewide.Application/Enum/HouseManagerRole.cs
Normal file
36
Api/Ewide.Application/Enum/HouseManagerRole.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
public enum HouseManagerRole
|
||||
{
|
||||
/// <summary>
|
||||
/// 市住建部门
|
||||
/// </summary>
|
||||
CityManager,
|
||||
|
||||
/// <summary>
|
||||
/// 区住建部门
|
||||
/// </summary>
|
||||
AreaManager,
|
||||
|
||||
/// <summary>
|
||||
/// 街道管理员
|
||||
/// </summary>
|
||||
RoadManager,
|
||||
|
||||
/// <summary>
|
||||
/// 片区监管员
|
||||
/// </summary>
|
||||
ZoneManager,
|
||||
|
||||
/// <summary>
|
||||
/// 房屋安全管理员
|
||||
/// </summary>
|
||||
HouseSecurityManager
|
||||
}
|
||||
}
|
||||
87
Api/Ewide.Application/Enum/InspectionOrgEnum.cs
Normal file
87
Api/Ewide.Application/Enum/InspectionOrgEnum.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
/// <summary>
|
||||
/// 鉴定机构相关设置
|
||||
/// </summary>
|
||||
public enum InspectionOrgSettingType
|
||||
{
|
||||
/// <summary>
|
||||
/// 开放时间范围
|
||||
/// </summary>
|
||||
DateRange = 1
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定机构状态
|
||||
/// </summary>
|
||||
public enum InspectionOrgStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 因红牌撤销
|
||||
/// </summary>
|
||||
Delisting = -2,
|
||||
|
||||
/// <summary>
|
||||
/// 撤销
|
||||
/// </summary>
|
||||
Revoke = -1,
|
||||
|
||||
/// <summary>
|
||||
/// 登记中
|
||||
/// </summary>
|
||||
Register = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 正常
|
||||
/// </summary>
|
||||
Normal = 1,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定机构登记/修改类型
|
||||
/// </summary>
|
||||
public enum InspectionOrgUpdateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 登记/回归
|
||||
/// </summary>
|
||||
Register = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
Update = 2,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定机构登记/修改审核状态
|
||||
/// </summary>
|
||||
public enum InspectionOrgUpdateStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 放弃
|
||||
/// </summary>
|
||||
Close = -2,
|
||||
|
||||
/// <summary>
|
||||
/// 退回
|
||||
/// </summary>
|
||||
Back = -1,
|
||||
|
||||
/// <summary>
|
||||
/// 审核中
|
||||
/// </summary>
|
||||
Reviewing = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 审核通过
|
||||
/// </summary>
|
||||
Approved = 2,
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Application/Ewide.Application.csproj
Normal file
28
Api/Ewide.Application/Ewide.Application.csproj
Normal file
@@ -0,0 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
<DocumentationFile>Ewide.Application.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="applicationsettings.json" />
|
||||
<None Remove="Ewide.Application.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="applicationsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\EwideCore\Api\Ewide.Core\Ewide.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\EwideCore\Api\Ewide.EntityFramework.Core\Ewide.EntityFramework.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
1647
Api/Ewide.Application/Ewide.Application.xml
Normal file
1647
Api/Ewide.Application/Ewide.Application.xml
Normal file
File diff suppressed because it is too large
Load Diff
3
Api/Ewide.Application/README.md
Normal file
3
Api/Ewide.Application/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
1、原则上服务应该放在Application层次,考虑将咱自己的业务层直接写在Application里面好些,后续升级后,咱大家直接升级就行了,减少冲突!
|
||||
2、系统默认ORM为EF Core,如果觉得不趁手,可以自行更换
|
||||
3、在此应用层默认集成了SqlSugar,其他ORM类同,可以多个ORM并行开发,熟悉哪个用哪个
|
||||
@@ -0,0 +1,65 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋编码相关
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseCode", Order = 180)]
|
||||
public class HouseCodeService : IHouseCodeService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<BsHouseCode> _houseCodeRep;
|
||||
private readonly IDapperRepository _dapperRepository;
|
||||
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IHouseLogService _houseLogService;
|
||||
|
||||
public HouseCodeService(IRepository<BsHouseCode> 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<BsHouseProjectInfo>();
|
||||
var houseProject = await houseProjectInfoRep.FirstOrDefaultAsync(p => p.Id == input.ProjectId);
|
||||
if (houseProject == null) throw Oops.Oh("项目参数有误,添加失败");
|
||||
|
||||
var areaCodeRep = Db.GetRepository<SysAreaCode>();
|
||||
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<BsHouseCode>();
|
||||
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<BsHouseCode>();
|
||||
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<dynamic> 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<dynamic> GetHouserCode([FromQuery] GetHouseCodeInput input)
|
||||
{
|
||||
var houseCode = await _houseCodeRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.Id);
|
||||
var areaCode = (await Db.GetRepository<BsHouseProjectInfo>().DetachedEntities.FirstOrDefaultAsync(p => p.Id == houseCode.ProjectId)).AreaCode;
|
||||
var result = houseCode.Adapt<GetHouseCodeOutput>();
|
||||
result.AreaCode = areaCode;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取同一区域下的下一个编号
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseCode/getNextNoByCode")]
|
||||
public async Task<dynamic> GetNextNoByFullNumber([Required] string projectId)
|
||||
{
|
||||
var areaCodeRep = Db.GetRepository<SysAreaCode>();
|
||||
var houseProjectInfoRep = Db.GetRepository<BsHouseProjectInfo>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
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<HouseCompanyInfoInput> 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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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<HouseCompanyInfoOutput> Info { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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<BsHouseCompany> _bsHouseCompanyRep;
|
||||
|
||||
public HouseCompanyService(IRepository<BsHouseCompany> bsHouseCompanyRep)
|
||||
{
|
||||
_bsHouseCompanyRep = bsHouseCompanyRep;
|
||||
}
|
||||
|
||||
[HttpPost("/houseCompany/page")]
|
||||
public async Task<dynamic> Page([FromBody] HouseCompanyPageInput input)
|
||||
{
|
||||
var config = new TypeAdapterConfig().ForType<BsHouseCompany, HouseCompanyDetailOutput>()
|
||||
.Map(target => target.Info, src => JsonConvert.DeserializeObject<List<HouseCompanyInfoOutput>>(src.Info))
|
||||
.Config;
|
||||
return await _bsHouseCompanyRep.DetachedEntities.ToPageData<BsHouseCompany, HouseCompanyDetailOutput>(input, config);
|
||||
}
|
||||
|
||||
[HttpPost("/houseCompany/add")]
|
||||
public async Task Add([FromBody] HouseCompanyAddInput input)
|
||||
{
|
||||
var info = JsonConvert.SerializeObject(input.Info);
|
||||
var config = new TypeAdapterConfig().ForType<HouseCompanyAddInput, BsHouseCompany>()
|
||||
.Map(target => target.Info, src => JsonConvert.SerializeObject(src.Info))
|
||||
.Config;
|
||||
var company = input.Adapt<BsHouseCompany>(config);
|
||||
await company.InsertAsync();
|
||||
}
|
||||
|
||||
[HttpPost("/houseCompany/edit")]
|
||||
public async Task Edit([FromBody] HouseCompanyEditInput input)
|
||||
{
|
||||
var config = new TypeAdapterConfig().ForType<HouseCompanyEditInput, BsHouseCompany>()
|
||||
.Map(target => target.Info, src => JsonConvert.SerializeObject(src.Info))
|
||||
.Config;
|
||||
var company = input.Adapt<BsHouseCompany>(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<HouseCompanyDetailOutput> Detail([FromQuery] HouseCompanyInput input)
|
||||
{
|
||||
var company = await _bsHouseCompanyRep.FirstOrDefaultAsync(p => p.Id.Equals(input.Id));
|
||||
var config = new TypeAdapterConfig().ForType<BsHouseCompany, HouseCompanyDetailOutput>()
|
||||
.Map(target => target.Info, src => JsonConvert.DeserializeObject<List<HouseCompanyInfoOutput>>(src.Info))
|
||||
.Config;
|
||||
var output = company.Adapt<HouseCompanyDetailOutput>(config);
|
||||
return output;
|
||||
}
|
||||
|
||||
[HttpGet("/houseCompany/list")]
|
||||
public async Task<dynamic> List([FromQuery] HouseCompanyListInput input)
|
||||
{
|
||||
var types = input.Type.Split(',');
|
||||
var result = new List<HouseCompanyDetailOutput>();
|
||||
var config = new TypeAdapterConfig().ForType<BsHouseCompany, HouseCompanyDetailOutput>()
|
||||
.Map(target => target.Info, src => JsonConvert.DeserializeObject<List<HouseCompanyInfoOutput>>(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<HouseCompanyDetailOutput>(config);
|
||||
return output;
|
||||
});
|
||||
result.AddRange(list);
|
||||
}
|
||||
|
||||
return result.Distinct();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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<dynamic> Page([FromBody] HouseCompanyPageInput input);
|
||||
Task Add([FromBody] HouseCompanyAddInput input);
|
||||
Task Edit([FromBody] HouseCompanyEditInput input);
|
||||
Task Delete([FromBody] HouseCompanyInput input);
|
||||
Task<HouseCompanyDetailOutput> Detail([FromQuery] HouseCompanyInput input);
|
||||
Task<dynamic> List([FromQuery] HouseCompanyListInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
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; }
|
||||
/// <summary>
|
||||
/// 总建筑面积
|
||||
/// </summary>
|
||||
public float? TotalArea { get; set; }
|
||||
/// <summary>
|
||||
/// 总户数(户)
|
||||
/// </summary>
|
||||
public int? HouseHolds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋单元数
|
||||
/// </summary>
|
||||
public int? Units { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 各单元每层户数(户)
|
||||
/// </summary>
|
||||
public int? UnitFloorHolds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总层数
|
||||
/// </summary>
|
||||
public int? TotalFloor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上层数
|
||||
/// </summary>
|
||||
public int? LandFloorCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上商业层数开始
|
||||
/// </summary>
|
||||
public int? LandBsFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上商业层数结束
|
||||
/// </summary>
|
||||
public int? LandBsFloorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上车棚层开始
|
||||
/// </summary>
|
||||
public int? LandBikeFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上住宅层开始
|
||||
/// </summary>
|
||||
public int? LandResidenceFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上住宅层结束
|
||||
/// </summary>
|
||||
public int? LandResidenceFloorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地下层数
|
||||
/// </summary>
|
||||
public int? UnderFloorCount { get; set; }
|
||||
#endregion
|
||||
#region 权属情况ownership
|
||||
/// <summary>
|
||||
/// 产权性质
|
||||
/// </summary>
|
||||
public string PropertyRights { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总共套数
|
||||
/// </summary>
|
||||
public int? HouseCount { get; set; }
|
||||
/// <summary>
|
||||
/// 直管公房套数
|
||||
/// </summary>
|
||||
public int? StraightHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自管公房套数
|
||||
/// </summary>
|
||||
public int? SelfHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 私房套数
|
||||
/// </summary>
|
||||
public int? PrivateHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品房套数
|
||||
/// </summary>
|
||||
public int? BusinessCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房改房套数
|
||||
/// </summary>
|
||||
public int? ChangeHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拆迁安置房套数
|
||||
/// </summary>
|
||||
public int? ResettlementHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其它套数
|
||||
/// </summary>
|
||||
public int? OtherCount { get; set; }
|
||||
|
||||
#endregion
|
||||
#region 管理情况manager
|
||||
#endregion
|
||||
|
||||
#region 鉴定治理identification
|
||||
|
||||
/// <summary>
|
||||
/// 房屋等级 1,2,3,4,C,d
|
||||
/// </summary>
|
||||
public int? HouseGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋使用状态
|
||||
/// </summary>
|
||||
public int? HouseUsedStatus { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 图纸资料存档处drawing
|
||||
|
||||
/// <summary>
|
||||
/// 图纸资料存档处
|
||||
/// </summary>
|
||||
public string DrawingMaterial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他图纸存档
|
||||
/// </summary>
|
||||
public string DrawingMaterialText { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 相关附件资料attachments
|
||||
/// <summary>
|
||||
/// 立项文件
|
||||
/// </summary>
|
||||
public string AnEntryDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规划许可
|
||||
/// </summary>
|
||||
public string PlanningPermission { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 竣工验收备案
|
||||
/// </summary>
|
||||
public string CompletionRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 监理资料
|
||||
/// </summary>
|
||||
public string MonitorDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定报告
|
||||
/// </summary>
|
||||
public string IdentificationReport { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其它资料
|
||||
/// </summary>
|
||||
public string OtherDocument { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 建筑概貌aspect
|
||||
/// <summary>
|
||||
/// 外立面照片
|
||||
/// </summary>
|
||||
public string FacadePhoto { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 调查单位unit
|
||||
/// <summary>
|
||||
/// 调查登记机构
|
||||
/// </summary>
|
||||
public string InvestigateAgency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 纸质资料调查人
|
||||
/// </summary>
|
||||
public string InvestigateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 纸质资料审核人
|
||||
/// </summary>
|
||||
public string OfflineAuditor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主管部门
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
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; }
|
||||
/// <summary>
|
||||
/// 总建筑面积
|
||||
/// </summary>
|
||||
public float? TotalArea { get; set; }
|
||||
/// <summary>
|
||||
/// 总户数(户)
|
||||
/// </summary>
|
||||
public int? HouseHolds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋单元数
|
||||
/// </summary>
|
||||
public int? Units { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 各单元每层户数(户)
|
||||
/// </summary>
|
||||
public int? UnitFloorHolds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总层数
|
||||
/// </summary>
|
||||
public int? TotalFloor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上层数
|
||||
/// </summary>
|
||||
public int? LandFloorCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上商业层数开始
|
||||
/// </summary>
|
||||
public int? LandBsFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上商业层数结束
|
||||
/// </summary>
|
||||
public int? LandBsFloorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上车棚层开始
|
||||
/// </summary>
|
||||
public int? LandBikeFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上住宅层开始
|
||||
/// </summary>
|
||||
public int? LandResidenceFloorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地上住宅层结束
|
||||
/// </summary>
|
||||
public int? LandResidenceFloorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地下层数
|
||||
/// </summary>
|
||||
public int? UnderFloorCount { get; set; }
|
||||
#endregion
|
||||
#region 权属情况ownership
|
||||
/// <summary>
|
||||
/// 产权性质
|
||||
/// </summary>
|
||||
public string PropertyRights { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总共套数
|
||||
/// </summary>
|
||||
public int? HouseCount { get; set; }
|
||||
/// <summary>
|
||||
/// 直管公房套数
|
||||
/// </summary>
|
||||
public int? StraightHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自管公房套数
|
||||
/// </summary>
|
||||
public int? SelfHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 私房套数
|
||||
/// </summary>
|
||||
public int? PrivateHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品房套数
|
||||
/// </summary>
|
||||
public int? BusinessCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房改房套数
|
||||
/// </summary>
|
||||
public int? ChangeHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拆迁安置房套数
|
||||
/// </summary>
|
||||
public int? ResettlementHouseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其它套数
|
||||
/// </summary>
|
||||
public int? OtherCount { get; set; }
|
||||
|
||||
#endregion
|
||||
#region 管理情况manager
|
||||
#endregion
|
||||
|
||||
#region 鉴定治理identification
|
||||
|
||||
/// <summary>
|
||||
/// 房屋等级 1,2,3,4,C,d
|
||||
/// </summary>
|
||||
public int? HouseGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房屋使用状态
|
||||
/// </summary>
|
||||
public int? HouseUsedStatus { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 图纸资料存档处drawing
|
||||
|
||||
/// <summary>
|
||||
/// 图纸资料存档处
|
||||
/// </summary>
|
||||
public string DrawingMaterial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他图纸存档
|
||||
/// </summary>
|
||||
public string DrawingMaterialText { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 相关附件资料attachments
|
||||
/// <summary>
|
||||
/// 立项文件
|
||||
/// </summary>
|
||||
public string AnEntryDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规划许可
|
||||
/// </summary>
|
||||
public string PlanningPermission { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 竣工验收备案
|
||||
/// </summary>
|
||||
public string CompletionRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 监理资料
|
||||
/// </summary>
|
||||
public string MonitorDocument { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定报告
|
||||
/// </summary>
|
||||
public string IdentificationReport { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其它资料
|
||||
/// </summary>
|
||||
public string OtherDocument { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 建筑概貌aspect
|
||||
/// <summary>
|
||||
/// 外立面照片
|
||||
/// </summary>
|
||||
public string FacadePhoto { get; set; }
|
||||
#endregion
|
||||
public int State { get; set; }
|
||||
#region 调查单位unit
|
||||
/// <summary>
|
||||
/// 调查登记机构
|
||||
/// </summary>
|
||||
public string InvestigateAgency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 纸质资料调查人
|
||||
/// </summary>
|
||||
public string InvestigateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 纸质资料审核人
|
||||
/// </summary>
|
||||
public string OfflineAuditor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主管部门
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋详细信息
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseInfo", Order = 200)]
|
||||
public class HouseInfoService : IHouseInfoService, IDynamicApiController, ITransient
|
||||
{
|
||||
|
||||
private readonly IRepository<BsHouseCode> _houseCodeRep;
|
||||
private readonly IRepository<BsHouseInfo> _houseInfoRep;
|
||||
private readonly IRepository<BsHouseTask> _houseTaskRep;
|
||||
private readonly IRepository<SysUser> _sysUserRep;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDapperRepository _dapperRepository;
|
||||
|
||||
private readonly IHouseLogService _houseLogService;
|
||||
|
||||
|
||||
public HouseInfoService(
|
||||
IRepository<BsHouseCode> HouseCodeRep,
|
||||
IRepository<BsHouseInfo> HouseInfoRep,
|
||||
IRepository<BsHouseTask> HouseTaskRep,
|
||||
IRepository<SysUser> 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<HouseInfoOutputForDetailPage> 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<HouseCodeOutput>(
|
||||
@"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<HouseTaskOutput>();
|
||||
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<HouseInfoOutput>();
|
||||
houseInfoOutputForDetailPage.HouseInfo = houseInfoOutput;
|
||||
|
||||
return houseInfoOutputForDetailPage;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task InputDataProcess(HouseInfoInputSave input,DataStatus dataStatus = DataStatus.Init)
|
||||
{
|
||||
//房屋编码地址/坐标单独更新
|
||||
var houseCode = input.houseCode.Adapt<BsHouseCode>();
|
||||
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<BsHouseTask>();
|
||||
_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<BsHouseInfo>();
|
||||
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<SysEmp>();
|
||||
var _sysUserRoleRep = Db.GetRepository<SysUserRole>();
|
||||
var _sysRoleRep = Db.GetRepository<SysRole>();
|
||||
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<BsHouseTaskCheckRecord>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application.Service
|
||||
{
|
||||
public interface IHouseInfoService
|
||||
{
|
||||
Task<HouseInfoOutputForDetailPage> GetByTaskId(string taskId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋流转日志
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseLog", Order = 210)]
|
||||
public class HouseLogService : IHouseLogService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IDapperRepository _dapperRep;
|
||||
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
private readonly IRepository<BsHouseLog> _bsHouseLogRep;
|
||||
|
||||
public HouseLogService(IDapperRepository dapperRep, IUserManager userManager, IRepository<BsHouseLog> bsHouseLogRep)
|
||||
{
|
||||
_dapperRep = dapperRep;
|
||||
_userManager = userManager;
|
||||
_bsHouseLogRep = bsHouseLogRep;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task<int> Add(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null)
|
||||
{
|
||||
return await Add(houseCodeId, new List<SysUser> { targetUser }, type, remark, sort);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task<int> Add(string houseCodeId, List<SysUser> 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<int> AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null)
|
||||
{
|
||||
return await AddThenRead(houseCodeId, new List<SysUser> { targetUser }, type, remark, sort);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task<int> AddThenRead(string houseCodeId, List<SysUser> 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<int> AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null)
|
||||
{
|
||||
return await AddThenDone(houseCodeId, new List<SysUser> { targetUser }, type, remark, sort);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task<int> AddThenDone(string houseCodeId, List<SysUser> 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<dynamic> 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<HouseLogOutput>(sql, new { houseCodeId = input.Id });
|
||||
}
|
||||
|
||||
[HttpGet("/houseLog/listByInfoId")]
|
||||
public async Task<dynamic> ListByInfoId([FromQuery] HouseLogInput input)
|
||||
{
|
||||
var info = await Db.GetRepository<BsHouseInfo>().DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.Id));
|
||||
return await List(new HouseLogInput
|
||||
{
|
||||
Id = info.HouseCodeId
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("/houseLog/listByTaskId")]
|
||||
public async Task<dynamic> ListByTaskId([FromQuery] HouseLogInput input)
|
||||
{
|
||||
var task = await Db.GetRepository<BsHouseTask>().DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.Id));
|
||||
return await List(new HouseLogInput
|
||||
{
|
||||
Id = task.HouseCodeId
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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<int> Add(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null);
|
||||
Task<int> Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null);
|
||||
Task Read(string houseCodeId);
|
||||
Task Done(string houseCodeId);
|
||||
Task<int> AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null);
|
||||
Task<int> AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null);
|
||||
Task<int> AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type, string remark = null, int? sort = null);
|
||||
Task<int> AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type, string remark = null, int? sort = null);
|
||||
Task<dynamic> List(HouseLogInput input);
|
||||
Task<dynamic> ListByInfoId(HouseLogInput input);
|
||||
Task<dynamic> ListByTaskId(HouseLogInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
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<SysUser> _sysUserRep; // 用户表仓储
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ISysUserService _sysUserService;
|
||||
private readonly ISysEmpService _sysEmpService;
|
||||
|
||||
public HouseMemberService(
|
||||
IDapperRepository dapperRepository,
|
||||
IRepository<SysUser> sysUserRep,
|
||||
IUserManager userManager,
|
||||
ISysUserService sysUserService,
|
||||
ISysEmpService sysEmpService
|
||||
)
|
||||
{
|
||||
_dapperRepository = dapperRepository;
|
||||
_sysUserRep = sysUserRep;
|
||||
_userManager = userManager;
|
||||
_sysUserService = sysUserService;
|
||||
_sysEmpService = sysEmpService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询用户
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseMember/page")]
|
||||
public async Task<dynamic> 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<UserOutput>(sql, input, param);
|
||||
|
||||
//foreach (var user in users.Items)
|
||||
//{
|
||||
// user.SysEmpInfo = await _sysEmpService.GetEmpInfo(user.Id);
|
||||
//}
|
||||
return PageDataResult<UserOutput>.PageResult(users);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加用户
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseMember/add")]
|
||||
[UnitOfWork]
|
||||
public async Task AddUser(AddHouseMemberInput input)
|
||||
{
|
||||
var id = await _sysUserService.AddUser(input);
|
||||
var grantRoleInput = input.Adapt<UpdateUserInput>();
|
||||
grantRoleInput.Id = id;
|
||||
|
||||
// 添加角色
|
||||
grantRoleInput.GrantRoleIdList.Add(input.RoleId);
|
||||
await _sysUserService.GrantUserRole(grantRoleInput);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取角色
|
||||
/// </summary>
|
||||
/// <param name="orgId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseMember/defaultRole")]
|
||||
public async Task<dynamic> DefaultRole([FromQuery] string orgId)
|
||||
{
|
||||
return (await GetDefaultRole(orgId)).Adapt<RoleOutput>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户拥有角色
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseMember/ownRole")]
|
||||
public async Task<dynamic> GetUserOwnRole([FromQuery] QueryUserInput input)
|
||||
{
|
||||
return await _sysUserService.GetUserOwnRole(input);
|
||||
}
|
||||
|
||||
[HttpGet("/houseMember/defaultRoleRange")]
|
||||
public async Task<dynamic> DefaultRoleRange()
|
||||
{
|
||||
return (await GetRoleRange()).Select(p => p.Adapt<RoleOutput>()).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除用户
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseMember/delete")]
|
||||
[UnitOfWork]
|
||||
public async Task DeleteUser(DeleteUserInput input)
|
||||
{
|
||||
/*
|
||||
* 未处理逻辑
|
||||
* 片区监管员在本片区已有安全员的情况下无法删除
|
||||
*/
|
||||
|
||||
await _sysUserService.DeleteUser(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新用户
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseMember/edit")]
|
||||
[UnitOfWork]
|
||||
public async Task UpdateUser(UpdateUserInput input)
|
||||
{
|
||||
/*
|
||||
* 未处理逻辑
|
||||
* 如果移动组织架构,会产生以下几种逻辑
|
||||
* 片区1监管员(无安全员或有其他监管员)=>片区2,直接成功
|
||||
* 片区1监管员(有安全员并且无其他监管员)=>片区2,无法移动
|
||||
* 片区1安全员=>片区2(有监管员),直接成功
|
||||
* 片区1安全员=>片区2(无监管员),无法移动,需要创建监管员
|
||||
*/
|
||||
|
||||
await _sysUserService.UpdateUser(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查看用户
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseMember/detail")]
|
||||
public async Task<dynamic> 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<UserOutput>(sql, new { input.Id })).SingleOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
user.SysEmpInfo = await _sysEmpService.GetEmpInfo(user.Id);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户状态
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseMember/changeStatus")]
|
||||
public async Task ChangeUserStatus(UpdateUserInput input)
|
||||
{
|
||||
await _sysUserService.ChangeUserStatus(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 授权用户数据范围
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseMember/grantData")]
|
||||
public async Task GrantUserData(UpdateUserInput input)
|
||||
{
|
||||
await _sysUserService.GrantUserData(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户拥有数据
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseMember/ownData")]
|
||||
public async Task<dynamic> GetUserOwnData([FromQuery] QueryUserInput input)
|
||||
{
|
||||
return await _sysUserService.GetUserOwnData(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前机构中所创建的默认角色
|
||||
/// 片区中的第一个帐号必定为片区监管员
|
||||
/// </summary>
|
||||
/// <param name="orgId"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
private async Task<SysRole> GetDefaultRole(string orgId)
|
||||
{
|
||||
var roles = await GetRoleRange();
|
||||
if (roles.Count < 2) throw Oops.Oh("未配置正确的角色");
|
||||
|
||||
var _sysOrgRep = Db.GetRepository<SysOrg>();
|
||||
var org = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == orgId);
|
||||
// 如果当前组织为街道, 则直接返回安全员
|
||||
if (org == null || org.Type <= (int)OrgType.乡镇街道办事处)
|
||||
{
|
||||
return roles.LastOrDefault();
|
||||
}
|
||||
|
||||
var _sysEmpRep = Db.GetRepository<SysEmp>();
|
||||
var _sysUserRoleRep = Db.GetRepository<SysUserRole>();
|
||||
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<SysRole>();
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取可创建的角色列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
private async Task<List<SysRole>> GetRoleRange()
|
||||
{
|
||||
var codes = (new[] {
|
||||
Enum.GetName(HouseManagerRole.ZoneManager),
|
||||
Enum.GetName(HouseManagerRole.HouseSecurityManager),
|
||||
}).Select(p => p.ToUnderScoreCase());
|
||||
|
||||
var _sysRoleRep = Db.GetRepository<SysRole>();
|
||||
var roles = await _sysRoleRep.DetachedEntities.Where(p => codes.Contains(p.Code)).ToListAsync();
|
||||
|
||||
return roles;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Ewide.Core.Service;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application.Service
|
||||
{
|
||||
public interface IHouseMemberService
|
||||
{
|
||||
Task<dynamic> QueryMemberPageList([FromBody] UserInput input);
|
||||
Task AddUser(AddHouseMemberInput input);
|
||||
Task<dynamic> DefaultRole([FromQuery] string orgId);
|
||||
Task DeleteUser(DeleteUserInput input);
|
||||
Task UpdateUser(UpdateUserInput input);
|
||||
Task<dynamic> GetUser([FromQuery] QueryUserInput input);
|
||||
Task ChangeUserStatus(UpdateUserInput input);
|
||||
Task<dynamic> GetUserOwnRole([FromQuery] QueryUserInput input);
|
||||
Task GrantUserData(UpdateUserInput input);
|
||||
Task<dynamic> GetUserOwnData([FromQuery] QueryUserInput input);
|
||||
Task<dynamic> DefaultRoleRange();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目管理相关服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseProjectInfo", Order = 170)]
|
||||
public class HouseProjectInfoService : IHouseProjectInfoService, ITransient, IDynamicApiController
|
||||
{
|
||||
private readonly IRepository<BsHouseProjectInfo> _houseProjectInfoRep;
|
||||
|
||||
public HouseProjectInfoService(IRepository<BsHouseProjectInfo> houseProjectInfoRep)
|
||||
{
|
||||
_houseProjectInfoRep = houseProjectInfoRep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加项目
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseProjectInfo/add")]
|
||||
public async Task AddProject(AddProjectInput input)
|
||||
{
|
||||
await _houseProjectInfoRep.InsertNowAsync(input.Adapt<BsHouseProjectInfo>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除项目
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseProjectInfo/delete")]
|
||||
public async Task DeleteProject(DeleteProjectInput input)
|
||||
{
|
||||
var project = _houseProjectInfoRep.FirstOrDefault(p => p.Id == input.Id);
|
||||
await project.DeleteNowAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑项目
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseProjectInfo/edit")]
|
||||
public async Task UpdateProject(UpdateProjectInput input)
|
||||
{
|
||||
var project = input.Adapt<BsHouseProjectInfo>();
|
||||
await project.UpdateExcludeAsync(new[] { nameof(BsHouseProjectInfo.AreaCode) }, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过ID获取项目
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseProjectInfo/getById")]
|
||||
public async Task<BsHouseProjectInfo> GetById([Required] string projectId)
|
||||
{
|
||||
return await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == projectId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseProjectInfo/page")]
|
||||
public async Task<dynamic> QueryProjectPageList([FromBody] PageProjectInput input)
|
||||
{
|
||||
var areaCodeRep = Db.GetRepository<SysAreaCode>();
|
||||
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<HouseProjectOutput>()).ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
return PageDataResult<HouseProjectOutput>.PageResult(projects);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseProjectInfo/detail")]
|
||||
public async Task<dynamic> GetProject([FromQuery] QueryProjectInput input)
|
||||
{
|
||||
var user = await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == input.Id);
|
||||
var userDto = user.Adapt<UserOutput>();
|
||||
|
||||
return userDto;
|
||||
}
|
||||
|
||||
[HttpGet("/houseProjectInfo/nextSort")]
|
||||
public async Task<int> 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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目下拉列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("houseProjectInfo/list")]
|
||||
public async Task<dynamic> GetProjectList([FromQuery] ListHouseProjectInfoInput input)
|
||||
{
|
||||
return await _houseProjectInfoRep.DetachedEntities
|
||||
.Where(p => p.AreaCode == input.AreaCode && p.Type == input.Type)
|
||||
.OrderBy(p => p.Sort)
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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<BsHouseProjectInfo> GetById([FromRoute] string projectId);
|
||||
Task<dynamic> GetProject([FromQuery] QueryProjectInput input);
|
||||
Task<dynamic> QueryProjectPageList([FromQuery] PageProjectInput input);
|
||||
|
||||
Task<int> GetNextProjectSortByAreaCode([FromQuery] ListHouseProjectInfoInput input);
|
||||
Task<dynamic> GetProjectList([FromQuery] ListHouseProjectInfoInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
public class HouseQueryOutput
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 住宅查询
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseQuery", Order = 210)]
|
||||
public class HouseQueryService : IHouseQueryService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<BsHouseCode> _houseCodeRep;
|
||||
private readonly IRepository<BsHouseInfo> _houseInfoRep;
|
||||
private readonly IRepository<BsHouseTask> _houseTaskRep;
|
||||
private readonly IDapperRepository _dapperRepository;
|
||||
|
||||
public HouseQueryService(IRepository<BsHouseCode> HouseCodeRep, IRepository<BsHouseInfo> HouseInfoRep, IRepository<BsHouseTask> HouseTaskRep, IDapperRepository dapperRepository)
|
||||
{
|
||||
_houseCodeRep = HouseCodeRep;
|
||||
_houseInfoRep = HouseInfoRep;
|
||||
_houseTaskRep = HouseTaskRep;
|
||||
_dapperRepository = dapperRepository;
|
||||
}
|
||||
|
||||
[HttpPost("/houseQuery/page")]
|
||||
public async Task<dynamic> 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<dynamic> Detail([FromQuery] HouseQueryDetailInput input)
|
||||
{
|
||||
var houseCodeOutputAsync = await _dapperRepository.QueryAsync<HouseCodeOutput>(
|
||||
@"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<HouseInfoOutput>();
|
||||
houseInfoOutputForDetailPage.HouseInfo = houseInfoOutput;
|
||||
|
||||
return houseInfoOutputForDetailPage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
public class HouseSelectorOutput
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 选房相关
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseSelector", Order = 180)]
|
||||
public class HouseSelectorService : IHouseSelectorService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDapperRepository _dapperRep;
|
||||
|
||||
private readonly IRepository<BsHouseMemberRelation> _bsHouseMemberRelationRep;
|
||||
private readonly IRepository<BsHouseCode> _bsHouseCodeRep;
|
||||
private readonly IRepository<BsHouseTask> _bsHouseTaskRep;
|
||||
private readonly IRepository<SysUser> _sysUserRep;
|
||||
private readonly IHouseZoneService _houseZoneService;
|
||||
|
||||
private readonly IHouseLogService _houseLogService;
|
||||
|
||||
public HouseSelectorService(
|
||||
IUserManager userManager,
|
||||
IDapperRepository dapperRep,
|
||||
IRepository<BsHouseMemberRelation> bsHouseMemberRelationRep,
|
||||
IRepository<BsHouseCode> bsHouseCodeRep,
|
||||
IRepository<BsHouseTask> bsHouseTaskRep,
|
||||
IRepository<SysUser> sysUserRep,
|
||||
IHouseZoneService houseZoneService,
|
||||
IHouseLogService houseLogService
|
||||
)
|
||||
{
|
||||
_userManager = userManager;
|
||||
|
||||
_dapperRep = dapperRep;
|
||||
_bsHouseMemberRelationRep = bsHouseMemberRelationRep;
|
||||
_bsHouseCodeRep = bsHouseCodeRep;
|
||||
_bsHouseTaskRep = bsHouseTaskRep;
|
||||
_sysUserRep = sysUserRep;
|
||||
_houseZoneService = houseZoneService;
|
||||
|
||||
_houseLogService = houseLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员允许绑定的房屋编码列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseSelector/selectorPage")]
|
||||
public async Task<dynamic> 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)
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员已经绑定的房屋编码列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseSelector/selectedPage")]
|
||||
public async Task<dynamic> 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)
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从人员选择房屋
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[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<BsHouseTask>();
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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<dynamic> HouseSelectorList([FromQuery] QueryHouseSelectorInput input);
|
||||
Task<dynamic> HouseSelectedList([FromQuery] QueryHouseSelectorInput input);
|
||||
Task Select([FromBody] HouseSelectInput input);
|
||||
Task Revoke([FromBody] HouseSelectInput input);
|
||||
Task SelectMember();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// 沉降倾斜
|
||||
/// </summary>
|
||||
public string SettlementTilt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 沉降倾斜附件
|
||||
/// </summary>
|
||||
public string SettlementTiltFiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他情况
|
||||
/// </summary>
|
||||
public string OtherInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他情况附件
|
||||
/// </summary>
|
||||
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
|
||||
/// <summary>
|
||||
/// 房屋场地
|
||||
/// </summary>
|
||||
public string HouseSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 相邻施工
|
||||
/// </summary>
|
||||
public string AdjacentConstruction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 化学侵蚀
|
||||
/// </summary>
|
||||
public string ChemicalErosion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结构拆改
|
||||
/// </summary>
|
||||
public int? StructuralDismantling { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 加层改造
|
||||
/// </summary>
|
||||
public int? AddingLayer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修缮加固
|
||||
/// </summary>
|
||||
public string RepairAndReinforce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 历史灾害
|
||||
/// </summary>
|
||||
public string HistoricalCalamity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用功能变更
|
||||
/// </summary>
|
||||
public string FunctionalChange { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他调查内容
|
||||
/// </summary>
|
||||
public string OtherContents { get; set; }
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 主要安全隐患综述
|
||||
/// </summary>
|
||||
public string MainSafety { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理意见
|
||||
/// </summary>
|
||||
public int? HandlingOpinion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理意见备注
|
||||
/// </summary>
|
||||
public string HandlingOpinionRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改情况
|
||||
/// </summary>
|
||||
public int? RectifyAndReform { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改情况备注
|
||||
/// </summary>
|
||||
public string RectifyAndReformRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡查结果:1正常,-1异常
|
||||
/// </summary>
|
||||
//[Required(ErrorMessage = "巡查结果不能为空")]
|
||||
public int PatrolResult { get; set; }
|
||||
|
||||
public string PatrolResultRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报街道
|
||||
/// </summary>
|
||||
public int? ReportRoad { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报街道时间
|
||||
/// </summary>
|
||||
public DateTime? ReportRoadTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报区住建
|
||||
/// </summary>
|
||||
public int? ReportArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报区住建时间
|
||||
/// </summary>
|
||||
public DateTime? ReportAreaTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报备注
|
||||
/// </summary>
|
||||
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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// 沉降倾斜
|
||||
/// </summary>
|
||||
public string SettlementTilt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 沉降倾斜附件
|
||||
/// </summary>
|
||||
public string SettlementTiltFiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他情况
|
||||
/// </summary>
|
||||
public string OtherInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他情况附件
|
||||
/// </summary>
|
||||
public string OtherInfoFiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始等级
|
||||
/// </summary>
|
||||
public int? InitGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 损坏等级
|
||||
/// </summary>
|
||||
public int? DamageGrade { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 综合等级
|
||||
/// </summary>
|
||||
public int? ComprehensiveGrade { get; set; }
|
||||
|
||||
#region 调查情况investigation
|
||||
/// <summary>
|
||||
/// 房屋场地
|
||||
/// </summary>
|
||||
public string HouseSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 相邻施工
|
||||
/// </summary>
|
||||
public string AdjacentConstruction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 化学侵蚀
|
||||
/// </summary>
|
||||
public string ChemicalErosion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结构拆改
|
||||
/// </summary>
|
||||
public int? StructuralDismantling { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 加层改造
|
||||
/// </summary>
|
||||
public int? AddingLayer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修缮加固
|
||||
/// </summary>
|
||||
public string RepairAndReinforce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 历史灾害
|
||||
/// </summary>
|
||||
public string HistoricalCalamity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用功能变更
|
||||
/// </summary>
|
||||
public string FunctionalChange { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他调查内容
|
||||
/// </summary>
|
||||
public string OtherContents { get; set; }
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 主要安全隐患综述
|
||||
/// </summary>
|
||||
public string MainSafety { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理意见
|
||||
/// </summary>
|
||||
public int? HandlingOpinion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理意见备注
|
||||
/// </summary>
|
||||
public string HandlingOpinionRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改情况
|
||||
/// </summary>
|
||||
public int? RectifyAndReform { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改情况备注
|
||||
/// </summary>
|
||||
public string RectifyAndReformRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡查结果:1正常,-1异常
|
||||
/// </summary>
|
||||
public int? PatrolResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡查异常描述
|
||||
/// </summary>
|
||||
public string PatrolResultRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报街道
|
||||
/// </summary>
|
||||
public int? ReportRoad { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报街道时间
|
||||
/// </summary>
|
||||
public DateTime? ReportRoadTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报区住建
|
||||
/// </summary>
|
||||
public int? ReportArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报区住建时间
|
||||
/// </summary>
|
||||
public DateTime? ReportAreaTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报备注
|
||||
/// </summary>
|
||||
public string ReportRemark { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交时间
|
||||
/// </summary>
|
||||
public DateTime? SubmitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后提交时间
|
||||
/// </summary>
|
||||
public DateTime? LastSubmitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 房屋任务(巡查任务/建档任务)
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseTask", Order = 190)]
|
||||
public class HouseTaskService : IHouseTaskService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<BsHouseTask> _houseTaskRep;
|
||||
private readonly IRepository<BsHouseInfo> _houseInfoRep;
|
||||
private readonly IDapperRepository _dapperRepository;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
private readonly IHouseLogService _houseLogService;
|
||||
|
||||
public HouseTaskService(IRepository<BsHouseTask> HouseTaskRep, IRepository<BsHouseInfo> HouseInfoRep, IDapperRepository dapperRepository, IUserManager userManager, IHouseLogService houseLogService)
|
||||
{
|
||||
_houseTaskRep = HouseTaskRep;
|
||||
_houseInfoRep = HouseInfoRep;
|
||||
_dapperRepository = dapperRepository;
|
||||
_userManager = userManager;
|
||||
|
||||
_houseLogService = houseLogService;
|
||||
}
|
||||
|
||||
[HttpPost("/houseTask/page")]
|
||||
public async Task<dynamic> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application.Service
|
||||
{
|
||||
public interface IHouseTaskService
|
||||
{
|
||||
Task<dynamic> QueryPage(QueryHouseTaskInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "任务参数有误")]
|
||||
public string TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 通过3;退回-1
|
||||
/// </summary>
|
||||
[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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核内容
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "审核内容不能为空")]
|
||||
public string Content { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 所属街道
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "所属街道不能为空")]
|
||||
public override string Pid { get; set; }
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "片区名称不能为空")]
|
||||
public override string Name { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class UpdateHouseZoneInput : AddHouseZoneInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "片区Id不能为空")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
class HouseZoneOutput
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 片区相关
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseZone", Order = 180)]
|
||||
public class HouseZoneService : IHouseZoneService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IRepository<SysOrg> _sysOrgRep;
|
||||
private readonly IRepository<SysEmp> _sysEmpRep;
|
||||
private readonly ISysOrgService _sysOrgService;
|
||||
|
||||
public HouseZoneService(
|
||||
IUserManager userManager,
|
||||
IRepository<SysOrg> sysOrgRep,
|
||||
IRepository<SysEmp> sysEmpRep,
|
||||
ISysOrgService sysOrgService
|
||||
)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_sysOrgRep = sysOrgRep;
|
||||
_sysEmpRep = sysEmpRep;
|
||||
_sysOrgService = sysOrgService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取片区列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseZone/list")]
|
||||
public async Task<dynamic> 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<dynamic> GetById([Required] string zoneId)
|
||||
{
|
||||
return await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == zoneId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询片区
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/houseZone/page")]
|
||||
public async Task<dynamic> 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<SysOrg, OrgOutput>(input);
|
||||
return PageDataResult<OrgOutput>.PageResult(orgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据用户Id获取所在片区的Id
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/houseZone/getByUser")]
|
||||
public async Task<string> 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<dynamic> 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<dynamic> 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<AddOrgInput>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
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<dynamic> GetHouseZoneList([FromQuery] HouseZoneInput input);
|
||||
Task<string> GetZoneByUser([FromQuery] string userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
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 InspectionOrgKeyInput
|
||||
{
|
||||
public virtual string Id { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionOrgKeyRequiredInput : InspectionOrgKeyInput
|
||||
{
|
||||
[Required]
|
||||
public override string Id { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionOrgPageInput : PageInputBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class InspectionOrgRegisterInput
|
||||
{
|
||||
[MaxLength(100)]
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
[Required]
|
||||
public string CreditCode { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Address { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
[Required]
|
||||
public string Contacts { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
[Required]
|
||||
public string ContactsPhone { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
[Required]
|
||||
public string LegalPerson { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string OrgTelephone { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ApplicationFormFiles { get; set; }
|
||||
|
||||
[Required]
|
||||
public string OrgBusinessLicenseFiles { get; set; }
|
||||
|
||||
[Required]
|
||||
public string InspectionQualificationCertificateFiles { get; set; }
|
||||
|
||||
[Required]
|
||||
public string OfficeInformationFiles { get; set; }
|
||||
|
||||
[Required]
|
||||
public string EmployeeCertificateFiles { get; set; }
|
||||
|
||||
[Required]
|
||||
public string CalibrationCertificateFiles { get; set; }
|
||||
|
||||
public string OtherFiles { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionOrgReviewNotApprovedInput : InspectionOrgKeyRequiredInput
|
||||
{
|
||||
[Required]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
public class InspectionOrgDetailOutput
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Code { get; set; }
|
||||
public InspectionOrgStatus Status { get; set; }
|
||||
public InspectionOrgUpdateStatus UpdateStatus { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
public InspectionOrgRegisterInput Record { get; set; }
|
||||
public InspectionOrgRegisterInput UpdateRecord { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionRegisterStatusOutput
|
||||
{
|
||||
public DateTime BeginDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public InspectionOrgDetailOutput InspectionOrg { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application.Service
|
||||
{
|
||||
public interface IInspectionOrgService
|
||||
{
|
||||
public Task<string> NewCode();
|
||||
public Task<InspectionRegisterStatusOutput> RegisterStatus();
|
||||
public Task Register(InspectionOrgRegisterInput input);
|
||||
public Task Update(InspectionOrgRegisterInput input);
|
||||
public Task<InspectionOrgDetailOutput> Detail(InspectionOrgKeyInput input);
|
||||
public Task<dynamic> ReviewPage(InspectionOrgPageInput input);
|
||||
public Task<dynamic> ReviewUpdatePage(InspectionOrgPageInput input);
|
||||
public Task ReviewApproved(InspectionOrgKeyRequiredInput input);
|
||||
public Task ReviewNotApproved(InspectionOrgReviewNotApprovedInput input);
|
||||
public Task<dynamic> History(InspectionOrgKeyRequiredInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,410 @@
|
||||
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 Furion.JsonSerialization;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 鉴定机构相关
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "InspectionOrg")]
|
||||
public class InspectionOrgService : IInspectionOrgService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IJsonSerializerProvider _jsonSerializer;
|
||||
private readonly IDapperRepository _dapperRep;
|
||||
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
private readonly IRepository<BsInspectionOrg> _orgRep;
|
||||
private readonly IRepository<BsInspectionOrgUpdate> _orgUpdateRep;
|
||||
private readonly IRepository<BsInspectionMemberRelation> _relationRep;
|
||||
private readonly IRepository<BsInspectionOrgSetting> _settingRep;
|
||||
|
||||
public InspectionOrgService(
|
||||
IJsonSerializerProvider jsonSerializer,
|
||||
IDapperRepository dapperRep,
|
||||
IUserManager userManager,
|
||||
IRepository<BsInspectionOrg> orgRep,
|
||||
IRepository<BsInspectionOrgUpdate> orgUpdateRep,
|
||||
IRepository<BsInspectionMemberRelation> relationRep,
|
||||
IRepository<BsInspectionOrgSetting> settingRep
|
||||
)
|
||||
{
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_dapperRep = dapperRep;
|
||||
|
||||
_userManager = userManager;
|
||||
|
||||
_orgRep = orgRep;
|
||||
_orgUpdateRep = orgUpdateRep;
|
||||
_relationRep = relationRep;
|
||||
_settingRep = settingRep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取可登记的时间范围
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<BsInspectionOrgSetting_DateRange> DateRange()
|
||||
{
|
||||
// 验证当前时间是否已在可申报时间范围内
|
||||
var setting = await _settingRep.DetachedEntities.FirstOrDefaultAsync(p => p.Type == InspectionOrgSettingType.DateRange);
|
||||
var dateRange = _jsonSerializer.Deserialize<BsInspectionOrgSetting_DateRange>(setting.Setting);
|
||||
return dateRange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前用户所在机构
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<string> RelationOrgId()
|
||||
{
|
||||
var relation = await _relationRep.DetachedEntities.FirstOrDefaultAsync(p => p.SysUserId.Equals(_userManager.UserId));
|
||||
if (relation == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return relation.InspectionOrgId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取最新备案编号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/inspectionOrg/newCode")]
|
||||
public async Task<string> NewCode()
|
||||
{
|
||||
var nowYear = DateTime.Now.Year;
|
||||
var code = await _orgRep.DetachedEntities.MaxAsync(p => p.Code);
|
||||
if (String.IsNullOrEmpty(code))
|
||||
{
|
||||
code = nowYear + "001";
|
||||
}
|
||||
else
|
||||
{
|
||||
var year = int.Parse(code.Substring(0, 4));
|
||||
var no = int.Parse(code.Substring(4, 3));
|
||||
if (year < nowYear)
|
||||
{
|
||||
code = nowYear + "001";
|
||||
}
|
||||
else
|
||||
{
|
||||
code = year + (no + 1).ToString().PadLeft(3, '0');
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前用户所在鉴定机构信息及登记时间范围
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/inspectionOrg/registerStatus")]
|
||||
public async Task<InspectionRegisterStatusOutput> RegisterStatus()
|
||||
{
|
||||
var orgId = await RelationOrgId();
|
||||
var dateRange = await DateRange();
|
||||
var output = dateRange.Adapt<InspectionRegisterStatusOutput>();
|
||||
if (String.IsNullOrEmpty(orgId))
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
||||
var org = await _orgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(orgId));
|
||||
var orgUpdate = await _orgUpdateRep.DetachedEntities.Where(p => p.OrgId.Equals(orgId)).OrderByDescending(p => p.CreatedTime).FirstOrDefaultAsync();
|
||||
output.InspectionOrg = org.Adapt<InspectionOrgDetailOutput>();
|
||||
output.InspectionOrg.UpdateStatus = orgUpdate.Status;
|
||||
output.InspectionOrg.Remark = orgUpdate.Remark;
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定机构登记
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/inspectionOrg/register")]
|
||||
[UnitOfWork]
|
||||
public async Task Register([FromBody] InspectionOrgRegisterInput input)
|
||||
{
|
||||
// 验证当前时间是否已在可申报时间范围内
|
||||
var dateRange = await DateRange();
|
||||
var now = DateTime.Now;
|
||||
if (!(now >= dateRange.BeginDate && now < dateRange.EndDate.AddDays(1)))
|
||||
throw Oops.Oh("当前时间段无法登记鉴定机构");
|
||||
|
||||
// 登记时主表数据应为空, 只向记录数据中插入当前填表的内容
|
||||
var updateData = input.Adapt<BsInspectionOrgUpdate>();
|
||||
var orgId = await RelationOrgId();
|
||||
if (String.IsNullOrEmpty(orgId))
|
||||
{
|
||||
orgId = Guid.NewGuid().ToString().ToLower();
|
||||
var code = await NewCode();
|
||||
// 登记主表
|
||||
var data = new BsInspectionOrg
|
||||
{
|
||||
Id = orgId,
|
||||
Code = code,
|
||||
};
|
||||
await data.InsertAsync();
|
||||
|
||||
// 用户关系表
|
||||
await new BsInspectionMemberRelation
|
||||
{
|
||||
SysUserId = _userManager.UserId,
|
||||
InspectionOrgId = orgId
|
||||
}.InsertAsync();
|
||||
}
|
||||
// 登记记录表
|
||||
updateData.OrgId = orgId;
|
||||
updateData.Type = InspectionOrgUpdateType.Register;
|
||||
updateData.Status = InspectionOrgUpdateStatus.Reviewing;
|
||||
await updateData.InsertAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定机构申请修改
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/inspectionOrg/update")]
|
||||
public async Task Update([FromBody] InspectionOrgRegisterInput input)
|
||||
{
|
||||
var orgId = await RelationOrgId();
|
||||
var org = await _orgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(orgId));
|
||||
var updateData = input.Adapt<BsInspectionOrgUpdate>();
|
||||
// 与之前的值进行对比, 没有变更则不提交
|
||||
var updated = false;
|
||||
var TSource = org.GetType();
|
||||
var TSourceProperties = TSource.GetProperties();
|
||||
var TTarget = updateData.GetType();
|
||||
var TTargetProperties = TTarget.GetProperties();
|
||||
var compareFields = new[] {
|
||||
nameof(BsInspectionOrg.Name),
|
||||
nameof(BsInspectionOrg.CreditCode),
|
||||
nameof(BsInspectionOrg.Address),
|
||||
nameof(BsInspectionOrg.Contacts),
|
||||
nameof(BsInspectionOrg.ContactsPhone),
|
||||
nameof(BsInspectionOrg.LegalPerson),
|
||||
nameof(BsInspectionOrg.OrgTelephone),
|
||||
nameof(BsInspectionOrg.ApplicationFormFiles),
|
||||
nameof(BsInspectionOrg.OrgBusinessLicenseFiles),
|
||||
nameof(BsInspectionOrg.InspectionQualificationCertificateFiles),
|
||||
nameof(BsInspectionOrg.OfficeInformationFiles),
|
||||
nameof(BsInspectionOrg.EmployeeCertificateFiles),
|
||||
nameof(BsInspectionOrg.CalibrationCertificateFiles),
|
||||
nameof(BsInspectionOrg.OtherFiles)
|
||||
};
|
||||
|
||||
foreach (var fields in compareFields)
|
||||
{
|
||||
var PSource = TSourceProperties.FirstOrDefault(p => p.Name.Equals(fields));
|
||||
var VSource = PSource.GetValue(org);
|
||||
var PTarget = TTargetProperties.FirstOrDefault(p => p.Name.Equals(fields));
|
||||
var VTarget = PTarget.GetValue(updateData);
|
||||
if (
|
||||
(VSource == null && VTarget != null)
|
||||
||
|
||||
(VSource != null && !VSource.Equals(VTarget))
|
||||
)
|
||||
{
|
||||
updated = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!updated)
|
||||
{
|
||||
throw Oops.Oh("当前信息未修改");
|
||||
}
|
||||
|
||||
// 登记记录表
|
||||
updateData.OrgId = orgId;
|
||||
updateData.Type = InspectionOrgUpdateType.Update;
|
||||
updateData.Status = InspectionOrgUpdateStatus.Reviewing;
|
||||
await updateData.InsertAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鉴定机构详情
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/inspectionOrg/detail")]
|
||||
public async Task<InspectionOrgDetailOutput> Detail([FromQuery] InspectionOrgKeyInput input)
|
||||
{
|
||||
var orgId = String.Empty;
|
||||
// 传入Id表示查看他人,否则查看自己
|
||||
if (!String.IsNullOrEmpty(input.Id))
|
||||
{
|
||||
orgId = input.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
orgId = await RelationOrgId();
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(orgId))
|
||||
return null;
|
||||
|
||||
var output = new InspectionOrgDetailOutput();
|
||||
|
||||
var org = await _orgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(orgId));
|
||||
var orgUpdate = await _orgUpdateRep.DetachedEntities.Where(p => p.OrgId.Equals(orgId)).OrderByDescending(p => p.CreatedTime).FirstOrDefaultAsync();
|
||||
|
||||
if (org.Status == InspectionOrgStatus.Normal)
|
||||
{
|
||||
output.Record = org.Adapt<InspectionOrgRegisterInput>();
|
||||
}
|
||||
if (orgUpdate != null &&
|
||||
(orgUpdate.Status == InspectionOrgUpdateStatus.Reviewing || orgUpdate.Status == InspectionOrgUpdateStatus.Back))
|
||||
{
|
||||
output.UpdateRecord = orgUpdate.Adapt<InspectionOrgRegisterInput>();
|
||||
}
|
||||
|
||||
// 获取最新更新时间
|
||||
var lastOrgUpdatedTime = await _orgUpdateRep.DetachedEntities
|
||||
.Where(p => p.OrgId.Equals(orgId))
|
||||
.Where(p => p.Status == InspectionOrgUpdateStatus.Approved)
|
||||
.MaxAsync(p => p.UpdatedTime);
|
||||
|
||||
output.Id = orgId;
|
||||
output.Code = org.Code;
|
||||
output.Status = org.Status;
|
||||
output.UpdateStatus = orgUpdate.Status;
|
||||
output.Remark = orgUpdate.Remark;
|
||||
output.CreatedTime = org.CreatedTime;
|
||||
output.UpdatedTime = lastOrgUpdatedTime;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
private async Task<dynamic> Page(InspectionOrgPageInput input, int Type)
|
||||
{
|
||||
var sql = @"SELECT
|
||||
IO.Id,
|
||||
IO.Code,
|
||||
IOU.Name,
|
||||
IOU.CreditCode,
|
||||
IOU.Address,
|
||||
IOU.Contacts,
|
||||
IOU.ContactsPhone,
|
||||
IOU.LegalPerson,
|
||||
IOU.OrgTelephone,
|
||||
IO.Status,
|
||||
IOU.Type UpdateType,
|
||||
IOU.Status UpdateStatus,
|
||||
(SELECT COUNT(0) FROM bs_inspection_org_update WHERE OrgId = IO.Id AND Status <> 1) UpdateCount,
|
||||
IOU.UpdatedTime
|
||||
FROM bs_inspection_org IO
|
||||
LEFT JOIN
|
||||
(SELECT * FROM bs_inspection_org_update WHERE CreatedTime IN (SELECT MAX(CreatedTime) FROM bs_inspection_org_update WHERE Status <> -2 AND Type = @UpdateType GROUP BY OrgId))
|
||||
IOU ON IOU.OrgId = IO.Id";
|
||||
|
||||
return await _dapperRep.QueryPageDataDynamic(
|
||||
sql,
|
||||
input,
|
||||
param: new { UpdateType = Type },
|
||||
filterFields: new[] { "Code", "UpdateStatus" }
|
||||
);
|
||||
}
|
||||
|
||||
[HttpPost("/inspectionOrg/reviewPage")]
|
||||
public async Task<dynamic> ReviewPage([FromBody] InspectionOrgPageInput input)
|
||||
{
|
||||
return await Page(input, 1);
|
||||
}
|
||||
|
||||
[HttpPost("/inspectionOrg/reviewUpdatePage")]
|
||||
public async Task<dynamic> ReviewUpdatePage([FromBody] InspectionOrgPageInput input)
|
||||
{
|
||||
return await Page(input, 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登记审核通过
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/inspectionOrg/reviewApproved")]
|
||||
[UnitOfWork]
|
||||
public async Task ReviewApproved([FromBody] InspectionOrgKeyRequiredInput input)
|
||||
{
|
||||
var orgUpdate = await _orgUpdateRep.DetachedEntities.Where(p => p.OrgId.Equals(input.Id)).OrderByDescending(p => p.CreatedTime).FirstOrDefaultAsync();
|
||||
|
||||
orgUpdate.Status = InspectionOrgUpdateStatus.Approved;
|
||||
await orgUpdate.UpdateIncludeAsync(new [] {
|
||||
nameof(BsInspectionOrgUpdate.Status)
|
||||
});
|
||||
|
||||
var org = orgUpdate.Adapt<BsInspectionOrg>();
|
||||
org.Id = input.Id;
|
||||
org.Status = InspectionOrgStatus.Normal;
|
||||
|
||||
await org.UpdateExcludeAsync(new[] {
|
||||
nameof(BsInspectionOrg.Code)
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登记审核退回
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/inspectionOrg/reviewNotApproved")]
|
||||
public async Task ReviewNotApproved([FromBody] InspectionOrgReviewNotApprovedInput input)
|
||||
{
|
||||
var orgUpdate = await _orgUpdateRep.DetachedEntities.Where(p => p.OrgId.Equals(input.Id)).OrderByDescending(p => p.CreatedTime).FirstOrDefaultAsync();
|
||||
|
||||
orgUpdate.Status = InspectionOrgUpdateStatus.Back;
|
||||
orgUpdate.Remark = input.Remark;
|
||||
await orgUpdate.UpdateIncludeAsync(new[] {
|
||||
nameof(BsInspectionOrgUpdate.Status),
|
||||
nameof(BsInspectionOrgUpdate.Remark)
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取审核记录
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/inspectionOrg/history")]
|
||||
public async Task<dynamic> History([FromQuery] InspectionOrgKeyRequiredInput input)
|
||||
{
|
||||
var sql = @"SELECT
|
||||
IOU.Id,
|
||||
IOU.OrgId,
|
||||
IO.Code,
|
||||
IOU.Remark,
|
||||
IOU.Type,
|
||||
IOU.Status,
|
||||
IOU.CreatedTime,
|
||||
IOU.UpdatedTime
|
||||
FROM bs_inspection_org_update IOU
|
||||
LEFT JOIN bs_inspection_org IO ON IO.Id = IOU.OrgId
|
||||
WHERE IO.Id = @Id
|
||||
AND IOU.Status <> 1 -- 审核中
|
||||
ORDER BY CreatedTime DESC";
|
||||
return await _dapperRep.QueryAsync(sql, new { Id = input.Id });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
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 InspectionOrgDirKeyInput
|
||||
{
|
||||
public virtual string Id { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionOrgDirKeyRequiredInput : InspectionOrgDirKeyInput
|
||||
{
|
||||
[Required]
|
||||
public override string Id { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionOrgDirPageInput : PageInputBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class InspectionOrgDirSaveInput : InspectionOrgDirKeyInput
|
||||
{
|
||||
[Required]
|
||||
public string No { get; set; }
|
||||
[Required]
|
||||
public InspectionOrgDirSaveDetailInput[] Detail { get; set; }
|
||||
}
|
||||
|
||||
public class InspectionOrgDirSaveDetailInput
|
||||
{
|
||||
[Required]
|
||||
public string OrgId { get; set; }
|
||||
[Required]
|
||||
public int Score { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
public class InspectionOrgDirPreviewOutput
|
||||
{
|
||||
public BsInspectionOrgDirStage Stage { get; set; }
|
||||
public int Count { get; set; }
|
||||
public dynamic List { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application.Service
|
||||
{
|
||||
public interface IInspectionOrgDirService
|
||||
{
|
||||
public Task<dynamic> Page(InspectionOrgDirPageInput input);
|
||||
public Task<dynamic> ListScore();
|
||||
public Task<dynamic> Detail();
|
||||
public Task SaveScore(InspectionOrgDirSaveInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
using Dapper;
|
||||
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;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application.Service
|
||||
{
|
||||
public class InspectionOrgDirService : IInspectionOrgDirService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IDapperRepository _dapperRep;
|
||||
|
||||
private readonly IRepository<BsInspectionOrgDirStage> _dirStageRep;
|
||||
private readonly IRepository<BsInspectionOrgDirDetail> _dirDetailRep;
|
||||
private readonly IRepository<BsInspectionOrg> _orgRep;
|
||||
|
||||
public InspectionOrgDirService(
|
||||
IDapperRepository dapperRep,
|
||||
|
||||
IRepository<BsInspectionOrgDirStage> dirStageRep,
|
||||
IRepository<BsInspectionOrgDirDetail> dirDetailRep,
|
||||
IRepository<BsInspectionOrg> orgRep
|
||||
)
|
||||
{
|
||||
_dapperRep = dapperRep;
|
||||
|
||||
_dirStageRep = dirStageRep;
|
||||
_dirDetailRep = dirDetailRep;
|
||||
_orgRep = orgRep;
|
||||
}
|
||||
|
||||
[HttpPost("/inspectionOrgDir/page")]
|
||||
public async Task<dynamic> Page([FromBody] InspectionOrgDirPageInput input)
|
||||
{
|
||||
var sql = "SELECT * FROM bs_inspection_org_dir_stage WHERE Status = 1 ORDER BY PublishTime DESC";
|
||||
return await _dapperRep.QueryPageDataDynamic(sql, input, filterFields: new[] { nameof(BsInspectionOrgDirStage.No) });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前名录打分列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/inspectionOrgDir/listScore")]
|
||||
public async Task<dynamic> ListScore()
|
||||
{
|
||||
var sql = @"SELECT * FROM
|
||||
(
|
||||
SELECT
|
||||
IO.Id,
|
||||
IO.`Code`,
|
||||
IO.`Name`,
|
||||
CASE WHEN LIODD.ScoreResult IS NULL THEN 1 ELSE 0 END IsNew,
|
||||
LIODD.ScoreResult PrevScoreResult,
|
||||
TIODD.Score,
|
||||
TIODD.ScoreResult
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
*,
|
||||
(SELECT Id FROM bs_inspection_org_dir_stage WHERE Status = 1 ORDER BY CreatedTime DESC LIMIT 1) PrevStageId,
|
||||
(SELECT Id FROM bs_inspection_org_dir_stage WHERE Status = 0) CurrentStageId
|
||||
FROM
|
||||
bs_inspection_org
|
||||
) IO
|
||||
LEFT JOIN bs_inspection_org_dir_detail LIODD ON IO.PrevStageId = LIODD.StageId AND IO.Id = LIODD.OrgId
|
||||
LEFT JOIN bs_inspection_org_dir_detail TIODD ON IO.CurrentStageId = TIODD.StageId AND IO.Id = TIODD.OrgId
|
||||
WHERE IO.Status = 1
|
||||
) T ORDER BY IsNew DESC, `Code`";
|
||||
return await _dapperRep.QueryAsync(sql);
|
||||
}
|
||||
|
||||
[HttpGet("/inspectionOrgDir/detail")]
|
||||
public async Task<dynamic> Detail()
|
||||
{
|
||||
return await _dirStageRep.DetachedEntities.FirstOrDefaultAsync(p => p.Status.Equals(0));
|
||||
}
|
||||
|
||||
private int ScoreResult(int score, int? prevScoreResult)
|
||||
{
|
||||
int result;
|
||||
if (score >= 10)
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
else if (score >= 8)
|
||||
{
|
||||
result = 2;
|
||||
}
|
||||
else if (score >= 6)
|
||||
{
|
||||
result = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = 4;
|
||||
}
|
||||
|
||||
if (prevScoreResult.GetValueOrDefault(0).Equals(3) && result.Equals(3))
|
||||
{
|
||||
result = 4;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpPost("/inspectionOrgDir/saveScore")]
|
||||
[UnitOfWork]
|
||||
public async Task SaveScore([FromBody] InspectionOrgDirSaveInput input)
|
||||
{
|
||||
var stageId = input.Id;
|
||||
|
||||
var isAdd = false;
|
||||
// 新增修改名录主表
|
||||
if (String.IsNullOrEmpty(stageId))
|
||||
{
|
||||
// 新增
|
||||
// 如果存在未公布的名录,则失败
|
||||
var isExistUnpublished = await _dirStageRep.DetachedEntities.AnyAsync(p => p.Status.Equals(0));
|
||||
if(isExistUnpublished)
|
||||
throw Oops.Oh("存在未公布的名录,无法新增");
|
||||
|
||||
var isExistNo = await _dirStageRep.DetachedEntities.AnyAsync(p => p.No.Equals(input.No));
|
||||
if (isExistNo)
|
||||
throw Oops.Oh("名录期号已存在");
|
||||
|
||||
var stage = input.Adapt<BsInspectionOrgDirStage>();
|
||||
stageId = Guid.NewGuid().ToString().ToLower();
|
||||
stage.Id = stageId;
|
||||
|
||||
await stage.InsertAsync();
|
||||
|
||||
isAdd = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var isExistNo = await _dirStageRep.DetachedEntities.AnyAsync(p => p.No.Equals(input.No) && !p.Id.Equals(input.Id));
|
||||
if (isExistNo)
|
||||
throw Oops.Oh("名录期号已存在");
|
||||
|
||||
// 修改
|
||||
var stage = await _dirStageRep.FirstOrDefaultAsync(p => p.Id.Equals(input.Id));
|
||||
stage.No = input.No;
|
||||
|
||||
await stage.UpdateAsync();
|
||||
}
|
||||
|
||||
var prevStage = await _dirStageRep.DetachedEntities.OrderByDescending(p => p.CreatedTime).FirstOrDefaultAsync(p => !p.Id.Equals(stageId));
|
||||
var prevDetails = new List<BsInspectionOrgDirDetail>();
|
||||
if (prevStage != null)
|
||||
{
|
||||
prevDetails = await _dirDetailRep.DetachedEntities.Where(p => p.StageId.Equals(prevStage.Id)).ToListAsync();
|
||||
}
|
||||
|
||||
// 新增修改名录详细表
|
||||
foreach (var detail in input.Detail)
|
||||
{
|
||||
var prevDetail = prevDetails.FirstOrDefault(p => p.OrgId.Equals(detail.OrgId));
|
||||
var scoreResult = ScoreResult(detail.Score, prevDetail?.ScoreResult);
|
||||
|
||||
if (!isAdd)
|
||||
{
|
||||
// 名录已经存在时,判断每个机构的打分记录是否已经存在
|
||||
var _data = await _dirDetailRep.FirstOrDefaultAsync(p => p.OrgId.Equals(detail.OrgId) && p.StageId.Equals(stageId));
|
||||
if (_data != null)
|
||||
{
|
||||
_data.Score = detail.Score;
|
||||
_data.ScoreResult = scoreResult;
|
||||
await _data.UpdateAsync();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var data = detail.Adapt<BsInspectionOrgDirDetail>();
|
||||
data.StageId = stageId;
|
||||
data.ScoreResult = scoreResult;
|
||||
|
||||
await data.InsertAsync();
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("/inspectionOrgDir/preview")]
|
||||
public async Task<InspectionOrgDirPreviewOutput> Preview()
|
||||
{
|
||||
var stage = await _dirStageRep.FirstOrDefaultAsync(p => p.Status.Equals(0));
|
||||
if (stage == null)
|
||||
{
|
||||
// 当前没有需要发布的名录
|
||||
return null;
|
||||
}
|
||||
|
||||
var count = await _dirDetailRep.Where(p => p.StageId.Equals(stage.Id) && !p.ScoreResult.Equals(4)).CountAsync();
|
||||
|
||||
var sql = @"SELECT * FROM
|
||||
(
|
||||
SELECT
|
||||
IO.Id,
|
||||
IO.`Code`,
|
||||
IO.`Name`,
|
||||
IO.Address,
|
||||
CASE
|
||||
WHEN TIODD.ScoreResult = 4 THEN -1
|
||||
WHEN LIODD.ScoreResult IS NULL THEN 1
|
||||
ELSE 0 END `Status`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
*,
|
||||
(SELECT Id FROM bs_inspection_org_dir_stage WHERE Status = 1 ORDER BY CreatedTime DESC LIMIT 1) PrevStageId,
|
||||
(SELECT Id FROM bs_inspection_org_dir_stage WHERE Status = 0) CurrentStageId
|
||||
FROM
|
||||
bs_inspection_org
|
||||
) IO
|
||||
LEFT JOIN bs_inspection_org_dir_detail LIODD ON IO.PrevStageId = LIODD.StageId AND IO.Id = LIODD.OrgId
|
||||
LEFT JOIN bs_inspection_org_dir_detail TIODD ON IO.CurrentStageId = TIODD.StageId AND IO.Id = TIODD.OrgId
|
||||
WHERE (LIODD.ScoreResult IS NULL OR LIODD.ScoreResult < 4) AND IO.`Status` >= 0
|
||||
) T ORDER BY `Status` DESC, `Code`";
|
||||
var list = await _dapperRep.QueryAsync(sql);
|
||||
|
||||
return new InspectionOrgDirPreviewOutput
|
||||
{
|
||||
Stage = stage,
|
||||
Count = count,
|
||||
List = list
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPost("/inspectionOrgDir/publish")]
|
||||
[UnitOfWork]
|
||||
public async Task Publish()
|
||||
{
|
||||
var stage = await _dirStageRep.FirstOrDefaultAsync(p => p.Status.Equals(0));
|
||||
if (stage == null)
|
||||
throw Oops.Oh("当前名录数据错误");
|
||||
|
||||
// 评分详情
|
||||
var details = await _dirDetailRep.DetachedEntities.Where(p => p.StageId.Equals(stage.Id)).ToListAsync();
|
||||
// 当前需打分的机构
|
||||
var orgIds = await _orgRep.DetachedEntities.Where(p => p.Status != InspectionOrgStatus.Delisting && p.Status != InspectionOrgStatus.Revoke).Select(p => p.Id).ToListAsync();
|
||||
if (orgIds.Any(p => !details.Select(p => p.OrgId).Contains(p)))
|
||||
throw Oops.Oh("存在未评分的机构");
|
||||
|
||||
// 往期名录
|
||||
var prevStage = await _dirStageRep.DetachedEntities.OrderByDescending(p => p.CreatedTime).FirstOrDefaultAsync(p => !p.Id.Equals(stage.Id));
|
||||
// 往期机构
|
||||
var prevDetails = await _dirDetailRep.DetachedEntities.Where(p => p.StageId.Equals(prevStage.Id)).ToListAsync();
|
||||
// 往期黄牌机构
|
||||
var prevFilteredDetailOrgIds = new List<string>();
|
||||
if (prevStage != null)
|
||||
{
|
||||
// 获取往期黄牌机构
|
||||
prevFilteredDetailOrgIds = prevDetails.Where(p => p.ScoreResult.Equals(3)).Select(p => p.OrgId).ToList();
|
||||
}
|
||||
|
||||
// 对除名的机构修改状态
|
||||
var revmoeCount = 0;
|
||||
var mayBeRemovedDetails = details.Where(p => p.ScoreResult.Equals(3) || p.ScoreResult.Equals(4)).ToList();
|
||||
foreach (var detail in mayBeRemovedDetails)
|
||||
{
|
||||
if ((detail.ScoreResult.Equals(3) && prevFilteredDetailOrgIds.Contains(detail.OrgId))
|
||||
|| detail.ScoreResult.Equals(4))
|
||||
{
|
||||
// 本期及往期为黄牌或者本期为红牌的,进行除名
|
||||
var org = await _orgRep.FirstOrDefaultAsync(p => p.Id.Equals(detail.OrgId));
|
||||
org.Status = InspectionOrgStatus.Delisting;
|
||||
await org.UpdateIncludeAsync(new[] { nameof(BsInspectionOrg.Status) });
|
||||
revmoeCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// 新增机构数量
|
||||
var newDetailsCount = details.Where(p => (p.ScoreResult.Equals(1) || p.ScoreResult.Equals(2)) && !prevDetails.Select(p => p.OrgId).Contains(p.OrgId)).Count();
|
||||
|
||||
// 总数减去除名
|
||||
stage.OrgAmount = details.Count - revmoeCount;
|
||||
// 除名
|
||||
stage.RemovedOrgAmount = revmoeCount;
|
||||
// 新增
|
||||
stage.NewOrgAmount = newDetailsCount;
|
||||
|
||||
stage.Status = 1;
|
||||
stage.PublishTime = DateTime.Now;
|
||||
await stage.UpdateAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Api/Ewide.Application/Startup.cs
Normal file
30
Api/Ewide.Application/Startup.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Furion;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Linq;
|
||||
|
||||
namespace Ewide.Application
|
||||
{
|
||||
public class Startup : AppStartup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
//services.AddSqlSugar(new ConnectionConfig
|
||||
//{
|
||||
// ConnectionString = App.Configuration["ConnectionStrings:DefaultConnection"],
|
||||
// DbType = DbType.Sqlite,
|
||||
// IsAutoCloseConnection = true,
|
||||
// InitKeyType = InitKeyType.Attribute
|
||||
//},
|
||||
//db =>
|
||||
//{
|
||||
// // db.DbMaintenance.CreateDatabase();
|
||||
// // db.CodeFirst.SetStringDefaultLength(200).InitTables(typeof(Test));
|
||||
|
||||
// db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
// {
|
||||
// App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));
|
||||
// };
|
||||
//});
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Api/Ewide.Application/applicationsettings.json
Normal file
3
Api/Ewide.Application/applicationsettings.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
||||
100
Api/HouseSafety.sln
Normal file
100
Api/HouseSafety.sln
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31424.327
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ewide.Application", "Ewide.Application\Ewide.Application.csproj", "{68773592-648C-487D-B68B-33E017A37EC6}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ewide.Core", "..\EwideCore\Api\Ewide.Core\Ewide.Core.csproj", "{07C08564-894E-43CE-9981-FE78E2BE3BE0}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ewide.Database.Migrations", "..\EwideCore\Api\Ewide.Database.Migrations\Ewide.Database.Migrations.csproj", "{ADFE4B2B-B396-4A19-85D5-AACD6530D94D}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ewide.EntityFramework.Core", "..\EwideCore\Api\Ewide.EntityFramework.Core\Ewide.EntityFramework.Core.csproj", "{D2F59ABE-62DE-4C5C-A104-4A2275ECD9CB}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ewide.Test", "..\EwideCore\Api\Ewide.Test\Ewide.Test.csproj", "{27696F6B-F895-4A7B-B47C-777D83259DAA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ewide.Web.Core", "..\EwideCore\Api\Ewide.Web.Core\Ewide.Web.Core.csproj", "{9BF809F4-3219-4B03-8DD9-E7B174DA2041}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ewide.Web.Entry", "..\EwideCore\Api\Ewide.Web.Entry\Ewide.Web.Entry.csproj", "{D5D2CF2B-BD26-4C40-930A-CCBC30479520}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Furion", "Furion", "{B77F1834-B24B-439F-B828-8621138C560F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Furion", "..\EwideCore\Api\Furion\framework\Furion\Furion.csproj", "{E9570EF7-C1D5-4C4E-8FC9-26AB598FF2A2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Furion.Extras.Authentication.JwtBearer", "..\EwideCore\Api\Furion\framework\Furion.Extras.Authentication.JwtBearer\Furion.Extras.Authentication.JwtBearer.csproj", "{8AB345D4-0EEC-4017-BED4-0DFFF696D8B3}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Furion.Extras.DatabaseAccessor.Dapper", "..\EwideCore\Api\Furion\framework\Furion.Extras.DatabaseAccessor.Dapper\Furion.Extras.DatabaseAccessor.Dapper.csproj", "{EC8E2F6A-87C9-4369-8E00-7AE74BBA53C7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Furion.Extras.Logging.Serilog", "..\EwideCore\Api\Furion\framework\Furion.Extras.Logging.Serilog\Furion.Extras.Logging.Serilog.csproj", "{EF6EF253-94D0-4143-A763-3813922F43A2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Furion.Extras.ObjectMapper.Mapster", "..\EwideCore\Api\Furion\framework\Furion.Extras.ObjectMapper.Mapster\Furion.Extras.ObjectMapper.Mapster.csproj", "{35C3B1E9-1291-4B54-99C7-0849FB02569B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{68773592-648C-487D-B68B-33E017A37EC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{68773592-648C-487D-B68B-33E017A37EC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{68773592-648C-487D-B68B-33E017A37EC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{68773592-648C-487D-B68B-33E017A37EC6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{07C08564-894E-43CE-9981-FE78E2BE3BE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{07C08564-894E-43CE-9981-FE78E2BE3BE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{07C08564-894E-43CE-9981-FE78E2BE3BE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{07C08564-894E-43CE-9981-FE78E2BE3BE0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{ADFE4B2B-B396-4A19-85D5-AACD6530D94D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{ADFE4B2B-B396-4A19-85D5-AACD6530D94D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ADFE4B2B-B396-4A19-85D5-AACD6530D94D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ADFE4B2B-B396-4A19-85D5-AACD6530D94D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D2F59ABE-62DE-4C5C-A104-4A2275ECD9CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D2F59ABE-62DE-4C5C-A104-4A2275ECD9CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D2F59ABE-62DE-4C5C-A104-4A2275ECD9CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D2F59ABE-62DE-4C5C-A104-4A2275ECD9CB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{27696F6B-F895-4A7B-B47C-777D83259DAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{27696F6B-F895-4A7B-B47C-777D83259DAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{27696F6B-F895-4A7B-B47C-777D83259DAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{27696F6B-F895-4A7B-B47C-777D83259DAA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9BF809F4-3219-4B03-8DD9-E7B174DA2041}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9BF809F4-3219-4B03-8DD9-E7B174DA2041}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9BF809F4-3219-4B03-8DD9-E7B174DA2041}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9BF809F4-3219-4B03-8DD9-E7B174DA2041}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D5D2CF2B-BD26-4C40-930A-CCBC30479520}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D5D2CF2B-BD26-4C40-930A-CCBC30479520}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D5D2CF2B-BD26-4C40-930A-CCBC30479520}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D5D2CF2B-BD26-4C40-930A-CCBC30479520}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E9570EF7-C1D5-4C4E-8FC9-26AB598FF2A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E9570EF7-C1D5-4C4E-8FC9-26AB598FF2A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E9570EF7-C1D5-4C4E-8FC9-26AB598FF2A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E9570EF7-C1D5-4C4E-8FC9-26AB598FF2A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8AB345D4-0EEC-4017-BED4-0DFFF696D8B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8AB345D4-0EEC-4017-BED4-0DFFF696D8B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8AB345D4-0EEC-4017-BED4-0DFFF696D8B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8AB345D4-0EEC-4017-BED4-0DFFF696D8B3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EC8E2F6A-87C9-4369-8E00-7AE74BBA53C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EC8E2F6A-87C9-4369-8E00-7AE74BBA53C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EC8E2F6A-87C9-4369-8E00-7AE74BBA53C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EC8E2F6A-87C9-4369-8E00-7AE74BBA53C7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EF6EF253-94D0-4143-A763-3813922F43A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EF6EF253-94D0-4143-A763-3813922F43A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EF6EF253-94D0-4143-A763-3813922F43A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EF6EF253-94D0-4143-A763-3813922F43A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{35C3B1E9-1291-4B54-99C7-0849FB02569B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{35C3B1E9-1291-4B54-99C7-0849FB02569B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35C3B1E9-1291-4B54-99C7-0849FB02569B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{35C3B1E9-1291-4B54-99C7-0849FB02569B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{E9570EF7-C1D5-4C4E-8FC9-26AB598FF2A2} = {B77F1834-B24B-439F-B828-8621138C560F}
|
||||
{8AB345D4-0EEC-4017-BED4-0DFFF696D8B3} = {B77F1834-B24B-439F-B828-8621138C560F}
|
||||
{EC8E2F6A-87C9-4369-8E00-7AE74BBA53C7} = {B77F1834-B24B-439F-B828-8621138C560F}
|
||||
{EF6EF253-94D0-4143-A763-3813922F43A2} = {B77F1834-B24B-439F-B828-8621138C560F}
|
||||
{35C3B1E9-1291-4B54-99C7-0849FB02569B} = {B77F1834-B24B-439F-B828-8621138C560F}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {ED14FD8E-FA4B-477E-A71E-E4F21A9670B1}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Reference in New Issue
Block a user