jianghaiqing 4 months ago
commit 0eefcbfb9d

@ -1607,5 +1607,8 @@ public static class MultiLanguageConst
[Description("该业务存在费用信息")]
public const string CM_FeeExist = "CM_FeeExist";
[Description("此业务该状态下不能生成费用")]
public const string CM_CanNotMakeFee = "This Bill can not make fee in this state.";
#endregion
}

@ -73,6 +73,26 @@ namespace DS.Module.Core.Data
return default;
}
/// <summary>
///
/// </summary>
public T? GetOrDefault<T>(string key)
{
if (dataContext.TryGetValue(key, out var value))
{
if (value is T t)
{
return t;
}
else if (value != null)
{
return (T)Convert.ChangeType(value, typeof(T));
}
}
return default;
}
/// <summary>
///
/// </summary>

@ -181,22 +181,51 @@ namespace DS.Module.Core.Enums
}
/// <summary>
/// 箱管 箱可用状态
/// 箱管 箱运行状态
/// </summary>
public enum CMUsedStateEnum
public enum CMCtnFlowStateEnum
{
/// <summary>
/// 旧箱
/// 重箱卸船到码头DlF- Discharge Inbound Full container at TML
/// </summary>
[Description("可用")]
AV = 1,
[Description("损坏")]
DM = -1,
[Description("DIF")]
DIF = 0,
/// <summary>
/// 新箱
/// 收货人提箱卸货:
/// DCF - C/NEE pick up container from TML and unloading cargo in their warehous or at TML directly
/// </summary>
[Description("新箱")]
REP = 0,
[Description("DCF")]
DCF = 1,
/// <summary>
/// 收货人还空箱GlM - C/NEE empty return our container to our Local Depot
/// </summary>
[Description("GLM")]
GLM = 2,
/// <summary>
/// 坏箱维修计划确认RPM - Container upload Estimate and confirm to repair at our Local Depot.
/// </summary>
[Description("RPM")]
RPM = 3,
/// <summary>
/// 修箱完成进场GlM - Container competed repair and available to pick up with sound status.
/// </summary>
[Description("GIM")]
GIM = 4,
/// <summary>
/// 发货人提空箱DSM - Container picked up by shipper for export by our good service.
/// </summary>
[Description("DSM")]
DSM = 5,
/// <summary>
/// 重箱返场OBF - Container gate-in Terminal and ready for loading.
/// </summary>
[Description("OBF")]
OBF = 6,
/// <summary>
/// 重箱装船LDF- Container loading on board successful.
/// </summary>
[Description("LDF")]
LDF = 7,
}
/// <summary>

@ -168,12 +168,14 @@ namespace DS.Module.Core
}
else if (method == HttpMethod.Post)
{
var jsonRequest = new StringContent(JsonConvert.SerializeObject(requestParams), Encoding.UTF8, "application/json");
string json = JsonConvert.SerializeObject(requestParams);
var jsonRequest = new StringContent(json, Encoding.UTF8, "application/json");
response = await http.PostAsync(reqUri, jsonRequest);
}
else if (method == HttpMethod.Put)
{
var jsonRequest = new StringContent(JsonConvert.SerializeObject(requestParams), Encoding.UTF8, "application/json");
string json = JsonConvert.SerializeObject(requestParams);
var jsonRequest = new StringContent(json, Encoding.UTF8, "application/json");
response = await http.PutAsync(reqUri, jsonRequest);
}
else if (method == HttpMethod.Delete)

@ -18,11 +18,11 @@
<PackageReference Include="fasterflect" Version="3.0.0" />
<PackageReference Include="GZY.Quartz.MUI" Version="2.6.0" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.14" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.62" />
<PackageReference Include="LanguageExt.Core" Version="4.4.7" />
<PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="Mapster" Version="7.4.0" />
<PackageReference Include="Masuit.Tools.Core" Version="2024.4.5" />
<PackageReference Include="Masuit.Tools.Core" Version="2024.5.0" />
<PackageReference Include="MediatR" Version="12.2.0" />
<PackageReference Include="MediatR.Contracts" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNet.SignalR" Version="2.4.3" />
@ -31,7 +31,7 @@
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.7" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.16" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.17" />
<PackageReference Include="MimeKit" Version="4.7.1" />
<PackageReference Include="MiniExcel" Version="1.34.0" />

@ -107,4 +107,17 @@ public class CM_RentInController : ApiController
var res = _invokeService.CM_RentIn_Cancel(id);
return res;
}
/// <summary>
/// 租箱租入_生成费用
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
[Route("CM_RentIn_MakeFee")]
public Task<DataResult> CM_RentIn_MakeFee([FromBody] string id)
{
var res = _invokeService.CM_RentIn_MakeFee(id);
return res;
}
}

@ -6,6 +6,7 @@ using DS.Module.Core.Extensions;
using DS.Module.Core.ServiceExtensions;
using DS.Module.Jwt;
using DS.Module.MultiLanguage;
using DS.Module.RedisModule;
using DS.Module.SqlSugar;
using DS.Module.Swagger;
using DS.Module.UserModule;
@ -32,6 +33,7 @@ builder.Host
builder.Services.AddAppWebInstal();
builder.Services.AddCorsInstall();
builder.Services.AddUserModuleInstall(); //Óû§·þÎñ
builder.Services.AddRedisModuleInstall();//redis
builder.Services.AddSqlSugarInstall();
builder.Services.AddSwaggerInstall();
builder.Services.AddJwtInstall();

