ISF增加购买Bond需求开发:添加【获取计费规则】接口

master
zhangxiaofeng 1 year ago
parent f53c370e6c
commit ba0179334d

@ -881,19 +881,39 @@
赠送余额 赠送余额
</summary> </summary>
</member> </member>
<member name="P:Common.DJYModel.CustPrice.PRICE">
<summary>
单价(主单)
</summary>
</member>
<member name="P:Common.DJYModel.CustPrice.PRICEF"> <member name="P:Common.DJYModel.CustPrice.PRICEF">
<summary> <summary>
pricef 分单 单价(分单)
</summary> </summary>
</member> </member>
<member name="P:Common.DJYModel.CustPrice.PRICEFQG"> <member name="P:Common.DJYModel.CustPrice.PRICEFQG">
<summary> <summary>
青港主单 单价(青港主单
</summary> </summary>
</member> </member>
<member name="P:Common.DJYModel.CustPrice.PRICEQG"> <member name="P:Common.DJYModel.CustPrice.PRICEQG">
<summary> <summary>
青港分单 单价(青港分单)
</summary>
</member>
<member name="T:Common.DJYModel.CustPriceDto">
<summary>
计费规则 <see cref="T:Common.DJYModel.CustPrice"/> 类型的Dto类
</summary>
</member>
<member name="P:Common.DJYModel.CustPriceDto.BSTYPE">
<summary>
业务类型
</summary>
</member>
<member name="P:Common.DJYModel.CustPriceDto.PRICE">
<summary>
单价(主单)
</summary> </summary>
</member> </member>
<member name="T:Common.DJYModel.DataBase"> <member name="T:Common.DJYModel.DataBase">

@ -32,24 +32,27 @@ namespace Common.DJYModel
[JsonProperty, Column(DbType = "decimal(19,2)")] [JsonProperty, Column(DbType = "decimal(19,2)")]
public decimal? GiftBalance { get; set; } public decimal? GiftBalance { get; set; }
/// <summary>
/// 데송(寮데)
/// </summary>
[JsonProperty, Column(DbType = "decimal(19,2)")] [JsonProperty, Column(DbType = "decimal(19,2)")]
public decimal? PRICE { get; set; } public decimal? PRICE { get; set; }
/// <summary> /// <summary>
/// pricef 롸데 /// 데송(롸데)
/// </summary> /// </summary>
[JsonProperty, Column(DbType = "decimal(19,2)")] [JsonProperty, Column(DbType = "decimal(19,2)")]
public decimal PRICEF { get; set; } = 0M; public decimal PRICEF { get; set; } = 0M;
/// <summary> /// <summary>
/// 행멍寮데 /// 데송(행멍寮데)
/// </summary> /// </summary>
[JsonProperty, Column(DbType = "decimal(19,2)")] [JsonProperty, Column(DbType = "decimal(19,2)")]
public decimal PRICEFQG { get; set; } = 0M; public decimal PRICEFQG { get; set; } = 0M;
/// <summary> /// <summary>
/// 행멍롸데 /// 데송(행멍롸데)
/// </summary> /// </summary>
[JsonProperty, Column(DbType = "decimal(19,2)")] [JsonProperty, Column(DbType = "decimal(19,2)")]
public decimal PRICEQG { get; set; } = 0M; public decimal PRICEQG { get; set; } = 0M;

@ -0,0 +1,22 @@
namespace Common.DJYModel
{
/// <summary>
/// 计费规则 <see cref="CustPrice"/> 类型的Dto类
/// </summary>
public class CustPriceDto
{
public string GID { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public int? BSTYPE { get; set; }
public string COMID { get; set; }
public string COMNAME { get; set; }
/// <summary>
/// 单价(主单)
/// </summary>
public decimal? PRICE { get; set; }
}
}

@ -44,7 +44,7 @@ namespace djy.IService.Isf
/// 获取模板 /// 获取模板
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
List<ISF_CompanyTemplate> GetTemplate(User user, string CompanyType, string InFoType,string TemPlateName); List<ISF_CompanyTemplate> GetTemplate(User user, string CompanyType, string InFoType, string TemPlateName);
/// <summary> /// <summary>
@ -66,6 +66,14 @@ namespace djy.IService.Isf
Response SaveReceipt(string msg ); Response SaveReceipt(string msg);
/// <summary>
/// 获取计费规则
/// </summary>
/// <param name="bstype">业务类型</param>
/// <param name="user">登录人信息</param>
/// <returns>计费规则</returns>
Task<Response<CustPriceDto>> GetPrice(string bstype, User user);
} }
} }

