usertest
jianghaiqing 4 months ago
commit 761fa598d7

@ -1491,6 +1491,11 @@ public static class MultiLanguageConst
public const string TaskAuditStatusError = "Task_Audit_Status_Error";
[Description("无法从配置中获取任务接收人,请联系管理员检查系统配置")]
public const string TaskReceiverNotFound = "Task_Receiver_Not_Found";
[Description("任务邮件必须设置收件人")]
public const string TaskMailReceiverNotNull = "Task_Mail_Receiver_Not_Null";
[Description("任务邮件必须设置发件人")]
public const string TaskMailSenderNotNull = "Task_Mail_Sender_Not_Null";
#endregion
#region 任务台相关

@ -25,5 +25,30 @@ namespace DS.Module.Core.Constants
/// SqlSugar二级缓存 往来单位信息
/// </summary>
public const string InfoClient = "sys_sqlSugar:InfoClient";
/// <summary>
/// SqlSugar二级缓存 用户信息
/// </summary>
public const string User = "sys_sqlSugar:User";
/// <summary>
/// SqlSugar二级缓存 包装信息
/// </summary>
public const string Package = "sys_sqlSugar:Package";
/// <summary>
/// SqlSugar二级缓存 船名信息
/// </summary>
public const string Vessel = "sys_sqlSugar:Vessel";
/// <summary>
/// SqlSugar二级缓存 航次信息
/// </summary>
public const string Voyno = "sys_sqlSugar:Voyno";
/// <summary>
/// SqlSugar二级缓存 商品信息
/// </summary>
public const string Goods = "sys_sqlSugar:Goods";
}
}

@ -40,5 +40,7 @@
/// 任务主表主键
/// </summary>
public const string TaskPkId = "taskPkId";
public const string BusinessTask = "BusinessTask";
}
}

@ -30,6 +30,6 @@ public abstract class BaseOrgModelV2<TKey> : BaseModelV2<TKey>, IOrgId
/// <summary>
/// 机构Id
/// </summary>
[SugarColumn(ColumnDescription = "机构Id")]
[SugarColumn(ColumnDescription = "机构Id", IsOnlyIgnoreUpdate = true)]
public long OrgId { get; set; }
}

@ -53,8 +53,9 @@ public static class SqlSugarSetup
{
dbList.Add(item);
}
var connectConfigList = SqlsugarHelper.ReturnConnectionConfig(dbList);
var _serviceProvider = services.GetService<IServiceProvider>();
ICacheService myCache = new SqlSugarCsRedisCache(_serviceProvider);
var connectConfigList = SqlsugarHelper.ReturnConnectionConfig(dbList, myCache);
foreach (var item in dbList)
{

@ -1,4 +1,5 @@
using DS.Module.Core;
using Amazon.Runtime.Internal.Util;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.UserModule;
@ -113,7 +114,7 @@ namespace DS.Module.SqlSugar
#region 加载配置文件 + ReturnConnectionConfig
public static List<ConnectionConfig> ReturnConnectionConfig(List<DbConfig> dbList)
public static List<ConnectionConfig> ReturnConnectionConfig(List<DbConfig> dbList,ICacheService cache)
{
var connectConfigList = new List<ConnectionConfig>();
@ -140,6 +141,7 @@ namespace DS.Module.SqlSugar
// 自定义特性
ConfigureExternalServices = new ConfigureExternalServices()
{
DataInfoCacheService = cache
}
});
}

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using SqlSugar;
using System;
namespace DS.Module.SqlSugar;
@ -55,8 +56,9 @@ public static class SqlsugarInstall
{
dbList.Add(item);
}
var connectConfigList = SqlsugarHelper.ReturnConnectionConfig(dbList);
var _serviceProvider =services.GetService<IServiceProvider>();
ICacheService myCache = new SqlSugarCsRedisCache(_serviceProvider);
var connectConfigList = SqlsugarHelper.ReturnConnectionConfig(dbList, myCache);
//foreach (var item in dbList)
//{
@ -106,6 +108,8 @@ public static class SqlsugarInstall
foreach (var c in connectConfigList)
{
var dbProvider = db.GetConnectionScope((string)c.ConfigId);
// var user = services.GetService<IUser>();
//单例参数配置,所有上下文生效
dbProvider.Ado.CommandTimeOut = 30;

@ -1,4 +1,5 @@
using DS.Module.Core;
using SqlSugar;
namespace DS.WMS.Core.Code.Dtos;
@ -27,5 +28,10 @@ public class IssueTypeSelectRes
/// 副本份数
/// </summary>
public string CopyNoBill { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -102,7 +103,7 @@ public class CodeGoodsService:ICodeGoodsService
var data = req.Adapt<CodeGoods>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -112,7 +113,7 @@ public class CodeGoodsService:ICodeGoodsService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Goods).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -156,7 +157,7 @@ public class CodeGoodsService:ICodeGoodsService
return DataResult.Failed("存在已导入的商品!",MultiLanguageConst.CodeGoodsImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -179,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).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -52,7 +53,7 @@ public class CodePackageService:ICodePackageService
var data = req.Adapt<CodePackage>();
var entity = db.Insertable(data).ExecuteReturnEntity();
var entity = db.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -62,7 +63,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Package).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -100,7 +101,7 @@ public class CodePackageService:ICodePackageService
var data = req.Adapt<CodePackage>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -110,7 +111,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Package).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -153,7 +154,7 @@ public class CodePackageService:ICodePackageService
return DataResult.Failed("存在已导入的包装类型!",MultiLanguageConst.CodePackageImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -175,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).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -109,7 +110,7 @@ public class CodeVesselService : ICodeVesselService
var data = req.Adapt<CodeVessel>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Vessel).ExecuteReturnEntity();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -121,7 +122,7 @@ public class CodeVesselService : ICodeVesselService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Vessel).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -167,7 +168,7 @@ public class CodeVesselService : ICodeVesselService
return DataResult.Failed("存在已导入的船名信息!", MultiLanguageConst.CodeVesselImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Vessel).ExecuteCommand();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -194,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).ExecuteCommand();
tenantDb.Deleteable(list).ExecuteCommand();
tenantDb.Deleteable(voynos).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Vessel).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -102,7 +103,7 @@ public class CodeVoynoService:ICodeVoynoService
var data = req.Adapt<CodeVoyno>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -112,7 +113,7 @@ public class CodeVoynoService:ICodeVoynoService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Voyno).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -157,7 +158,7 @@ public class CodeVoynoService:ICodeVoynoService
return DataResult.Failed("存在已导入的航次信息!",MultiLanguageConst.CodeVoynoImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -180,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).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -38,7 +38,7 @@ public class ClientContactRes
/// <summary>
/// 职务
/// </summary>
public string[]? Jobs => Job.IsNullOrEmpty() ? [] : Job.Split([','], StringSplitOptions.RemoveEmptyEntries);
public string[]? Jobs => Job.IsNullOrEmpty() ? [] : Job.Split(',', StringSplitOptions.RemoveEmptyEntries);
/// <summary>
/// Desc:通讯地址

