wet 2 years ago
parent d936cea178
commit d3b6098fd7

@ -62,51 +62,98 @@ 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);
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)
if (req.ReportState == "0")
{
foreach (var item in list)
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)
{
var SASCCODE = SASCCODEList.Where(x => x.CompId == item.CompID).FirstOrDefault();
if (SASCCODE != null)
{
item.SASCCODE = SASCCODE.ItemCode;
}
else
foreach (var item in list)
{
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;
if (hodto != null)
{
foreach (var it in hodto)
var SASCCODE = SASCCODEList.Where(x => x.CompId == item.CompID).FirstOrDefault();
if (SASCCODE != null)
{
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;
item.SASCCODE = SASCCODE.ItemCode;
}
else
{
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;
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;
}
}
count += hodto.Count();
}
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();
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList();
}
else
{
result.count = count;
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)
{
var SASCCODE = SASCCODEList.Where(x => x.CompId == item.CompID).FirstOrDefault();
if (SASCCODE != null)
{
item.SASCCODE = SASCCODE.ItemCode;
}
else
{
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
{
@ -44,7 +36,7 @@ namespace djy_AmsApi.Controllers.AMS
result.Message = "登录过期,请重新登录!";
return result;
}
return ser.Load(request, user, aut);
return ser.Load(request, user, aut);
}
#endregion
@ -66,7 +58,7 @@ namespace djy_AmsApi.Controllers.AMS
result.Code = 500;
result.Message = "无效数据!";
}
result.data = ser.SaveInfo(Dto, user);
if (result.data == "-1")
{
@ -112,7 +104,7 @@ namespace djy_AmsApi.Controllers.AMS
#region 第三方接口
[HttpGet("Send")]
public async Task<Response> Send(string ids, string docType,string hid)
public async Task<Response> Send(string ids, string docType, string hid)
{
Response req = new Response();
var user = GetUserInfo();
@ -123,7 +115,7 @@ namespace djy_AmsApi.Controllers.AMS
req.Message = "登录过期,请重新登录!";
return req;
}
var result = ser.SendDE(ids, user, docType,hid);
var result = ser.SendDE(ids, user, docType, hid);
req.Code = result.Result.Code;
req.Message = result.Result.Message;
return req;
@ -150,7 +142,7 @@ namespace djy_AmsApi.Controllers.AMS
#region 获取模板
[HttpGet("GetTemplate")]
public Response<List<AMS_AddrTemplate>> GetTemplate(string type, string TemPlateName=null)
public Response<List<AMS_AddrTemplate>> GetTemplate(string type, string TemPlateName = null)
{
var result = new Response<List<AMS_AddrTemplate>>();
try
@ -188,9 +180,9 @@ namespace djy_AmsApi.Controllers.AMS
result.Code = 500;
result.Message = "无效数据!";
}
result.data = ser.SaveTemplate(Dto, GetUserInfo());
if (result.data=="-1")
if (result.data == "-1")
{
result.Code = 201;
result.Message = "模板名称重复!";
@ -244,7 +236,7 @@ namespace djy_AmsApi.Controllers.AMS
var user = GetUserInfo();
if (user == null)
{
req.Code = 401;
req.Message = "登录过期,请重新登录!";
return req;
@ -252,7 +244,7 @@ namespace djy_AmsApi.Controllers.AMS
var result = ser.GetSASCCODE(user);
req.Result = result.Result;
req.Code = 200;
req.Message ="操作成功";
req.Message = "操作成功";
return req;
}

@ -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