jianghaiqing 1 month ago
commit c606ae6e15

@ -82,18 +82,19 @@ namespace DS.Module.ExcelModule
{
var columnSet = req.ColumnSets[n];
var key = columnSet.DataIndex;
if (temp[key].ObjToString().ToLower()== "false")
{
info.Add(columnSet.Title, "否");
}
if (temp[key].ObjToString().ToLower() == "true")
{
info.Add(columnSet.Title, "是");
}
else
{
info.Add(columnSet.Title, temp[key]);
}
//if (temp[key].ObjToString().ToLower()== "false")
//{
// info.Add(columnSet.Title, "否");
//}
//if (temp[key].ObjToString().ToLower() == "true")
//{
// info.Add(columnSet.Title, "是");
//}
//else
//{
// info.Add(columnSet.Title, temp[key]);
//}
}
values.Add(info);
}

@ -7,6 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AlibabaCloud.SDK.Dingtalk" Version="2.1.56" />
<PackageReference Include="AnyDiff" Version="1.0.99" />
<PackageReference Include="Autofac" Version="8.1.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />

@ -1,5 +1,6 @@
using DS.WMS.Core.Jobs;
using DS.WMS.Core.QuarztJobs;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Quartz;
@ -7,7 +8,7 @@ namespace DS.Module.QuartzModuleInstall
{
public static class QuartzModuleInstall
{
public static void AddFeeQuartzModuleInstall(this IServiceCollection services)
public static void AddFeeQuartzModuleInstall(this IServiceCollection services, IConfiguration configuration)
{
//获取进项发票
var jobKey = new JobKey("InInvoice");
@ -52,7 +53,7 @@ namespace DS.Module.QuartzModuleInstall
q.AddTrigger(opts => opts
.ForJob(jobKey3)
.WithIdentity(nameof(FeeCustTemplateJob) + "-trigger")
.WithCronSchedule("1 59 23 * * ?")
.WithCronSchedule(configuration["JobConfig:" + jobKey3.Name])
);
});
@ -60,7 +61,7 @@ namespace DS.Module.QuartzModuleInstall
services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
}
public static void AddOpQuartzModuleInstall(this IServiceCollection services)
public static void AddOpQuartzModuleInstall(this IServiceCollection services, IConfiguration configuration)
{
var jobKey1 = new JobKey(nameof(WSLReportJob));
services.AddQuartz(q =>
@ -70,7 +71,7 @@ namespace DS.Module.QuartzModuleInstall
q.AddTrigger(opts => opts
.ForJob(jobKey1)
.WithIdentity(nameof(WSLReportJob) + "-trigger")
.WithCronSchedule("0 0 1 * * ?")
.WithCronSchedule(configuration["JobConfig:" + jobKey1.Name])
//.WithSimpleSchedule(s => s.WithIntervalInMinutes(1).WithRepeatCount(1)) //测试用
);
});

