zhangxiaofeng 4 months ago
commit 44fd9b0389

@ -366,6 +366,9 @@ public static class MultiLanguageConst
public const string CodeVesselImportNoData = "Code_Vessel_Import_No_Data";
[Description("存在已导入的船名信息")]
public const string CodeVesselImportAlready = "Code_Vessel_Import_Already";
[Description("船公司信息已存在")]
public const string CodeCarrierExist = "Code_Carrier_Exist";
[Description("航次信息已存在")]
public const string CodeVoynoExist = "Code_Voyno_Exist";

@ -50,5 +50,10 @@ namespace DS.Module.Core.Constants
/// SqlSugar二级缓存 商品信息
/// </summary>
public const string Goods = "sys_sqlSugar:Goods";
/// <summary>
/// SqlSugar二级缓存 船公司信息
/// </summary>
public const string Carrier = "sys_sqlSugar:Carrier";
}
}

@ -0,0 +1,63 @@
using DS.Module.Core;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Sys.Dtos;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.AdminApi.Controllers;
/// <summary>
/// 船公司信息服务
/// </summary>
public class CodeCarrierController : ApiController
{
private readonly ICodeCarrierService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public CodeCarrierController(ICodeCarrierService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetCodeCarrierList")]
public DataResult<List<CodeCarrierRes>> GetCodeCarrierList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditCodeCarrier")]
public DataResult EditCodeCarrier([FromBody] CodeCarrierReq model)
{
var res = _invokeService.EditCodeCarrier(model);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetCodeCarrierInfo")]
public DataResult<CodeCarrierRes> GetCodeCarrierInfo([FromQuery] string id)
{
var res = _invokeService.GetCodeCarrierInfo(id);
return res;
}
}

@ -22,6 +22,7 @@
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.Jwt\DS.Module.Jwt.csproj" />
<ProjectReference Include="..\DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj" />
<ProjectReference Include="..\DS.Module.RedisModule\DS.Module.RedisModule.csproj" />
<ProjectReference Include="..\DS.Module.SqlSugar\DS.Module.SqlSugar.csproj" />
<ProjectReference Include="..\DS.Module.Swagger\DS.Module.Swagger.csproj" />
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />

@ -32,12 +32,12 @@ builder.Host
builder.Services.AddAppWebInstal();
builder.Services.AddCorsInstall();
builder.Services.AddUserModuleInstall(); //用户服务
builder.Services.AddRedisModuleInstall();//redis
builder.Services.AddSqlSugarInstall();
builder.Services.AddSwaggerInstall();
builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务
builder.Services.AddRedisModuleInstall();//redis
var app = builder.Build();

@ -1,52 +1,55 @@
{
"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": "WmsAdminAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Admin API",
"Description": "Wms Admin 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", ".txt", ".pms" ]
"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": "WmsAdminAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Admin API",
"Description": "Wms Admin 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", ".txt", ".pms" ]
},
"RedisInfo": {
"RedisConfig": "127.0.0.1:6379,password=,defaultDatabase=15"
}
}

