diff --git a/web/Djy.Common/Common.xml b/web/Djy.Common/Common.xml index 9fac501..19fb1a1 100644 --- a/web/Djy.Common/Common.xml +++ b/web/Djy.Common/Common.xml @@ -881,19 +881,39 @@ 赠送余额 + + + 单价(主单) + + - pricef 分单 + 单价(分单) - 青港主单 + 单价(青港主单) - 青港分单 + 单价(青港分单) + + + + + 计费规则 类型的Dto类 + + + + + 业务类型 + + + + + 单价(主单) diff --git a/web/Djy.Common/DJYModel/CustPrice.cs b/web/Djy.Common/DJYModel/CustPrice.cs index e99f69a..c0ea1e5 100644 --- a/web/Djy.Common/DJYModel/CustPrice.cs +++ b/web/Djy.Common/DJYModel/CustPrice.cs @@ -32,25 +32,28 @@ namespace Common.DJYModel [JsonProperty, Column(DbType = "decimal(19,2)")] public decimal? GiftBalance { get; set; } - [JsonProperty, Column(DbType = "decimal(19,2)")] + /// + /// ۣ + /// + [JsonProperty, Column(DbType = "decimal(19,2)")] public decimal? PRICE { get; set; } - /// - /// pricef ֵ - /// - - [JsonProperty, Column(DbType = "decimal(19,2)")] + /// + /// ֵۣ + /// + [JsonProperty, Column(DbType = "decimal(19,2)")] public decimal PRICEF { get; set; } = 0M; - /// - /// - /// - [JsonProperty, Column(DbType = "decimal(19,2)")] + + /// + /// ۣ + /// + [JsonProperty, Column(DbType = "decimal(19,2)")] public decimal PRICEFQG { get; set; } = 0M; - /// - /// ۷ֵ - /// - [JsonProperty, Column(DbType = "decimal(19,2)")] + /// + /// ۣ۷ֵ + /// + [JsonProperty, Column(DbType = "decimal(19,2)")] public decimal PRICEQG { get; set; } = 0M; [JsonProperty] diff --git a/web/Djy.Common/DJYModel/CustPriceDto.cs b/web/Djy.Common/DJYModel/CustPriceDto.cs new file mode 100644 index 0000000..1c6d98b --- /dev/null +++ b/web/Djy.Common/DJYModel/CustPriceDto.cs @@ -0,0 +1,22 @@ +namespace Common.DJYModel +{ + /// + /// 计费规则 类型的Dto类 + /// + public class CustPriceDto + { + public string GID { get; set; } + + /// + /// 业务类型 + /// + public int? BSTYPE { get; set; } + public string COMID { get; set; } + public string COMNAME { get; set; } + + /// + /// 单价(主单) + /// + public decimal? PRICE { get; set; } + } +} diff --git a/web/djy.IService/Isf/IIsfService.cs b/web/djy.IService/Isf/IIsfService.cs index 5e57a3b..21af9e4 100644 --- a/web/djy.IService/Isf/IIsfService.cs +++ b/web/djy.IService/Isf/IIsfService.cs @@ -44,7 +44,7 @@ namespace djy.IService.Isf /// 获取模板 /// /// - List GetTemplate(User user, string CompanyType, string InFoType,string TemPlateName); + List GetTemplate(User user, string CompanyType, string InFoType, string TemPlateName); /// @@ -66,6 +66,14 @@ namespace djy.IService.Isf - Response SaveReceipt(string msg ); + Response SaveReceipt(string msg); + + /// + /// 获取计费规则 + /// + /// 业务类型 + /// 登录人信息 + /// 计费规则 + Task> GetPrice(string bstype, User user); } } diff --git a/web/djy.Service/DjyService/AutoMapperConfig.cs b/web/djy.Service/DjyService/AutoMapperConfig.cs index f1e8ce0..a7259b3 100644 --- a/web/djy.Service/DjyService/AutoMapperConfig.cs +++ b/web/djy.Service/DjyService/AutoMapperConfig.cs @@ -14,7 +14,8 @@ namespace djy.Service.DjyService public AutoMapperConfig() { CreateMap().ReverseMap(); CreateMap().ReverseMap(); - + CreateMap().ReverseMap(); + } } } diff --git a/web/djy.Service/DjyService/ServBase.cs b/web/djy.Service/DjyService/ServBase.cs index f66d7bf..f4bcfaa 100644 --- a/web/djy.Service/DjyService/ServBase.cs +++ b/web/djy.Service/DjyService/ServBase.cs @@ -16,6 +16,7 @@ using System.Reflection; using Common.Extensions; using Common.DJYModel; using Common.Entity; +using Common.Utilities; namespace djy.Service.DjyService { @@ -125,7 +126,17 @@ namespace djy.Service.DjyService return count > 0 ? true : false; } - + + /// + /// 创建Response响应对象 + /// + /// 结果代码 + /// 结果描述 + internal Response CreateResponse(int code, string message) + { + return new Response() { Code = code, Message = message }; + } + } diff --git a/web/djy.Service/ISF/IsfService.cs b/web/djy.Service/ISF/IsfService.cs index a6764c1..e296760 100644 --- a/web/djy.Service/ISF/IsfService.cs +++ b/web/djy.Service/ISF/IsfService.cs @@ -56,6 +56,37 @@ namespace djy.Service.Isf result.data = list; return result; } + + /// + /// 获取计费规则 + /// + /// 业务类型 + /// 登录人信息 + /// 计费规则 + public async Task> GetPrice(string bstype, User user) + { + try + { + if (!int.TryParse(bstype, out int _bstype)) + { + return CreateResponse(400, "参数[bstype:业务类型]为空或格式错误"); + } + + CustPrice custPrice = await DbBus.Get(DbList.djydb).Select().Where(w => w.BSTYPE == _bstype && w.SENDTYPE == 0 && w.COMNAME == user.COMNAME).ToOneAsync(); + if (custPrice == null) + { + return CreateResponse(201, "没有找到此业务的计费规则"); + } + + CustPriceDto custPriceDto = custPrice.MapTo(); + return new Response() { Code = 200, Message = "查询成功", Result = custPriceDto }; + } + catch (Exception ex) + { + _LogsAdd("GetPrice", "post", $"ISF_GetPrice接口:{ex.Message}"); + return CreateResponse(500, ex.Message); + } + } #endregion #region 新增编辑 @@ -280,7 +311,7 @@ namespace djy.Service.Isf #endregion #region 第三方接口 - + /// 类型(1.原始 2.修改 3.删除 4.重发) public async Task SendDE(string Gid, User user, string msgType) { Response req = new Response(); @@ -311,7 +342,7 @@ namespace djy.Service.Isf var gethtml = ""; if (msgType != "3") { - if (msgType == "1" && master.NewNotice == "新增发送") + if (msgType == "1" && master.NewNotice == "新增发送") { req.Code = 200; req.Message = "当前单据已经发送,不能再次发送!如有疑问,请联系相关客服!"; @@ -368,7 +399,7 @@ namespace djy.Service.Isf provinceCode = item.ProvinceCode, countryCode = item.CountryCode, postcode = item.PostCode, - hstCode = item.CompanyType!="MF"?item.HstCode: master.HstCode, + hstCode = item.CompanyType != "MF" ? item.HstCode : master.HstCode, }); } @@ -394,7 +425,7 @@ namespace djy.Service.Isf isfinfo.version = "1.0"; string json = JsonConvert.SerializeObject(isfinfo); _LogsAdd("SendDE", "post", $"ISF接口调用发送{oid}:{json}"); - + Dictionary dic = new Dictionary(); dic.Add("user_id", Account.PARAMVALUE); dic.Add("method", method.PARAMVALUE); @@ -466,7 +497,7 @@ namespace djy.Service.Isf } history.Operator = user.SHOWNAME; - history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "发送单据失败,失败原因:" + msg+ " "; + history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "发送单据失败,失败原因:" + msg + " "; DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows(); req.Code = 201; req.Message = "操作失败," + msg; @@ -597,7 +628,7 @@ namespace djy.Service.Isf { req.Code = 500; req.Message = ex.InnerException?.Message ?? ex.Message; - _LogsAdd("SendDE", "post", $"ISF_SendDE接口:{req.Message }"); + _LogsAdd("SendDE", "post", $"ISF_SendDE接口:{req.Message}"); return req; } @@ -686,7 +717,7 @@ namespace djy.Service.Isf { req.Code = 500; req.Message = ex.InnerException?.Message ?? ex.Message; - _LogsAdd("SendDE", "post", $"AMS_SaveReceipt接口:{req.Message }"); + _LogsAdd("SendDE", "post", $"AMS_SaveReceipt接口:{req.Message}"); return req; } diff --git a/web/djy_IsfApi/Controllers/ISF/IsfController.cs b/web/djy_IsfApi/Controllers/ISF/IsfController.cs index c1ec6cb..a6cdb98 100644 --- a/web/djy_IsfApi/Controllers/ISF/IsfController.cs +++ b/web/djy_IsfApi/Controllers/ISF/IsfController.cs @@ -41,6 +41,38 @@ namespace djy_Isfpi.Controllers.ISF return ser.Load(request, user, aut); } + + /// + /// 查询指定业务类型的计费规则 + /// + /// 业务类型代码 + /// + [HttpGet("GetPrice")] + public async Task> GetPrice([FromQuery] string bstype) + { + try + { + var user = GetUserInfo(); + if (user == null) + { + return new Response() + { + Code = 401, + Message = "登录过期,请重新登录!" + }; + } + Response result = await ser.GetPrice(bstype, user); + return result; + } + catch (Exception ex) + { + return new Response() + { + Code = 500, + Message = ex.InnerException?.Message ?? ex.Message + }; + } + } #endregion #region 新增/编辑 diff --git a/web/djy_IsfApi/Properties/launchSettings.json b/web/djy_IsfApi/Properties/launchSettings.json index f340c55..6bd802a 100644 --- a/web/djy_IsfApi/Properties/launchSettings.json +++ b/web/djy_IsfApi/Properties/launchSettings.json @@ -1,13 +1,4 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:5002", - "sslPort": 0 - } - }, +{ "profiles": { "IIS Express": { "commandName": "IISExpress", @@ -17,7 +8,13 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "djy_AmsApi": { + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "publishAllPorts": true + }, + "NetCore": { "commandName": "Project", "launchBrowser": true, "launchUrl": "swagger/index.html", @@ -26,12 +23,15 @@ }, "applicationUrl": "http://localhost:5000", "dotnetRunMessages": "true" - }, - "Docker": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", - "publishAllPorts": true + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:5002", + "sslPort": 0 } } } \ No newline at end of file diff --git a/web/djy_IsfApi/djy_IsfApi.csproj.user b/web/djy_IsfApi/djy_IsfApi.csproj.user index 0c0d867..ebba816 100644 --- a/web/djy_IsfApi/djy_IsfApi.csproj.user +++ b/web/djy_IsfApi/djy_IsfApi.csproj.user @@ -4,5 +4,12 @@ C:\Project\DJYAMS\djyweb_ams\web\djy_IsfApi\Properties\PublishProfiles\FolderProfile.pubxml MvcControllerEmptyScaffolder root/Common/MVC/Controller + NetCore + + + ProjectDebugger + + + ProjectDebugger \ No newline at end of file