@ -344,7 +344,7 @@ public class ClientInfoRes
/// 所属分部
/// </summary>
public long[] SaleOrgIdList => SaleOrgId.IsNullOrEmpty() ? [] :
SaleOrgId.Split([','], StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
SaleOrgId.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
/// <summary>
/// 所属分部名称

@ -381,6 +381,36 @@ namespace DS.WMS.Core.Op.Dtos
/// 计费日期
/// </summary>
public Nullable<DateTime> PriceCalculationDate { get; set; }
/// <summary>
/// 设置温度
/// </summary>
public string TemperatureSet { get; set; }
/// <summary>
/// 最低温度
/// </summary>
public string TemperatureMin { get; set; }
/// <summary>
/// 最高温度
/// </summary>
public string TemperatureMax { get; set; }
/// <summary>
/// Desc:湿度
/// </summary>
public string Humidity { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string Destination { get; set; }
}
public class ParserBCCTNInfoDto

@ -1111,6 +1111,48 @@ public class SeaExportReq
/// 运输条款代码 CY-CY t_code_service
/// </summary>
public string ServiceCode { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
public string ReceiptPlaceCode { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
public string LoadPortCode { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string DischargePortCode { get; set; }
/// <summary>
/// 交货地代码
/// </summary>
public string DeliveryPlaceCode { get; set; }
/// <summary>
/// 目的地代码
/// </summary>
public string DestinationCode { get; set; }
/// <summary>
/// 预付地点
/// </summary>
public string PayableAtCode { get; set; }
/// <summary>
/// 第三付款地代码
/// </summary>
public string ThirdPayAtCode { get; set; }
/// <summary>
/// 签单地点代码
/// </summary>
public string IssuePlaceCode { get; set; }
}
/// <summary>

@ -1308,4 +1308,45 @@ public class SeaExportRes
/// 运输条款代码 CY-CY t_code_service
/// </summary>
public string ServiceCode { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
public string ReceiptPlaceCode { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
public string LoadPortCode { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string DischargePortCode { get; set; }
/// <summary>
/// 交货地代码
/// </summary>
public string DeliveryPlaceCode { get; set; }
/// <summary>
/// 目的地代码
/// </summary>
public string DestinationCode { get; set; }
/// <summary>
/// 预付地点
/// </summary>
public string PayableAtCode { get; set; }
/// <summary>
/// 第三付款地代码
/// </summary>
public string ThirdPayAtCode { get; set; }
/// <summary>
/// 签单地点代码
/// </summary>
public string IssuePlaceCode { get; set; }
}

@ -0,0 +1,15 @@
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Entity.TaskInteraction;
namespace DS.WMS.Core.Op.Dtos.TaskInteraction
{
/// <summary>
/// 动作执行上下文
/// </summary>
public class ActionExecutionContext
{
public BusinessTask Task { get; set; }
}
}

@ -282,9 +282,9 @@ public class SeaExport : BaseOrgModel<long>
/// <summary>
/// 交货地代码
/// 交货地id
/// </summary>
[SugarColumn(ColumnDescription = "交货地代码", IsNullable = true)]
[SugarColumn(ColumnDescription = "交货地id", IsNullable = true)]
public long DeliveryPlaceId { get; set; }
/// <summary>
@ -294,9 +294,9 @@ public class SeaExport : BaseOrgModel<long>
public string DeliveryPlace { get; set; }
/// <summary>
/// 目的地代码
/// 目的地id
/// </summary>
[SugarColumn(ColumnDescription = "目的地代码", IsNullable = true)]
[SugarColumn(ColumnDescription = "目的地id", IsNullable = true)]
public long DestinationId { get; set; }
/// <summary>
@ -1221,11 +1221,7 @@ public class SeaExport : BaseOrgModel<long>
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "中转港Id", IsNullable = true, DefaultValue = "0")]
public long TransPortId { get; set; }
/// <summary>
/// 中转港代码
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "中转港代码", IsNullable = true, Length = 60)]
public string TransPortCode { get; set; }
/// <summary>
/// 中转港
/// </summary>
@ -1468,5 +1464,58 @@ public class SeaExport : BaseOrgModel<long>
/// </summary>
[SugarColumn(ColumnDescription = "最后格式单比对时间", IsNullable = true)]
public Nullable<DateTime> LstDraftCompareDate { get; set; }
/// <summary>
/// 中转港代码
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "中转港代码", IsNullable = true, Length = 60)]
public string TransPortCode { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
[SugarColumn(ColumnDescription = "收货地代码", IsNullable = true, Length = 100)]
public string ReceiptPlaceCode { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
[SugarColumn(ColumnDescription = "装货港代码", IsNullable = true, Length = 100)]
public string LoadPortCode { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
[SugarColumn(ColumnDescription = "卸货港代码", IsNullable = true, Length = 100)]
public string DischargePortCode { get; set; }
/// <summary>
/// 交货地代码
/// </summary>
[SugarColumn(ColumnDescription = "交货地代码", IsNullable = true, Length = 100)]
public string DeliveryPlaceCode { get; set; }
/// <summary>
/// 目的地代码
/// </summary>
[SugarColumn(ColumnDescription = "目的地代码", IsNullable = true, Length = 100)]
public string DestinationCode { get; set; }
/// <summary>
/// 预付地点
/// </summary>
[SugarColumn(ColumnDescription = "预付地点", IsNullable = true, Length = 50)]
public string PayableAtCode { get; set; }
/// <summary>
/// 第三付款地代码
/// </summary>
[SugarColumn(ColumnDescription = "第三付款地代码", IsNullable = true, Length = 50)]
public string ThirdPayAtCode { get; set; }
/// <summary>
/// 签单地点代码
/// </summary>
[SugarColumn(ColumnDescription = "签单地点代码", IsNullable = true, Length = 100)]
public string IssuePlaceCode { get; set; }
}

@ -5,8 +5,8 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
/// <summary>
/// 任务邮件附件配置
/// </summary>
[SugarTable("business_task_mail_attachment", "任务邮件附件配置")]
public class BusinessTaskMailAttachment
[SugarTable("business_task_attachment", "任务邮件附件配置")]
public class BusinessTaskAttachment
{
/// <summary>
/// 任务邮件配置ID

@ -105,6 +105,12 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
/// 审核
/// </summary>
[Description("审核")]
Audit = 101
Audit = 101,
/// <summary>
/// 邮件服务
/// </summary>
[Description("邮件服务")]
Mail = 201
}
}

@ -8,7 +8,7 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
/// 任务邮件发送配置
/// </summary>
[SugarTable("business_task_mail", "任务邮件发送配置")]
public class BusinessTaskMail : BaseModelV2<long>
public class BusinessTaskMail : BaseOrgModelV2<long>
{
/// <summary>
/// 任务类型
@ -16,11 +16,11 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
[SugarColumn(ColumnDescription = "任务类型", IsNullable = false)]
public TaskBaseTypeEnum TaskType { get; set; }
/// <summary>
/// 任务状态
/// </summary>
[SugarColumn(ColumnDescription = "任务状态", IsNullable = false)]
public TaskStatusEnum TaskStatus { get; set; }
///// <summary>
///// 任务状态
///// </summary>
//[SugarColumn(ColumnDescription = "任务状态", IsNullable = false)]
//public TaskStatusEnum TaskStatus { get; set; } = TaskStatusEnum.Complete;
/// <summary>
/// 主题
@ -41,10 +41,16 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
public string? CustomerName { get; set; }
/// <summary>
/// 机构ID
/// 服务器设置ID
/// </summary>
[SugarColumn(ColumnDescription = "任务类型", IsNullable = false)]
public long ServerId { get; set; }
/// <summary>
/// 服务器设置
/// </summary>
[SugarColumn(ColumnDescription = "机构ID", IsNullable = false)]
public long OrgId { get; set; }
[Navigate(NavigateType.OneToOne, nameof(ServerId))]
public BusinessTaskMailServer? Server { get; set; }
/// <summary>
/// 接收人设置
@ -61,7 +67,7 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
/// <summary>
/// 附件设置
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(BusinessTaskMailAttachment.TaskMailId))]
public List<BusinessTaskMailAttachment>? Attachments { get; set; }
[Navigate(NavigateType.OneToMany, nameof(BusinessTaskAttachment.TaskMailId))]
public List<BusinessTaskAttachment>? Attachments { get; set; }
}
}

