add 接口代码

This commit is contained in:
路 范
2021-09-07 17:42:30 +08:00
parent ae17583411
commit 5807fbf9fe
21 changed files with 2073 additions and 16 deletions

View File

@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
//using System.Data.Entity.ModelConfiguration;
using Ewide.NbzsZheliban.Entity;
using System.Runtime.Serialization;
namespace Ewide.WorkOrderSys.Entity
namespace Ewide.NbzsZheliban.Entity
{
/// <summary>
/// 数据表实体类InvestigateTable

View File

@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
//using System.Data.Entity.ModelConfiguration;
using Ewide.NbzsZheliban.Entity;
using System.Runtime.Serialization;
namespace Ewide.WorkOrderSys.Entity
namespace Ewide.NbzsZheliban.Entity
{
/// <summary>
/// 数据表实体类InvestigateTable_Assessment

View File

@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
//using System.Data.Entity.ModelConfiguration;
using Ewide.NbzsZheliban.Entity;
using System.Runtime.Serialization;
namespace Ewide.WorkOrderSys.Entity
namespace Ewide.NbzsZheliban.Entity
{
/// <summary>
/// 数据表实体类NonInvestigateTable_Assessment

View File

@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
//using System.Data.Entity.ModelConfiguration;
using Ewide.NbzsZheliban.Entity;
using System.Runtime.Serialization;
namespace Ewide.WorkOrderSys.Entity
namespace Ewide.NbzsZheliban.Entity
{
/// <summary>
/// 数据表实体类NonResidentialAgreement

View File

@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
//using System.Data.Entity.ModelConfiguration;
using Ewide.NbzsZheliban.Entity;
using System.Runtime.Serialization;
namespace Ewide.WorkOrderSys.Entity
namespace Ewide.NbzsZheliban.Entity
{
/// <summary>
/// 数据表实体类NonResidentialInvestigateTable

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
//using System.Data.Entity.ModelConfiguration;
using Ewide.NbzsZheliban.Entity;
using System.Runtime.Serialization;
namespace Ewide.WorkOrderSys.Entity
namespace Ewide.NbzsZheliban.Entity
{
/// <summary>
/// 数据表实体类ResidentialAgreement

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ewide.NbzsZheliban.Entity.Extends
{
public class Dcbs
{
public string dcbId { get; set; }
public string PrjId { get; set; }
}
public class Fhpgs
{
public string PrjId { get; set; }
public string AssessmentNo { get; set; }
public string HouseAddress { get; set; }
public string countValue { get; set; }
}
public class Bcxy
{
public string PrjId { get; set; }
public string XyNo { get; set; }
public string HouseAddress { get; set; }
public string SummationShouldCompensateMoney { get; set; }
}
public class H5IndexModel
{
/// <summary>
/// 项目信息
/// </summary>
public List<H5IndexPrjModel> PrjList { get; set; }
}
public class H5IndexPrjModel
{
public string PrjId { get; set; }
/// <summary>
/// 区域
/// </summary>
public string Area { get; set; }
/// <summary>
/// 征收部门
/// </summary>
public string zsbm { get; set; }
/// <summary>
/// 年份
/// </summary>
public decimal? Year { get; set; }
/// <summary>
/// 征收决定号
/// </summary>
public string Zsjdh { get; set; }
/// <summary>
/// 当前阶段
/// </summary>
public string CurrentState { get; set; }
/// <summary>
/// 分户评估集合
/// </summary>
public object FhpgList { get; set; }
/// <summary>
/// 补偿协议集合
/// </summary>
public object BcxyList { get; set; }
}
}

View File

@@ -11,6 +11,7 @@

View File

@@ -16,7 +16,7 @@
string tableClass="";
//所有表名称
//string sqlGetTable = "SELECT Name FROM SysObjects Where XType='U' ORDER BY Name";
DataTable dt = GetDataTable(new List<string> { "InvestigateTable","NonResidentialInvestigateTable","InvestigateTable_Assessment","NonInvestigateTable_Assessment","NonResidentialAgreement","ResidentialAgreement" });
DataTable dt = GetDataTable(new List<string> { "Projects","InvestigateTable","NonResidentialInvestigateTable","InvestigateTable_Assessment","NonInvestigateTable_Assessment","NonResidentialAgreement","ResidentialAgreement" });
//DataTable dtRelationTable = GetRelationTable();
//所有表信息
string selectQuery ="select syscolumns.name,systypes.name,syscolumns.length from syscolumns,systypes where syscolumns.xusertype=systypes.xusertype and syscolumns.id=object_id('@tableName')";
@@ -43,7 +43,7 @@ using System.ComponentModel.DataAnnotations.Schema;
//using System.Data.Entity.ModelConfiguration;
using Ewide.NbzsZheliban.Entity;
using System.Runtime.Serialization;
namespace Ewide.WorkOrderSys.Entity
namespace Ewide.NbzsZheliban.Entity
{
/// <summary>
/// 数据表实体类:<#= tableClass #>
@@ -173,6 +173,7 @@ using System.Runtime.Serialization;
case "bigint":
type="long";
break;
case "numeric":
case "real":
case "decimal":
type="decimal"+(nullable=="1"?"?":"");

View File

@@ -27,8 +27,4 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Entity\DataBase\" />
</ItemGroup>
</Project>

View File

@@ -1,4 +1,6 @@
using Ewide.NbzsZheliban.Tools;
using Ewide.NbzsZheliban.Entity;
using Ewide.NbzsZheliban.Entity.Extends;
using Ewide.NbzsZheliban.Tools;
using Furion.JsonSerialization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
@@ -32,9 +34,31 @@ namespace Ewide.NbzsZheliban.Service
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public async Task<dynamic> PrjList([FromBody] JObject args)
{
var cardno = args.GetJsonIntValue("cardno", isThrowExp: true);
var cardno = args.GetJsonValue("cardno", isThrowExp: true);
//住宅调查表
var list_zz_dcb = await db.Ado.SqlQueryAsync<Dcbs>("select ID dcbId,ProjectId PrjId from InvestigateTable b where b.ExpropriatedCardNo=@ExpropriatedCardNo", new List<SugarParameter> { new SugarParameter("ExpropriatedCardNo", cardno, System.Data.DbType.String) }.ToArray());
//非住宅调查表
var list_fzz_dcb = await db.Ado.SqlQueryAsync<Dcbs>("select ID dcbId,ProjectId PrjId from NonResidentialInvestigateTable b where b.PropertyRightCardNo=@ExpropriatedCardNo", new List<SugarParameter> { new SugarParameter("ExpropriatedCardNo", cardno, System.Data.DbType.String) }.ToArray());
//调查表集合
var list_dcbs = list_zz_dcb.Concat(list_fzz_dcb);
//项目列表
var list_projects = await db.Ado.SqlQueryAsync<H5IndexPrjModel>("select a.ID Prjid,a.area,a.HouseAcquisitionDepartment as zsbm,a.CollectDecisionNo1 as year,(isnull(a.CollectDecisionNoHeadName,'')+'['+cast(a.CollectDecisionNo1 as varchar)+']'+ isnull(cast(a.CollectDecisionNo2 as varchar),'')+'号') zsjdh,dbo.get_current_state(a.ID) CurrentState from Projects a where ID in ('" + string.Join("','", list_dcbs.Select(p => p.PrjId)) + "') ");
//分户评估
var InvestigateTableID_param = "'" + string.Join("','", list_dcbs.Select(p => p.dcbId)) + "'";
var list_fhpgs = await db.Ado.SqlQueryAsync<Fhpgs>("select e.ProjectId as PrjId ,d.AssessmentNo,e.HouseAddress,d.countValue from InvestigateTable_Assessment d inner join InvestigateTable e on d.InvestigateTableId=e.ID where d.InvestigateTableID in ( " + InvestigateTableID_param + " ) union all select e.ProjectId as PrjId ,AssessmentNo, e.HouseAddress, d.countValue from NonInvestigateTable_Assessment d inner join NonResidentialInvestigateTable e on d.NonInvestigateTableID = e.ID where d.NonInvestigateTableID in ( " + InvestigateTableID_param + " ) ;");
//补偿协议
var list_bcxys = await db.Ado.SqlQueryAsync<Bcxy>("select isnull(d.CollectDecisionNoHeadName,'')+isnull(d.No1,'')+'-'+isnull(d.No2,'')+(case when (d.No3 is null or d.No3 = '') then '' else ('-'+d.No3) end ) XyNo,d.SwitchProductionWay,e.HouseAddress,d.SummationShouldCompensateMoney,e.ProjectId as PrjId from ResidentialAgreement d inner join InvestigateTable e on d.InvestigateTableId=e.ID where d.InvestigateTableID in ( " + InvestigateTableID_param + " ) union all select isnull(d.CollectDecisionNoHeadName, '') + isnull(d.No2, '') + '-' + isnull(d.No3, '') XyNo , d.SwitchProductionWay, e.HouseAddress, d.SummationShouldCompensateMoney, e.ProjectId as PrjId from NonResidentialAgreement d inner join NonResidentialInvestigateTable e on d.NonInvestigateTableID = e.ID where d.NonInvestigateTableID in ( " + InvestigateTableID_param + " ); ");
return null;
list_projects.ForEach(p =>
{
p.FhpgList = list_fhpgs.Where(a => a.PrjId == p.PrjId);
p.BcxyList = list_bcxys.Where(a => a.PrjId == p.PrjId);
});
H5IndexModel h5IndexModel = new()
{
PrjList = list_projects
};
return h5IndexModel;
}
}
}

View File

@@ -1 +1 @@
7b799cc3db7328fbe695e7ddc36b67be20033025
e18cbf8e59bc83ce9fd9daee67e8ec04308bbafb