jianghaiqing 4 months ago
commit 65ecbec26b

@ -80,7 +80,7 @@ namespace DS.Module.Core.Enums
Invoiced = 4,
/// <summary>
/// 开出
/// 部分开出
/// </summary>
[Description("部分开出")]
PartialInvoiced = 5

@ -7,17 +7,23 @@ namespace DS.Module.Core.Enums
/// </summary>
public enum InvoiceCategory
{
/// <summary>
/// 普通发票
/// </summary>
[Description("普通发票")]
General = 0,
/// <summary>
/// 电子发票
/// </summary>
[Description("电子发票")]
Electronic = 0,
Electronic = 1,
/// <summary>
/// 纸质发票
/// </summary>
[Description("纸质发票")]
Paper = 1
Paper = 2
}
/// <summary>

@ -45,10 +45,17 @@ namespace DS.WMS.Core.Application.Dtos
public string? AmountUppercase { get; set; }
/// <summary>
/// 所属机构(公司)
/// 所属机构(公司)ID
/// </summary>
[IgnoreDataMember]
public long? OrgId { get; set; }
/// <summary>
/// 所属机构(公司)
/// </summary>
[IgnoreDataMember]
public string? OrgName { get; set; }
/// <summary>
/// 客户地址电话
/// </summary>

@ -253,5 +253,10 @@ namespace DS.WMS.Core.Invoice.Dto
/// 发票明细
/// </summary>
public List<InvoiceDetail>? InvoiceDetails { get; set; }
/// <summary>
/// 费用明细汇总
/// </summary>
public List<SummaryItem>? Summary { get; set; }
}
}

@ -317,7 +317,7 @@ namespace DS.WMS.Core.Invoice.Entity
/// 作废时间
/// </summary>
[SugarColumn(ColumnDescription = "作废时间")]
public DateTime CancelTime { get; set; }
public DateTime? CancelTime { get; set; }
/// <summary>
/// 费用明细

@ -1,7 +1,6 @@
using DS.Module.Core;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Invoice.Dto;
namespace DS.WMS.Core.Invoice.Interface
{
@ -24,11 +23,6 @@ namespace DS.WMS.Core.Invoice.Interface
/// <returns></returns>
Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params BizItem[] items);
/// <summary>
/// 获取发票详情
/// </summary>
/// <param name="id">发票ID</param>
/// <returns></returns>
Task<DataResult<InvoiceDto>> GetAsync(long id);
}
}

@ -0,0 +1,10 @@
namespace DS.WMS.Core.Invoice.Interface
{
/// <summary>
/// 标准开票
/// </summary>
public interface IGeneralInvoiceService : IInvoiceService<Entity.Invoice>
{
}
}

@ -17,6 +17,13 @@ namespace DS.WMS.Core.Invoice.Interface
/// <returns></returns>
Task<DataResult<List<InvoiceDto>>> GetListAsync(PageRequest<string> request);
/// <summary>
/// 获取发票详情
/// </summary>
/// <param name="id">发票ID</param>
/// <returns></returns>
Task<DataResult<InvoiceDto>> GetAsync(long id);
/// <summary>
/// 提交发票开票
/// </summary>
@ -45,5 +52,13 @@ namespace DS.WMS.Core.Invoice.Interface
/// <param name="ids">发票ID</param>
/// <returns></returns>
Task<DataResult> SetLockAsync(bool isLocked, params long[] ids);
/// <summary>
/// 设置发票的作废状态
/// </summary>
/// <param name="isCancelled">是否锁定</param>
/// <param name="ids">发票ID</param>
/// <returns></returns>
Task<DataResult> SetCancelAsync(bool isCancelled, params long[] ids);
}
}

