往来单位干系人API

dev
嵇文龙 2 months ago
parent 8607e61ea3
commit 735289a568

@ -1,20 +1,22 @@
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Fee.Interface;
using DS.WMS.Core.Sys.Entity;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using Mapster;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Code.Dtos;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using MiniExcelLibs;
using SqlSugar;
namespace DS.WMS.Core.Fee.Method
{
/// <summary>
///
/// </summary>
public class FeeCodeService: IFeeCodeService
{
private readonly IServiceProvider _serviceProvider;

@ -205,7 +205,7 @@ namespace DS.WMS.Core.Fee.Method
/// <returns></returns>
protected internal async Task FetchExchangeRateAsync(IEnumerable<FeeRecord> items)
{
var exRecords = items.Where(x => x.Currency != x.LocalCurrency);
var exRecords = items.Where(x => x.Currency != x.LocalCurrency && x.ExchangeRate == null);
if (exRecords.Any())
{
var exchanges = exRecords.GroupBy(x => new

@ -1,4 +1,7 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Info.Entity;
namespace DS.WMS.Core.Info.Interface
@ -8,6 +11,34 @@ namespace DS.WMS.Core.Info.Interface
/// </summary>
public interface IClientStakeholderService
{
/// <summary>
/// 提交审核
/// </summary>
/// <param name="idModel"></param>
/// <returns></returns>
Task<DataResult> SubmitAuditAsync(IdModel idModel);
/// <summary>
/// 执行审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult> AuditAsync(AuditRequest request);
/// <summary>
/// 撤销审核
/// </summary>
/// <param name="idModel"></param>
/// <returns></returns>
Task<DataResult> WithdrawAsync(IdModel idModel);
/// <summary>
/// 审核完成回调
/// </summary>
/// <param name="callback">回调信息</param>
/// <returns></returns>
Task<DataResult> AuditCallbackAsync(FlowCallback callback);
/// <summary>
/// 列表
/// </summary>

@ -0,0 +1,137 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.UserModule;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Info.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers
{
/// <summary>
/// 往来单位干系人API
/// </summary>
public class ClientStakeholderController : ApiController
{
readonly IUser _user;
readonly IClientStakeholderService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
/// <param name="user"></param>
public ClientStakeholderController(IClientStakeholderService invokeService, IUser user)
{
_invokeService = invokeService;
_user = user;
}
/// <summary>
/// 提交审核
/// </summary>
/// <param name="idModel"></param>
/// <returns></returns>
[HttpPost, Route("SubmitAudit")]
public async Task<DataResult> SubmitAuditAsync([FromBody] IdModel idModel)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage());
return await _invokeService.SubmitAuditAsync(idModel);
}
/// <summary>
/// 执行审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("Audit")]
public async Task<DataResult> AuditAsync([FromBody] AuditRequest request)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage());
return await _invokeService.AuditAsync(request);
}
/// <summary>
/// 撤销审核
/// </summary>
/// <param name="idModel"></param>
/// <returns></returns>
[HttpPost, Route("Withdraw")]
public async Task<DataResult> WithdrawAsync([FromBody] IdModel idModel)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage());
return await _invokeService.WithdrawAsync(idModel);
}
/// <summary>
/// 审核完成回调
/// </summary>
/// <param name="callback">回调信息</param>
/// <returns></returns>
[HttpPost, Route("AuditCallback")]
public async Task<DataResult> AuditCallbackAsync([FromBody] FlowCallback callback)
{
return await _invokeService.AuditCallbackAsync(callback);
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetList")]
public async Task<DataResult<List<InfoClientStakeholder>>> GetListByPageAsync(PageRequest request)
{
return await _invokeService.GetListByPageAsync(request);
}
/// <summary>
/// 获取客户干系人
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet, Route("Get")]
public async Task<DataResult<InfoClientStakeholder>> GetAsync([FromQuery] long id)
{
return await _invokeService.GetAsync(id);
}
/// <summary>
/// 新增客户干系人
/// </summary>
/// <param name="clientId">客户ID</param>
/// <returns></returns>
[HttpPost, Route("Create")]
public async Task<DataResult> EditAsync(long clientId)
{
var date = DateTime.Now.Date;
return await _invokeService.EditAsync(new InfoClientStakeholder
{
ClientId = clientId,
CreateBy = long.Parse(_user.UserId),
CreateByName = _user.UserName,
StartDate = date,
EndDate = date.AddMonths(4),
Status = StakeholderStatus.Uncommitted
});
}
/// <summary>
/// 更新客户干系人
/// </summary>
/// <param name="stakeholder">干系人</param>
/// <returns></returns>
[HttpPost, Route("Edit")]
public async Task<DataResult> EditAsync([FromBody] InfoClientStakeholder stakeholder)
{
return await _invokeService.EditAsync(stakeholder);
}
}
}
Loading…
Cancel
Save