From aa958e0a141e5fbc1a97659ebeadf08cc24612e2 Mon Sep 17 00:00:00 2001
From: ky_yusj <2655568377@qq.com>
Date: Thu, 20 May 2021 16:41:33 +0800
Subject: [PATCH] =?UTF-8?q?update=20=E6=88=BF=E5=B1=8B=E7=BC=96=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Api/Ewide.Application/Entity/BsHouseInfo.cs | 408 ++++++++++++++++++
Api/Ewide.Application/Ewide.Application.xml | 325 ++++++++++++++
.../Service/HouseCode/HouseCodeService.cs | 19 +-
3 files changed, 746 insertions(+), 6 deletions(-)
create mode 100644 Api/Ewide.Application/Entity/BsHouseInfo.cs
diff --git a/Api/Ewide.Application/Entity/BsHouseInfo.cs b/Api/Ewide.Application/Entity/BsHouseInfo.cs
new file mode 100644
index 0000000..2ff75e9
--- /dev/null
+++ b/Api/Ewide.Application/Entity/BsHouseInfo.cs
@@ -0,0 +1,408 @@
+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.Entity
+{
+ public class BsHouseInfo : Core.DEntityBase
+ {
+ ///
+ /// HouseCode主键ID
+ ///
+ [Comment("HouseCode主键ID")]
+ [MaxLength(36)]
+ [Required]
+ public string NumberId { get; set; }
+
+ ///
+ /// 幢名称
+ ///
+ [Comment("幢名称")]
+ [MaxLength(255)]
+ public string BuildingName { get; set; }
+
+ ///
+ /// 土地性质
+ ///
+ [Comment("土地性质")]
+ public int? LandAttribute { get; set; }
+
+ ///
+ /// 结构类型
+ ///
+ [Comment("结构类型")]
+ public int? StructureType { get; set; }
+
+ ///
+ /// 基础情况
+ ///
+ [Comment("基础情况")]
+ public int? BaseInfo { get; set; }
+
+ ///
+ /// 抗震等级
+ ///
+ [Comment("抗震等级")]
+ public int? SeismicGrade { get; set; }
+
+ ///
+ /// 竣工日期
+ ///
+ [Comment("竣工日期")]
+ public DateTime? CompletedDate { get; set; }
+
+ ///
+ /// 设计使用年限
+ ///
+ [Comment("设计使用年限")]
+ public int? UsefulYear { get; set; }
+
+ ///
+ /// 总层数
+ ///
+ [Comment("总层数")]
+ public int? TotalFloor { get; set; }
+
+ ///
+ /// 地上层数
+ ///
+ [Comment("地上层数")]
+ public int? LandFloorCount { get; set; }
+
+ ///
+ /// 地上商业层数开始
+ ///
+ [Comment("地上商业层数开始")]
+ public int? LandBsFloorStart { get; set; }
+
+ ///
+ /// 地上商业层数结束
+ ///
+ [Comment("地上商业层数结束")]
+ public int? LandBsFloorEnd { get; set; }
+
+ ///
+ /// 地上车棚层开始
+ ///
+ [Comment("地上车棚层开始")]
+ public int? LandBikeFloorStart { get; set; }
+
+ ///
+ /// 地上住宅层开始
+ ///
+ [Comment("地上住宅层开始")]
+ public int? LandResidenceFloorStart { get; set; }
+
+ ///
+ /// 地上住宅层结束
+ ///
+ [Comment("地上住宅层结束")]
+ public int? LandResidenceFloorEnd { get; set; }
+
+ ///
+ /// 地下层数
+ ///
+ [Comment("地下层数")]
+ public int? UnderFloorCount { get; set; }
+
+ ///
+ /// 总建筑面积
+ ///
+ [Comment("总建筑面积")]
+ public float? TotalArea { get; set; }
+
+ ///
+ /// 有无建筑幕墙
+ ///
+ [Comment("有无建筑幕墙")]
+ public int? CurtainWall { get; set; }
+
+ ///
+ /// 有无面砖
+ ///
+ [Comment("有无面砖")]
+ public int? FaceBrick { get; set; }
+
+ ///
+ /// 有无涂料
+ ///
+ [Comment("有无涂料")]
+ public int? Coating { get; set; }
+
+ ///
+ /// 有无粉刷
+ ///
+ [Comment("有无粉刷")]
+ public int? Painting { get; set; }
+
+ ///
+ /// 电梯
+ ///
+ [Comment("电梯")]
+ public string Elevator { get; set; }
+
+ ///
+ /// 总户数(户)
+ ///
+ [Comment("总户数(户)")]
+ public int? HouseHolds { get; set; }
+
+ ///
+ /// 房屋单元数
+ ///
+ [Comment("房屋单元数")]
+ public int? Units { get; set; }
+
+ ///
+ /// 各单元每层户数(户)
+ ///
+ [Comment("各单元每层户数(户)")]
+ public int? UnitFloorHolds { get; set; }
+
+ ///
+ /// 建设单位ID
+ ///
+ [Comment("建设单位ID")]
+ public string BuildingUnitId { get; set; }
+
+ ///
+ /// 设计单位ID
+ ///
+ [Comment("设计单位ID")]
+ public string DesingerUnitId { get; set; }
+
+ ///
+ /// 施工单位ID
+ ///
+ [Comment("施工单位ID")]
+ public string ConstructionUnitId { get; set; }
+
+ ///
+ /// 监理单位ID
+ ///
+ [Comment("监理单位ID")]
+ public string MonitorUnitId { get; set; }
+
+ ///
+ /// 产权性质
+ ///
+ [Comment("产权性质")]
+ public string PropertyRights { get; set; }
+
+ ///
+ /// 总共套数
+ ///
+ [Comment("总共套数")]
+ public int? HouseCount { get; set; }
+
+ ///
+ /// 直管公房套数
+ ///
+ [Comment("直管公房套数")]
+ public int? StraightHouseCount { get; set; }
+
+ ///
+ /// 自管公房套数
+ ///
+ [Comment("自管公房套数")]
+ public int? SelfHouseCount { get; set; }
+
+ ///
+ /// 私房套数
+ ///
+ [Comment("私房套数")]
+ public int? PrivateHouseCount { get; set; }
+
+ ///
+ /// 商品房套数
+ ///
+ [Comment("商品房套数")]
+ public int? BusinessCount { get; set; }
+
+ ///
+ /// 房改房套数
+ ///
+ [Comment("房改房套数")]
+ public int? ChangeHouseCount { get; set; }
+
+ ///
+ /// 拆迁安置房套数
+ ///
+ [Comment("拆迁安置房套数")]
+ public int? ResettlementHouseCount { get; set; }
+
+ ///
+ /// 其它套数
+ ///
+ [Comment("其它套数")]
+ public int? OtherCount { get; set; }
+
+ ///
+ /// 产权单位ID
+ ///
+ [Comment("产权单位ID")]
+ public string PropertyUnitId { get; set; }
+
+ ///
+ /// 物业单位ID
+ ///
+ [Comment("物业单位ID")]
+ public string WuYeUnitId { get; set; }
+
+ ///
+ /// 房屋场地
+ ///
+ [Comment("房屋场地")]
+ public string HouseSite { get; set; }
+
+ ///
+ /// 相邻施工
+ ///
+ [Comment("相邻施工")]
+ public string AdjacentConstruction { get; set; }
+
+ ///
+ /// 化学侵蚀
+ ///
+ [Comment("化学侵蚀")]
+ public string ChemicalErosion { get; set; }
+
+ ///
+ /// 结构拆改
+ ///
+ [Comment("结构拆改")]
+ public int? StructuralDismantling { get; set; }
+
+ ///
+ /// 加层改造
+ ///
+ [Comment("加层改造")]
+ public int? AddingLayer { get; set; }
+
+ ///
+ /// 修缮加固
+ ///
+ [Comment("修缮加固")]
+ public string RepairAndReinforce { get; set; }
+
+ ///
+ /// 历史灾害
+ ///
+ [Comment("历史灾害")]
+ public string HistoricalCalamity { get; set; }
+
+ ///
+ /// 使用功能变更
+ ///
+ [Comment("使用功能变更")]
+ public string FunctionalChange { get; set; }
+
+ ///
+ /// 其他调查内容
+ ///
+ [Comment("其他调查内容")]
+ public string OtherContents { get; set; }
+
+ ///
+ /// 图纸资料存档处
+ ///
+ [Comment("图纸资料存档处")]
+ public string DrawingMaterial { get; set; }
+
+ ///
+ /// 其他图纸存档
+ ///
+ [Comment("其他图纸存档")]
+ public string DrawingMaterialText { get; set; }
+
+ ///
+ /// 立项文件
+ ///
+ [Comment("立项文件")]
+ public string AnEntryDocument { get; set; }
+
+ ///
+ /// 规划许可
+ ///
+ [Comment("规划许可")]
+ public string PlanningPermission { get; set; }
+
+ ///
+ /// 竣工验收备案
+ ///
+ [Comment("竣工验收备案")]
+ public string CompletionRecord { get; set; }
+
+ ///
+ /// 监理资料
+ ///
+ [Comment("监理资料")]
+ public string MonitorDocument { get; set; }
+
+ ///
+ /// 鉴定报告
+ ///
+ [Comment("鉴定报告")]
+ public string IdentificationReport { get; set; }
+
+ ///
+ /// 其它资料
+ ///
+ [Comment("其它资料")]
+ public string OtherDocument { get; set; }
+
+ ///
+ /// 外立面照片
+ ///
+ [Comment("外立面照片")]
+ public string FacadePhoto { get; set; }
+
+ ///
+ /// 房屋等级 1,2,3,4,C,d
+ ///
+ [Comment("房屋等级 1,2,3,4,C,d")]
+ public int? HouseLevel { get; set; }
+
+ ///
+ /// 房屋使用状态
+ ///
+ [Comment("房屋使用状态")]
+ public int? UsedStatus { get; set; }
+
+ ///
+ /// 1、待建档(需要建档的数据未暂存未保存的)2、暂存(点击了暂存的数据)3、待提交(点击了保存的数据) 4、退回(审核被退回的数据)5、审核中6、审核通过
+ ///
+ [Comment("1、待建档(需要建档的数据未暂存未保存的)2、暂存(点击了暂存的数据)3、待提交(点击了保存的数据) 4、退回(审核被退回的数据)5、审核中6、审核通过")]
+ [Required]
+ public int State { get; set; }
+
+ ///
+ /// 调查登记机构
+ ///
+ [Comment("调查登记机构")]
+ public string InvestigateAgency { get; set; }
+
+ ///
+ /// 纸质资料调查人
+ ///
+ [Comment("纸质资料调查人")]
+ public string InvestigateUser { get; set; }
+
+ ///
+ /// 纸质资料审核人
+ ///
+ [Comment("纸质资料审核人")]
+ public string OfflineAuditor { get; set; }
+
+ ///
+ /// 主管部门
+ ///
+ [Comment("主管部门")]
+ public string CompetentDepartment { get; set; }
+
+ }
+}
diff --git a/Api/Ewide.Application/Ewide.Application.xml b/Api/Ewide.Application/Ewide.Application.xml
index 0a3cbc6..335e000 100644
--- a/Api/Ewide.Application/Ewide.Application.xml
+++ b/Api/Ewide.Application/Ewide.Application.xml
@@ -4,6 +4,331 @@
Ewide.Application
+
+
+ HouseCode主键ID
+
+
+
+
+ 幢名称
+
+
+
+
+ 土地性质
+
+
+
+
+ 结构类型
+
+
+
+
+ 基础情况
+
+
+
+
+ 抗震等级
+
+
+
+
+ 竣工日期
+
+
+
+
+ 设计使用年限
+
+
+
+
+ 总层数
+
+
+
+
+ 地上层数
+
+
+
+
+ 地上商业层数开始
+
+
+
+
+ 地上商业层数结束
+
+
+
+
+ 地上车棚层开始
+
+
+
+
+ 地上住宅层开始
+
+
+
+
+ 地上住宅层结束
+
+
+
+
+ 地下层数
+
+
+
+
+ 总建筑面积
+
+
+
+
+ 有无建筑幕墙
+
+
+
+
+ 有无面砖
+
+
+
+
+ 有无涂料
+
+
+
+
+ 有无粉刷
+
+
+
+
+ 电梯
+
+
+
+
+ 总户数(户)
+
+
+
+
+ 房屋单元数
+
+
+
+
+ 各单元每层户数(户)
+
+
+
+
+ 建设单位ID
+
+
+
+
+ 设计单位ID
+
+
+
+
+ 施工单位ID
+
+
+
+
+ 监理单位ID
+
+
+
+
+ 产权性质
+
+
+
+
+ 总共套数
+
+
+
+
+ 直管公房套数
+
+
+
+
+ 自管公房套数
+
+
+
+
+ 私房套数
+
+
+
+
+ 商品房套数
+
+
+
+
+ 房改房套数
+
+
+
+
+ 拆迁安置房套数
+
+
+
+
+ 其它套数
+
+
+
+
+ 产权单位ID
+
+
+
+
+ 物业单位ID
+
+
+
+
+ 房屋场地
+
+
+
+
+ 相邻施工
+
+
+
+
+ 化学侵蚀
+
+
+
+
+ 结构拆改
+
+
+
+
+ 加层改造
+
+
+
+
+ 修缮加固
+
+
+
+
+ 历史灾害
+
+
+
+
+ 使用功能变更
+
+
+
+
+ 其他调查内容
+
+
+
+
+ 图纸资料存档处
+
+
+
+
+ 其他图纸存档
+
+
+
+
+ 立项文件
+
+
+
+
+ 规划许可
+
+
+
+
+ 竣工验收备案
+
+
+
+
+ 监理资料
+
+
+
+
+ 鉴定报告
+
+
+
+
+ 其它资料
+
+
+
+
+ 外立面照片
+
+
+
+
+ 房屋等级 1,2,3,4,C,d
+
+
+
+
+ 房屋使用状态
+
+
+
+
+ 1、待建档(需要建档的数据未暂存未保存的)2、暂存(点击了暂存的数据)3、待提交(点击了保存的数据) 4、退回(审核被退回的数据)5、审核中6、审核通过
+
+
+
+
+ 调查登记机构
+
+
+
+
+ 纸质资料调查人
+
+
+
+
+ 纸质资料审核人
+
+
+
+
+ 主管部门
+
+
房屋编码相关
diff --git a/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs b/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs
index 5534b39..a5c5bb5 100644
--- a/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs
+++ b/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs
@@ -35,10 +35,14 @@ namespace Ewide.Application.Service.HouseCode
[HttpPost("/houseCode/add")]
public async Task AddHouseCode(AddHouseCodeInput input)
{
+ var houseProjectInfoRep = Db.GetRepository();
+ var houseProject = await houseProjectInfoRep.FirstOrDefaultAsync(p => p.Id == input.ProjectId);
+ if (houseProject == null) throw Oops.Oh("项目参数有误,添加失败");
+
var areaCodeRep = Db.GetRepository();
var areaCode = await areaCodeRep.DetachedEntities.FirstOrDefaultAsync(a => a.Code == input.AreaCode && a.LevelType == 4);
if(areaCode == null) throw Oops.Oh("区域编码有误,添加失败");
- input.HouseCode = areaCode.AdCode + input.No.ToString().PadLeft(3, '0');
+ input.HouseCode = areaCode.AdCode + houseProject.Sort.ToString().PadLeft(3, '0') + input.No.ToString().PadLeft(3, '0');
var houseCode = input.Adapt();
var isExist = await _houseCodeRep.AnyAsync(p => p.HouseCode == houseCode.HouseCode);
if (isExist) throw Oops.Oh("房屋编码已存在,不可重复添加");
@@ -73,17 +77,20 @@ LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) WHERE HC.Address
///
/// 获取同一区域下的下一个编号
///
- ///
+ ///
///
[HttpGet("/houseCode/GetNextNoByFullNumber")]
- public async Task GetNextNoByFullNumber([Required] string areaCode)
+ public async Task GetNextNoByFullNumber([Required] string projectId)
{
var areaCodeRep = Db.GetRepository();
+ var houseProjectInfoRep = Db.GetRepository();
+ var houseProject = await houseProjectInfoRep.FirstOrDefaultAsync(p => p.Id == projectId);
+ if(houseProject == null) throw Oops.Oh("项目参数有误,房屋编码生成失败");
//取到社区编码
- var commAreaCode = await areaCodeRep.FirstOrDefaultAsync(a => a.Code == areaCode && a.LevelType == 4);
- if(commAreaCode == 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))
+ .Where(h => h.HouseCode.Contains(commAreaCode.AdCode + houseProject.Sort.ToString().PadLeft(3, '0')))
.MaxAsync(h => (int?)h.No);
return maxNo.GetValueOrDefault(0) + 1;
}