@ -14,6 +14,7 @@ namespace djy.Service.DjyService
public AutoMapperConfig() { public AutoMapperConfig() {
CreateMap<tb_OpenModuleServer, ModuleServerDto>().ReverseMap(); CreateMap<tb_OpenModuleServer, ModuleServerDto>().ReverseMap();
CreateMap<tb_sys_Dictionary, tb_sys_DictionaryDto>().ReverseMap(); CreateMap<tb_sys_Dictionary, tb_sys_DictionaryDto>().ReverseMap();
CreateMap<CustPrice, CustPriceDto>().ReverseMap();
} }
} }

@ -16,6 +16,7 @@ using System.Reflection;
using Common.Extensions; using Common.Extensions;
using Common.DJYModel; using Common.DJYModel;
using Common.Entity; using Common.Entity;
using Common.Utilities;
namespace djy.Service.DjyService namespace djy.Service.DjyService
{ {
@ -126,6 +127,16 @@ namespace djy.Service.DjyService
return count > 0 ? true : false; return count > 0 ? true : false;
} }
/// <summary>
/// 创建Response响应对象
/// </summary>
/// <param name="code">结果代码</param>
/// <param name="message">结果描述</param>
internal Response<T> CreateResponse<T>(int code, string message)
{
return new Response<T>() { Code = code, Message = message };
}
} }

@ -56,6 +56,37 @@ namespace djy.Service.Isf
result.data = list; result.data = list;
return result; return result;
} }
/// <summary>
/// 获取计费规则
/// </summary>
/// <param name="bstype">业务类型</param>
/// <param name="user">登录人信息</param>
/// <returns>计费规则</returns>
public async Task<Response<CustPriceDto>> GetPrice(string bstype, User user)
{
try
{
if (!int.TryParse(bstype, out int _bstype))
{
return CreateResponse<CustPriceDto>(400, "参数[bstype:业务类型]为空或格式错误");
}
CustPrice custPrice = await DbBus.Get(DbList.djydb).Select<CustPrice>().Where(w => w.BSTYPE == _bstype && w.SENDTYPE == 0 && w.COMNAME == user.COMNAME).ToOneAsync();
if (custPrice == null)
{
return CreateResponse<CustPriceDto>(201, "没有找到此业务的计费规则");
}
CustPriceDto custPriceDto = custPrice.MapTo<CustPriceDto>();
return new Response<CustPriceDto>() { Code = 200, Message = "查询成功", Result = custPriceDto };
}
catch (Exception ex)
{
_LogsAdd("GetPrice", "post", $"ISF_GetPrice接口{ex.Message}");
return CreateResponse<CustPriceDto>(500, ex.Message);
}
}
#endregion #endregion
#region 新增编辑 #region 新增编辑
@ -280,7 +311,7 @@ namespace djy.Service.Isf
#endregion #endregion
#region 第三方接口 #region 第三方接口
/// <param name="msgType">类型(1.原始 2.修改 3.删除 4.重发)</param>
public async Task<Response> SendDE(string Gid, User user, string msgType) public async Task<Response> SendDE(string Gid, User user, string msgType)
{ {
Response req = new Response(); Response req = new Response();
@ -368,7 +399,7 @@ namespace djy.Service.Isf
provinceCode = item.ProvinceCode, provinceCode = item.ProvinceCode,
countryCode = item.CountryCode, countryCode = item.CountryCode,
postcode = item.PostCode, postcode = item.PostCode,
hstCode = item.CompanyType!="MF"?item.HstCode: master.HstCode, hstCode = item.CompanyType != "MF" ? item.HstCode : master.HstCode,
}); });
} }
@ -466,7 +497,7 @@ namespace djy.Service.Isf
} }
history.Operator = user.SHOWNAME; 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(); DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
req.Code = 201; req.Code = 201;
req.Message = "操作失败," + msg; req.Message = "操作失败," + msg;
@ -597,7 +628,7 @@ namespace djy.Service.Isf
{ {
req.Code = 500; req.Code = 500;
req.Message = ex.InnerException?.Message ?? ex.Message; req.Message = ex.InnerException?.Message ?? ex.Message;
_LogsAdd("SendDE", "post", $"ISF_SendDE接口{req.Message }"); _LogsAdd("SendDE", "post", $"ISF_SendDE接口{req.Message}");
return req; return req;
} }
@ -686,7 +717,7 @@ namespace djy.Service.Isf
{ {
req.Code = 500; req.Code = 500;
req.Message = ex.InnerException?.Message ?? ex.Message; req.Message = ex.InnerException?.Message ?? ex.Message;
_LogsAdd("SendDE", "post", $"AMS_SaveReceipt接口{req.Message }"); _LogsAdd("SendDE", "post", $"AMS_SaveReceipt接口{req.Message}");
return req; return req;
} }