@ -0,0 +1,191 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Entity;
using Masuit.Tools.Systems;
namespace DS.WMS.Core.Fee.Dtos
{
/// <summary>
/// 客户费用模板视图
/// </summary>
public class FeeCustTemplateView
{
/// <summary>
/// 主键ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 模板ID
/// </summary>
public long TemplateId { get; set; }
/// <summary>
/// 结算对象Id
/// </summary>
public long CustomerId { get; set; }
/// <summary>
/// 结算对象
/// </summary>
public string? CustomerName { get; set; }
/// <summary>
/// 结算对象类型
/// </summary>
public string? CustomerType { get; set; }
/// <summary>
/// 费用Id
/// </summary>
public long FeeId { get; set; }
/// <summary>
/// 费用名称
/// </summary>
public string? FeeName { get; set; }
/// <summary>
/// 20GP
/// </summary>
public string? Unit20GP { get; set; }
/// <summary>
/// 40GP
/// </summary>
public string? Unit40GP { get; set; }
/// <summary>
/// 40HC
/// </summary>
public string? Unit40HC { get; set; }
/// <summary>
/// 45G0
/// </summary>
public string? Unit45G0 { get; set; }
/// <summary>
/// TEU
/// </summary>
public string? UnitTEU { get; set; }
/// <summary>
/// 单票
/// </summary>
public string? UnitP { get; set; }
/// <summary>
/// 是否箱型
/// </summary>
public bool IsCtn { get; set; }
/// <summary>
/// 币别
/// </summary>
public string? Currency { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal? UnitPrice { get; set; }
/// <summary>
/// 汇率,为空时取默认汇率
/// </summary>
public decimal? ExchangeRate { get; set; }
/// <summary>
/// 费用默认税率
/// </summary>
public decimal? TaxRate { get; set; }
/// <summary>
/// 财务税率
/// </summary>
public decimal? AccTaxRate { get; set; }
/// <summary>
/// 税额
/// </summary>
public decimal? Tax { get; set; }
/// <summary>
/// 含税单价
/// </summary>
public decimal? TaxUnitPrice { get; set; }
/// <summary>
/// 是否开票
/// </summary>
public bool IsInvoice { get; set; }
/// <summary>
/// 是否垫付费用
/// </summary>
public bool IsAdvancedPay { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string? CreateBy { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public BusinessType BusinessType { get; set; }
/// <summary>
/// 业务类型文本
/// </summary>
public string BusinessTypeText => BusinessType.GetDescription();
/// <summary>
/// 费用类型
/// </summary>
public FeeType FeeType { get; set; }
/// <summary>
/// 费用类型文本
/// </summary>
public string FeeTypeText => FeeType.GetDescription();
/// <summary>
/// 开始时间
/// </summary>
public DateTime? StartTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public DateTime? EndTime { get; set; }
/// <summary>
/// 是否禁用
/// </summary>
public bool IsDisabled { get; set; }
///// <summary>
///// 费用类别ID
///// </summary>
//public string? FeeCategoryId { get; set; }
/// <summary>
/// 费用类别名称
/// </summary>
public string? FeeCategoryName { get; set; }
/// <summary>
/// 优先级
/// </summary>
public int Priority { get; set; }
/// <summary>
/// 起运港代码
/// </summary>
public string? POLCode { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string? PODCode { get; set; }
/// <summary>
/// 航线名称
/// </summary>
public string? LaneName { get; set; }
/// <summary>
/// 承运商名称
/// </summary>
public string? CarrierName { get; set; }
/// <summary>
/// 付费方式代码
/// </summary>
public string? MBLFrtCode { get; set; }
/// <summary>
/// 业务来源名称
/// </summary>
public string? SourceName { get; set; }
/// <summary>
/// 业务来源明细名称
/// </summary>
public string? SourceDetailName { get; set; }
/// <summary>
/// 订舱口名称
/// </summary>
public string? ForwarderName { get; set; }
/// <summary>
/// 分公司名称
/// </summary>
public string? DeptOrgName { get; set; }
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using AngleSharp.Css;
using DS.Module.Core;
using DS.Module.Core.Condition;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Code.Entity;
@ -497,6 +498,79 @@ namespace DS.WMS.Core.Fee.Method
return await TenantDb.Queryable<FeeCustTemplate>().Where(whereList).ToQueryPageAsync(request.PageCondition);
}
///// <summary>
///// 视图列表
///// </summary>
///// <param name="request"></param>
///// <returns></returns>
//public async Task<DataResult<List<FeeCustTemplateView>>> GetListViewAsync(PageRequest request)
//{
// var list = TenantDb.Queryable<FeeCustTemplateDetail>()
// .InnerJoin<FeeCustTemplate>((d, t) => d.TemplateId == t.Id)
// .LeftJoin<CodeCarrier>((d, t, cc) => t.CarrierId == cc.Id)
// .LeftJoin<CodeLanes>((d, t, cc, cl) => t.LaneId == cl.Id)
// .LeftJoin<CodeSource>((d, t, cc, cl, cs) => t.SourceId == cs.Id)
// .LeftJoin<CodeSourceDetail>((d, t, cc, cl, cs, csd) => t.SourceDetailId == csd.Id)
// .LeftJoin<InfoClient>((d, t, cc, cl, cs, csd, c) => t.ForwarderId == c.Id)
// .LeftJoin<SysOrg>((d, t, cc, cl, cs, csd, c, so) => t.DeptOrgId == so.Id, "shippingweb8_dev.sys_org")
// .GroupBy((d, t, cc, cl, cs, csd, c, so) => new
// {
// d.TemplateId,
// d.FeeId,
// d.FeeName,
// d.CustomerType,
// d.CustomerId,
// d.CustomerName,
// t.BusinessType,
// t.FeeType,
// t.StartTime,
// t.EndTime,
// t.IsDisabled,
// t.FeeCategoryName,
// t.Priority,
// t.POLCode,
// t.PODCode,
// t.MBLFrtCode,
// cl.LaneName,
// CarrierName = cc.CnName,
// cs.SourceName,
// SourceDetailName = csd.DetailName,
// ForwarderName = c.ShortName,
// DeptOrgName = so.OrgName
// }).Select((d, t, cc, cl, cs, csd, c, so) => new FeeCustTemplateView
// {
// Id = d.Id,
// TemplateId = d.TemplateId,
// CustomerType = d.CustomerType,
// CustomerId = d.CustomerId,
// CustomerName = d.CustomerName,
// FeeId = d.FeeId,
// FeeName = d.FeeName,
// BusinessType = t.BusinessType,
// FeeType = t.FeeType,
// StartTime = t.StartTime,
// EndTime = t.EndTime,
// IsDisabled = t.IsDisabled,
// FeeCategoryName = t.FeeCategoryName,
// Priority = t.Priority,
// POLCode = t.POLCode,
// PODCode = t.PODCode,
// MBLFrtCode = t.MBLFrtCode,
// LaneName = cl.LaneName,
// CarrierName = cc.CnName,
// SourceName = cs.SourceName,
// SourceDetailName = csd.DetailName,
// ForwarderName = c.ShortName,
// DeptOrgName = so.OrgName
// });
//}
/// <summary>
/// 详情
/// </summary>

@ -46,5 +46,19 @@ namespace DS.WMS.Core.Op.Dtos
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 更新人Id
/// </summary>
public long UpdateBy { get; set; }
/// <summary>
/// 更新人
/// </summary>
public string UpdateUserName { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}

@ -60,7 +60,11 @@ namespace DS.WMS.Core.Sys.Dtos
/// </summary>
[Description("是否可用")]
public bool Disable { get; set; }
/// <summary>
/// 命名规则
/// </summary>
[Description("命名规则")]
public string NamingRule { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -87,7 +87,11 @@ namespace DS.WMS.Core.Sys.Dtos
/// </summary>
[Description("是否可用")]
public bool Disable { get; set; }
/// <summary>
/// 命名规则
/// </summary>
[Description("命名规则")]
public string NamingRule { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -87,7 +87,11 @@ namespace DS.WMS.Core.Sys.Dtos
/// </summary>
[Description("是否可用")]
public bool Disable { get; set; }
/// <summary>
/// 命名规则
/// </summary>
[Description("命名规则")]
public string NamingRule { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -47,7 +47,7 @@ builder.Services.AddRuleEngineModuleInstall();//Djy
//builder.Services.AddHangfireFeeInstall();//Hangfire服务
// 使用自定义的 Quartz 配置// 添加 Quartz 服务
builder.Services.AddFeeQuartzModuleInstall();
builder.Services.AddFeeQuartzModuleInstall(builder.Configuration);
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();

@ -73,5 +73,8 @@
"WorkerCount": 10,
"ServerName": "FeeApi",
"Queues": "fee"
},
"JobConfig": {
"FeeCustTemplateJob": "1 59 23 * * ?"
}
}

@ -56,8 +56,8 @@ builder.Services.AddMQModuleInstall();//MQ
//builder.Services.AddCrawlerModuleInstall();//ÔË×Ù·þÎñ
// 使用自定义的 Quartz 配置// 添加 Quartz 服务
builder.Services.AddOpQuartzModuleInstall();
//Ìí¼Ó Quartz ·þÎñ
builder.Services.AddOpQuartzModuleInstall(builder.Configuration);
var app = builder.Build();

@ -146,5 +146,8 @@
"BasePath": "", //使
"RelativePath": "ExportTemplate",
"FileType": [ ".xls", ".xlsx" ]
},
"JobConfig": {
"WSLReportJob": "0 0 1 * * ?"
}
}

@ -79,7 +79,12 @@ namespace DS.WMS.PrintApi.Model
/// </summary>
[Description("是否可用")]
public bool Disable { get; set; }
/// <summary>
/// 命名规则
/// </summary>
[Description("命名规则")]
[SugarColumn(IsNullable = true, ColumnDescription = "命名规则", Length = 200)]
public string NamingRule { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -19,6 +19,7 @@ using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Data;
using System.Dynamic;
using FastReport.Cloud.OAuth;
namespace DS.WMS.PrintApi.Service
{
@ -387,10 +388,33 @@ namespace DS.WMS.PrintApi.Service
var basePath = String.Empty;
var savePath = "wwwroot/PrintTempFile";
var fileName = DateTime.Now.Ticks + "-" + NumUtil.GetRandomString(3);
var fileName =string.Empty;
if (!string.IsNullOrEmpty(template.NamingRule))
{
fileName = template.NamingRule;
var id = sugarParams.Where(x=>x.ParameterName.ToLower()=="@id").FirstOrDefault().Value;
if (id != null) {
var info = tenantDb.Queryable<dynamic>().AS("op_sea_export").Where("id=@id", new { id = id }).First();
if (fileName.Contains("[委托编号]"))
{
fileName = fileName.Replace("[委托编号]", info.MBLNO);
}
if (fileName.Contains("[提单号]"))
{
fileName = fileName.Replace("[提单号]", info.CustomerNo);
}
}
}
if (string.IsNullOrEmpty(fileName))
fileName = DateTime.Now.Ticks + "-" + NumUtil.GetRandomString(3);
//var fileName = DateTime.Now.Ticks + "-" + NumUtil.GetRandomString(3);
var printFileName = $"{fileName}.frx";
var printFile = Path.Combine(savePath, printFileName);
if (File.Exists(printFile))
File.Delete(printFile);
//写入CRX文件
using (FileStream fs = new FileStream(printFile, FileMode.Create))
@ -450,6 +474,8 @@ namespace DS.WMS.PrintApi.Service
{
printName = $"{fileName}.pdf";
saveFile = Path.Combine(savePath, printName);
if (File.Exists(saveFile))
File.Delete(saveFile);
PDFExport pdfExport = new PDFExport();
pdfExport.Export(report, saveFile);
@ -472,6 +498,8 @@ namespace DS.WMS.PrintApi.Service
{
printName = $"{fileName}.xlsx";
saveFile = Path.Combine(savePath, printName);
if (File.Exists(saveFile))
File.Delete(saveFile);
Excel2007Export excelExport = new Excel2007Export();
excelExport.Export(report, saveFile);
}
@ -479,6 +507,8 @@ namespace DS.WMS.PrintApi.Service
{
printName = $"{fileName}.doc";
saveFile = Path.Combine(savePath, printName);
if (File.Exists(saveFile))
File.Delete(saveFile);
Word2007Export wordExport = new Word2007Export();
wordExport.Export(report, saveFile);
}

Loading…
Cancel
Save