@ -103,7 +103,7 @@ public class CodeGoodsService:ICodeGoodsService
var data = req.Adapt<CodeGoods>();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Goods + user.TenantId).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.Goods}{user.TenantId}").ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -113,7 +113,7 @@ public class CodeGoodsService:ICodeGoodsService
info = req.Adapt(info);
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Goods + user.TenantId).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.Goods}{user.TenantId}").IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -157,7 +157,7 @@ public class CodeGoodsService:ICodeGoodsService
return DataResult.Failed("存在已导入的商品!",MultiLanguageConst.CodeGoodsImportAlready);
}
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Goods + user.TenantId).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache($"{SqlSugarCacheConst.Goods}{user.TenantId}").ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -180,7 +180,7 @@ public class CodeGoodsService:ICodeGoodsService
var list = tenantDb.Queryable<CodeGoods>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Goods + user.TenantId).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache($"{SqlSugarCacheConst.Goods}{user.TenantId}").ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -53,7 +53,7 @@ public class CodePackageService:ICodePackageService
var data = req.Adapt<CodePackage>();
var entity = db.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Package + user.TenantId).ExecuteReturnEntity();
var entity = db.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.Package}{user.TenantId}").ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -63,7 +63,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
db.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Package + user.TenantId).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.Package}{user.TenantId}").IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -101,7 +101,7 @@ public class CodePackageService:ICodePackageService
var data = req.Adapt<CodePackage>();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Package + user.TenantId).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.Package}{user.TenantId}").ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -111,7 +111,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Package + user.TenantId).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.Package}{user.TenantId}").IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -154,7 +154,7 @@ public class CodePackageService:ICodePackageService
return DataResult.Failed("存在已导入的包装类型!",MultiLanguageConst.CodePackageImportAlready);
}
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Package + user.TenantId).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache($"{SqlSugarCacheConst.Package}{user.TenantId}").ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -176,7 +176,7 @@ public class CodePackageService:ICodePackageService
var list = tenantDb.Queryable<CodePackage>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Package + user.TenantId).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache($"{SqlSugarCacheConst.Package}{user.TenantId}").ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -110,7 +110,7 @@ public class CodeVesselService : ICodeVesselService
var data = req.Adapt<CodeVessel>();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Vessel + user.TenantId).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.Vessel}{user.TenantId}").ExecuteReturnEntity();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -122,7 +122,7 @@ public class CodeVesselService : ICodeVesselService
info = req.Adapt(info);
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Vessel + user.TenantId).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.Vessel}{user.TenantId}").IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -168,7 +168,7 @@ public class CodeVesselService : ICodeVesselService
return DataResult.Failed("存在已导入的船名信息!", MultiLanguageConst.CodeVesselImportAlready);
}
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Vessel + user.TenantId).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache($"{SqlSugarCacheConst.Vessel}{user.TenantId}").ExecuteCommand();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -195,8 +195,8 @@ public class CodeVesselService : ICodeVesselService
{
var voynos = tenantDb.Queryable<CodeVoyno>().Where(x => req.Ids.Contains(x.VesselId)).ToList();
if (voynos.Count > 0)
tenantDb.Deleteable(voynos).RemoveDataCache(SqlSugarCacheConst.Voyno + user.TenantId).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Vessel + user.TenantId).ExecuteCommand();
tenantDb.Deleteable(voynos).RemoveDataCache($"{SqlSugarCacheConst.Voyno}{user.TenantId}").ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache($"{SqlSugarCacheConst.Vessel}{user.TenantId}").ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -103,7 +103,7 @@ public class CodeVoynoService:ICodeVoynoService
var data = req.Adapt<CodeVoyno>();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Voyno + user.TenantId).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.Voyno}{user.TenantId}").ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -113,7 +113,7 @@ public class CodeVoynoService:ICodeVoynoService
info = req.Adapt(info);
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Voyno + user.TenantId).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.Voyno}{user.TenantId}").IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -158,7 +158,7 @@ public class CodeVoynoService:ICodeVoynoService
return DataResult.Failed("存在已导入的航次信息!",MultiLanguageConst.CodeVoynoImportAlready);
}
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Voyno + user.TenantId).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache($"{SqlSugarCacheConst.Voyno}{user.TenantId}").ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -181,7 +181,7 @@ public class CodeVoynoService:ICodeVoynoService
var list = tenantDb.Queryable<CodeVoyno>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Voyno + user.TenantId).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache($"{SqlSugarCacheConst.Voyno}{user.TenantId}").ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -79,7 +79,8 @@ public class CM_CurrentStateReq
/// </summary>
public string CtnReleaseNo { get; set; }
/// <summary>
/// <summary>
/// Desc:箱状态Id
/// </summary>
@ -89,10 +90,23 @@ public class CM_CurrentStateReq
/// </summary>
public string CtnState => CtnStateId?.GetDescription();
/// <summary>
/// Desc:箱流转状态Id
/// </summary>
public CMCtnFlowStateEnum? CtnFlowStateId { get; set; }
/// <summary>
/// Desc:箱流转状态
/// </summary>
public string CtnFlowState => CtnFlowStateId?.GetDescription();
/// <summary>
/// Desc:箱损坏/维修状态Id
/// </summary>
public CMCtnBreakStateEnum? CtnBreakStateId { get; set; }
/// <summary>
/// Desc:箱损坏/维修状态
/// </summary>
public string CtnBreakState { get; set; }
public string CtnBreakState => CtnBreakStateId?.GetDescription();
/// <summary>

@ -86,6 +86,15 @@ public class CM_CurrentStateRes
/// </summary>
public string CtnState => CtnStateId?.GetDescription();
/// <summary>
/// Desc:箱流转状态Id
/// </summary>
public CMCtnFlowStateEnum? CtnFlowStateId { get; set; }
/// <summary>
/// Desc:箱流转状态
/// </summary>
public string CtnFlowState => CtnFlowStateId?.GetDescription();
/// <summary>
/// Desc:箱损坏/维修状态Id
/// </summary>

@ -96,6 +96,17 @@ public class CM_State_ChangeReq
/// </summary>
public string CtnState => CtnStateId?.GetDescription();
/// <summary>
/// Desc:箱流转状态Id
/// </summary>
public CMCtnFlowStateEnum? CtnFlowStateId { get; set; }
/// <summary>
/// Desc:箱流转状态
/// </summary>
public string CtnFlowState => CtnFlowStateId?.GetDescription();
/// <summary>
/// Desc:箱损坏/维修状态Id
/// </summary>

@ -83,10 +83,23 @@ public class CM_State_ChangeRes
/// </summary>
public string CtnState => CtnStateId?.GetDescription();
/// <summary>
/// Desc:箱流转状态Id
/// </summary>
public CMCtnFlowStateEnum? CtnFlowStateId { get; set; }
/// <summary>
/// Desc:箱流转状态
/// </summary>
public string CtnFlowState => CtnFlowStateId?.GetDescription();
/// <summary>
/// Desc:箱损坏/维修状态Id
/// </summary>
public CMCtnBreakStateEnum? CtnBreakStateId { get; set; }
/// <summary>
/// Desc:箱损坏/维修状态
/// </summary>
public string CtnBreakState { get; set; }
public string CtnBreakState => CtnBreakStateId?.GetDescription();
/// <summary>
/// Desc:空重箱

@ -102,10 +102,10 @@ public class CM_CurrentState : BaseOrgModel<long>
[SugarColumn(ColumnDescription = "箱状态Id", IsNullable = true)]
public CMCtnStateEnum? CtnStateId { get; set; }
/// <summary>
/// Desc:箱状态
/// Desc:箱流转状态Id
/// </summary>
//[SugarColumn(ColumnDescription = "箱状态", IsNullable = true, Length = 20)]
//public string CtnState { get; set; }
[SugarColumn(ColumnDescription = "箱流转状态Id", IsNullable = true)]
public CMCtnStateEnum? CtnFlowStateId { get; set; }
/// <summary>
/// Desc:箱损坏/维修状态

@ -103,15 +103,26 @@ public class CM_State_Change : BaseOrgModel<long>
[SugarColumn(ColumnDescription = "箱状态Id", IsNullable = true, Length = 20)]
public CMCtnStateEnum? CtnStateId { get; set; }
/// <summary>
/// Desc:箱状态
/// Desc:箱状态 AV可用
/// </summary>
[SugarColumn(ColumnDescription = "箱状态", IsNullable = true, Length = 20)]
public string CtnState { get; set; }
/// <summary>
/// Desc:箱损坏/维修状态
/// Desc:箱流转状态Id
/// </summary>
[SugarColumn(ColumnDescription = "箱损坏/维修状态Id", IsNullable = true, Length = 20)]
[SugarColumn(ColumnDescription = "箱流转状态Id", IsNullable = true)]
public CMCtnStateEnum? CtnFlowStateId { get; set; }
/// <summary>
/// Desc:箱流转状态
/// </summary>
[SugarColumn(ColumnDescription = "箱流转状态", IsNullable = true, Length = 20)]
public string CtnFlowState { get; set; }
/// <summary>
/// Desc:箱可用状态 损坏/维修状态 AV BK REP
/// </summary>
[SugarColumn(ColumnDescription = "箱可用状态Id", IsNullable = true, Length = 20)]
public CMCtnBreakStateEnum? CtnBreakStateId { get; set; }
/// <summary>