@ -32,47 +32,6 @@ namespace DS.WMS.Core.Invoice.Method
{
}
/// <summary>
/// 获取发票详情
/// </summary>
/// <param name="id">发票ID</param>
/// <returns></returns>
public async Task<DataResult<InvoiceDto>> GetAsync(long id)
{
var invoice = await TenantDb.Queryable<Entity.Invoice>().Select<InvoiceDto>().FirstAsync(x => x.Id == id);
if (invoice != null)
{
invoice.Details = await CreateApplicationDetailQuery((d, f, s) => d.ApplicationId == id && d.Category == DetailCategory.InvoiceIssuance)
.Select(x => new ApplicationDetailDto
{
Id = x.Id,
ApplicationId = x.ApplicationId,
RecordId = x.RecordId,
FeeName = x.FeeName,
FeeType = x.FeeType,
ApplyAmount = x.ApplyAmount,
ExchangeRate = x.ExchangeRate,
OriginalAmount = x.OriginalAmount,
OriginalCurrency = x.OriginalCurrency,
OriginalRate = x.OriginalRate,
CustomerNo = x.CustomerNo,
MBLNO = x.MBLNO,
ClientName = x.ClientName,
ETD = x.ETD,
SaleName = x.SaleName,
SourceName = x.SourceName,
LoadPort = x.LoadPort,
Vessel = x.Vessel,
Voyage = x.Voyage,
}).ToListAsync();
invoice.InvoiceDetails = await TenantDb.Queryable<InvoiceDetail>().Where(
x => x.ApplicationId == id && x.Category == DetailCategory.InvoiceIssuance).ToListAsync();
}
return DataResult<InvoiceDto>.Success(invoice);
}
/// <summary>
/// 获取待开票的业务列表
/// </summary>

@ -0,0 +1,82 @@
using DS.Module.Core;
using DS.Module.Core.Enums;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Invoice.Interface;
using DS.WMS.Core.Sys.Entity;
using SqlSugar;
namespace DS.WMS.Core.Invoice.Method
{
/// <summary>
/// 标准(按申请)开票实现
/// </summary>
public class GeneralInvoiceService : InvoiceService<Entity.Invoice>, IGeneralInvoiceService
{
/// <summary>
/// 初始化
/// </summary>
/// <param name="provider"></param>
public GeneralInvoiceService(IServiceProvider provider) : base(provider)
{
}
/// <summary>
/// 获取付费申请分页列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<InvoiceApplicationDto>>> GetApplicationListAsync(PageRequest request)
{
var query = TenantDb.Queryable<InvoiceApplication>().Where(x => x.Status == InvoiceApplicationStatus.AuditPassed || x.Status == InvoiceApplicationStatus.PartialInvoiced)
.InnerJoin<ApplicationDetail>((a, d) => a.Id == d.ApplicationId && (d.OriginalAmount - d.OriginalProcessedAmount) != 0)
.Select(a => new InvoiceApplicationDto
{
Id = a.Id,
ApplicationNO = a.ApplicationNO,
Status = a.Status,
CustomerId = a.CustomerId,
CustomerName = a.CustomerName, //结算单位
InvoiceHeader = a.InvoiceHeader,
ApplyAmount = a.ApplyAmount,
InvoiceAmount = a.InvoiceAmount,
Currency = a.Currency,
Category = a.Category,
OrgId = a.OrgId, //所属部门
SaleDeptId = a.SaleDeptId, //所属分部
CreateBy = a.CreateBy, //申请人
CreateTime = a.CreateTime, //申请日期
InvoiceRemark = a.InvoiceRemark, //开票要求
Note = a.Note,
//原币金额
OriginalAmountList = SqlFunc.Subqueryable<ApplicationDetail>().Where(y => a.Id == y.ApplicationId)
.GroupBy(y => y.OriginalCurrency).ToList(y => new CurrencyAmount { Currency = y.OriginalCurrency, Amount = y.OriginalAmount })
});
var whereList = request.GetConditionalModels(Db);
var result = await query.Where(whereList).ToQueryPageAsync(request.PageCondition);
if (result.Data.Count > 0)
{
var userIds = result.Data.Select(x => x.CreateBy).Distinct();
var users = await Db.Queryable<SysUser>().Where(x => userIds.Contains(x.Id)).Select(x => new { x.Id, x.UserName }).ToListAsync();
var orgIds = result.Data.Where(x => x.SaleDeptId.HasValue).Select(x => x.SaleDeptId)
.Union(result.Data.Where(x => x.OrgId.HasValue).Select(x => x.OrgId))
.Distinct();
var orgs = await Db.Queryable<SysOrg>().Where(x => orgIds.Contains(x.Id)).Select(x => new { x.Id, x.OrgName }).ToListAsync();
foreach (var item in result.Data)
{
item.CreateByName = users.Find(x => x.Id == item.CreateBy)?.UserName;
item.SaleDeptName = orgs.Find(x => x.Id == item.SaleDeptId)?.OrgName;
item.OrgName = orgs.Find(x => x.Id == item.OrgId)?.OrgName;
}
}
return result;
}
}
}