@ -0,0 +1,42 @@
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 Server { 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; }
}
}

@ -0,0 +1,17 @@
using DS.WMS.Core.Op.Dtos.TaskInteraction;
namespace DS.WMS.Core.Op.Interface.TaskInteraction
{
/// <summary>
/// 动作执行器
/// </summary>
public interface IActionExecutor
{
/// <summary>
/// 执行特定动作
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
Task ExecuteAsync(ActionExecutionContext context);
}
}

@ -0,0 +1,25 @@
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Entity.TaskInteraction;
namespace DS.WMS.Core.Op.Interface.TaskInteraction
{
/// <summary>
/// 动作执行管理
/// </summary>
public interface IActionManager
{
/// <summary>
/// 执行特定动作
/// </summary>
/// <param name="dataContext">数据上下文</param>
/// <returns></returns>
Task ExecuteAsync(TaskFlowDataContext dataContext);
/// <summary>
/// 触发任务执行动作
/// </summary>
/// <param name="businessTask">任务信息</param>
/// <returns></returns>
Task TriggerAction(BusinessTask businessTask);
}
}

@ -1,9 +1,40 @@
namespace DS.WMS.Core.Op.Interface.TaskInteraction
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Entity.TaskInteraction;
namespace DS.WMS.Core.Op.Interface.TaskInteraction
{
/// <summary>
/// 邮件配置服务定义
/// </summary>
public interface ITaskMailService
{
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<BusinessTaskMail>>> GetListAsync(PageRequest request);
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<DataResult<BusinessTaskMail>> GetAsync(long id);
/// <summary>
/// 编辑
/// </summary>
/// <param name="taskMail"></param>
/// <returns></returns>
Task<DataResult> EditAsync(BusinessTaskMail taskMail);
/// <summary>
/// 删除
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
Task<DataResult> DeleteAsync(IdModel model);
}
}

@ -0,0 +1,45 @@
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();
//}
}
}

@ -0,0 +1,69 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.TaskPlat;
namespace DS.WMS.Core.Op.Method.TaskInteraction
{
/// <summary>
/// 动作执行管理
/// </summary>
public class ActionManager : ServiceBase, IActionManager
{
Dictionary<TaskActionType, IActionExecutor> ExecutorMappings;
/// <summary>
/// 初始化
/// </summary>
public ActionManager(IServiceProvider serviceProvider) : base(serviceProvider)
{
ExecutorMappings = new Dictionary<TaskActionType, IActionExecutor>();
ExecutorMappings[TaskActionType.Mail] = new MailActionExecutor();
}
/// <summary>
/// 触发任务执行动作
/// </summary>
/// <param name="businessTask">任务信息</param>
/// <returns></returns>
public async Task TriggerAction(BusinessTask businessTask)
{
ArgumentNullException.ThrowIfNull(businessTask, nameof(businessTask));
//目前只限制任务完成才触发
if (businessTask.TaskStatus != TaskStatusEnum.Complete)
return;
// 执行自动化操作
TaskFlowDataContext dataContext = new(
(TaskFlowDataNameConst.BusinessTask, businessTask)
);
TaskFlowRuner taskFlow = new(TenantDb, ServiceProvider);
await taskFlow.Run(businessTask.TaskType, businessTask.BusinessId, dataContext);
}
public async Task ExecuteAsync(TaskFlowDataContext dataContext)
{
ArgumentNullException.ThrowIfNull(dataContext, nameof(dataContext));
}
}
/// <summary>
/// 任务执行类型
/// </summary>
public enum TaskActionType
{
/// <summary>
/// 后台任务
/// </summary>
BackgroundWorker,
/// <summary>
/// 邮件
/// </summary>
Mail,
}
}