@ -50,4 +50,11 @@ public interface ICM_RentInService
/// <param name="id"></param>
/// <returns></returns>
Task<DataResult> CM_RentIn_Cancel(string id);
/// <summary>
/// 租箱租入_生成费用
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<DataResult> CM_RentIn_MakeFee(string id);
}

@ -24,6 +24,7 @@ using AngleSharp.Dom;
using NPOI.Util;
using DS.WMS.Core.Sys.Method;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.Fee.Interface;
namespace DS.WMS.ContainerManagement.Info.Method;
@ -35,7 +36,7 @@ public class CM_RentInService : CMServiceBase, ICM_RentInService
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly ICommonService commonService;
readonly IFeeRecordService _feeService;
/// <summary>
///
/// </summary>
@ -48,6 +49,8 @@ public class CM_RentInService : CMServiceBase, ICM_RentInService
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
commonService = _serviceProvider.GetRequiredService<ICommonService>();
_feeService = _serviceProvider.GetRequiredService<IFeeRecordService>();
}
/// <summary>
@ -202,7 +205,7 @@ public class CM_RentInService : CMServiceBase, ICM_RentInService
.First();
//20240808 首先判断该箱号能否
data.BillState = "Confirm";
data.IsBusinessLocking = true;
var entity = await tenantDb.Insertable(data).ExecuteReturnEntityAsync();
return await Task.FromResult(DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess));
@ -221,8 +224,48 @@ public class CM_RentInService : CMServiceBase, ICM_RentInService
.Where(a => a.Id == long.Parse(id))
.Select<CM_RentInRes>()
.First();
data.BillState = "";
data.IsBusinessLocking = false;
var entity = await tenantDb.Insertable(data).ExecuteReturnEntityAsync();
return await Task.FromResult(DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess));
}
/// <summary>
/// 租箱租入_生成费用
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<DataResult> CM_RentIn_MakeFee(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CM_RentIn>()
.Where(a => a.Id == long.Parse(id))
.Select<CM_RentInRes>()
.First();
if (data.BillState != "Confirm")
{
return await Task.FromResult(DataResult.Failed("添加失败!", MultiLanguageConst.CM_CanNotMakeFee));
}
else {
var newFee = new FeeRecord();
newFee.Id = 0;
newFee.FeeType = FeeType.Payable;
newFee.FeeName = "提箱费";
newFee.TaxUnitPrice = 10;
newFee.Amount = 10;
newFee.TaxRate = 0;
newFee.Quantity = 1;
var feeDetail = new List<FeeRecord>();
feeDetail.Add(newFee);
return await _feeService.SaveAsync(feeDetail);
}
//根据
//return await Task.FromResult(DataResult.Successed("添加成功!", data.Id, MultiLanguageConst.DataCreateSuccess));
}
}

@ -75,7 +75,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
var entity = TenantDb.InsertNav(data).Include(x => x.InvoiceHeaders).ExecuteReturnEntity();
tag.ClientId = entity.Id;
TenantDb.Insertable(tag).RemoveDataCache(SqlSugarCacheConst.InfoClient + User.TenantId).ExecuteCommand();
TenantDb.Insertable(tag).RemoveDataCache($"{SqlSugarCacheConst.InfoClient}{User.TenantId}").ExecuteCommand();
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
else
@ -86,7 +86,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
info = req.Adapt(info);
tag = req.ClientTag.Adapt(tag);
TenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.InfoClient + User.TenantId).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
TenantDb.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.InfoClient}{User.TenantId}").IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
TenantDb.Updateable(tag).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
//创建或更新发票抬头
@ -186,7 +186,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
//收发货人
await TenantDb.Deleteable<InfoClientShipper>().Where(x => req.Ids.Contains(x.ClientId)).ExecuteCommandAsync();
//删除客户信息
await TenantDb.Deleteable<InfoClient>().RemoveDataCache(SqlSugarCacheConst.InfoClient + User.TenantId).Where(x => req.Ids.Contains(x.Id)).ExecuteCommandAsync();
await TenantDb.Deleteable<InfoClient>().RemoveDataCache($"{SqlSugarCacheConst.InfoClient}{User.TenantId}").Where(x => req.Ids.Contains(x.Id)).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;

@ -21,9 +21,9 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
public long TemplateId { get; set; }
/// <summary>
/// 附件获取接口的URL
/// 附件文件名
/// </summary>
[SugarColumn(ColumnDescription = "附件获取接口的URL", Length = 255, IsNullable = false)]
public string RequestURL { get; set; } = string.Empty;
[SugarColumn(ColumnDescription = "附件文件名", Length = 50, IsNullable = true)]
public string? FileName { get; set; }
}
}

@ -48,15 +48,9 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
/// <summary>
/// 服务器设置ID
/// </summary>
[SugarColumn(ColumnDescription = "任务类型", IsNullable = false)]
[SugarColumn(ColumnDescription = "服务器设置ID", IsNullable = false)]
public long ServerId { get; set; }
/// <summary>
/// 服务器设置
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(ServerId))]
public BusinessTaskMailServer? Server { get; set; }
/// <summary>
/// 接收人设置
/// </summary>

@ -1,42 +0,0 @@
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.Op.Entity.TaskInteraction
{
/// <summary>
/// 任务邮件服务器配置
/// </summary>
[SugarTable("business_task_mail_server", "任务邮件服务器配置")]
public class BusinessTaskMailServer : BaseOrgModelV2<long>
{
/// <summary>
/// 服务器地址
/// </summary>
[SugarColumn(ColumnDescription = "服务器地址", Length = 200, IsNullable = false)]
public string Host { get; set; } = string.Empty;
/// <summary>
/// 端口号
/// </summary>
[SugarColumn(ColumnDescription = "端口号")]
public int Port { get; set; }
/// <summary>
/// 使用SSL连接
/// </summary>
[SugarColumn(ColumnDescription = "使用SSL连接", DefaultValue = "1")]
public bool UseSSL { get; set; } = true;
/// <summary>
/// 登录账号
/// </summary>
[SugarColumn(ColumnDescription = "登录账号", Length = 200, IsNullable = true)]
public string? LoginName { get; set; }
/// <summary>
/// 登录密码
/// </summary>
[SugarColumn(ColumnDescription = "登录密码", Length = 200, IsNullable = true)]
public string? Password { get; set; }
}
}

@ -1,4 +1,5 @@
using DS.Module.Core.Data;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Entity.TaskInteraction;
namespace DS.WMS.Core.Op.Interface.TaskInteraction
@ -21,5 +22,7 @@ namespace DS.WMS.Core.Op.Interface.TaskInteraction
/// <param name="businessTask">任务信息</param>
/// <returns></returns>
Task TriggerAction(BusinessTask businessTask);
Task TriggerTest(TaskBaseTypeEnum taskType, long? id);
}
}