@ -41,6 +41,38 @@ namespace djy_Isfpi.Controllers.ISF
return ser.Load(request, user, aut); return ser.Load(request, user, aut);
} }
/// <summary>
/// 查询指定业务类型的计费规则
/// </summary>
/// <param name="bstype">业务类型代码</param>
/// <returns></returns>
[HttpGet("GetPrice")]
public async Task<Response<CustPriceDto>> GetPrice([FromQuery] string bstype)
{
try
{
var user = GetUserInfo();
if (user == null)
{
return new Response<CustPriceDto>()
{
Code = 401,
Message = "登录过期,请重新登录!"
};
}
Response<CustPriceDto> result = await ser.GetPrice(bstype, user);
return result;
}
catch (Exception ex)
{
return new Response<CustPriceDto>()
{
Code = 500,
Message = ex.InnerException?.Message ?? ex.Message
};
}
}
#endregion #endregion
#region 新增/编辑 #region 新增/编辑

@ -1,13 +1,4 @@
{ {
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:5002",
"sslPort": 0
}
},
"profiles": { "profiles": {
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
@ -17,7 +8,13 @@
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
}, },
"djy_AmsApi": { "Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
"publishAllPorts": true
},
"NetCore": {
"commandName": "Project", "commandName": "Project",
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "swagger/index.html", "launchUrl": "swagger/index.html",
@ -26,12 +23,15 @@
}, },
"applicationUrl": "http://localhost:5000", "applicationUrl": "http://localhost:5000",
"dotnetRunMessages": "true" "dotnetRunMessages": "true"
}
}, },
"Docker": { "$schema": "http://json.schemastore.org/launchsettings.json",
"commandName": "Docker", "iisSettings": {
"launchBrowser": true, "windowsAuthentication": false,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", "anonymousAuthentication": true,
"publishAllPorts": true "iisExpress": {
"applicationUrl": "http://localhost:5002",
"sslPort": 0
} }
} }
} }

@ -4,5 +4,12 @@
<NameOfLastUsedPublishProfile>C:\Project\DJYAMS\djyweb_ams\web\djy_IsfApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>C:\Project\DJYAMS\djyweb_ams\web\djy_IsfApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<ActiveDebugProfile>NetCore</ActiveDebugProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save