From 6d64934a38eb261fb075fd4e328761d16a9c2184 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Mon, 16 May 2022 18:19:42 +0800 Subject: [PATCH] AMS --- ams/Djy.Common/DapperDBBase.cs | 17 ++-- ams/djy.IService/Ams/IAmsService.cs | 3 + ams/djy.Model/Ams/AMS_Cntrno.cs | 24 +++++ ams/djy.Model/Ams/AMS_House.cs | 56 +++++++++++- ams/djy.Model/Ams/AMS_Master.cs | 27 +++++- ams/djy.Model/AmsDto/AMSDto.cs | 88 +++++++++++++++++-- ams/djy.Model/AmsDto/CommonCodeValue.cs | 16 ++++ ams/djy.Service/Ams/AmsService.cs | 22 +++-- .../Controllers/AMS/AmsController.cs | 36 +++++++- 9 files changed, 261 insertions(+), 28 deletions(-) create mode 100644 ams/djy.Model/AmsDto/CommonCodeValue.cs diff --git a/ams/Djy.Common/DapperDBBase.cs b/ams/Djy.Common/DapperDBBase.cs index a68f853..5a27d27 100644 --- a/ams/Djy.Common/DapperDBBase.cs +++ b/ams/Djy.Common/DapperDBBase.cs @@ -53,6 +53,9 @@ namespace Common return Conn.Query(SPName, null, null, true, 0, CommandType.StoredProcedure).AsList(); } } + + + /// /// /// @@ -438,10 +441,9 @@ namespace Common } } - - + /// /// 执行中包含事务sql /// @@ -521,10 +523,13 @@ namespace Common return Conn.Update(model); } } - - - - + public List Query(String sql, object param = null) + { + using (IDbConnection Conn = GetConn()) + { + return Query(sql, param); + } + } } } diff --git a/ams/djy.IService/Ams/IAmsService.cs b/ams/djy.IService/Ams/IAmsService.cs index 5382e6c..5c98fce 100644 --- a/ams/djy.IService/Ams/IAmsService.cs +++ b/ams/djy.IService/Ams/IAmsService.cs @@ -33,5 +33,8 @@ namespace djy.Paas.IService void Delete(string ids); + + + List GetCountry(); } } diff --git a/ams/djy.Model/Ams/AMS_Cntrno.cs b/ams/djy.Model/Ams/AMS_Cntrno.cs index 10e2843..4c78b9f 100644 --- a/ams/djy.Model/Ams/AMS_Cntrno.cs +++ b/ams/djy.Model/Ams/AMS_Cntrno.cs @@ -97,5 +97,29 @@ namespace djy.Model.Ams public string IsDel { get; set; } + + /// + /// 包装code + /// + public string KINDPKGSCode { get; set; } + /// + /// 原产国 + /// + public string OriginCountry { get; set; } + /// + /// 原产国代码 + /// + public string OriginCountryCode { get; set; } + + /// + /// 危品联系人电话(选填) + /// + public string LINKMANTel { get; set; } + /// + /// 危品等级(条件必填) + /// + public string DangerGrade { get; set; } + + } } diff --git a/ams/djy.Model/Ams/AMS_House.cs b/ams/djy.Model/Ams/AMS_House.cs index 8cc3c2e..b25e804 100644 --- a/ams/djy.Model/Ams/AMS_House.cs +++ b/ams/djy.Model/Ams/AMS_House.cs @@ -5,9 +5,6 @@ namespace djy.Model.Ams [Table("AMS_House")] public class AMS_House { - - - public AMS_House(){ this.IsDel = "0"; @@ -54,7 +51,7 @@ namespace djy.Model.Ams /// /// 收货人名称 /// - public string CONSIGNEE { get; set; } + public string CONSIGNEEName { get; set; } /// @@ -89,5 +86,56 @@ namespace djy.Model.Ams /// public string NOTIFYPARTYTEL { get; set; } public string IsDel { get; set; } + + + /// + /// 货代单运编号(选填) + /// + public string ShippingNo { get; set; } + /// + /// 发货人国家 + /// + public string SHIPPERCountry { get; set; } + + + /// + /// 发货人国家code + /// + public string SHIPPERCountryCode { get; set; } + + + /// + /// 发货人城市 + /// + public string SHIPPERCity { get; set; } + + + /// + /// 收货人国家 + /// + public string CONSIGNEECountry { get; set; } + /// + /// 收货人国家code + /// + public string CONSIGNEECode { get; set; } + /// + /// 收货人城市 + /// + public string CONSIGNEECity { get; set; } + + + + /// + /// 通知人国家 + /// + public string NOTIFYPARTYCountry { get; set; } + /// + /// 通知人国家code + /// + public string NOTIFYPARTYCode { get; set; } + /// + /// 通知人城市 + /// + public string NOTIFYPARTYCity { get; set; } } } diff --git a/ams/djy.Model/Ams/AMS_Master.cs b/ams/djy.Model/Ams/AMS_Master.cs index 38f184f..3c1b88d 100644 --- a/ams/djy.Model/Ams/AMS_Master.cs +++ b/ams/djy.Model/Ams/AMS_Master.cs @@ -85,7 +85,7 @@ namespace djy.Model.Ams public string LoadingPort { get; set; } /// - /// 最后一个非美港 + /// 最后一个非美港/中转港 /// public string LastNoUsPort { get; set; } @@ -109,5 +109,30 @@ namespace djy.Model.Ams public DateTime? CreateTime { get; set; } public DateTime? LastUpdate { get; set; } public string IsDel { get; set; } + /// + /// 船东单运编号(选填) + /// + public string ShippingNo { get; set; } + /// + /// 整箱/拼箱 FCL:整箱 LCL:拼箱 + /// + public string ConsignmentType { get; set; } + + /// + /// 装货港code + /// + public string LoadingPortCode { get; set; } + + + /// + /// 卸货港code + /// + public string PORTDISCHARGECode { get; set; } + + + /// + /// 最后一个非美港/中转港Code + /// + public string LastNoUsPortCode { get; set; } } } diff --git a/ams/djy.Model/AmsDto/AMSDto.cs b/ams/djy.Model/AmsDto/AMSDto.cs index 845262f..8af68ba 100644 --- a/ams/djy.Model/AmsDto/AMSDto.cs +++ b/ams/djy.Model/AmsDto/AMSDto.cs @@ -4,14 +4,13 @@ using System.Collections.Generic; namespace djy.Model.AmsDto { - - public class AMSDto { - /// /// 主键 /// + + public string GID { get; set; } /// @@ -81,7 +80,7 @@ namespace djy.Model.AmsDto public string LoadingPort { get; set; } /// - /// 最后一个非美港 + /// 最后一个非美港/中转港 /// public string LastNoUsPort { get; set; } @@ -104,6 +103,32 @@ namespace djy.Model.AmsDto public DateTime? CreateTime { get; set; } public DateTime? LastUpdate { get; set; } + public string IsDel { get; set; } + /// + /// 船东单运编号(选填) + /// + public string ShippingNo { get; set; } + /// + /// 整箱/拼箱 FCL:整箱 LCL:拼箱 + /// + public string ConsignmentType { get; set; } + + /// + /// 装货港code + /// + public string LoadingPortCode { get; set; } + + + /// + /// 卸货港code + /// + public string PORTDISCHARGECode { get; set; } + + + /// + /// 最后一个非美港/中转港Code + /// + public string LastNoUsPortCode { get; set; } public List HouseDto { get; set; } = new List(); } @@ -150,7 +175,7 @@ namespace djy.Model.AmsDto /// /// 收货人名称 /// - public string CONSIGNEE { get; set; } + public string CONSIGNEEName { get; set; } /// @@ -184,8 +209,59 @@ namespace djy.Model.AmsDto /// 通知人电话 /// public string NOTIFYPARTYTEL { get; set; } - public List CntrnoDto { get; set; } + public string IsDel { get; set; } + + + /// + /// 货代单运编号(选填) + /// + public string ShippingNo { get; set; } + /// + /// 发货人国家 + /// + public string SHIPPERCountry { get; set; } + + /// + /// 发货人国家code + /// + public string SHIPPERCountryCode { get; set; } + + + /// + /// 发货人城市 + /// + public string SHIPPERCity { get; set; } + + + /// + /// 收货人国家 + /// + public string CONSIGNEECountry { get; set; } + /// + /// 收货人国家code + /// + public string CONSIGNEECode { get; set; } + /// + /// 收货人城市 + /// + public string CONSIGNEECity { get; set; } + + + + /// + /// 通知人国家 + /// + public string NOTIFYPARTYCountry { get; set; } + /// + /// 通知人国家code + /// + public string NOTIFYPARTYCode { get; set; } + /// + /// 通知人城市 + /// + public string NOTIFYPARTYCity { get; set; } + public List CntrnoDto { get; set; } } } diff --git a/ams/djy.Model/AmsDto/CommonCodeValue.cs b/ams/djy.Model/AmsDto/CommonCodeValue.cs new file mode 100644 index 0000000..6a28a2b --- /dev/null +++ b/ams/djy.Model/AmsDto/CommonCodeValue.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace djy.Model.AmsDto +{ + public class CommonCodeValue + { + + public string Code { get; set; } + + public string Value { get; set; } + } +} diff --git a/ams/djy.Service/Ams/AmsService.cs b/ams/djy.Service/Ams/AmsService.cs index 03683c4..8eca2bd 100644 --- a/ams/djy.Service/Ams/AmsService.cs +++ b/ams/djy.Service/Ams/AmsService.cs @@ -26,8 +26,6 @@ namespace djy.Service.Ams { DapperDBBase dapper = new DapperDBBase(); - - public TableData Load(AMSQuery req, string userid) { var result = new TableData(); @@ -55,7 +53,6 @@ namespace djy.Service.Ams public void Delete(string ids) { - string[] id = ids.Split(','); using (var transaction = new TransactionScope()) { @@ -86,8 +83,6 @@ namespace djy.Service.Ams } - - public async void SaveInfo(AMSDto dto, string userid) { if (dto.GID.IsNull()) @@ -183,8 +178,6 @@ namespace djy.Service.Ams connection.Close(); } - - } } @@ -193,5 +186,20 @@ namespace djy.Service.Ams } } + + public List GetCountry() + { + try + { + var List = dapper.Query("select Code,Value from AMS_SysCARRIER order by value"); + return List; + } + catch (Exception e) + { + throw; + } + + + } } } diff --git a/ams/djy.WebApi/Controllers/AMS/AmsController.cs b/ams/djy.WebApi/Controllers/AMS/AmsController.cs index 995024c..21eb29f 100644 --- a/ams/djy.WebApi/Controllers/AMS/AmsController.cs +++ b/ams/djy.WebApi/Controllers/AMS/AmsController.cs @@ -8,15 +8,17 @@ using djy.Service.Ams; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; +using System.Collections.Generic; namespace djy_AmsApi.Controllers { [AllowAnonymous] public class AmsController : ApiBase { - + AmsService ser =new AmsService(); + [HttpPost("AddOrUpdate")] public Response AddOrUpdate(AMSDto Dto) { @@ -32,9 +34,11 @@ namespace djy_AmsApi.Controllers result.Message = "无效数据!"; } ser.SaveInfo(Dto, GetLoginId.ToString()); - + return result; } + + [HttpGet("Load")] public object Load([FromQuery] AMSQuery request) { @@ -45,10 +49,10 @@ namespace djy_AmsApi.Controllers result.Message = "登录过期,请重新登录!"; return result; } - return ser.Load(request, GetLoginId.ToString()); } + [HttpGet("Del")] public Response Delete(string ids) { @@ -67,7 +71,31 @@ namespace djy_AmsApi.Controllers return result; } + /// + /// 下拉获取国家 + /// + /// + [HttpGet("GetCountry")] + public Response> GetCountry() + { + var result = new Response>(); + try + { + result.Result = ser.GetCountry(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + + return result; + } + + + + } - } +}