@ -1,9 +1,23 @@
@model DS.WMS.Core.Op.Dtos.TaskInteraction.MailTemplateModel<DS.WMS.Core.Op.Dtos.SeaExportRes>
@{
@{
var item = Model.Primary;
}
<style>
.parent {
position: relative;
height: 300px;
width: 300px;
}
.child {
position: absolute;
bottom: 0;
right: 0;
width: 50px;
height: 50px;
}
</style>
<h1>测试邮件-@item.MBLNO<span style="padding: 2px"></span>@item.CustomerNo</h1>
<div>
@ -14,3 +28,7 @@
<div>
<span>订单创建时间:@item.CreateTime.ToString("yyyy年MM月dd日 HH:mm:ss")</span>
</div>
<div class="parent">
<div id="sign" class="child"></div>
</div>

@ -1,45 +0,0 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using Microsoft.Extensions.DependencyInjection;
namespace DS.WMS.Core.Op.Method.TaskInteraction
{
public class ActionExecutor : ServiceBase
{
//任务日志服务
//readonly ITaskLogService LogService;
/// <summary>
/// 初始化
/// </summary>
/// <param name="provider"></param>
public ActionExecutor(IServiceProvider provider) : base(provider)
{
//LogService = provider.GetRequiredService<ITaskLogService>();
}
///// <summary>
///// 执行特定任务类型的邮件服务
///// </summary>
///// <param name="task">任务</param>
///// <returns></returns>
///// <exception cref="ArgumentNullException"><paramref name="task"/>为null</exception>
//public async Task<DataResult> ExecuteAsync(BusinessTask task)
//{
// ArgumentNullException.ThrowIfNull(task, nameof(task));
// var list = await TenantDb.Queryable<BusinessTaskMail>().Where(x => x.TaskType == task.TaskType && x.TaskStatus == task.TaskStatus)
// .Select(x => new
// {
// TemplateIds = x.Attachments.Select(x => x.TemplateId),
// x.Receiver,
// x.Sender,
// x.Title,
// x.Content
// }).ToListAsync();
//}
}
}

@ -1,9 +1,11 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.TaskPlat;
using SqlSugar;
namespace DS.WMS.Core.Op.Method.TaskInteraction
{
@ -65,6 +67,28 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
await executor.ExecuteAsync(context);
}
}
public async Task TriggerTest(TaskBaseTypeEnum taskType, long? id)
{
var task = await TenantDb.Queryable<BusinessTask>()
.Where(t => t.TaskType == taskType
//&& SqlFunc.Subqueryable<SeaExport>().Where(s => t.BusinessId == s.Id && s.BillSubmitStatus == AuditStatusEnum.Approve).Any()
)
//.Where(x => x.TaskStatus == TaskStatusEnum.Complete)
.WhereIF(id.HasValue, x => x.BusinessId == id)
.OrderByDescending(t => SqlFunc.GetRandom()).Take(1).FirstAsync();
if (task != null)
{
TaskFlowDataContext dataContext = new(
(TaskFlowDataNameConst.BusinessTask, task),
("ActionType", 1),
("Name", "订舱代理通知")
);
TaskFlowRuner taskFlow = new(TenantDb, ServiceProvider);
await taskFlow.RunWithBsno(task.TaskType, task.BusinessId, dataContext);
}
}
}
/// <summary>

