update 前端数据

This commit is contained in:
路 范
2021-09-10 15:08:18 +08:00
parent 7a7ccf4afd
commit 36302d2b84
18 changed files with 110 additions and 55 deletions

View File

@@ -27,6 +27,8 @@ namespace Ewide.NbzsZheliban.Entity.Extends
}
public class H5IndexModel
{
public string UserName { get; set; }
public string IdCard { get; set; }
/// <summary>
/// 项目信息
/// </summary>

View File

@@ -18,7 +18,7 @@ using System.Threading.Tasks;
namespace Ewide.NbzsZheliban.Service
{
[ApiDescriptionSettings(Name = "数据接口")]
public class DataService : BaseService
public class DataService : Furion.DynamicApiController.IDynamicApiController///: BaseService
{
private readonly ISqlSugarRepository repository;
private readonly SqlSugarClient db;
@@ -90,6 +90,7 @@ namespace Ewide.NbzsZheliban.Service
throw Oops.Oh($"ticket接口返回值有误,[{tickerRsltStr}]");
var cardno = userinfoObj["idnum"].ToString();
var username = userinfoObj["username"].ToString();
#endregion
//var cardno = args.GetJsonValue("cardno", isThrowExp: true);
//住宅调查表
@@ -113,7 +114,9 @@ namespace Ewide.NbzsZheliban.Service
});
H5IndexModel h5IndexModel = new()
{
PrjList = list_projects
PrjList = list_projects,
IdCard = cardno,
UserName = username
};
return h5IndexModel;
}
@@ -122,5 +125,43 @@ namespace Ewide.NbzsZheliban.Service
throw Oops.Oh("无效访问");
}
}
/// <summary>
/// 被征收人关联的项目列表
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
[HttpPost("/project/list2")]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public async Task<dynamic> PrjList2([FromBody] JObject args)
{
var cardno = "341203199206303411";
//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 + " ); ");
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;
}
}
}