@ -113,6 +113,55 @@ namespace DS.WMS.Core.Invoice.Method
return result;
}
/// <summary>
/// 获取发票详情
/// </summary>
/// <param name="id">发票ID</param>
/// <returns></returns>
public async Task<DataResult<InvoiceDto>> GetAsync(long id)
{
var invoice = await TenantDb.Queryable<Entity.Invoice>().Select<InvoiceDto>().FirstAsync(x => x.Id == id);
if (invoice != null)
{
invoice.Details = await CreateApplicationDetailQuery((d, f, s) => d.ApplicationId == id && d.Category == DetailCategory.InvoiceIssuance)
.Select(x => new ApplicationDetailDto
{
Id = x.Id,
ApplicationId = x.ApplicationId,
RecordId = x.RecordId,
FeeName = x.FeeName,
FeeType = x.FeeType,
ApplyAmount = x.ApplyAmount,
ExchangeRate = x.ExchangeRate,
Currency = x.Currency,
OriginalAmount = x.OriginalAmount,
OriginalCurrency = x.OriginalCurrency,
OriginalRate = x.OriginalRate,
CustomerNo = x.CustomerNo,
MBLNO = x.MBLNO,
ClientName = x.ClientName,
ETD = x.ETD,
SaleName = x.SaleName,
SourceName = x.SourceName,
LoadPort = x.LoadPort,
Vessel = x.Vessel,
Voyage = x.Voyage,
}).ToListAsync();
invoice.Summary = invoice.Details.GroupBy(x => new { x.FeeType, x.Currency }).Select(x => new SummaryItem
{
FeeType = x.Key.FeeType,
Currency = x.Key.Currency,
Amount = x.Sum(y => y.ApplyAmount)
}).ToList();
invoice.InvoiceDetails = await TenantDb.Queryable<InvoiceDetail>().Where(
x => x.ApplicationId == id && x.Category == DetailCategory.InvoiceIssuance).ToListAsync();
}
return DataResult<InvoiceDto>.Success(invoice);
}
/// <summary>
/// 提交发票开票
/// </summary>
@ -518,5 +567,28 @@ namespace DS.WMS.Core.Invoice.Method
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
/// <summary>
/// 设置发票的作废状态
/// </summary>
/// <param name="isCancelled">是否锁定</param>
/// <param name="ids">发票ID</param>
/// <returns></returns>
public async Task<DataResult> SetCancelAsync(bool isCancelled, params long[] ids)
{
var dt = DateTime.Now;
var userId = long.Parse(User.UserId);
var list = ids.Select(x => new TEntity
{
Id = x,
IsCancelled = isCancelled,
CancelTime = isCancelled ? dt : null,
CancelUserId = isCancelled ? userId : null
}).ToList();
int rows = await TenantDb.Updateable(list)
.UpdateColumns(x => new { x.IsCancelled, x.CancelTime, x.CancelUserId }).ExecuteCommandAsync();
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
}
}