@ -2,17 +2,19 @@
using DS.Module.PrintModule;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.Sys.Entity;
using MailKit.Net.Smtp;
using HtmlAgilityPack;
using Masuit.Tools;
using Masuit.Tools.Systems;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MimeKit;
using Newtonsoft.Json;
using RazorEngineCore;
using SqlSugar;
@ -47,159 +49,222 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var logService = context.ServiceProvider.GetRequiredService<ITaskLogService>();
var seService = context.ServiceProvider.GetRequiredService<ISeaExportService>();
var mailName = context.AdditionalData["MailName"] as string;
if (mailName.IsNullOrEmpty())
var config = context.ServiceProvider.GetRequiredService<IConfiguration>();
BusinessTaskMail? mailConfig = null;
if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail.Id), out var id))
{
await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置");
return;
if (id == null)
{
await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置");
return;
}
var idVal = (long)Convert.ChangeType(id, typeof(long));
mailConfig = (await service.GetAsync(idVal)).Data;
}
else if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail.Name), out var name))
{
var mailName = name as string;
if (mailName.IsNullOrEmpty())
{
await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置");
return;
}
mailConfig = await service.GetAsync(mailName);
}
var mailConfig = await service.GetAsync(mailName);
if (mailConfig == null)
{
await logService.WriteLogAsync(context.TaskInfo, $"未能获取名为【{mailName}】的邮件配置");
await logService.WriteLogAsync(context.TaskInfo, $"未能根据任务配置值获取邮件模板设置");
return;
}
var result = seService.GetSeaExportInfo(context.TaskInfo.BusinessId.ToString());
if (!result.Succeeded)
if (!result.Succeeded || result.Data == null)
{
await logService.WriteLogAsync(context.TaskInfo, $"未能获取Id={context.TaskInfo.BusinessId}的{context.TaskInfo.BusinessType.GetDescription()}数据");
return;
}
string title, content = string.Empty;
var templateModel = new MailTemplateModel<SeaExportRes> { Primary = result.Data };
IRazorEngine razorEngine = new RazorEngine();
var titleTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportRes>>>(mailConfig.Title);
string title = titleTemplate.Run(x =>
{
x.Model = templateModel;
});
var contentTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportRes>>>(mailConfig.Content);
string content = contentTemplate.Run(x =>
{
x.Model = templateModel;
});
var textPart = new TextPart("plain") { Text = content };
var message = new MimeMessage
try
{
Subject = title,
};
var titleTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportRes>>>(mailConfig.Title);
title = await titleTemplate.RunAsync(x =>
{
x.Model = templateModel;
});
//设置发件人
List<long> senderIds = new List<long>();
if (mailConfig.Sender.IsSale)
{
senderIds.Add(templateModel.Primary.SaleId);
var contentTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportRes>>>(mailConfig.Content);
content = await contentTemplate.RunAsync(x =>
{
x.Model = templateModel;
});
}
if (mailConfig.Sender.IsOperator)
catch (Exception ex)
{
senderIds.Add(templateModel.Primary.OperatorId);
await ex.LogAsync(db);
await logService.WriteLogAsync(context.TaskInfo, $"渲染邮件模板({mailConfig.Id})时出错,请检查模板是否有语法错误");
return;
}
if (mailConfig.Sender.IsCustomerService)
//设置发件人
long senderId = 0;
if (mailConfig.Sender.IsSale)
senderId = templateModel.Primary.SaleId;
else if (mailConfig.Sender.IsOperator)
senderId = templateModel.Primary.OperatorId;
else if (mailConfig.Sender.IsCustomerService)
senderId = templateModel.Primary.CustomerService;
else if (mailConfig.Sender.IsVouchingClerk)
senderId = templateModel.Primary.Doc;
var sender = await db.Queryable<SysUser>().Where(x => x.Id == senderId).Select(
x => new { x.UserName, x.SignatureHtml }).FirstAsync();
if (sender == null)
{
senderIds.Add(templateModel.Primary.CustomerService);
await logService.WriteLogAsync(context.TaskInfo, "未设置发件人");
return;
}
if (mailConfig.Sender.IsVouchingClerk)
var senderConfig = await tenantDb.Queryable<CodeUserEmail>().FirstAsync(x => x.CreateBy == senderId);
if (senderConfig == null)
{
senderIds.Add(templateModel.Primary.Doc);
await logService.WriteLogAsync(context.TaskInfo, $"发件人用户:{sender.UserName} 未设置SMTP发件信息");
return;
}
var senderList = await db.Queryable<SysUser>().Where(x => senderIds.Contains(x.Id) && x.Email != null && x.Email != string.Empty)
.Select(x => new { x.UserName, x.UserEnName, x.Email }).ToListAsync();
foreach (var sender in senderList)
message.From.Add(new MailboxAddress(sender.UserName, sender.Email));
//插入发件人签名
var htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(content);
var node = htmlDoc.GetElementbyId("sign");
if (node != null)
node.InnerHtml = sender.SignatureHtml;
StringWriter writer = new();
htmlDoc.Save(writer);
content = writer.ToString();
//设置收件人
List<long> receiverIds = new List<long>();
List<long> receiverIds = [];
if (mailConfig.Receiver.IsCarrier)
{
receiverIds.Add(templateModel.Primary.CarrierId);
}
if (mailConfig.Receiver.IsBooking)
{
//receiverIds.Add(templateModel.Primary.CarrierId);
}
receiverIds.Add(templateModel.Primary.CarrierId);
if (mailConfig.Receiver.IsYard)
{
receiverIds.Add(templateModel.Primary.YardId);
}
if (mailConfig.Receiver.IsTruck)
{
receiverIds.Add(templateModel.Primary.TruckerId);
}
if (mailConfig.Receiver.IsController)
{
receiverIds.Add(templateModel.Primary.CustomerId);
}
var receiverList = await tenantDb.Queryable<InfoClient>().Where(x => receiverIds.Contains(x.Id) && x.Email != null && x.Email != string.Empty)
.Select(x => new { x.ShortName, x.EnShortName, x.Email }).ToListAsync();
foreach (var item in receiverList)
message.To.Add(new MailboxAddress(item.ShortName, item.Email));
//需要上传附件
if (mailConfig.Attachments?.Count > 0)
var attachmentList = mailConfig.Attachments == null ? [] : new List<Tuple<string, string>>(mailConfig.Attachments.Count);
try
{
var multipart = new Multipart("mixed");
multipart.Add(textPart);
if (api.DefaultHeaders.Contains("Authorization"))
api.DefaultHeaders.Remove("Authorization");
//需要上传附件
if (mailConfig.Attachments?.Count > 0)
{
if (api.DefaultHeaders.Contains("Authorization"))
api.DefaultHeaders.Remove("Authorization");
api.DefaultHeaders.Add("Authorization", "Bearer " + user.GetToken());
api.DefaultHeaders.Add("Authorization", "Bearer " + user.GetToken());
long tenantId = long.Parse(user.TenantId);
foreach (var item in mailConfig.Attachments)
{
var req = new OpenPrintReq
{
ParamJsonStr = JsonConvert.SerializeObject(new { Id = context.TaskInfo.BusinessId }),
PrintType = "1",
TemplateId = item.TemplateId,
TenantId = tenantId
};
var reqResult = await api.PostAsync<PrintResult>(item.RequestURL, req);
if (!reqResult.Succeeded)
long tenantId = long.Parse(user.TenantId);
string requestUrl = config["TaskMail:FileBaseUrl"] + config["TaskMail:SQLPrint"];
foreach (var item in mailConfig.Attachments)
{
await logService.WriteLogAsync(context.TaskInfo, $"未能获取打印API生成的文件请求地址{item.RequestURL}");
return;
var req = new OpenPrintReq
{
ParamJsonStr = JsonConvert.SerializeObject(new { Id = context.TaskInfo.BusinessId }),
PrintType = ((int)FileFormat.PDF).ToString(),
TemplateId = item.TemplateId,
TenantId = tenantId
};
var reqResult = await api.PostAsync<PrintResult>(requestUrl, req);
if (!reqResult.Succeeded)
{
await logService.WriteLogAsync(context.TaskInfo, $"未能获取打印API生成的文件请求地址{requestUrl}");
return;
}
string url = config["TaskMail:FileBaseUrl"] + @"/PrintTempFile/" + reqResult.Data.Data;
var fileResult = await api.SendRequestAsync(HttpMethod.Get, url);
if (!fileResult.Succeeded)
{
await logService.WriteLogAsync(context.TaskInfo, $"未能获取打印API生成的文件附件地址{url}");
return;
}
string fileName = item.FileName.IsNullOrEmpty() ? Path.GetFileName(reqResult.Data.Data) : item.FileName;
var bytes = await fileResult.Data.Content.ReadAsByteArrayAsync();
string base64Str = Convert.ToBase64String(bytes);
attachmentList.Add(new Tuple<string, string>(fileName, base64Str));
}
Uri uri = new Uri(item.RequestURL);
string url = uri.Scheme + "://" + uri.Host
+ ((uri.Port == 80 || uri.Port == 443) ? string.Empty : ":" + uri.Port)
+ "//PrintTempFile//" + reqResult.Data;
//var attachment = new MimePart("image", "gif")
//{
// Content = new MimeContent(File.OpenRead(path), ContentEncoding.Default),
// ContentDisposition = new ContentDisposition(ContentDisposition.Attachment),
// ContentTransferEncoding = ContentEncoding.Base64,
// FileName = Path.GetFileName(path)
//};
}
}
else
{
message.Body = textPart;
}
var client = new SmtpClient();
try
{
client.Connect(mailConfig.Server.Host, mailConfig.Server.Port, mailConfig.Server.UseSSL);
if (!mailConfig.Server.LoginName.IsNullOrEmpty() && !mailConfig.Server.Password.IsNullOrEmpty())
dynamic[] mailParams = [new
{
SendTo = string.Join(",", receiverList.Select(x => x.Email)),
Title = title,
Body = content,
ShowName = senderConfig.ShowName.IsNullOrEmpty() ? sender.UserName : senderConfig.ShowName,
Account = senderConfig.MailAccount,
senderConfig.Password,
Server = senderConfig.SmtpServer,
Port = senderConfig.SmtpPort.GetValueOrDefault(),
UseSSL = senderConfig.SmtpSSL.GetValueOrDefault(),
Attaches = attachmentList.Select(x => new
{
AttachName = x.Item1,
AttachContent = x.Item2
}).ToList()
}];
var mailResult = await api.SendRequestAsync(HttpMethod.Post, config["TaskMail:MailApiUrl"], mailParams);
if (mailResult.Data.IsSuccessStatusCode)
{
client.Authenticate(mailConfig.Server.LoginName, mailConfig.Server.Password);
await logService.WriteLogAsync(context.TaskInfo, $"已发邮件(委托单:{templateModel.Primary.CustomerNo}),收件人:"
+ string.Join(",", receiverList.Select(x => x.Email)) + "发件人:" + senderConfig.MailAccount);
}
else
{
await logService.WriteLogAsync(context.TaskInfo, $"邮件发送失败(委托单:{templateModel.Primary.CustomerNo}),收件人:"
+ string.Join(",", receiverList.Select(x => x.Email)) + "发件人:" + senderConfig.MailAccount);
}
client.Send(message);
client.Disconnect(true);
}
catch (Exception ex)
{
await ex.LogAsync(db);
}
finally
{
client?.Dispose();
}
}
}
/// <summary>
/// 文件格式
/// </summary>
public enum FileFormat
{
/// <summary>
/// PDF
/// </summary>
PDF = 1,
/// <summary>
/// Excel
/// </summary>
Xlsx = 2,
/// <summary>
/// Word
/// </summary>
Docx = 3
}
}

