wet 2 years ago
parent 3581e9e1e5
commit adce417074

@ -40,7 +40,7 @@ namespace djy.Service.Ams
public TableData Load(AMSQuery req, User user, UserAuthorityDto aut)
{
var result = new TableData();
int count = 0;
string[] ReportStates = null;
if (req.ReportState != null)
{
@ -65,10 +65,11 @@ namespace djy.Service.Ams
.WhereIf(hou != null, x => hou.Contains(x.GID))
.WhereIf(req.BDate != null, x => x.CreateTime >= req.BDate)
.WhereIf(req.EDate != null, x => x.CreateTime <= req.EDate).OrderByDescending(x => x.CreateTime);
result.count = dto.ToList().Count();
var list = dto.Page(req.Page, req.Limit).ToList<AMSDto>();
if (list != null)
{
foreach (var item in list)
{
var historyDto = DbBus.Get(DbList.AMSCenter).Select<AMS_MasterHistory>().Where(x => x.AM_ID == item.GID).OrderByDescending(x => x.SendTime).ToList();
@ -76,9 +77,9 @@ namespace djy.Service.Ams
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x =>x.IsDel !=true && x.PID == item.GID)
.WhereIf(req.HBLNo != null, x => x.HBLNo.Contains(req.HBLNo.Trim()))
.WhereIf(req.ReportState == "0", x => x.ReportState == "未申报" || x.ReportState == "接收失败")
.WhereIf(req.ReportState == "1", x => !(x.ReportState == "未申报" || x.ReportState == "接收失败"))
.WhereIf(req.ReportState != null && req.ReportState != "0" && req.ReportState != "1", x => ReportStates.Contains(x.ReportState))
.ToList<AMS_HouseDto>();
.WhereIf(req.ReportState == "1", x => !(x.ReportState == "未申报" || x.ReportState == "接收失败"))
.WhereIf(req.ReportState != null && req.ReportState != "0" && req.ReportState != "1", x => ReportStates.Contains(x.ReportState))
.ToList<AMS_HouseDto>();
item.HouseDto = hodto;
if (hodto != null)
{
@ -88,9 +89,20 @@ namespace djy.Service.Ams
it.CntrnoDto = cnt;
}
}
count += hodto.Count();
}
}
result.data = list.Where(x=>x.HouseDto!=null && x.HouseDto.Count() > 0).ToList();
if (req.ReportState == "0")
{
result.count = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList().Count();
}
else {
result.count = count;
}
result.data = list;
return result;
}
#endregion

Loading…
Cancel
Save