@ -0,0 +1,13 @@
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
namespace DS.WMS.Core.Op.Method.TaskInteraction
{
public class MailActionExecutor : IActionExecutor
{
public Task ExecuteAsync(ActionExecutionContext context)
{
throw new NotImplementedException();
}
}
}

@ -199,7 +199,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
if (((JObject)result.data)["ext"] is not JArray extArray || extArray.Count == 0)
return [];
return extArray.Select(x => x["projectName"]?.Value<string>() ?? string.Empty).ToArray();
return extArray.Where(x => x["isYield"].Value<bool>()).Select(x => x["projectName"]?.Value<string>() ?? string.Empty).ToArray();
}
//public override async Task MarkerChangedAsync(MarkerChangedCallback callback)

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
@ -30,36 +31,87 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
.Where(whereList).ToQueryPageAsync(request.PageCondition);
}
///// <summary>
///// 编辑
///// </summary>
///// <param name="taskMail"></param>
///// <returns></returns>
//public async Task<DataResult> EditAsync(BusinessTaskMail taskMail)
//{
// try
// {
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<DataResult<BusinessTaskMail>> GetAsync(long id)
{
var entity = await TenantDb.Queryable<BusinessTaskMail>().Includes(x => x.Receiver).Includes(x => x.Sender)
.Where(x => x.Id == id).FirstAsync();
return DataResult<BusinessTaskMail>.Success(entity);
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="taskMail"></param>
/// <returns></returns>
public async Task<DataResult> EditAsync(BusinessTaskMail taskMail)
{
await TenantDb.Ado.BeginTranAsync();
try
{
if (taskMail.Id == 0)
{
taskMail.Receiver ??= new();
taskMail.Sender ??= new();
// }
// catch (Exception ex)
// {
// await TenantDb.Ado.RollbackTranAsync();
// await ex.LogAsync(Db);
// return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
// }
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).ExecuteCommandAsync();
}
// if (taskMail.Id == 0)
// {
// taskMail.Receiver ??= new();
// taskMail.Sender ??= new();
if (taskMail.Attachments?.Count > 0)
{
var list = taskMail.Attachments.FindAll(x => x.TaskMailId == 0);
foreach (var item in list)
item.TaskMailId = taskMail.Id;
await TenantDb.Deleteable<BusinessTaskAttachment>().Where(x => x.TaskMailId == taskMail.Id).ExecuteCommandAsync();
await TenantDb.Insertable(taskMail.Attachments).ExecuteCommandAsync();
}
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public async Task<DataResult> DeleteAsync(IdModel model)
{
await TenantDb.Ado.BeginTranAsync();
try
{
await TenantDb.DeleteNav<BusinessTaskMail>(x => model.Ids.Contains(x.Id))
.Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Attachments).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
}
// await TenantDb.InsertNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteCommandAsync();
// }
// else
// {
// }
//}
}
}

@ -12,6 +12,10 @@ namespace DS.WMS.Core
/// </summary>
public abstract class ServiceBase
{
/// <summary>
/// 获取服务容器
/// </summary>
protected IServiceProvider ServiceProvider { get; private set; }
/// <summary>
/// 获取用户相关信息
/// </summary>
@ -46,6 +50,7 @@ namespace DS.WMS.Core
/// <param name="serviceProvider">服务提供程序</param>
protected ServiceBase(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
User = serviceProvider.GetRequiredService<IUser>();
Db = serviceProvider.GetRequiredService<ISqlSugarClient>();
SaasService = serviceProvider.GetRequiredService<ISaasDbService>();

@ -18,7 +18,7 @@ public interface IClientCommonService
/// 获取商品下拉列表-客户端
/// </summary>
/// <returns></returns>
public Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string code = "");
public Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string queryKey = "");
/// <summary>
/// 根据id获取往来单位参数信息
/// </summary>
@ -35,7 +35,7 @@ public interface IClientCommonService
/// 根据类型获取用户下拉列表
/// </summary>
/// <returns></returns>
public Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code = "");
public Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code,string queryKey = "");
/// <summary>
/// 获取工厂信息下拉列表
/// </summary>
@ -66,7 +66,7 @@ public interface IClientCommonService
/// 获取揽货人信息
/// </summary>
/// <returns></returns>
public DataResult<List<SaleSelectListRes>> GetSaleList();
public DataResult<List<SaleSelectListRes>> GetSaleList(string queryKey = "");
/// <summary>
/// 获取审核日志列表
/// </summary>
@ -226,49 +226,49 @@ public interface IClientCommonService
/// 获取操作员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetOperatorUserList();
public DataResult<List<UserSelectRes>> GetOperatorUserList(string queryKey = "");
/// <summary>
/// 获取单证员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetVouchingClerkList();
public DataResult<List<UserSelectRes>> GetVouchingClerkList(string queryKey = "");
/// <summary>
/// 获取销售员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetSaleUserList();
public DataResult<List<UserSelectRes>> GetSaleUserList(string queryKey = "");
/// <summary>
/// 获取报关员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetCustomUserList();
public DataResult<List<UserSelectRes>> GetCustomUserList(string queryKey = "");
/// <summary>
/// 获取财务员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetFinancialStaffList();
public DataResult<List<UserSelectRes>> GetFinancialStaffList(string queryKey = "");
/// <summary>
/// 获取客服列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetCustomerServiceList();
public DataResult<List<UserSelectRes>> GetCustomerServiceList(string queryKey = "");
/// <summary>
/// 获取司机列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetDiverList();
public DataResult<List<UserSelectRes>> GetDiverList(string queryKey = "");
/// <summary>
/// 获取派车调度人员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetDispatcherList();
public DataResult<List<UserSelectRes>> GetDispatcherList(string queryKey = "");
/// <summary>
/// 获取签单方式下拉列表
@ -286,19 +286,19 @@ public interface IClientCommonService
/// 获取包装类型下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList();
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList(string queryKey = "");
/// <summary>
/// 获取船名下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList();
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList(string queryKey = "");
/// <summary>
/// 获取航次下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList();
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList(string queryKey = "");
/// <summary>
/// 获取运输条款下拉列表