@ -39,7 +39,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
public async Task<DataResult<BusinessTaskMail>> GetAsync(long id)
{
var entity = await TenantDb.Queryable<BusinessTaskMail>()
.Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Server).Includes(x => x.Attachments)
.Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments)
.Where(x => x.Id == id).FirstAsync();
return DataResult<BusinessTaskMail>.Success(entity);
@ -53,7 +53,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
public async Task<BusinessTaskMail> GetAsync(string name)
{
return await TenantDb.Queryable<BusinessTaskMail>()
.Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Server).Includes(x => x.Attachments)
.Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments)
.Where(x => x.Name == name).FirstAsync();
}
@ -71,13 +71,12 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
{
taskMail.Receiver ??= new();
taskMail.Sender ??= new();
taskMail.Server ??= new();
taskMail = await TenantDb.InsertNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Server).ExecuteReturnEntityAsync();
taskMail = await TenantDb.InsertNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteReturnEntityAsync();
}
else
{
await TenantDb.UpdateNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Server).ExecuteCommandAsync();
await TenantDb.UpdateNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteCommandAsync();
}
if (taskMail.Attachments?.Count > 0)
@ -113,7 +112,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
try
{
await TenantDb.DeleteNav<BusinessTaskMail>(x => model.Ids.Contains(x.Id))
.Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Server).Include(x => x.Attachments)
.Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Attachments)
.ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();

@ -175,9 +175,13 @@ public class UserReq
public string SourceName { get; set; } = "";
/// <summary>
/// 签名照片Url
/// 签名图片
/// </summary>
public string SignatureUrl { get; set; } = "";
public string SignatureUrl { get; set; } = "";
/// <summary>
/// 邮件签名
/// </summary>
public string SignatureHtml { get; set; } = "";
}
/// <summary>

@ -66,4 +66,12 @@ public class UserSelectRes
/// 财务软件代码
/// </summary>
public string FinanceSoftCode { get; set; }
/// <summary>
/// 签名图片
/// </summary>
public string SignatureUrl { get; set; } = "";
/// <summary>
/// 邮件签名
/// </summary>
public string SignatureHtml { get; set; } = "";
}

@ -192,7 +192,11 @@ public class UserViewModel
public string SourceName { get; set; } = "";
/// <summary>
/// 签名照片Url
/// 签名图片
/// </summary>
public string SignatureUrl { get; set; } = "";
/// <summary>
/// 邮件签名
/// </summary>
public string SignatureHtml { get; set; } = "";
}

@ -1,4 +1,5 @@
using DS.Module.Core.Data;
using SqlSugar;
using System.ComponentModel;
namespace DS.WMS.Core.Sys.Entity;
@ -6,9 +7,9 @@ namespace DS.WMS.Core.Sys.Entity;
/// <summary>
/// 用户实体
/// </summary>
[SqlSugar.SugarTable("sys_user")]
[SugarTable("sys_user")]
public class SysUser : UserTenantModel<long>
{
{
/// <summary>
/// 登陆账号
/// </summary>
@ -118,7 +119,7 @@ public class SysUser : UserTenantModel<long>
[Description("大简云用户id")]
public string DjyUserId { get; set; }
/// <summary>
/// 用户类型 0-超管 1-管理员 2-普通用户 3- 租户申请
/// </summary>
@ -142,8 +143,8 @@ public class SysUser : UserTenantModel<long>
/// </summary>
[Description("公司Id")]
public string CompanyId { get; set; }
/// <summary>
/// 默认机构Id
/// </summary>
@ -166,25 +167,25 @@ public class SysUser : UserTenantModel<long>
/// </summary>
[Description("是否操作")]
public bool IsOperator { get; set; } = false;
/// <summary>
/// 是否单证
/// </summary>
[Description("是否单证")]
public bool IsVouchingClerk { get; set; } = false;
/// <summary>
/// 是否销售
/// </summary>
[Description("是否销售")]
public bool IsSale { get; set; } = false;
/// <summary>
/// 是否报关员
/// </summary>
[Description("是否报关员")]
public bool IsCustom { get; set; } = false;
/// <summary>
/// 是否财务
/// </summary>
@ -205,5 +206,17 @@ public class SysUser : UserTenantModel<long>
/// </summary>
[Description("是否派车调度人员")]
public bool IsDispatcher { get; set; } = false;
/// <summary>
/// 签名图片
/// </summary>
[Description("签名图片")]
public string SignatureUrl { get; set; }
/// <summary>
/// 邮件签名Html代码
/// </summary>
[SugarColumn(ColumnDescription = "SignatureHtml", Length = 255, IsNullable = true)]
public string? SignatureHtml { get; set; }
}

@ -76,7 +76,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.GoodsCode.Contains(queryKey) || a.GoodName.Contains(queryKey))
.Select<CodeGoodsSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Goods + user.TenantId)
.WithCache($"{SqlSugarCacheConst.Goods}{user.TenantId}")
.ToListAsync();
return await Task.FromResult(DataResult<List<CodeGoodsSelectRes>>.Success("获取数据成功!", list));
}
@ -105,7 +105,7 @@ public class ClientCommonService : IClientCommonService
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && ids.Contains(a.Id))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToListAsync();
return await Task.FromResult(DataResult<List<UserSelectRes>>.Success(data));
}
@ -134,7 +134,7 @@ public class ClientCommonService : IClientCommonService
Value = a.Id,
})
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToListAsync();
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1005,7 +1005,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<SaleSelectListRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
if (list.Count > 0)
{
@ -1110,7 +1110,7 @@ public class ClientCommonService : IClientCommonService
BLContent = a.BLContent,
PinYinCode = a.ShortName + "(" + a.CodeName + ")"
}
).Take(20).WithCache(SqlSugarCacheConst.InfoClient + user.TenantId).ToListAsync();
).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}").ToListAsync();
return await Task.FromResult(DataResult<List<ClientSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess));
}
/// <summary>
@ -1590,7 +1590,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.PackageName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
.Select<CodePackageSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Package + user.TenantId)
.WithCache($"{SqlSugarCacheConst.Package}{user.TenantId}")
.ToList();
return DataResult<List<CodePackageSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1606,7 +1606,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VesselName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
.Select<CodeVesselSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Vessel + user.TenantId)
.WithCache($"{SqlSugarCacheConst.Vessel}{user.TenantId}")
.ToList();
return DataResult<List<CodeVesselSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1622,7 +1622,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VoyNo.Contains(queryKey))
.Select<CodeVoynoSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Voyno + user.TenantId)
.WithCache($"{SqlSugarCacheConst.Voyno}{user.TenantId}")
.ToList();
return DataResult<List<CodeVoynoSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1663,7 +1663,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1679,7 +1679,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1694,7 +1694,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1710,7 +1710,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1726,7 +1726,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1742,7 +1742,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1758,7 +1758,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1773,7 +1773,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId)
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}")
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}

@ -936,7 +936,7 @@ public class CommonService : ICommonService
Value = a.Id,
})
.Take(20)
.WithCache(SqlSugarCacheConst.User + user.TenantId).ToList();
.WithCache($"{SqlSugarCacheConst.User}{user.TenantId}").ToList();
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", list);
}