@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 历史提单信息引入列表
/// </summary>
public class BillManageHistoryListRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 分提单号
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 船名 t_code_vessel
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 船名Id t_code_vessel
/// </summary>
public long VesselId { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
public long LoadPortId { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string LoadPort { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public long DischargePortId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 发货人 t_info_client CUSTNAME
/// </summary>
public long? ShipperId { get; set; }
/// <summary>
/// 发货人内容
/// </summary>
public string ShipperContent { get; set; }
/// <summary>
/// 收货人 t_info_client CUSTNAME
/// </summary>
public long? ConsigneeId { get; set; }
/// <summary>
/// 收货人内容
/// </summary>
public string ConsigneeContent { get; set; }
/// <summary>
/// 代理人 t_info_client CUSTNAME
/// </summary>
public long? AgentId { get; set; }
/// <summary>
/// 代理人内容
/// </summary>
public string AgentContent { get; set; }
/// <summary>
/// 录入日期
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 录入人Id
/// </summary>
public long CreateBy { get; set; }
/// <summary>
/// 录入人
/// </summary>
public string CreateByName { get; set; }
}
}

@ -46,6 +46,10 @@ namespace DS.WMS.Core.Op.Dtos
}
public class BookingStatusLogDetailDto
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 主单id
/// </summary>

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 货运动态
/// </summary>
public class BookingStatusLogRes
{
public long Id { get; set; }
/// <summary>
/// 业务id
/// </summary>
public long BusinessId { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 状态时间
/// </summary>
public DateTime? OpTime { get; set; }
/// <summary>
/// 类别
/// </summary>
public string Group { get; set; }
/// <summary>
/// 状态分类
/// </summary>
public string Type { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBLNO { get; set; }
public List<BookingStatusLogDetailDto> detail { get; set; }
}
}

@ -36,10 +36,10 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 模板Id
/// </summary>
public long TemplateId { get; set; }
///// <summary>
///// 模板Id
///// </summary>
//public long TemplateId { get; set; }
/// <summary>
/// 提单类型

@ -21,16 +21,19 @@ namespace DS.WMS.Core.Op.Dtos
/// 业务Id
/// </summary>
public long BusinessId { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 分提单号
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 模板Id
/// </summary>
public long TemplateId { get; set; }
///// <summary>
///// 模板Id
///// </summary>
//public long TemplateId { get; set; }
/// <summary>
/// 提单类型

@ -1325,4 +1325,23 @@ public class SeaExport : BaseOrgModel<long>
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "车队联系人Id", IsNullable = false, DefaultValue = "0")]
public long CarrierContactId { get; set; }
/// <summary>
/// 云港通ETD
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "云港通ETD", IsNullable = true)]
public DateTime? YgtETD { get; set; }
/// <summary>
/// StartATA
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "StartATA", IsNullable = true)]
public DateTime? StartATA { get; set; }
/// <summary>
/// StartETA
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "StartETA", IsNullable = true)]
public DateTime? StartETA { get; set; }
}

@ -29,11 +29,11 @@ public class SeaExportBillManage : BaseOrgModel<long>
[SqlSugar.SugarColumn(ColumnDescription = "分提单号", IsNullable = true, Length = 30)]
public string HBLNO { get; set; }
/// <summary>
/// 模板Id
/// </summary>
[SugarColumn(ColumnDescription = "模板Id")]
public long TemplateId { get; set; }
///// <summary>
///// 模板Id
///// </summary>
//[SugarColumn(ColumnDescription = "模板Id")]
//public long TemplateId { get; set; }
/// <summary>
/// 提单类型

@ -56,5 +56,19 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="req">主表Id及箱信息Ids</param>
/// <returns></returns>
public DataResult BatchDelBillManageCtn(IdModel req);
/// <summary>
/// 历史引入查询列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<BillManageHistoryListRes>> GetBillManageHistoryList(PageRequest request);
/// <summary>
/// 历史引入提单信息
/// </summary>
/// <param name="req">主表Id及历史提单Ids</param>
/// <returns></returns>
public Task<DataResult> ImportBillManageHistory(IdModel req);
}
}