@ -94,7 +94,7 @@ public interface ICommonService
/// 获取指定用户下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<ApiSelectViewModel>> GetUserList();
public DataResult<List<ApiSelectViewModel>> GetUserList(string queryKey="");
/// <summary>
/// 获取机构下拉列表

@ -53,12 +53,14 @@ public class ClientCommonService : IClientCommonService
/// 获取商品下拉列表-客户端
/// </summary>
/// <returns></returns>
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string code ="")
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string queryKey ="")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = await tenantDb.Queryable<CodeGoods>()
.WhereIF(!string.IsNullOrEmpty(code), a => a.GoodsCode.Contains(code))
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.GoodsCode.Contains(queryKey) || a.GoodName.Contains(queryKey))
.Select<CodeGoodsSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Goods)
.ToListAsync();
return await Task.FromResult(DataResult<List<CodeGoodsSelectRes>>.Success("获取数据成功!", list));
}
@ -84,8 +86,10 @@ public class ClientCommonService : IClientCommonService
public async Task<DataResult<List<UserSelectRes>>> GetUseEmailListByIds(long[] ids)
{
var data = await db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && ids.Contains(a.Id))
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && ids.Contains(a.Id))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToListAsync();
return await Task.FromResult(DataResult<List<UserSelectRes>>.Success(data));
}
@ -94,7 +98,7 @@ public class ClientCommonService : IClientCommonService
/// 根据类型获取用户下拉列表
/// </summary>
/// <returns></returns>
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code = "")
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode(string code, string queryKey = "")
{
code = code.ToLower();
var data = await db.Queryable<SysUser>()
@ -107,11 +111,15 @@ public class ClientCommonService : IClientCommonService
.WhereIF(code == "service", a => a.IsCustomerService == true)
.WhereIF(code == "driver", a => a.IsDriver == true)
.WhereIF(code == "dispatcher", a => a.IsDispatcher == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select(a => new ApiSelectViewModel
{
Label = a.UserName,
Label = a.PinYinCode,
Value = a.Id,
}).ToListAsync();
})
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToListAsync();
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
@ -974,10 +982,13 @@ public class ClientCommonService : IClientCommonService
/// 获取揽货人信息
/// </summary>
/// <returns></returns>
public DataResult<List<SaleSelectListRes>> GetSaleList()
public DataResult<List<SaleSelectListRes>> GetSaleList(string queryKey = "")
{
var list = db.Queryable<SysUser>().Where(x => x.Status == StatusEnum.Enable.ToEnumInt() && x.IsSale == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<SaleSelectListRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
if (list.Count > 0)
{
@ -1553,36 +1564,48 @@ public class ClientCommonService : IClientCommonService
/// 获取包装类型下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList()
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList(string queryKey ="")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodePackage>()
.Where(a => a.Status == StatusEnum.Enable)
.Select<CodePackageSelectRes>().ToList();
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.PackageName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
.Select<CodePackageSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Package)
.ToList();
return DataResult<List<CodePackageSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
/// 获取船名下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList()
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList(string queryKey = "")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeVessel>()
.Where(a => a.Status == StatusEnum.Enable)
.Select<CodeVesselSelectRes>().ToList();
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VesselName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
.Select<CodeVesselSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Vessel)
.ToList();
return DataResult<List<CodeVesselSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
/// 获取航次下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList()
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList(string queryKey = "")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeVoyno>()
.Where(a => a.Status == StatusEnum.Enable)
.Select<CodeVoynoSelectRes>().ToList();
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VoyNo.Contains(queryKey))
.Select<CodeVoynoSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Voyno)
.ToList();
return DataResult<List<CodeVoynoSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
@ -1615,11 +1638,14 @@ public class ClientCommonService : IClientCommonService
/// 获取操作员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetOperatorUserList()
public DataResult<List<UserSelectRes>> GetOperatorUserList(string queryKey = "")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsOperator == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1628,11 +1654,14 @@ public class ClientCommonService : IClientCommonService
/// 获取单证员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetVouchingClerkList()
public DataResult<List<UserSelectRes>> GetVouchingClerkList(string queryKey ="")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsVouchingClerk == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1640,11 +1669,14 @@ public class ClientCommonService : IClientCommonService
/// 获取销售员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetSaleUserList()
public DataResult<List<UserSelectRes>> GetSaleUserList(string queryKey = "")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsSale == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1653,11 +1685,14 @@ public class ClientCommonService : IClientCommonService
/// 获取报关员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetCustomUserList()
public DataResult<List<UserSelectRes>> GetCustomUserList(string queryKey = "")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsCustom == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1666,11 +1701,14 @@ public class ClientCommonService : IClientCommonService
/// 获取财务员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetFinancialStaffList()
public DataResult<List<UserSelectRes>> GetFinancialStaffList(string queryKey = "")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsFinancialStaff == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1679,11 +1717,14 @@ public class ClientCommonService : IClientCommonService
/// 获取客服列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetCustomerServiceList()
public DataResult<List<UserSelectRes>> GetCustomerServiceList(string queryKey = "")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsCustomerService == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1692,11 +1733,14 @@ public class ClientCommonService : IClientCommonService
/// 获取司机列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetDiverList()
public DataResult<List<UserSelectRes>> GetDiverList(string queryKey = "")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsDriver == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
@ -1704,11 +1748,14 @@ public class ClientCommonService : IClientCommonService
/// 获取派车调度人员列表
/// </summary>
/// <returns></returns>
public DataResult<List<UserSelectRes>> GetDispatcherList()
public DataResult<List<UserSelectRes>> GetDispatcherList(string queryKey = "")
{
var data = db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsDispatcher == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select<UserSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.User)
.ToList();
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}