@ -0,0 +1,90 @@
using DS.Module.Core;
using DS.WMS.Core.Code.Entity;
using FluentValidation;
using SqlSugar;
namespace DS.WMS.Core.Code.Dtos;
/// <summary>
/// 船公司信息请求实体
/// </summary>
public class CodeCarrierReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 英文简称
/// </summary>
public string Code { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// 中文简称
/// </summary>
public string CnShortName { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 船公司代码别名
/// </summary>
public string OtherCode { get; set; }
/// <summary>
/// 国家Id
/// </summary>
public long CountryId { get; set; }
/// <summary>
/// 国家名称
/// </summary>
public string CountryName { get; set; }
/// <summary>
/// 船公司Logo
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
}
/// <summary>
/// 验证
/// </summary>
public class CodeCarrierReqValidator : AbstractValidator<CodeCarrierReq>
{
/// <summary>
/// 构造函数
/// </summary>
public CodeCarrierReqValidator()
{
}
}

@ -0,0 +1,77 @@
using DS.Module.Core;
namespace DS.WMS.Core.Code.Dtos;
/// <summary>
/// 船公司信息返回
/// </summary>
public class CodeCarrierRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 英文简称
/// </summary>
public string Code { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// 中文简称
/// </summary>
public string CnShortName { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 船公司代码别名
/// </summary>
public string OtherCode { get; set; }
/// <summary>
/// 国家Id
/// </summary>
public long CountryId { get; set; }
/// <summary>
/// 国家名称
/// </summary>
public string CountryName { get; set; }
/// <summary>
/// 船公司Logo
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}

@ -0,0 +1,87 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Code.Entity
{
/// <summary>
/// 船公司信息表
/// </summary>
[SqlSugar.SugarTable("code_carrier", "船公司信息表")]
public class CodeCarrier : BaseModel<long>
{
/// <summary>
/// 英文简称
/// </summary>
[SugarColumn(ColumnDescription = "英文简称", IsNullable = false, Length = 100)]
public string Code { get; set; }
/// <summary>
/// 中文名称
/// </summary>
[SugarColumn(ColumnDescription = "中文名称",IsNullable = false, Length = 100)]
public string CnName { get; set; }
/// <summary>
/// 中文简称
/// </summary>
[SugarColumn(ColumnDescription = "中文简称", IsNullable = false, Length = 100)]
public string CnShortName { get; set; }
/// <summary>
/// 英文名称
/// </summary>
[SugarColumn(ColumnDescription = "英文名称", IsNullable = false, Length = 100)]
public string EnName { get; set; }
/// <summary>
/// 船公司代码别名
/// </summary>
[SugarColumn(ColumnDescription = "船公司代码别名", IsNullable = true, Length = 100)]
public string OtherCode { get; set; }
/// <summary>
/// 国家Id
/// </summary>
[SugarColumn(ColumnDescription = "国家Id", IsNullable = true,DefaultValue ="")]
public long CountryId { get; set; }
/// <summary>
/// 国家名称
/// </summary>
[SugarColumn(ColumnDescription = "国家名称", IsNullable = true, Length = 100)]
public string CountryName { get; set; }
/// <summary>
/// 船公司Logo Base64
/// </summary>
[SugarColumn(ColumnDescription = "船公司Logo", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
public string Logo { get; set; }
/// <summary>
/// 描述
/// </summary>
[SugarColumn(ColumnDescription = "描述", Length = 200, IsNullable = true)]
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", Length = 200, IsNullable = true)]
public string Remark { get; set; }
/// <summary>
/// EDI代码
/// </summary>
[SugarColumn(ColumnDescription = "EDI代码", Length = 10, IsNullable = false)]
public string EdiCode { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
[SugarColumn(ColumnDescription = "状态", DefaultValue = "0")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}
}

@ -0,0 +1,57 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
namespace DS.WMS.Core.Code.Interface;
public interface ICodeCarrierService
{
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DataResult<List<CodeCarrierRes>> GetListByPage(PageRequest request);
/// <summary>
/// 编辑
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
DataResult EditCodeCarrier(CodeCarrierReq req);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<CodeCarrierRes> GetCodeCarrierInfo(string id);
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DataResult<List<CodeCarrierRes>> GetClientListByPage(PageRequest request);
/// <summary>
/// 编辑-客户端
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
DataResult EditClientCodeCarrier(CodeCarrierReq req);
/// <summary>
/// 获取详情 -客户端
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public DataResult<CodeCarrierRes> GetClientCodeCarrierInfo(string id);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelCodeCarrier(IdModel req);
}

@ -0,0 +1,137 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Code.Interface;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core.Code.Method;
public class CodeCarrierService:ICodeCarrierService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
/// <summary>
///
/// </summary>
/// <param name="serviceProvider"></param>
public CodeCarrierService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
public DataResult<List<CodeCarrierRes>> GetListByPage(PageRequest request)
{
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = db.Queryable<CodeCarrier>()
.Where(whereList)
.Select<CodeCarrierRes>().ToQueryPage(request.PageCondition);
return data;
}
public DataResult EditCodeCarrier(CodeCarrierReq req)
{
if (req.Id == 0)
{
if (db.Queryable<CodeCarrier>().Where(x=>x.Code == req.Code.Trim()).Any())
{
return DataResult.Failed("船公司信息已存在!", MultiLanguageConst.CodeCarrierExist);
}
var data = req.Adapt<CodeCarrier>();
var entity = db.Insertable(data).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
else
{
var info = db.Queryable<CodeCarrier>().Where(x => x.Id == req.Id).First();
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
public DataResult<CodeCarrierRes> GetCodeCarrierInfo(string id)
{
var data = db.Queryable<CodeCarrier>()
.Where(a => a.Id == long.Parse(id))
.Select<CodeCarrierRes>()
.First();
return DataResult<CodeCarrierRes>.Success(data,MultiLanguageConst.DataQuerySuccess);
}
public DataResult<List<CodeCarrierRes>> GetClientListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<CodeCarrier>()
.Where(whereList)
.Select<CodeCarrierRes>().ToQueryPage(request.PageCondition);
return data;
}
public DataResult EditClientCodeCarrier(CodeCarrierReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.Id == 0)
{
if (tenantDb.Queryable<CodeCarrier>().Where(x=>x.Code == req.Code.Trim()).Any())
{
return DataResult.Failed("船公司信息已存在!", MultiLanguageConst.CodeCarrierExist);
}
var data = req.Adapt<CodeCarrier>();
var entity = tenantDb.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.Carrier}{user.TenantId}").ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
else
{
var info = tenantDb.Queryable<CodeCarrier>().Where(x => x.Id == req.Id).First();
info = req.Adapt(info);
tenantDb.Updateable(info).RemoveDataCache($"{SqlSugarCacheConst.Carrier}{user.TenantId}").IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
public DataResult<CodeCarrierRes> GetClientCodeCarrierInfo(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeCarrier>()
.Where(a => a.Id == long.Parse(id))
.Select<CodeCarrierRes>()
.First();
return DataResult<CodeCarrierRes>.Success(data,MultiLanguageConst.DataQuerySuccess);
}
public DataResult BatchDelCodeCarrier(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<CodeCarrier>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).RemoveDataCache($"{SqlSugarCacheConst.Carrier}{user.TenantId}").ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
}

@ -196,7 +196,7 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
public DataResult CancelFlowInstance(CancelFlowInstanceReq req)
{
var instance = Db.Queryable<FlowInstance>().First(x => x.Id == req.Id);
if (instance.IsNull())
if (instance == null)
{
return DataResult.Failed("该工作流不存在!", MultiLanguageConst.FlowInstanceNotExist);
}
@ -266,7 +266,7 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
public DataResult StartFlowInstance(string id)
{
var instance = Db.Queryable<FlowInstance>().First(x => x.Id == long.Parse(id));
if (instance.IsNull())
if (instance == null)
{
return DataResult.Failed("该工作流不存在!", MultiLanguageConst.FlowInstanceNotExist);
}
@ -321,7 +321,7 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
{
var instance = GetFlowInstance(req.Id);
if (instance.IsNull())
if (instance == null)
{
return DataResult.Failed("该工作流不存在!", MultiLanguageConst.FlowInstanceNotExist);
}
@ -416,7 +416,7 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
instance.ActivityType = runtime.NextNodeType;
instance.ActivityName = runtime.NextNode.Name;
instance.MakerList = runtime.NextNodeType == 4 ? "1" : GetNextMakers(runtime);
instance.FlowStatus = (runtime.NextNodeType == 4 ? FlowStatusEnum.Approve : FlowStatusEnum.Running);
instance.FlowStatus = runtime.NextNodeType == 4 ? FlowStatusEnum.Approve : FlowStatusEnum.Running;
}
else
{
@ -428,12 +428,16 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
#endregion 一般审核
var serializerSettings = new JsonSerializerSettings
if (!string.IsNullOrEmpty(instance.MakerList) && instance.MakerList != "1")
{
// 设置为驼峰命名
ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
};
instance.Content = JsonConvert.SerializeObject(runtime.ToFlowRoot(), Formatting.None, serializerSettings);
var serializerSettings = new JsonSerializerSettings
{
// 设置为驼峰命名
ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
};
instance.Content = JsonConvert.SerializeObject(runtime.ToFlowRoot(), Formatting.None, serializerSettings);
}
instance.Note = auditNote;
Db.Updateable(instance).ExecuteCommand();

@ -442,12 +442,18 @@ public class FlowRuntime
public FlowRoot ToFlowRoot()
{
var root = ChildNodes.First(x => x.Id == "root");
var list = ChildNodes.Where(x => x.Id != "root").ToList();
var info = root.Adapt<FlowRoot>();
info.Child = list.First(x => x.Pid == "root");
UpdateChild(info.Child);
try
{
UpdateChild(info.Child);
}
catch
{
}
return info;
}

@ -4,13 +4,13 @@ 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 HtmlAgilityPack;
using Mapster;
using Masuit.Tools;
using Masuit.Tools.Systems;
using Microsoft.Extensions.Configuration;
@ -19,7 +19,7 @@ using Newtonsoft.Json;
using RazorEngineCore;
using SqlSugar;
namespace DS.WMS.Core.Op.Method.TaskInteraction
namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor
{
/// <summary>
/// 用于邮件发送的执行器
@ -87,17 +87,17 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
string title, content = string.Empty;
var templateModel = new MailTemplateModel<SeaExportRes> { Primary = result.Data };
var templateModel = new MailTemplateModel<SeaExportOrder> { Primary = result.Data.Adapt<SeaExportOrder>() };
IRazorEngine razorEngine = new RazorEngine();
try
{
var titleTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportRes>>>(mailConfig.Title);
var titleTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportOrder>>>(mailConfig.Title);
title = await titleTemplate.RunAsync(x =>
{
x.Model = templateModel;
});
var contentTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportRes>>>(mailConfig.Content);
var contentTemplate = razorEngine.Compile<RazorEngineTemplateBase<MailTemplateModel<SeaExportOrder>>>(mailConfig.Content);
content = await contentTemplate.RunAsync(x =>
{
x.Model = templateModel;
@ -145,6 +145,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
StringWriter writer = new();
htmlDoc.Save(writer);
content = writer.ToString();
writer.Close();
//设置收件人
List<long> receiverIds = [];
@ -152,7 +153,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
receiverIds.Add(templateModel.Primary.CarrierId);
if (mailConfig.Receiver.IsBooking)
receiverIds.Add(templateModel.Primary.CarrierId);
receiverIds.Add(templateModel.Primary.ForwarderId);
if (mailConfig.Receiver.IsYard)
receiverIds.Add(templateModel.Primary.YardId);

@ -1,9 +1,9 @@
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.Op.Method.TaskInteraction.ActionExecutor;
using DS.WMS.Core.TaskPlat;
using SqlSugar;

@ -0,0 +1,9 @@
using RazorEngineCore;
namespace DS.WMS.Core.Op.Method.TaskInteraction
{
internal class TemplateTranslator
{
}
}

@ -14,6 +14,12 @@ namespace DS.WMS.Core.Sys.Interface;
/// </summary>
public interface IClientCommonService
{
/// <summary>
/// 获取船公司下拉列表
/// </summary>
/// <returns></returns>
public Task<DataResult<List<CodeCarrierRes>>> GetCarrierSelectList(string queryKey = "");
/// <summary>
/// 获取约号下拉列表-客户端
/// </summary>

@ -47,8 +47,23 @@ public class ClientCommonService : IClientCommonService
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
/// 获取船公司下拉列表
/// </summary>
/// <returns></returns>
public async Task<DataResult<List<CodeCarrierRes>>> GetCarrierSelectList(string queryKey = "") {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = await tenantDb.Queryable<CodeCarrier>()
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.Code.Contains(queryKey) || a.CnName.Contains(queryKey))
.Select<CodeCarrierRes>()
.Take(20)
.WithCache($"{SqlSugarCacheConst.Carrier}{user.TenantId}")
.ToListAsync();
return await Task.FromResult(DataResult<List<CodeCarrierRes>>.Success("获取数据成功!", list));
}
/// <summary>
/// 获取约号下拉列表-客户端
/// </summary>

@ -29,6 +29,18 @@ public class ClientCommonController : ApiController
_invokeService = invokeService;
}
/// <summary>
/// 获取船公司下拉列表-客户端
/// </summary>
/// <param name="queryKey">船公司代码或中文名称</param>
/// <returns></returns>
[HttpGet]
[Route("GetCarrierSelectList")]
public async Task<DataResult<List<CodeCarrierRes>>> GetCarrierSelectList([FromQuery] string queryKey)
{
var res = await _invokeService.GetCarrierSelectList(queryKey);
return res;
}
/// <summary>
/// 获取发票商品编码下拉数据
/// </summary>

@ -0,0 +1,75 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
/// <summary>
/// 船公司信息服务
/// </summary>
public class CodeCarrierController : ApiController
{
private readonly ICodeCarrierService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public CodeCarrierController(ICodeCarrierService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetCodeCarrierList")]
public DataResult<List<CodeCarrierRes>> GetCodeCarrierList([FromBody] PageRequest request)
{
var res = _invokeService.GetClientListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditCodeCarrier")]
public DataResult EditCodeCarrier([FromBody] CodeCarrierReq model)
{
var res = _invokeService.EditClientCodeCarrier(model);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetCodeCarrierInfo")]
public DataResult<CodeCarrierRes> GetCodeCarrierInfo([FromQuery] string id)
{
var res = _invokeService.GetClientCodeCarrierInfo(id);
return res;
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req">主表Ids</param>
/// <returns></returns>
[HttpPost]
[Route("BatchDelCodeCarrier")]
public DataResult BatchDelCodeCarrier([FromBody] IdModel req)
{
var res = _invokeService.BatchDelCodeCarrier(req);
return res;
}
}

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>

@ -60,7 +60,7 @@ public class SaasDBUpdateTest
var tenantDb = saasService.GetBizDbScopeById(item.TenantId).CopyNew();
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci"; //较高版本支持
//tenantDb.CodeFirst.InitTables(types); //指定表空间下的实体
tenantDb.CodeFirst.InitTables(typeof(OpBusinessLog));//指定更新特定实体
tenantDb.CodeFirst.InitTables(typeof(CodeCarrier));//指定更新特定实体
}
Assert.True(true);

Loading…
Cancel
Save