@ -174,4 +174,12 @@ public interface ISeaExportService
/// <returns></returns>
public Task<DataResult<RuleEngineResult>> ExcuteRuleEngine(string id);
/// <summary>
/// 订单及货运动态
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList(PageRequest request);
}

@ -371,42 +371,42 @@ namespace DS.WMS.Core.Op.Method
// }
//}
}
//else if (item.Status == "ETD")
//{
// if (order != null && item.OpTime != null && order.YgtETD != item.OpTime)
// {
// order.YgtETD = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new
// {
// x.YgtETD
// }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// }
//}
//else if (item.Status == "ATA")
//{
// if (order != null && item.OpTime != null && order.StartATA != item.OpTime)
// {
// order.StartATA = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new
// {
// x.StartATA
// }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// }
//}
//else if (item.Status == "ETA")
//{
// if (order != null && item.OpTime != null && order.StartETA != item.OpTime)
// {
// order.StartETA = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new
// {
// x.StartETA
// }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// }
//}
else if (item.Status == "ETD")
{
if (order != null && item.OpTime != null && order.YgtETD != item.OpTime)
{
order.YgtETD = item.OpTime;
await tenantDb.Updateable(order).UpdateColumns(x => new
{
x.YgtETD
}).EnableDiffLogEvent().ExecuteCommandAsync();
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
else if (item.Status == "ATA")
{
if (order != null && item.OpTime != null && order.StartATA != item.OpTime)
{
order.StartATA = item.OpTime;
await tenantDb.Updateable(order).UpdateColumns(x => new
{
x.StartATA
}).EnableDiffLogEvent().ExecuteCommandAsync();
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
else if (item.Status == "ETA")
{
if (order != null && item.OpTime != null && order.StartETA != item.OpTime)
{
order.StartETA = item.OpTime;
await tenantDb.Updateable(order).UpdateColumns(x => new
{
x.StartETA
}).EnableDiffLogEvent().ExecuteCommandAsync();
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
else if (item.Status == "MDGETA")
{
if (order != null && item.OpTime != null && order.ETA != item.OpTime)

@ -14,6 +14,10 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Entity;
using Microsoft.AspNet.SignalR.Hubs;
namespace DS.WMS.Core.Op.Method
{
@ -175,5 +179,76 @@ namespace DS.WMS.Core.Op.Method
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
/// <summary>
/// 历史引入查询列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<BillManageHistoryListRes>> GetBillManageHistoryList(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var users = db.Queryable<SysUser>().Select(x => new { x.Id, x.UserName }).ToList();
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<SeaExportBillManage>()
.Where(whereList)
.Select<BillManageHistoryListRes>()
.Mapper(it =>
{
it.CreateByName = users.Find(x => x.Id == it.CreateBy).UserName;
})
.ToQueryPage(request.PageCondition);
return data;
}
/// <summary>
/// 历史引入提单信息
/// </summary>
/// <param name="req">主表Id及历史提单Ids</param>
/// <returns></returns>
public async Task<DataResult> ImportBillManageHistory(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = await tenantDb.Queryable<SeaExport>().Where(x => x.Id ==long.Parse(req.Id)).FirstAsync();
if (info.IsNull())
return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist));
if (!tenantDb.Queryable<SeaExportBillManage>().Where(x => req.Ids.Contains(x.Id)).Any())
return DataResult.Failed("提单信息不存在", MultiLanguageConst.ShippingBillManageNotExist);
var list = await tenantDb.Queryable<SeaExportBillManage>().Where(x => req.Ids.Contains(x.Id)).ToListAsync();
var newList = new List<SeaExportBillManage>();
foreach (var item in list)
{
var temp = new SeaExportBillManage()
{
BusinessId = long.Parse(req.Id),
ShipperContent = item.ShipperContent,
ShipperCode = item.ShipperCode,
ShipperCountry = item.ShipperCountry,
ShipperEmail = item.ShipperEmail,
ShipperTel = item.ShipperTel,
ConsigneeContent = item.ConsigneeContent,
ConsigneeCode = item.ConsigneeCode,
ConsigneeCountry = item.ConsigneeCountry,
ConsigneeEmail = item.ConsigneeEmail,
ConsigneeTel = item.ConsigneeTel,
NotifyPartyContent = item.NotifyPartyContent,
NotifyPartyCode = item.NotifyPartyCode,
NotifyPartyCountry = item.NotifyPartyCountry,
NotifyPartyEmail = item.NotifyPartyEmail,
NotifyPartyTel = item.NotifyPartyTel,
Marks = item.Marks,
Description = item.Description,
};
newList.Add(temp);
}
await tenantDb.Insertable(newList).ExecuteCommandAsync();
return await Task.FromResult(DataResult.Successed("导入成功",MultiLanguageConst.DataImportSuccess));
}
}
}

@ -806,6 +806,9 @@ public partial class SeaExportService : ISeaExportService
}
#region 删除
@ -1018,4 +1021,25 @@ public partial class SeaExportService : ISeaExportService
return entity;
}
#endregion
/// <summary>
/// 订单及货运动态
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var result = await tenantDb.Queryable<BookingStatusLog>()
.Select<BookingStatusLogRes>()
.Mapper(async it =>
{
it.detail = await tenantDb.Queryable<BookingStatusLogDetail>().Where(x => x.PId == it.Id).Select<BookingStatusLogDetailDto>().ToListAsync();
}
).Where(whereList).ToQueryPageAsync(request.PageCondition);
return result;
}
}