@ -926,15 +926,17 @@ public class CommonService : ICommonService
/// 获取指定用户下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<ApiSelectViewModel>> GetUserList()
public DataResult<List<ApiSelectViewModel>> GetUserList(string queryKey = "")
{
var list = db.Queryable<SysUser>().Where(a => a.UserType != UserTypeEnum.ApplyUser.ToEnumInt())
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey))
.Select(a => new ApiSelectViewModel
{
Label = a.UserName,
Value = a.Id,
})
.ToList();
.Take(20)
.WithCache(SqlSugarCacheConst.User).ToList();
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", list);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.Core.Helpers;
@ -130,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).ExecuteReturnEntity();
var entity = db.Insertable(data).RemoveDataCache(SqlSugarCacheConst.User).ExecuteReturnEntity();
if (model.RoleIds.IsNotNull() && model.RoleIds.Count() > 0)
{
@ -179,7 +180,7 @@ public class UserService : IUserService
info = model.MapTo<UserReq, SysUser>();
info.PinYinCode = info.UserName + "(" + PinYinUtil.GetFristLetter(info.UserName) + ")";
db.Updateable(info).IgnoreColumns(it => new { it.TenantId,it.TenantName, it.Password,it.MD5Password }).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).RemoveDataCache(SqlSugarCacheConst.User).IgnoreColumns(it => new { it.TenantId,it.TenantName, it.Password,it.MD5Password }).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
#region 处理用户角色
@ -301,7 +302,7 @@ public class UserService : IUserService
if (userLanes.Count > 0)
await db.Deleteable(userLanes).ExecuteCommandAsync();
}
await db.Deleteable(list).ExecuteCommandAsync();
await db.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.User).ExecuteCommandAsync();
}
return await Task.FromResult(DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess));

@ -6,8 +6,8 @@ namespace DS.WMS.Core.TaskPlat.Interface
public interface IMyModuleTest1
{
Task<DataResult> TestMethod11(TaskFlowDataContext dataContext);
Task<DataResult> TestMethod11();
DataResult TestMethod12(TaskFlowDataContext dataContext);
//Task<DataResult> TestMethod11();
Task<DataResult> TestMethod12(TaskFlowDataContext dataContext);
//public string G()
//{

@ -21,13 +21,14 @@ namespace DS.WMS.Core.TaskPlat.Method
return Task.FromResult(DataResult.Successed($"TestMethod11返回的成功结果address:{address}height:{height}bcInfoVessel:{bcInfoVessel}"));
}
public Task<DataResult> TestMethod11()
//public Task<DataResult> TestMethod11()
//{
// return Task.FromResult(DataResult.Successed($"TestMethod11返回的成功结果"));
//}
public Task<DataResult> TestMethod12(TaskFlowDataContext dataContext)
{
return Task.FromResult(DataResult.Successed($"TestMethod11返回的成功结果"));
}
public DataResult TestMethod12(TaskFlowDataContext dataContext)
{
throw new Exception("TestMethod12内的测试异常");
//throw new Exception("TestMethod12内的测试异常");
return Task.FromResult(DataResult.Successed($"TestMethod12返回的成功结果"));
}
}
}

@ -13,7 +13,8 @@ namespace DS.WMS.Core.TaskPlat.Method
{
public Task<DataResult> TestMethod21(TaskFlowDataContext dataContext)
{
throw new Exception("TestMethod21内的测试异常");
//throw new Exception("TestMethod21内的测试异常");
return Task.FromResult(DataResult.Successed($"TestMethod21返回的成功结果"));
}
}
}

@ -1,8 +1,6 @@
using Amazon.Runtime.Internal.Util;
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Helpers;
using DS.Module.DjyServiceStatus;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -263,7 +261,7 @@ namespace DS.WMS.Core.TaskPlat.Method
throw new Exception($"未获取有效任务记录,更新失败");
}
//var currBCOrder = await tenantDb.Queryable<TaskBaseInfo>().Where(a => a.Id == bcEntity.Id).FirstAsync();
//if (currBCOrder != null && model.IsDirectSend)
@ -1116,6 +1114,81 @@ namespace DS.WMS.Core.TaskPlat.Method
}
#endregion
/// <summary>
/// 对比BC与海运出口订单任务台使用
/// </summary>
public async Task<DataResult<TaskManageExcuteResultDto>> ExcuteCompareTask(TaskFlowDataContext dataContext)
{
try
{
var taskBcId = dataContext.Get<long?>(TaskFlowDataNameConst.TaskBCId);
if (taskBcId == null)
{
throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskBCId)}");
}
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
var taskBcInfo = await tenantDb.Queryable<TaskBCInfo>().Where(x => x.Id == taskBcId).FirstAsync();
if (taskBcInfo == null)
{
string msg = $"执行ExcuteCompareTask时根据未获取到BC信息";
logger.LogInformation(msg);
return DataResult<TaskManageExcuteResultDto>.Failed("对比失败:" + msg);
}
var taskBcCtnList = await tenantDb.Queryable<TaskBCCTNInfo>().Where(x => x.P_ID == taskBcInfo.Id).ToListAsync();
// 运费协议号(约号)是唯一的,服务合同号可能不是唯一的
// BC信息
ParserBCInfoDto bcSrcDto = new ParserBCInfoDto()
{
ContractNo = taskBcInfo.CONTRACTNO,
Vessel = taskBcInfo.VESSEL,
VoyNo = taskBcInfo.VOYNO,
//TemperatureMin = taskBcInfo
};
//bcTargetDto.CtnList = dto.DataObj.CtnList.GroupBy(x => x.CtnAll)
// .Select(x =>
// {
// return new ParserBCCTNInfoDto
// {
// CtnALL = x.Key,
// CtnNum = x.ToList().Sum(a => a.CtnNum)
// };
// }).ToList();
var seaExport = await tenantDb.Queryable<SeaExport>().Where(x => x.MBLNO == taskBcInfo.MBL_NO).FirstAsync();
// 订单信息
ParserBCInfoDto bcTargetDto = new ParserBCInfoDto()
{
ContractNo = seaExport.ContractNo,
Vessel = seaExport.Vessel,
VoyNo = seaExport.Voyno,
TemperatureMin = seaExport.TemperatureMin,
TemperatureMax = seaExport.TemperatureMax,
TemperatureSet = seaExport.TemperatureSet,
Humidity = seaExport.Humidity,
DischargePort = seaExport.DischargePort,
Destination = seaExport.Destination,
//CtnList = new List<ParserBCCTNInfoDto>(),
};
}
catch (Exception)
{
throw;
}
return default;
}
#region 生成并推送邮件
/// <summary>

