diff --git a/web/djy.IService/Ams/IAmsService.cs b/web/djy.IService/Ams/IAmsService.cs index 21b1365..c75aa8c 100644 --- a/web/djy.IService/Ams/IAmsService.cs +++ b/web/djy.IService/Ams/IAmsService.cs @@ -25,7 +25,7 @@ namespace djy.IService.Ams void Delete(string ids, User user); - List GetCountry(); + List GetCountry(string strlink , int page , int limit); List GetCodePortLoad(); @@ -37,10 +37,10 @@ namespace djy.IService.Ams List GetDangerousGoods(string strlink); - List GetPort(string strlink); + List GetPort(string strlink, int page, int limit); - List GetVessel(string strlink); + List GetVessel(string strlink,int page, int limit); Task SendDE(string Gid, User user, string docType,string hid); diff --git a/web/djy.Model/AmsDto/AMSQuery.cs b/web/djy.Model/AmsDto/AMSQuery.cs index 939764c..ba6bc84 100644 --- a/web/djy.Model/AmsDto/AMSQuery.cs +++ b/web/djy.Model/AmsDto/AMSQuery.cs @@ -42,5 +42,14 @@ namespace djy.Model.AmsDto public DateTime? BDate { get; set; } public DateTime? EDate { get; set; } + + /// + /// 主单id + /// + public string Mid { get; set; } + /// + /// 分单id + /// + public string Hid { get; set; } } } diff --git a/web/djy.Service/Ams/AmsService.cs b/web/djy.Service/Ams/AmsService.cs index e08b866..c7fe38a 100644 --- a/web/djy.Service/Ams/AmsService.cs +++ b/web/djy.Service/Ams/AmsService.cs @@ -54,6 +54,7 @@ namespace djy.Service.Ams } var dto = DbBus.Get(DbList.AMSCenter).Select() .Where(x => x.IsDel != true) + .WhereIf(!string.IsNullOrEmpty(req.Mid), x => x.GID == req.Mid) .WhereIf(aut.CompayId != null, x => x.CompID == aut.CompayId.ToString()) .WhereIf(aut.UserId != null, x => x.UserID == aut.UserId.ToString()) .WhereIf(req.MBLNO != null, x => x.MBLNO.Contains(req.MBLNO.Trim())) @@ -71,6 +72,7 @@ namespace djy.Service.Ams foreach (var item in list) { var hodto = DbBus.Get(DbList.AMSCenter).Select().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 == "未申报" || x.ReportState == "接收失败") .WhereIf(req.ReportState == "1", x => !(x.ReportState == "未申报" || x.ReportState == "接收失败")) @@ -1352,17 +1354,32 @@ namespace djy.Service.Ams #endregion #region 下拉接口 - public List GetCountry() + public List GetCountry(string strlink, int page, int limit) { try { - var List = DbBus.Get(DbList.Common).Select().ToList().Select(x => new CommonCNEN + if (page == 0 && limit == 0) { - Code = x.Code, - ENName = x.EnName, - CNName = x.CnName, - }).Distinct().ToList(); - return List; + var List = DbBus.Get(DbList.Common).Select().ToList().Select(x => new CommonCNEN + { + Code = x.Code, + ENName = x.EnName, + CNName = x.CnName, + }).Distinct().ToList(); + return List; + } + else { + var List = DbBus.Get(DbList.Common).Select().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())|| x.CnName.Contains(strlink.Trim()) ).Page(page, limit).ToList().Select(x => new CommonCNEN + { + Code = x.Code, + ENName = x.EnName, + CNName = x.CnName, + }).Distinct().ToList(); + return List; + + + + } } catch (Exception e) { @@ -1441,16 +1458,30 @@ namespace djy.Service.Ams } - public List GetPort(string strlink) + public List GetPort(string strlink, int page, int limit) { try { - var List = DbBus.Get(DbList.Common).Select().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())).ToList().Select(x => new CommonCodeValue + if (page == 0 && limit == 0) { - Code = x.Code, - Value = x.EnName, - }).Distinct().ToList(); - return List; + var List = DbBus.Get(DbList.Common).Select().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())).ToList().Select(x => new CommonCodeValue + { + Code = x.Code, + Value = x.EnName, + }).Distinct().ToList(); + return List; + } + else { + + var List = DbBus.Get(DbList.Common).Select().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCodeValue + { + Code = x.Code, + Value = x.EnName, + }).Distinct().ToList(); + return List; + + + } } catch (Exception e) { @@ -1476,16 +1507,27 @@ namespace djy.Service.Ams } - public List GetVessel(string strlink) + public List GetVessel(string strlink,int page,int limit) { try { - var List = DbBus.Get(DbList.Common).Select().WhereIf(strlink != "", x => x.Name.Contains(strlink.Trim())).ToList().Select(x => new CommonCodeValue + if (page == 0 && limit == 0) { - Code = x.Name, - Value = x.Name, - }).Distinct().ToList(); - return List; + var List = DbBus.Get(DbList.Common).Select().WhereIf(strlink != "", x => x.Name.Contains(strlink.Trim())).ToList().Select(x => new CommonCodeValue + { + Code = x.Name, + Value = x.Name, + }).Distinct().ToList(); + return List; + } + else { + var List = DbBus.Get(DbList.Common).Select().WhereIf(strlink != "", x => x.Name.Contains(strlink.Trim())).Page(page,limit).ToList().Select(x => new CommonCodeValue + { + Code = x.Name, + Value = x.Name, + }).Distinct().ToList(); + return List; + } } catch (Exception e) { diff --git a/web/djy.Service/ISF/IsfService.cs b/web/djy.Service/ISF/IsfService.cs index d83410e..bd2b6cd 100644 --- a/web/djy.Service/ISF/IsfService.cs +++ b/web/djy.Service/ISF/IsfService.cs @@ -241,16 +241,17 @@ namespace djy.Service.Isf template.IsDel = false; DbBus.Get(DbList.AMSCenter).Insert(template).ExecuteAffrows(); guid = template.GID; + return guid; } else { ISF_CompanyTemplate template = dto.MapTo(); - DbBus.Get(DbList.AMSCenter).Update().SetSource(template).ExecuteAffrows(); - + var i= DbBus.Get(DbList.AMSCenter).Update().SetSource(template).ExecuteAffrows(); + return i.ToString(); } - return guid; + } #endregion diff --git a/web/djy.WebApi/Controllers/AMS/AmsController.cs b/web/djy.WebApi/Controllers/AMS/AmsController.cs index 771adf8..0d3df04 100644 --- a/web/djy.WebApi/Controllers/AMS/AmsController.cs +++ b/web/djy.WebApi/Controllers/AMS/AmsController.cs @@ -175,7 +175,7 @@ namespace djy_AmsApi.Controllers.AMS #region 保存模板 [HttpPost("SaveTemplate")] - public Response SaveTemplate(AMS_AddrTemplate Dto) + public Response SaveTemplate([FromBody] AMS_AddrTemplate Dto) { var result = new Response(); if (GetUserInfo() == null) diff --git a/web/djy.WebApi/Controllers/Common/CommonController.cs b/web/djy.WebApi/Controllers/Common/CommonController.cs index 67c617b..054f9ed 100644 --- a/web/djy.WebApi/Controllers/Common/CommonController.cs +++ b/web/djy.WebApi/Controllers/Common/CommonController.cs @@ -19,12 +19,12 @@ namespace djy_AmsApi.Controllers.Common /// /// [HttpGet("GetCountry")] - public Response> GetCountry() + public Response> GetCountry(string strlink = "", int page = 0, int limit = 0) { var result = new Response>(); try { - result.Result = ser.GetCountry(); + result.Result = ser.GetCountry(strlink, page, limit); } catch (Exception ex) { @@ -52,7 +52,6 @@ namespace djy_AmsApi.Controllers.Common result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } - return result; } @@ -103,7 +102,7 @@ namespace djy_AmsApi.Controllers.Common /// /// [HttpGet("GetDangerousGoods")] - public Response> GetDangerousGoods(string strlink = "") + public Response> GetDangerousGoods(string strlink = "",int page = 0, int limit = 0) { var result = new Response>(); try @@ -145,12 +144,12 @@ namespace djy_AmsApi.Controllers.Common /// /// [HttpGet("GetPort")] - public Response> GetPort(string strlink = "") + public Response> GetPort(string strlink = "", int page = 0, int limit = 0) { var result = new Response>(); try { - result.Result = ser.GetPort(strlink); + result.Result = ser.GetPort(strlink, page, limit); } catch (Exception ex) { @@ -166,12 +165,12 @@ namespace djy_AmsApi.Controllers.Common /// /// [HttpGet("GetVessel")] - public Response> GetVessel(string strlink = "") + public Response> GetVessel(string strlink = "", int page = 0,int limit =0) { var result = new Response>(); try { - result.Result = ser.GetVessel(strlink); + result.Result = ser.GetVessel(strlink, page,limit); } catch (Exception ex) { diff --git a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user index 655946f..9ab57cd 100644 --- a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user +++ b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -6,6 +6,6 @@ <_PublishTargetUrl>C:\Project\DJYAMS\djyweb_ams\web\djy.WebApi\bin\Release\net5.0\publish\ - True|2022-08-16T07:41:06.8876151Z;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; + True|2022-08-23T06:06:20.0492662Z;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; \ No newline at end of file diff --git a/web/djy_IsfApi/Controllers/ISF/CommonController.cs b/web/djy_IsfApi/Controllers/ISF/CommonController.cs index 26b22d8..3b5c057 100644 --- a/web/djy_IsfApi/Controllers/ISF/CommonController.cs +++ b/web/djy_IsfApi/Controllers/ISF/CommonController.cs @@ -20,12 +20,12 @@ namespace djy_AmsApi.Controllers.Common /// /// [HttpGet("GetCountry")] - public Response> GetCountry() + public Response> GetCountry(string strlink, int page, int limit) { var result = new Response>(); try { - result.Result = ser.GetCountry(); + result.Result = ser.GetCountry( strlink, page, limit); } catch (Exception ex) { @@ -146,12 +146,12 @@ namespace djy_AmsApi.Controllers.Common /// /// [HttpGet("GetPort")] - public Response> GetPort(string strlink = "") + public Response> GetPort(int page, int limit,string strlink = "") { var result = new Response>(); try { - result.Result = ser.GetPort(strlink); + result.Result = ser.GetPort(strlink, page,limit); } catch (Exception ex) { @@ -167,12 +167,12 @@ namespace djy_AmsApi.Controllers.Common /// /// [HttpGet("GetVessel")] - public Response> GetVessel(string strlink = "") + public Response> GetVessel(int page, int limit,string strlink = "") { var result = new Response>(); try { - result.Result = ser.GetVessel(strlink); + result.Result = ser.GetVessel(strlink, page, limit); } catch (Exception ex) { diff --git a/web/djy_IsfApi/Controllers/ISF/IsfController.cs b/web/djy_IsfApi/Controllers/ISF/IsfController.cs index e9c5049..7192e57 100644 --- a/web/djy_IsfApi/Controllers/ISF/IsfController.cs +++ b/web/djy_IsfApi/Controllers/ISF/IsfController.cs @@ -45,7 +45,7 @@ namespace djy_Isfpi.Controllers.ISF #region 新增/编辑 [HttpPost("AddOrUpdate")] - public Response AddOrUpdate(ISFDto Dto) + public Response AddOrUpdate([FromBody] ISFDto Dto) { var result = new Response(); var user = GetUserInfo(); @@ -128,15 +128,11 @@ namespace djy_Isfpi.Controllers.ISF return result; } - - - - #endregion #region 保存模板 [HttpPost("SaveTemplate")] - public Response SaveTemplate(ISF_CompanyTemplate Dto) + public Response SaveTemplate([FromBody] ISF_CompanyTemplate Dto) { var result = new Response(); var user = GetUserInfo(); @@ -157,6 +153,12 @@ namespace djy_Isfpi.Controllers.ISF result.Code = 201; result.Message = "模板名称重复!"; + } + if (result.data == "0") + { + result.Code = 201; + result.Message = "不存在此模板,无法修改"; + } return result; } diff --git a/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml.user new file mode 100644 index 0000000..94f06f0 --- /dev/null +++ b/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -0,0 +1,11 @@ + + + + + <_PublishTargetUrl>C:\Project\DJYAMS\djyweb_ams\web\djy_IsfApi\bin\Release\net5.0\publish\ + True|2022-08-22T07:49:27.7983465Z; + + \ No newline at end of file