@ -14,7 +14,11 @@ namespace DS.WMS.Core.Sys.Interface;
/// </summary>
public interface IClientCommonService
{
/// <summary>
/// 根据类型获取用户下拉列表
/// </summary>
/// <returns></returns>
public Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code = "");
/// <summary>
/// 获取工厂信息下拉列表
/// </summary>

@ -43,7 +43,30 @@ public class ClientCommonService : IClientCommonService
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
/// 根据类型获取用户下拉列表
/// </summary>
/// <returns></returns>
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code = "")
{
code = code.ToLower();
var data = await db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt())
.WhereIF(code == "operator", a => a.IsOperator == true)
.WhereIF(code == "doc", a => a.IsVouchingClerk == true)
.WhereIF(code == "sale", a => a.IsSale == true)
.WhereIF(code == "custom", a => a.IsCustom == true)
.WhereIF(code == "finance", a => a.IsFinancialStaff == true)
.WhereIF(code == "service", a => a.IsCustomerService == true)
.WhereIF(code == "driver", a => a.IsDriver == true)
.WhereIF(code == "dispatcher", a => a.IsDispatcher == true)
.Select(a => new ApiSelectViewModel
{
Label = a.UserName,
Value = a.Id,
}).ToListAsync();
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
/// 获取工厂信息下拉列表-客户端
/// </summary>

@ -1,5 +1,4 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Invoice.Dto;
@ -72,48 +71,5 @@ namespace DS.WMS.FeeApi.Controllers
return await _service.SaveAsync(request);
}
/// <summary>
/// 删除发票明细
/// </summary>
/// <param name="model">发票明细ID</param>
/// <returns></returns>
[HttpPost, Route("DeleteDetail")]
public async Task<DataResult> DeleteDetailAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _service.DeleteDetailAsync(model.Ids);
}
/// <summary>
/// 删除发票
/// </summary>
/// <param name="model">发票ID</param>
/// <returns></returns>
[HttpPost, Route("Delete")]
public async Task<DataResult> DeleteAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _service.DeleteAsync(model.Ids);
}
/// <summary>
/// 设置发票的锁定状态
/// </summary>
/// <param name="model">发票ID</param>
/// <returns></returns>
[HttpPost, Route("SetLock")]
public async Task<DataResult> SetLockAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
bool isLocked = Convert.ToBoolean(model.Value);
return await _service.SetLockAsync(isLocked, model.Ids);
}
}
}