@ -71,7 +71,7 @@ namespace DS.WMS.Core.TaskPlat.Method
SqlSugarScopeProvider tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
TaskBaseInfo taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
.OrderByDescending(a => a.CreateTime)
.OrderByDescending(a => a.Id)
.FirstAsync(t => t.OUT_BS_NO == bsno && t.TASK_TYPE == taskBaseTypeEnum.ToString());
if (taskInfo == null)
@ -121,7 +121,7 @@ namespace DS.WMS.Core.TaskPlat.Method
SqlSugarScopeProvider tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
TaskBaseInfo taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
.OrderByDescending(a => a.CreateTime)
.OrderByDescending(a => a.Id)
.FirstAsync(t => t.OUT_BS_NO == bsno && t.TASK_TYPE == taskBaseTypeEnum.ToString());
if (taskInfo == null)
@ -184,7 +184,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
var taskId = await tenantDb.Queryable<TaskBaseInfo>()
.Where(t => t.OUT_BS_NO == bsno && t.TASK_TYPE == taskBaseTypeEnum.ToString())
.OrderByDescending(a => a.CreateTime)
.OrderByDescending(a => a.Id)
.Select<long?>(t => t.Id)
.FirstAsync();
@ -254,7 +254,7 @@ namespace DS.WMS.Core.TaskPlat.Method
taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
.Where(t => t.OUT_BS_NO == info.Head.BSNO)
.WhereIF(info.Main.IsCheckExistsByTaskType, t => t.TASK_TYPE == info.Main.TaskType.ToString())
.OrderByDescending(a => a.CreateTime)
.OrderByDescending(a => a.Id)
.FirstAsync();
}
// 否则通过Head.GID进行判断
@ -263,7 +263,7 @@ namespace DS.WMS.Core.TaskPlat.Method
taskInfo = await tenantDb.Queryable<TaskBaseInfo>()
.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.CreateTime)
.OrderByDescending(a => a.Id)
.FirstAsync();
}
@ -2159,13 +2159,12 @@ namespace DS.WMS.Core.TaskPlat.Method
//var b = user.GetOrgId();
//var b232 = user.OrgId;
// 任务匹配
if (LastMatchTaskTime < DateTime.Now.AddSeconds(-5)) // 效果距上一次全局任务匹配执行如果超过5秒才进行匹配
{
await MatchTask();
LastMatchTaskTime = DateTime.Now;
}
//if (LastMatchTaskTime < DateTime.Now.AddSeconds(-5)) // 效果距上一次全局任务匹配执行如果超过5秒才进行匹配
//{
//LastMatchTaskTime = DateTime.Now;
//}
await MatchTask();
//序列化查询条件
List<IConditionalModel>? whereList = null;

