|
|
@ -62,6 +62,9 @@ namespace djy.Service.Ams
|
|
|
|
.WhereIf(hou != null, x => hou.Contains(x.GID))
|
|
|
|
.WhereIf(hou != null, x => hou.Contains(x.GID))
|
|
|
|
.WhereIf(req.BDate != null, x => x.CreateTime >= req.BDate)
|
|
|
|
.WhereIf(req.BDate != null, x => x.CreateTime >= req.BDate)
|
|
|
|
.WhereIf(req.EDate != null, x => x.CreateTime <= req.EDate).OrderByDescending(x => x.CreateTime);
|
|
|
|
.WhereIf(req.EDate != null, x => x.CreateTime <= req.EDate).OrderByDescending(x => x.CreateTime);
|
|
|
|
|
|
|
|
if (req.ReportState == "0")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.count = dto.ToList().Count();
|
|
|
|
var SASCCODEList = DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.ParaCode == "AMSSASCCODE").ToList();
|
|
|
|
var SASCCODEList = DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.ParaCode == "AMSSASCCODE").ToList();
|
|
|
|
var list = dto.Page(req.Page, req.Limit).ToList<AMSDto>();
|
|
|
|
var list = dto.Page(req.Page, req.Limit).ToList<AMSDto>();
|
|
|
|
if (list != null)
|
|
|
|
if (list != null)
|
|
|
@ -99,14 +102,58 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList();
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList();
|
|
|
|
if (req.ReportState == "0")
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var g = dto.ToList().Select(x => x.GID).ToList();
|
|
|
|
|
|
|
|
result.count = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && g.Contains(x.PID))
|
|
|
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(req.Hid), x => x.GID == req.Hid)
|
|
|
|
|
|
|
|
.WhereIf(req.HBLNo != null, x => x.HBLNo.Contains(req.HBLNo.Trim()))
|
|
|
|
|
|
|
|
.WhereIf(req.ReportState == "0", x => x.ReportState == "未申报")
|
|
|
|
|
|
|
|
.WhereIf(req.ReportState == "1", x => x.ReportState != "未申报")
|
|
|
|
|
|
|
|
.WhereIf(req.ReportState != null && req.ReportState != "0" && req.ReportState != "1", x => ReportStates.Contains(x.ReportState)).ToList()
|
|
|
|
|
|
|
|
.Count();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SASCCODEList = DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.ParaCode == "AMSSASCCODE").ToList();
|
|
|
|
|
|
|
|
var list = dto.ToList<AMSDto>();
|
|
|
|
|
|
|
|
if (list != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result.count = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList().Count();
|
|
|
|
var SASCCODE = SASCCODEList.Where(x => x.CompId == item.CompID).FirstOrDefault();
|
|
|
|
|
|
|
|
if (SASCCODE != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.SASCCODE = SASCCODE.ItemCode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result.count = count;
|
|
|
|
item.SASCCODE = "NIAV";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.PID == item.GID)
|
|
|
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(req.Hid), x => x.GID == req.Hid)
|
|
|
|
|
|
|
|
.WhereIf(req.HBLNo != null, x => x.HBLNo.Contains(req.HBLNo.Trim()))
|
|
|
|
|
|
|
|
.WhereIf(req.ReportState == "0", x => x.ReportState == "未申报")
|
|
|
|
|
|
|
|
.WhereIf(req.ReportState == "1", x => x.ReportState != "未申报")
|
|
|
|
|
|
|
|
.WhereIf(req.ReportState != null && req.ReportState != "0" && req.ReportState != "1", x => ReportStates.Contains(x.ReportState))
|
|
|
|
|
|
|
|
.ToList<AMS_HouseDto>();
|
|
|
|
|
|
|
|
item.HouseDto = hodto.ToList();
|
|
|
|
|
|
|
|
if (hodto != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var it in hodto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => x.IsDel != true && x.HID == it.GID).ToList();
|
|
|
|
|
|
|
|
it.CntrnoDto = cnt;
|
|
|
|
|
|
|
|
var historyDto = DbBus.Get(DbList.AMSCenter).Select<AMS_MasterHistory>().Where(x => x.AM_ID == it.GID).OrderByDescending(x => x.SendTime).ToList();
|
|
|
|
|
|
|
|
it.HistoryDto = historyDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).Skip((req.Page-1) * req.Limit).Take(req.Limit).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|