bugfix
This commit is contained in:
@@ -160,7 +160,7 @@ namespace Ewide.NbzsZheliban.Service
|
||||
/// <returns></returns>
|
||||
private async Task<List<Bcxy>> GetBCXYListAsync(IEnumerable<Dcbs> list_dcbs)
|
||||
{
|
||||
var list = _cache.Get<List<Bcxy>>("CacheData-InvestigateTable_Assessment");
|
||||
var list = _cache.Get<List<Bcxy>>("CacheData-ResidentialAgreement");
|
||||
if (list != null && list.Count > 0)
|
||||
return list.Where(p => list_dcbs.Select(p => p.dcbId).Contains(p.dcbId)).ToList();
|
||||
else
|
||||
@@ -172,6 +172,9 @@ namespace Ewide.NbzsZheliban.Service
|
||||
}
|
||||
private async Task<H5IndexModel> GetInfoByCardNoAsync(string cardno, string username)
|
||||
{
|
||||
var cachedata = _cache.Get("IndexData-" + cardno);
|
||||
if (!string.IsNullOrWhiteSpace(cachedata))
|
||||
return JSON.Deserialize<H5IndexModel>(cachedata);
|
||||
//var cardno_aes = AESEncryption.Decrypt(cardno, Common.GetHashKey());
|
||||
var list_zz_dcb = await GetzzDcbsAsync(cardno);
|
||||
var list_fzz_dcb = await GetfzzDcbsAsync(cardno);
|
||||
@@ -198,11 +201,11 @@ namespace Ewide.NbzsZheliban.Service
|
||||
var listPoliciesRegulationsTemp = _cache.Get<List<Nbzs.Entity.PoliciesRegulations>>("CacheData-PoliciesRegulations");
|
||||
if (listPoliciesRegulationsTemp != null && listPoliciesRegulationsTemp.Count > 0)
|
||||
{
|
||||
list_PoliciesRegulations = listPoliciesRegulationsTemp.Where(a => listAreas.Contains(a.AreaID)).Select(b => new PoliciesRegulation
|
||||
list_PoliciesRegulations = listPoliciesRegulationsTemp.Where(a => listAreas.Contains(a.AreaID) && a.IsPublic && (a.PublicTimeEnd == null || a.PublicTimeEnd.Value > DateTime.Now)).Select(b => new PoliciesRegulation
|
||||
{
|
||||
ID = b.ID,
|
||||
Contents = b.Contents,
|
||||
PublicTime = b.PublicTime,
|
||||
PublicTime = b.PublicTime.HasValue ? b.PublicTime.Value.ToString("yyyy-MM-dd") : string.Empty,
|
||||
Title = b.Title,
|
||||
Area = b.Area
|
||||
}).ToList();
|
||||
@@ -210,15 +213,20 @@ namespace Ewide.NbzsZheliban.Service
|
||||
else
|
||||
{
|
||||
//政策
|
||||
list_PoliciesRegulations = db.Queryable<Nbzs.Entity.PoliciesRegulations>().Where(a => listAreas.Contains(a.AreaID)).Select(b => new PoliciesRegulation
|
||||
list_PoliciesRegulations = db.Queryable<Nbzs.Entity.PoliciesRegulations>().Where(a => listAreas.Contains(a.AreaID) && a.IsPublic && (a.PublicTimeEnd == null || a.PublicTimeEnd.Value > DateTime.Now)).Select(b => new PoliciesRegulation
|
||||
{
|
||||
ID = b.ID,
|
||||
Contents = b.Contents,
|
||||
PublicTime = b.PublicTime,
|
||||
PublicTime = b.PublicTime.HasValue ? b.PublicTime.Value.ToString("yyyy-MM-dd") : string.Empty,
|
||||
Title = b.Title,
|
||||
Area = b.Area
|
||||
}).ToList();
|
||||
}
|
||||
//移除没有协议也没有分户评估的项目 (空项目)
|
||||
list_projects.FindAll(a => (a.BcxyList == null || a.BcxyList.Count == 0) && (a.FhpgList == null || a.FhpgList.Count == 0)).ForEach(a =>
|
||||
{
|
||||
list_projects.Remove(a);
|
||||
});
|
||||
Nbzs.Entity.Extends.H5IndexModel h5IndexModel = new()
|
||||
{
|
||||
PrjList = list_projects,
|
||||
@@ -226,6 +234,7 @@ namespace Ewide.NbzsZheliban.Service
|
||||
UserName = username,
|
||||
PoliciesRegulationsLists = new Nbzs.Entity.Extends.PoliciesRegulations { List = list_PoliciesRegulations, TotalCount = list_PoliciesRegulations.Count }
|
||||
};
|
||||
_cache.Set("IndexData-" + cardno, h5IndexModel, new TimeSpan(0, 5, 0));
|
||||
return h5IndexModel;
|
||||
}
|
||||
private JObject GetInfoByTicket(string ticket)
|
||||
@@ -312,15 +321,39 @@ namespace Ewide.NbzsZheliban.Service
|
||||
var ticket = args.GetJsonValue("ticket", isThrowExp: true);
|
||||
var id = args.GetJsonGuidValue("id", isThrowExp: true);
|
||||
JObject userInfoObj = GetInfoByTicket(ticket);
|
||||
var entity = await db.Queryable<Nbzs.Entity.PoliciesRegulations>().Where(p => p.ID == id).Select(p => new PoliciesRegulation
|
||||
try
|
||||
{
|
||||
ID = p.ID,
|
||||
Area = p.Area,
|
||||
Contents = p.Contents,
|
||||
PublicTime = p.PublicTime,
|
||||
Title = p.Title
|
||||
}).FirstAsync();
|
||||
return entity;
|
||||
var cachedata = _cache.Get("IndexData-" + userInfoObj["idnum"]);
|
||||
if (!string.IsNullOrWhiteSpace(cachedata))
|
||||
return JSON.Deserialize<H5IndexModel>(cachedata).PoliciesRegulationsLists.List.Find(a => a.ID == id);
|
||||
}
|
||||
catch { }
|
||||
var listPoliciesRegulationsTemp = _cache.Get<List<Nbzs.Entity.PoliciesRegulations>>("CacheData-PoliciesRegulations");
|
||||
if (listPoliciesRegulationsTemp != null && listPoliciesRegulationsTemp.Count > 0)
|
||||
{
|
||||
return listPoliciesRegulationsTemp.Where(p => p.ID == id).Select(p => new PoliciesRegulation
|
||||
{
|
||||
ID = p.ID,
|
||||
Area = p.Area,
|
||||
Contents = p.Contents,
|
||||
PublicTime = p.PublicTime.HasValue ? p.PublicTime.Value.ToString("yyyy-MM-dd") : string.Empty,
|
||||
Title = p.Title
|
||||
}).First();
|
||||
}
|
||||
else
|
||||
{
|
||||
var asd = db.Queryable<Nbzs.Entity.PoliciesRegulations>().Where(p => p.ID == id).First();
|
||||
var entity = db.Queryable<Nbzs.Entity.PoliciesRegulations>().Where(p => p.ID == id).Select(p => new PoliciesRegulation
|
||||
{
|
||||
ID = p.ID,
|
||||
Area = p.Area,
|
||||
Contents = p.Contents,
|
||||
PublicTime = p.PublicTime.ToString(),
|
||||
Title = p.Title
|
||||
}).First();
|
||||
entity.PublicTime = Convert.ToDateTime(entity.PublicTime).ToString("yyyy-MM-dd");
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user