@ -131,7 +131,7 @@ public class UserService : IUserService
data.PinYinCode = data.UserName + "(" + PinYinUtil.GetFristLetter(data.UserName) + ")";
data.MD5Password = MD5Helper.MD5Encrypt(data.Password);
var entity = db.Insertable(data).RemoveDataCache(SqlSugarCacheConst.User + user.TenantId).ExecuteReturnEntity();
var entity = db.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.User}{user.TenantId}").ExecuteReturnEntity();
if (model.RoleIds.IsNotNull() && model.RoleIds.Count() > 0)
{
@ -180,7 +180,7 @@ public class UserService : IUserService
info = model.MapTo<UserReq, SysUser>();
info.PinYinCode = info.UserName + "(" + PinYinUtil.GetFristLetter(info.UserName) + ")";
db.Updateable(info).RemoveDataCache(SqlSugarCacheConst.User + user.TenantId).IgnoreColumns(it => new { it.TenantId,it.TenantName, it.Password,it.MD5Password }).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.User}{user.TenantId}").IgnoreColumns(it => new { it.TenantId,it.TenantName, it.Password,it.MD5Password }).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
#region 处理用户角色
@ -302,7 +302,7 @@ public class UserService : IUserService
if (userLanes.Count > 0)
await db.Deleteable(userLanes).ExecuteCommandAsync();
}
await db.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.User + user.TenantId).ExecuteCommandAsync();
await db.Deleteable(list).RemoveDataCache($"{SqlSugarCacheConst.User}{user.TenantId}").ExecuteCommandAsync();
}
return await Task.FromResult(DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess));

@ -70,7 +70,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
SqlSugarScopeProvider tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
TaskBaseInfo taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
TaskBaseInfo taskInfo = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
.OrderByDescending(a => a.Id)
.FirstAsync(t => t.OUT_BS_NO == bsno && t.TASK_TYPE == taskBaseTypeEnum.ToString());
@ -120,7 +120,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
SqlSugarScopeProvider tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
TaskBaseInfo taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
TaskBaseInfo taskInfo = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
.OrderByDescending(a => a.Id)
.FirstAsync(t => t.OUT_BS_NO == bsno && t.TASK_TYPE == taskBaseTypeEnum.ToString());
@ -182,7 +182,7 @@ namespace DS.WMS.Core.TaskPlat.Method
SqlSugarScopeProvider tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
try
{
var taskId = await tenantDb.Queryable<TaskBaseInfo>()
var taskId = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
.Where(t => t.OUT_BS_NO == bsno && t.TASK_TYPE == taskBaseTypeEnum.ToString())
.OrderByDescending(a => a.Id)
.Select<long?>(t => t.Id)
@ -251,7 +251,7 @@ namespace DS.WMS.Core.TaskPlat.Method
// 如果业务主键不为空,则通过业务主键进行重复判断
if (info.Head.BSNO is not null or 0)
{
taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
taskInfo = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
.Where(t => t.OUT_BS_NO == info.Head.BSNO)
.WhereIF(info.Main.IsCheckExistsByTaskType, t => t.TASK_TYPE == info.Main.TaskType.ToString())
.OrderByDescending(a => a.Id)
@ -260,7 +260,7 @@ namespace DS.WMS.Core.TaskPlat.Method
// 否则通过Head.GID进行判断
else
{
taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
taskInfo = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
.Where(t => t.OUT_BUSI_NO == $"{info.Head.SenderId}_{info.Head.GID}")
.WhereIF(info.Main.IsCheckExistsByTaskType, t => t.TASK_TYPE == info.Main.TaskType.ToString())
.OrderByDescending(a => a.Id)
@ -411,7 +411,7 @@ namespace DS.WMS.Core.TaskPlat.Method
taskInfo.NeedArriveTime = info.Main.TruckInfo.NeedArriveTime;
}
if(string.IsNullOrWhiteSpace(info.Main.TaskBatchNo))
if (string.IsNullOrWhiteSpace(info.Main.TaskBatchNo))
{
info.Main.TaskBatchNo = SnowFlakeSingle.Instance.NextId().ToString();
}
@ -1625,7 +1625,7 @@ namespace DS.WMS.Core.TaskPlat.Method
var taskNo = await tenantDb.Queryable<TaskBaseInfo>().Where(a => a.Id == taskInfo.Id).Select(a => a.TASK_NO).FirstAsync();
var taskNo = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId)).Where(a => a.Id == taskInfo.Id).Select(a => a.TASK_NO).FirstAsync();
//回写任务号
var result = new DataResult(ResultCode.Success, "新增任务成功", data: taskNo);
@ -2190,6 +2190,7 @@ namespace DS.WMS.Core.TaskPlat.Method
var userId = long.Parse(user.UserId);
//任务列表分组统计
var groupList = await tenantDb.Queryable<TaskBaseInfo>()
.ClearFilter(typeof(IOrgId))
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.Where(whereList)
.Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (t.CreateBy == userId || a.UserId == userId)))
@ -2421,7 +2422,7 @@ namespace DS.WMS.Core.TaskPlat.Method
var userId = long.Parse(user.UserId);
string batchNo = Guid.NewGuid().ToString();
var taskList = await tenantDb.Queryable<TaskBaseInfo>()
var taskList = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
.Where(x => ids.Contains(x.Id)).ToListAsync();
@ -2607,7 +2608,7 @@ namespace DS.WMS.Core.TaskPlat.Method
var userId = long.Parse(user.UserId);
string batchNo = Guid.NewGuid().ToString();
var taskList = await tenantDb.Queryable<TaskBaseInfo>()
var taskList = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
.Where(x => ids.Contains(x.Id)).ToListAsync();
@ -2673,7 +2674,7 @@ namespace DS.WMS.Core.TaskPlat.Method
string status,
long userId)
{
queryable.Where(whereList)
queryable.ClearFilter(typeof(IOrgId)).Where(whereList)
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
@ -2692,7 +2693,7 @@ namespace DS.WMS.Core.TaskPlat.Method
string status,
long userId)
{
queryable.Where(whereList)
queryable.ClearFilter(typeof(IOrgId)).Where(whereList)
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0

@ -110,3 +110,10 @@
2024-08-08 19:59:15.1322 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-08-08 19:59:15.1322 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-08 19:59:15.1461 Info Configuration initialized.
2024-08-09 09:16:39.0114 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-08-09 09:16:39.0238 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-08-09 09:16:39.0238 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-08-09 09:16:39.0383 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-08-09 09:16:39.0383 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-08-09 09:16:39.0383 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-09 09:16:39.0514 Info Configuration initialized.

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-08-09T00:45:38.7858906Z||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<History>True|2024-08-09T01:18:05.8484398Z||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -0,0 +1,53 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 集装箱报价-服务
/// </summary>
public class BusinessCtnPriceController : ApiController
{
private readonly IBusinessCtnPriceService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public BusinessCtnPriceController(IBusinessCtnPriceService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBusinessCtnPriceList")]
public async Task<DataResult<List<BusinessCtnPriceRes>>> GetBusinessCtnPriceList([FromBody] PageRequest request)
{
var res = await _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("BatchDelBusinessCtnPrice")]
public async Task<DataResult> BatchDelBusinessCtnPrice([FromBody] IdModel req)
{
var res = await _invokeService.BatchDelBusinessCtnPrice(req);
return res;
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using System.Net;
using DS.Module.Core;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using Microsoft.AspNetCore.Mvc;
@ -21,6 +22,31 @@ namespace DS.WMS.OpApi.Controllers
this.service = service;
}
/// <summary>
/// 运行测试
/// </summary>
/// <param name="actionManager"></param>
/// <param name="taskype">任务类型</param>
/// <param name="id">业务ID</param>
/// <returns></returns>
[HttpGet, Route("RunTest")]
public async Task<IActionResult> RunTestAsync([FromServices] IActionManagerService actionManager,
[FromQuery] TaskBaseTypeEnum taskype, [FromQuery] long? id)
{
HttpStatusCode statusCode;
try
{
await actionManager.TriggerTest(taskype, id);
statusCode = HttpStatusCode.NoContent;
}
catch
{
statusCode = HttpStatusCode.InternalServerError;
}
return new StatusCodeResult((int)statusCode);
}
/// <summary>
/// 获取分页列表
/// </summary>
@ -38,7 +64,7 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="id">ID</param>
/// <returns></returns>
[HttpGet, Route("Edit")]
public async Task<DataResult<BusinessTaskMail>>GetAsync(long id)
public async Task<DataResult<BusinessTaskMail>> GetAsync(long id)
{
return await service.GetAsync(id);
}
@ -49,7 +75,7 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="taskMail">邮件配置</param>
/// <returns></returns>
[HttpPost, Route("Edit")]
public async Task<DataResult> EditAsync(BusinessTaskMail taskMail)
public async Task<DataResult> EditAsync(BusinessTaskMail taskMail)
{
if (taskMail.Receiver == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskMailReceiverNotNull));

@ -1,64 +1,64 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"JwtSettings": {
"Issuer": "vol.core.owner",
"Audience": "vol.core",
"User": "C5ABA9E202D94C43A3CA66002BF77FAF",
"SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs"
},
"Cors": {
"PolicyName": "WMSCore.API",
"Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084"
},
"DBInfo": {
"DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0,
"DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1288018625843826680",
"DBType": 0,
"Enabled": false,
"HitRate": 40,
"Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_log"
}
]
},
"SwaggerDoc": {
"ContactName": "WmsOpAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Op API",
"Description": "Wms Op API"
},
"Middleware": {
"RecordAccessLogs": {
"Enabled": true,
"IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server,"
}
},
"FileSettings": {
"BasePath": "", //使
"RelativePath": "LinkAttach",
"FileType": [ ".xls", ".xlsx", ".pdf", ".jpg", ".png", ".txt", ".pms" ]
},
//
"PrintTemplate": {
"BasePath": "", //使
"RelativePath": "Upload/PrintTemplate",
"FileType": [ ".frx", ".xls" ]
},
"TempFile": {
"Path": "TempFiles",
"RemainHours": 2
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"JwtSettings": {
"Issuer": "vol.core.owner",
"Audience": "vol.core",
"User": "C5ABA9E202D94C43A3CA66002BF77FAF",
"SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs"
},
"Cors": {
"PolicyName": "WMSCore.API",
"Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084"
},
"DBInfo": {
"DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0,
"DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1288018625843826680",
"DBType": 0,
"Enabled": false,
"HitRate": 40,
"Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_log"
}
]
},
"SwaggerDoc": {
"ContactName": "WmsOpAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Op API",
"Description": "Wms Op API"
},
"Middleware": {
"RecordAccessLogs": {
"Enabled": true,
"IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server,"
}
},
"FileSettings": {
"BasePath": "", //使
"RelativePath": "LinkAttach",
"FileType": [ ".xls", ".xlsx", ".pdf", ".jpg", ".png", ".txt", ".pms" ]
},
//
"PrintTemplate": {
"BasePath": "", //使
"RelativePath": "Upload/PrintTemplate",
"FileType": [ ".frx", ".xls" ]
},
"TempFile": {
"Path": "TempFiles",
"RemainHours": 2
},
"PrintService": {
"IP": "60.209.125.238",
"Port": "3009",
@ -82,27 +82,34 @@
"CancelServiceStatusUrl": "/EmbedProjectGoodsStatus/CancelServiceStatus",
"GetEnableProjectDictTreeList": "/EmbedProjectGoodsStatus/GetEnableProjectDictTreeList"
},
"ExcuteRuleService": {
"IP": "47.104.73.97",
"Port": "7115",
"SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9",
"SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow",
"RulesEngineSender": "Dongsheng8",
"RulesEngineSenderName": "东胜8"
},
"MSKAPIService": {
"UserKey": "wu",
"UserSecret": "123456",
"Environment": "TEST"
},
"ExcuteRuleService": {
"IP": "47.104.73.97",
"Port": "7115",
"SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9",
"SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow",
"RulesEngineSender": "Dongsheng8",
"RulesEngineSenderName": "东胜8"
},
"MSKAPIService": {
"UserKey": "wu",
"UserSecret": "123456",
"Environment": "TEST"
},
"RedisInfo": {
"RedisConfig": "127.0.0.1:6379,password=,defaultDatabase=15"
},
"BCCompare": {
"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare"
},
"BCCompare": {
"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare"
},
"ShippingOrderCompare": {
"Url": "http://47.104.73.97:7115/api/TaskShippingOrderCompare/ExcuteShippingOrderCompare",
"ResultUrl": "http://47.104.73.97:7115/api/TaskShippingOrderCompare/CompareResult"
},
"TaskMail": {
"FileBaseUrl": "http://118.190.144.189:3008",
"JsonPrint": "/printApi/OpenPrint/GetOpenJsonPrintInfoAsync",
"JsonPrintByCode": "/printApi/OpenPrint/GetOpenJsonPrintInfoByTemplateCode",
"SQLPrint": "/printApi/OpenPrint/GetOpenSqlPrintInfo",
"MailApiUrl": "http://47.104.73.97:8801/mail/send"
}
}