@ -0,0 +1,95 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Invoice.Dto;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Invoice.Entity;
using DS.WMS.Core.Invoice.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.FeeApi.Controllers
{
/// <summary>
/// 标准按申请开票API
/// </summary>
public class GeneralInvoiceController : ApiController
{
readonly IGeneralInvoiceService _service;
/// <summary>
/// 初始化
/// </summary>
/// <param name="service"></param>
public GeneralInvoiceController(IGeneralInvoiceService service)
{
_service = service;
}
/// <summary>
/// 获取发票详情
/// </summary>
/// <param name="id">发票ID</param>
/// <returns></returns>
[HttpGet, Route("Get")]
public async Task<DataResult<InvoiceDto>> GetAsync(long id)
{
return await _service.GetAsync(id);
}
/// <summary>
/// 提交发票开票
/// </summary>
/// <param name="request">请求参数</param>
/// <returns></returns>
[HttpPost, Route("Save")]
public async Task<DataResult<Invoice>> SaveAsync(InvoiceRequest<Invoice> request)
{
if (!ModelState.IsValid)
return DataResult<Invoice>.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _service.SaveAsync(request);
}
/// <summary>
/// 删除发票明细
/// </summary>
/// <param name="model">发票明细ID</param>
/// <returns></returns>
[HttpPost, Route("DeleteDetail")]
public async Task<DataResult> DeleteDetailAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _service.DeleteDetailAsync(model.Ids);
}
/// <summary>
/// 删除发票
/// </summary>
/// <param name="model">发票ID</param>
/// <returns></returns>
[HttpPost, Route("Delete")]
public async Task<DataResult> DeleteAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _service.DeleteAsync(model.Ids);
}
/// <summary>
/// 设置发票的锁定状态
/// </summary>
/// <param name="model">发票ID</param>
/// <returns></returns>
[HttpPost, Route("SetLock")]
public async Task<DataResult> SetLockAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
bool isLocked = Convert.ToBoolean(model.Value);
return await _service.SetLockAsync(isLocked, model.Ids);
}
}
}

@ -2798,3 +2798,10 @@
2024-07-16 11:28:24.8156 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-16 11:28:24.8156 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-16 11:28:24.8313 Info Configuration initialized.
2024-07-16 14:04:36.2569 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-16 14:04:36.2882 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-16 14:04:36.2985 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-16 14:04:36.3120 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-16 14:04:36.3120 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-16 14:04:36.3120 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-16 14:04:36.3280 Info Configuration initialized.

@ -29,6 +29,17 @@ public class ClientCommonController : ApiController
_invokeService = invokeService;
}
/// <summary>
/// 根据类型获取用户下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetUserListByCode")]
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode([FromQuery] string code = "")
{
var res = await _invokeService.GetUserListByCode(code);
return res;
}
/// <summary>
/// 获取工厂信息下拉列表-客户端
/// </summary>
/// <returns></returns>

@ -100,4 +100,31 @@ public class SeaExportBillManageController : ApiController
var res = _invokeService.BatchDelBillManageCtn(req);
return res;
}
/// <summary>
/// 历史引入查询列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBillManageHistoryList")]
public DataResult<List<BillManageHistoryListRes>> GetBillManageHistoryList([FromBody] PageRequest request)
{
var res = _invokeService.GetBillManageHistoryList(request);
return res;
}
/// <summary>
/// 历史引入提单信息
/// </summary>
/// <param name="req">主表Id及历史提单Ids</param>
/// <returns></returns>
[HttpPost]
[Route("ImportBillManageHistory")]
public async Task<DataResult> ImportBillManageHistory([FromBody] IdModel req)
{
var res = await _invokeService.ImportBillManageHistory(req);
return res;
}
}

@ -402,4 +402,18 @@ public class SeaExportController : ApiController
{
return await _invokeService.ExcuteRuleEngine(id);
}
/// <summary>
/// 订单及货运动态
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBookingStatusLogList")]
public async Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList([FromBody] PageRequest request)
{
var res = await _invokeService.GetBookingStatusLogList(request);
return res;
}
}
Loading…
Cancel
Save