add 接口代码
This commit is contained in:
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
//using System.Data.Entity.ModelConfiguration;
|
//using System.Data.Entity.ModelConfiguration;
|
||||||
using Ewide.NbzsZheliban.Entity;
|
using Ewide.NbzsZheliban.Entity;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
namespace Ewide.WorkOrderSys.Entity
|
namespace Ewide.NbzsZheliban.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据表实体类:InvestigateTable
|
/// 数据表实体类:InvestigateTable
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
//using System.Data.Entity.ModelConfiguration;
|
//using System.Data.Entity.ModelConfiguration;
|
||||||
using Ewide.NbzsZheliban.Entity;
|
using Ewide.NbzsZheliban.Entity;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
namespace Ewide.WorkOrderSys.Entity
|
namespace Ewide.NbzsZheliban.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据表实体类:InvestigateTable_Assessment
|
/// 数据表实体类:InvestigateTable_Assessment
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
//using System.Data.Entity.ModelConfiguration;
|
//using System.Data.Entity.ModelConfiguration;
|
||||||
using Ewide.NbzsZheliban.Entity;
|
using Ewide.NbzsZheliban.Entity;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
namespace Ewide.WorkOrderSys.Entity
|
namespace Ewide.NbzsZheliban.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据表实体类:NonInvestigateTable_Assessment
|
/// 数据表实体类:NonInvestigateTable_Assessment
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
//using System.Data.Entity.ModelConfiguration;
|
//using System.Data.Entity.ModelConfiguration;
|
||||||
using Ewide.NbzsZheliban.Entity;
|
using Ewide.NbzsZheliban.Entity;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
namespace Ewide.WorkOrderSys.Entity
|
namespace Ewide.NbzsZheliban.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据表实体类:NonResidentialAgreement
|
/// 数据表实体类:NonResidentialAgreement
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
//using System.Data.Entity.ModelConfiguration;
|
//using System.Data.Entity.ModelConfiguration;
|
||||||
using Ewide.NbzsZheliban.Entity;
|
using Ewide.NbzsZheliban.Entity;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
namespace Ewide.WorkOrderSys.Entity
|
namespace Ewide.NbzsZheliban.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据表实体类:NonResidentialInvestigateTable
|
/// 数据表实体类:NonResidentialInvestigateTable
|
||||||
|
|||||||
1956
Ewide.NbzsZheliban/Entity/DataBase/Projects.cs
Normal file
1956
Ewide.NbzsZheliban/Entity/DataBase/Projects.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
//using System.Data.Entity.ModelConfiguration;
|
//using System.Data.Entity.ModelConfiguration;
|
||||||
using Ewide.NbzsZheliban.Entity;
|
using Ewide.NbzsZheliban.Entity;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
namespace Ewide.WorkOrderSys.Entity
|
namespace Ewide.NbzsZheliban.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据表实体类:ResidentialAgreement
|
/// 数据表实体类:ResidentialAgreement
|
||||||
|
|||||||
67
Ewide.NbzsZheliban/Entity/Extends/H5IndexPrjModel.cs
Normal file
67
Ewide.NbzsZheliban/Entity/Extends/H5IndexPrjModel.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
string tableClass="";
|
string tableClass="";
|
||||||
//所有表名称
|
//所有表名称
|
||||||
//string sqlGetTable = "SELECT Name FROM SysObjects Where XType='U' ORDER BY Name";
|
//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();
|
//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')";
|
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 System.Data.Entity.ModelConfiguration;
|
||||||
using Ewide.NbzsZheliban.Entity;
|
using Ewide.NbzsZheliban.Entity;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
namespace Ewide.WorkOrderSys.Entity
|
namespace Ewide.NbzsZheliban.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据表实体类:<#= tableClass #>
|
/// 数据表实体类:<#= tableClass #>
|
||||||
@@ -173,6 +173,7 @@ using System.Runtime.Serialization;
|
|||||||
case "bigint":
|
case "bigint":
|
||||||
type="long";
|
type="long";
|
||||||
break;
|
break;
|
||||||
|
case "numeric":
|
||||||
case "real":
|
case "real":
|
||||||
case "decimal":
|
case "decimal":
|
||||||
type="decimal"+(nullable=="1"?"?":"");
|
type="decimal"+(nullable=="1"?"?":"");
|
||||||
|
|||||||
@@ -27,8 +27,4 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Entity\DataBase\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -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 Furion.JsonSerialization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
@@ -32,9 +34,31 @@ namespace Ewide.NbzsZheliban.Service
|
|||||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||||
public async Task<dynamic> PrjList([FromBody] JObject args)
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
7b799cc3db7328fbe695e7ddc36b67be20033025
|
e18cbf8e59bc83ce9fd9daee67e8ec04308bbafb
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
12
sql/get_current_state.txt
Normal file
12
sql/get_current_state.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
if exists(select * from sys.objects where name='get_current_state')
|
||||||
|
drop function get_current_state;
|
||||||
|
go
|
||||||
|
create function get_current_state(@projectid uniqueidentifier)
|
||||||
|
RETURNS varchar(30)
|
||||||
|
as
|
||||||
|
begin
|
||||||
|
declare @current_state varchar(30)
|
||||||
|
select top 1 @current_state = b.StepName from Projects a inner join ProjectsStep b on a.id=b.ProjectId where a.id=@projectid and StartTime<=(select GETDATE()) order by StepSort desc
|
||||||
|
return @current_state
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user