@ -87,15 +87,15 @@ public class ContainerManagementTest
tenantDb.CodeFirst.InitTables(typeof(CM_CurrentState));
tenantDb.CodeFirst.InitTables(typeof(CM_BaseInfo));
//tenantDb.CodeFirst.InitTables(typeof(CM_BaseInfo));
tenantDb.CodeFirst.InitTables(typeof(CM_State_Change));
tenantDb.CodeFirst.InitTables(typeof(CM_RentIn));
tenantDb.CodeFirst.InitTables(typeof(CM_RentIn_Detail));
tenantDb.CodeFirst.InitTables(typeof(CM_RentOut));
tenantDb.CodeFirst.InitTables(typeof(CM_RentOut_Detail));
tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay));
tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay_Detail));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentIn));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentIn_Detail));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOut));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOut_Detail));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay_Detail));
@ -145,7 +145,7 @@ public class ContainerManagementTest
{
var tenantList = db.Queryable<DS.Module.SqlSugar.SysTenantLink>().ToList();
var ass = Assembly.Load("DS.WMS.Core");
var types = ass.GetTypes().Where(it => it.FullName?.Contains("DS.WMS.Core.TaskPlat.Entity") == true).ToArray();
//var types = ass.GetTypes().Where(it => it.FullName?.Contains("DS.WMS.Core.ContainerManagement.Entity") == true).ToArray();
foreach (var item in tenantList)
{
var tenantDb = saasService.GetBizDbScopeById(item.TenantId).CopyNew();

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
@ -29,6 +29,7 @@
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.ExcelModule\DS.Module.ExcelModule.csproj" />
<ProjectReference Include="..\DS.Module.PrintModule\DS.Module.PrintModule.csproj" />
<ProjectReference Include="..\DS.Module.RedisModule\DS.Module.RedisModule.csproj" />
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />
</ItemGroup>

@ -4,6 +4,7 @@ using DS.Module.AutofacModule;
using DS.Module.PrintModule;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.Module.RedisModule;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@ -51,6 +52,7 @@ public class Startup
{
// services.AddTransient<ITestService, TestService>();
services.AddUserModuleInstall(); //用户服务
services.AddRedisModuleInstall();//redis
services.AddSqlSugarInstall();
services.AddSaasDbInstall();
services.AddPrintModuleInstall();

Loading…
Cancel
Save