@ -31,6 +31,8 @@ namespace DS.WMS.Core.TaskPlat
this.serviceProvider = serviceProvider;
this.logger = serviceProvider.GetRequiredService<ILogger<TaskFlowRuner>>();
}
/// <summary>
/// 执行
/// </summary>
@ -199,17 +201,29 @@ namespace DS.WMS.Core.TaskPlat
};
// 执行流程
foreach (var configItem in configList)
long? nextExecuteConfigId = targetConfig.Id;
for (int i = 0; i < configList.Count; i++)
{
if (nextExecuteConfigId == null || nextExecuteConfigId == 0)
{
break;
}
var executeConfig = configList.FirstOrDefault(x => x.Id == nextExecuteConfigId);
if (executeConfig == null)
{
break;
}
nextExecuteConfigId = executeConfig.NextExecuteConfigId;
TaskFlowLogDetail flowLogDetail = new()
{
ConfigId = configItem.Id,
ConfigId = executeConfig.Id,
PId = flowLog.Id,
IsSuccess = true,
};
try
{
var paramItemList = paramList.Where(x => x.ConfigId == configItem.Id).ToList();
var paramItemList = paramList.Where(x => x.ConfigId == executeConfig.Id).ToList();
foreach (var paramItem in paramItemList)
{
dataContext.Set(paramItem.FieldName!, paramItem.FieldValue!);
@ -224,10 +238,10 @@ namespace DS.WMS.Core.TaskPlat
//}
}
var module = moduleList.FirstOrDefault(x => x.Id == configItem.ExecuteModuleId);
var module = moduleList.FirstOrDefault(x => x.Id == executeConfig.ExecuteModuleId);
if (module == null)
{
throw new Exception($"未找到指定流程配置ExecuteModuleId{configItem.ExecuteModuleId}");
throw new Exception($"未找到指定流程配置ExecuteModuleId{executeConfig.ExecuteModuleId}");
}
flowLogDetail.ModuleId = module.Id;
@ -319,7 +333,7 @@ namespace DS.WMS.Core.TaskPlat
flowLogDetail.ExceptionMessage = WriteLog("模块执行过程中发生异常", ex);
await tenantDb.Insertable(flowLogDetail).ExecuteCommandAsync();
if (configItem.IsExceptionContinue)
if (executeConfig.IsExceptionContinue)
{
continue;
}
@ -334,6 +348,22 @@ namespace DS.WMS.Core.TaskPlat
return (flowLog.Id, flowLog.IsComplete, flowLog.IsSuccess);
}
/// <summary>
/// 执行通过业务Id
/// </summary>
/// <param name="taskBaseType">任务类型</param>
/// <param name="bsno">业务Id</param>
/// <param name="dataContext">起始入参数据上下文</param>
/// <returns>(执行日志Id,模块是否全部执行完成,模块执行结果是否全部为success)</returns>
public async Task<(long? flowLogId, bool isAllComplete, bool isAllSuccess)> RunWithBsno(TaskBaseTypeEnum taskBaseType, long bsno, TaskFlowDataContext dataContext)
{
long taskId = await tenantDb.Queryable<TaskBaseInfo>()
.Where(t => t.OUT_BS_NO == bsno && t.TASK_TYPE == taskBaseType.ToString())
.OrderByDescending(a => a.Id)
.Select(t => t.Id)
.FirstAsync();
return await Run(taskBaseType, taskId, dataContext);
}
/// <summary>
/// 深度获取对象属性值

@ -84,9 +84,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetUserListByCode")]
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode([FromQuery] string code = "")
public async Task<DataResult<List<ApiSelectViewModel>>> GetUserListByCode([FromQuery] string code, string queryKey = "")
{
var res = await _invokeService.GetUserListByCode(code);
var res = await _invokeService.GetUserListByCode(code, queryKey);
return res;
}
/// <summary>
@ -150,9 +150,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetSaleList")]
public DataResult<List<SaleSelectListRes>> GetSaleList()
public DataResult<List<SaleSelectListRes>> GetSaleList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetSaleList();
var res = _invokeService.GetSaleList(queryKey);
return res;
}
/// <summary>
@ -450,9 +450,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetOperatorUserList")]
public DataResult<List<UserSelectRes>> GetOperatorUserList()
public DataResult<List<UserSelectRes>> GetOperatorUserList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetOperatorUserList();
var res = _invokeService.GetOperatorUserList(queryKey);
return res;
}
/// <summary>
@ -461,9 +461,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetVouchingClerkList")]
public DataResult<List<UserSelectRes>> GetVouchingClerkList()
public DataResult<List<UserSelectRes>> GetVouchingClerkList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetVouchingClerkList();
var res = _invokeService.GetVouchingClerkList(queryKey);
return res;
}
/// <summary>
@ -472,7 +472,7 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetSaleUserList")]
public DataResult<List<UserSelectRes>> GetSaleUserList()
public DataResult<List<UserSelectRes>> GetSaleUserList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetSaleUserList();
return res;
@ -483,9 +483,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetCustomUserList")]
public DataResult<List<UserSelectRes>> GetCustomUserList()
public DataResult<List<UserSelectRes>> GetCustomUserList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetCustomUserList();
var res = _invokeService.GetCustomUserList(queryKey);
return res;
}
/// <summary>
@ -494,9 +494,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetFinancialStaffList")]
public DataResult<List<UserSelectRes>> GetFinancialStaffList()
public DataResult<List<UserSelectRes>> GetFinancialStaffList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetFinancialStaffList();
var res = _invokeService.GetFinancialStaffList(queryKey);
return res;
}
/// <summary>
@ -505,9 +505,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetCustomerServiceList")]
public DataResult<List<UserSelectRes>> GetCustomerServiceList()
public DataResult<List<UserSelectRes>> GetCustomerServiceList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetCustomerServiceList();
var res = _invokeService.GetCustomerServiceList(queryKey);
return res;
}
@ -517,9 +517,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetDiverList")]
public DataResult<List<UserSelectRes>> GetDiverList()
public DataResult<List<UserSelectRes>> GetDiverList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetDiverList();
var res = _invokeService.GetDiverList(queryKey);
return res;
}
@ -529,9 +529,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetDispatcherList")]
public DataResult<List<UserSelectRes>> GetDispatcherList()
public DataResult<List<UserSelectRes>> GetDispatcherList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetDispatcherList();
var res = _invokeService.GetDispatcherList(queryKey);
return res;
}
/// <summary>
@ -562,9 +562,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetPackageSelectList")]
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList()
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList([FromQuery]string queryKey = "")
{
var res = _invokeService.GetPackageSelectList();
var res = _invokeService.GetPackageSelectList(queryKey);
return res;
}

@ -152,7 +152,7 @@ public class CommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetUserList")]
public DataResult<List<ApiSelectViewModel>> GetUserList()
public DataResult<List<ApiSelectViewModel>> GetUserList([FromQuery]string queryKey = "")
{
var res = _invokeService.GetUserList();
return res;

@ -37,6 +37,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();
@ -44,7 +45,6 @@ builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务
builder.Services.AddExcelModuleInstall();//Excel服务
builder.Services.AddPrintModuleInstall();//Print服务
builder.Services.AddRedisModuleInstall();//redis
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();

@ -1,6 +1,5 @@
using System.Net;
using DS.Module.Core;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;

@ -0,0 +1,63 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers
{
/// <summary>
/// 任务邮件API
/// </summary>
public class TaskMailController : ApiController
{
readonly ITaskMailService service;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="service"></param>
public TaskMailController(ITaskMailService service)
{
this.service = service;
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetList")]
public async Task<DataResult<List<BusinessTaskMail>>> GetListAsync(PageRequest request)
{
return await service.GetListAsync(request);
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id">ID</param>
/// <returns></returns>
[HttpGet, Route("Edit")]
public async Task<DataResult<BusinessTaskMail>>GetAsync(long id)
{
return await service.GetAsync(id);
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="taskMail">邮件配置</param>
/// <returns></returns>
[HttpPost, Route("Edit")]
public async Task<DataResult> EditAsync(BusinessTaskMail taskMail)
{
if (taskMail.Receiver == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskMailReceiverNotNull));
if (taskMail.Sender == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskMailSenderNotNull));
return await service.EditAsync(taskMail);
}
}
}

@ -95,9 +95,9 @@
"UserSecret": "123456",
"Environment": "TEST"
},
"RedisInfo": {
"RedisConfig": "rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:36379,password=,defaultDatabase=15"
},
"RedisInfo": {
"RedisConfig": "127.0.0.1:6379,password=,defaultDatabase=15"
},
"BCCompare": {
"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare"
},

@ -322,10 +322,19 @@ namespace DS.WMS.PrintApi.Service
FastReport.Report report = new FastReport.Report();
report.Load(printFile);
var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection;
report.Dictionary.Connections.Clear();
//var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection;
var str = new FastReport.Data.JsonConnection.JsonDataSourceConnectionStringBuilder();
str.Json = JsonConvert.SerializeObject(data);
dataSource.ConnectionString = str.ConnectionString;
//dataSource.ConnectionString = str.ConnectionString;
//重置数据源
report.Dictionary.Connections.Add(new JsonDataSourceConnection()
{
ConnectionString = str.ConnectionString,
Alias = "JSON"
});
//report.Dictionary.Connections[0].ConnectionString = str.ConnectionString;
report.Prepare();
var printName = string.Empty;

Loading…
Cancel
Save