wet 2 years ago
parent d936cea178
commit d3b6098fd7

@ -62,6 +62,9 @@ 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);
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 list = dto.Page(req.Page, req.Limit).ToList<AMSDto>();
if (list != null)
@ -99,14 +102,58 @@ namespace djy.Service.Ams
}
}
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
{
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;
}

@ -1,21 +1,13 @@
using Common;
using Common.DJYModel;
using Common.Utilities;
using djy.IService.Ams;
using djy.Model.Ams;
using djy.Model.AmsDto;
using djy.Service;
using djy.Service.Ams;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System.Text;
using System.IO;
using djy.Service.DjyService;
using djy.IService.Ams;
using Common.DJYModel;
namespace djy_AmsApi.Controllers.AMS
{

@ -6,6 +6,6 @@
<Project>
<PropertyGroup>
<_PublishTargetUrl>C:\Project\DJYAMS\djyweb_ams\web\djy.WebApi\bin\Release\net5.0\publish\</_PublishTargetUrl>
<History>True|2022-11-22T09:09:34.5920257Z;True|2022-11-21T16:04:10.7391070+08:00;True|2022-08-23T14:28:11.3249766+08:00;True|2022-08-23T14:06:20.0492662+08:00;True|2022-08-18T14:54:28.0305650+08:00;True|2022-08-18T14:01:59.8031822+08:00;True|2022-08-16T15:41:06.8876151+08:00;True|2022-08-11T16:30:26.5758718+08:00;True|2022-08-11T15:57:08.7787498+08:00;True|2022-08-11T15:31:36.9253999+08:00;</History>
<History>True|2023-04-06T09:35:59.4372358Z;True|2023-04-06T17:32:32.6039403+08:00;True|2023-04-06T17:09:53.6471276+08:00;True|2023-04-06T16:45:16.8603914+08:00;True|2023-04-06T16:01:37.4062230+08:00;True|2023-04-03T09:54:09.6559313+08:00;True|2022-11-22T17:09:34.5920257+08:00;True|2022-11-21T16:04:10.7391070+08:00;True|2022-08-23T14:28:11.3249766+08:00;True|2022-08-23T14:06:20.0492662+08:00;True|2022-08-18T14:54:28.0305650+08:00;True|2022-08-18T14:01:59.8031822+08:00;True|2022-08-16T15:41:06.8876151+08:00;True|2022-08-11T16:30:26.5758718+08:00;True|2022-08-11T15:57:08.7787498+08:00;True|2022-08-11T15:31:36.9253999+08:00;</History>
</PropertyGroup>
</Project>

@ -36,7 +36,7 @@
"Index": 100,
"DataType": 1,
"Status": 0,
"ConnString": "Data Source =60.209.125.238,28000; Initial Catalog=DevAMS; Persist Security Info=True; User ID =dev; Password=dev123;pooling=true;"
"ConnString": "Data Source =47.104.73.97,6762; Initial Catalog=AMS; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true;"
},
{
"SysKey": "Common",

Loading…
Cancel
Save