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);
//住宅调查表
@@ -106,6 +107,50 @@ namespace Ewide.NbzsZheliban.Service
//补偿协议
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,
IdCard = cardno,
UserName = username
};
return h5IndexModel;
}
else
{
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);
@@ -116,11 +161,7 @@ namespace Ewide.NbzsZheliban.Service
PrjList = list_projects
};
return h5IndexModel;
}
else
{
throw Oops.Oh("无效访问");
}
}
}
}

View File

@@ -257,28 +257,63 @@ export default {
name: "home",
data() {
return {
user: {
name: "胡伯钧",
identityId: "3302041982893743782",
},
project: {
name: "曙光一村地块",
apidata: {
success: true,
code: 200,
message: "请求成功",
data: {
prjList: [
{
prjId: "936d98a8-2c8f-410f-b126-68a7568f60c4",
area: "海曙区",
department: "宁海县房屋征收管理中心",
year: "2019",
num: "海政发2021】28号",
zsbm: "宁波市海曙区房屋征收管理服务中心",
year: 2021.0,
zsjdh: "海政发[2021]513号",
currentState: "项目报结",
fhpgList: [
{
prjId: "936d98a8-2c8f-410f-b126-68a7568f60c4",
assessmentNo: "0513",
houseAddress: "高桥镇",
countValue: "137654.00",
},
assess: {
num: "044",
address: "宁波市江北区泗洲街16号404",
amount: "180234",
],
bcxyList: [
{
prjId: "936d98a8-2c8f-410f-b126-68a7568f60c4",
xyNo: "海政发2021513-0513-1",
houseAddress: "高桥镇",
summationShouldCompensateMoney: "137654.00",
},
retrievalProtocol: {
num: "044",
address: "宁波市江北区泗洲街16号404",
compensation: "产权调换",
amount: "180234",
],
},
],
},
extras: null,
timestamp: 1631256680049,
},
// user: {
// name: "加载中...",
// identityId: "加载中...",
// },
// project: {
// name: "加载中...",
// area: "加载中...",
// department: "加载中...",
// year: "加载中...",
// num: "加载中...",
// },
// assess: {
// num: "",
// address: "加载中...",
// amount: "加载中...",
// },
// retrievalProtocol: {
// num: "",
// address: "加载中...",
// compensation: "加载中...",
// amount: "0",
// },
total: "8",
list: [
{
@@ -302,46 +337,23 @@ export default {
],
loading: false,
finished: true,
// user: {
// avatar: '',
// name: '',
// role: '',
// account: '',
// mobile: '',
// deptName: '',
// },
// statistics: {
// new: 0, // 新建项目总数
// signing: 0, // 正在签约项目总数
// signed: 0, // 已签约项目总数
// },
};
},
created() {
this.onInit();
},
methods: {
onLoad() {
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
// setTimeout(() => {
// for (let i = 0; i < 3; i++) {
// this.list.push(this.list.length + 1);
// }
// // 加载状态结束
// this.loading = false;
// // 数据全部加载完成
// if (this.list.length >= 3) {
// this.finished = true;
// }
// }, 1000);
},
onLoad() {},
onInit() {
debugger;
// this.onLogin();
//获取当前数据
var prjdata = apis.getprjdata({ ticket: this.$route.query.ticket });
console.log(prjdata);
// apis.getprjdata({ ticket: this.$route.query.ticket }).then((prjdata) => {
// debugger;
// console.log(prjdata);
// this.user.name = prjdata.data.UserName;
// this.user.identityId = prjdata.data.IdCard;
// });
},
onLogin() {
// this.loading = true;