diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index ebe79b3b..8b711008 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -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"; diff --git a/ds-wms-service/DS.Module.Core/Constants/SqlSugarCacheConst.cs b/ds-wms-service/DS.Module.Core/Constants/SqlSugarCacheConst.cs index 1b61681e..45d664c5 100644 --- a/ds-wms-service/DS.Module.Core/Constants/SqlSugarCacheConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/SqlSugarCacheConst.cs @@ -50,5 +50,10 @@ namespace DS.Module.Core.Constants /// SqlSugar二级缓存 商品信息 /// public const string Goods = "sys_sqlSugar:Goods"; + + /// + /// SqlSugar二级缓存 船公司信息 + /// + public const string Carrier = "sys_sqlSugar:Carrier"; } } diff --git a/ds-wms-service/DS.WMS.AdminApi/Controllers/CodeCarrierController.cs b/ds-wms-service/DS.WMS.AdminApi/Controllers/CodeCarrierController.cs new file mode 100644 index 00000000..f8d26fec --- /dev/null +++ b/ds-wms-service/DS.WMS.AdminApi/Controllers/CodeCarrierController.cs @@ -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; + +/// +/// 船公司信息服务 +/// +public class CodeCarrierController : ApiController +{ + private readonly ICodeCarrierService _invokeService; + + /// + /// 构造函数 + /// + /// + public CodeCarrierController(ICodeCarrierService invokeService) + { + _invokeService = invokeService; + } + + /// + /// 列表 + /// + /// + /// + [HttpPost] + [Route("GetCodeCarrierList")] + public DataResult> GetCodeCarrierList([FromBody] PageRequest request) + { + var res = _invokeService.GetListByPage(request); + return res; + } + + /// + /// 编辑 + /// + /// + /// + [HttpPost] + [Route("EditCodeCarrier")] + public DataResult EditCodeCarrier([FromBody] CodeCarrierReq model) + { + var res = _invokeService.EditCodeCarrier(model); + return res; + } + + /// + /// 详情 + /// + /// + /// + [HttpGet] + [Route("GetCodeCarrierInfo")] + public DataResult GetCodeCarrierInfo([FromQuery] string id) + { + var res = _invokeService.GetCodeCarrierInfo(id); + return res; + } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj b/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj index 8456e3bc..b849a3be 100644 --- a/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj +++ b/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj @@ -22,6 +22,7 @@ + diff --git a/ds-wms-service/DS.WMS.AdminApi/Program.cs b/ds-wms-service/DS.WMS.AdminApi/Program.cs index b2c676da..790e48b1 100644 --- a/ds-wms-service/DS.WMS.AdminApi/Program.cs +++ b/ds-wms-service/DS.WMS.AdminApi/Program.cs @@ -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(); diff --git a/ds-wms-service/DS.WMS.AdminApi/appsettings.json b/ds-wms-service/DS.WMS.AdminApi/appsettings.json index e688ec84..e3d1a10f 100644 --- a/ds-wms-service/DS.WMS.AdminApi/appsettings.json +++ b/ds-wms-service/DS.WMS.AdminApi/appsettings.json @@ -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" + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeCarrierReq.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeCarrierReq.cs new file mode 100644 index 00000000..9e2e187c --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeCarrierReq.cs @@ -0,0 +1,90 @@ +using DS.Module.Core; +using DS.WMS.Core.Code.Entity; +using FluentValidation; +using SqlSugar; + +namespace DS.WMS.Core.Code.Dtos; + +/// +/// 船公司信息请求实体 +/// +public class CodeCarrierReq +{ + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 英文简称 + /// + public string Code { get; set; } + /// + /// 中文名称 + /// + public string CnName { get; set; } + + /// + /// 中文简称 + /// + public string CnShortName { get; set; } + + /// + /// 英文名称 + /// + public string EnName { get; set; } + + /// + /// 船公司代码别名 + /// + public string OtherCode { get; set; } + + /// + /// 国家Id + /// + public long CountryId { get; set; } + + /// + /// 国家名称 + /// + public string CountryName { get; set; } + + /// + /// 船公司Logo + /// + public string Logo { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + /// + /// 备注 + /// + public string Remark { get; set; } + /// + /// EDI代码 + /// + public string EdiCode { get; set; } + /// + /// 状态 0 启用 1 禁用 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + /// + /// 备注 + /// + public string Note { get; set; } = ""; +} + +/// +/// 验证 +/// +public class CodeCarrierReqValidator : AbstractValidator +{ + /// + /// 构造函数 + /// + public CodeCarrierReqValidator() + { + + } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeCarrierRes.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeCarrierRes.cs new file mode 100644 index 00000000..7adc30eb --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeCarrierRes.cs @@ -0,0 +1,77 @@ +using DS.Module.Core; + +namespace DS.WMS.Core.Code.Dtos; + +/// +/// 船公司信息返回 +/// +public class CodeCarrierRes +{ + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 英文简称 + /// + public string Code { get; set; } + /// + /// 中文名称 + /// + public string CnName { get; set; } + + /// + /// 中文简称 + /// + public string CnShortName { get; set; } + + /// + /// 英文名称 + /// + public string EnName { get; set; } + + /// + /// 船公司代码别名 + /// + public string OtherCode { get; set; } + + /// + /// 国家Id + /// + public long CountryId { get; set; } + + /// + /// 国家名称 + /// + public string CountryName { get; set; } + + /// + /// 船公司Logo + /// + public string Logo { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + /// + /// 备注 + /// + public string Remark { get; set; } + /// + /// EDI代码 + /// + public string EdiCode { get; set; } + /// + /// 状态 0 启用 1 禁用 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + /// + /// 备注 + /// + public string Note { get; set; } = ""; + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Code/Entity/CodeCarrier.cs b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeCarrier.cs new file mode 100644 index 00000000..822473b3 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeCarrier.cs @@ -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 +{ + /// + /// 船公司信息表 + /// + [SqlSugar.SugarTable("code_carrier", "船公司信息表")] + public class CodeCarrier : BaseModel + { + /// + /// 英文简称 + /// + [SugarColumn(ColumnDescription = "英文简称", IsNullable = false, Length = 100)] + public string Code { get; set; } + /// + /// 中文名称 + /// + [SugarColumn(ColumnDescription = "中文名称",IsNullable = false, Length = 100)] + public string CnName { get; set; } + + /// + /// 中文简称 + /// + [SugarColumn(ColumnDescription = "中文简称", IsNullable = false, Length = 100)] + public string CnShortName { get; set; } + + /// + /// 英文名称 + /// + [SugarColumn(ColumnDescription = "英文名称", IsNullable = false, Length = 100)] + public string EnName { get; set; } + + /// + /// 船公司代码别名 + /// + [SugarColumn(ColumnDescription = "船公司代码别名", IsNullable = true, Length = 100)] + public string OtherCode { get; set; } + + /// + /// 国家Id + /// + [SugarColumn(ColumnDescription = "国家Id", IsNullable = true,DefaultValue ="")] + public long CountryId { get; set; } + + /// + /// 国家名称 + /// + [SugarColumn(ColumnDescription = "国家名称", IsNullable = true, Length = 100)] + public string CountryName { get; set; } + + /// + /// 船公司Logo Base64 + /// + [SugarColumn(ColumnDescription = "船公司Logo", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)] + public string Logo { get; set; } + /// + /// 描述 + /// + [SugarColumn(ColumnDescription = "描述", Length = 200, IsNullable = true)] + public string Description { get; set; } + /// + /// 备注 + /// + [SugarColumn(ColumnDescription = "备注", Length = 200, IsNullable = true)] + public string Remark { get; set; } + /// + /// EDI代码 + /// + [SugarColumn(ColumnDescription = "EDI代码", Length = 10, IsNullable = false)] + public string EdiCode { get; set; } + + /// + /// 状态 0启用 1禁用 + /// + [SugarColumn(ColumnDescription = "状态", DefaultValue = "0")] + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + } + +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Code/Interface/ICodeCarrierService.cs b/ds-wms-service/DS.WMS.Core/Code/Interface/ICodeCarrierService.cs new file mode 100644 index 00000000..7f876de7 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Interface/ICodeCarrierService.cs @@ -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 +{ + /// + /// 列表 + /// + /// + /// + DataResult> GetListByPage(PageRequest request); + + + /// + /// 编辑 + /// + /// + /// + DataResult EditCodeCarrier(CodeCarrierReq req); + + /// + /// 获取详情 + /// + /// + /// + DataResult GetCodeCarrierInfo(string id); + /// + /// 列表 + /// + /// + /// + DataResult> GetClientListByPage(PageRequest request); + /// + /// 编辑-客户端 + /// + /// + /// + DataResult EditClientCodeCarrier(CodeCarrierReq req); + /// + /// 获取详情 -客户端 + /// + /// + /// + public DataResult GetClientCodeCarrierInfo(string id); + + + /// + /// 批量删除 + /// + /// + /// + public DataResult BatchDelCodeCarrier(IdModel req); + +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Code/Method/CodeCarrierService.cs b/ds-wms-service/DS.WMS.Core/Code/Method/CodeCarrierService.cs new file mode 100644 index 00000000..b2c243cf --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Method/CodeCarrierService.cs @@ -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; + /// + /// + /// + /// + public CodeCarrierService(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + db = _serviceProvider.GetRequiredService(); + user = _serviceProvider.GetRequiredService(); + saasService = _serviceProvider.GetRequiredService(); + } + + public DataResult> GetListByPage(PageRequest request) + { + //序列化查询条件 + var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); + var data = db.Queryable() + .Where(whereList) + .Select().ToQueryPage(request.PageCondition); + return data; + } + + public DataResult EditCodeCarrier(CodeCarrierReq req) + { + if (req.Id == 0) + { + + if (db.Queryable().Where(x=>x.Code == req.Code.Trim()).Any()) + { + return DataResult.Failed("船公司信息已存在!", MultiLanguageConst.CodeCarrierExist); + } + var data = req.Adapt(); + + var entity = db.Insertable(data).ExecuteReturnEntity(); + + return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess); + } + else + { + var info = db.Queryable().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 GetCodeCarrierInfo(string id) + { + var data = db.Queryable() + .Where(a => a.Id == long.Parse(id)) + .Select() + .First(); + return DataResult.Success(data,MultiLanguageConst.DataQuerySuccess); + } + + public DataResult> GetClientListByPage(PageRequest request) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + //序列化查询条件 + var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); + var data = tenantDb.Queryable() + .Where(whereList) + .Select().ToQueryPage(request.PageCondition); + return data; + } + + public DataResult EditClientCodeCarrier(CodeCarrierReq req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + if (req.Id == 0) + { + + if (tenantDb.Queryable().Where(x=>x.Code == req.Code.Trim()).Any()) + { + return DataResult.Failed("船公司信息已存在!", MultiLanguageConst.CodeCarrierExist); + } + var data = req.Adapt(); + + var entity = tenantDb.Insertable(data).RemoveDataCache($"{SqlSugarCacheConst.Carrier}{user.TenantId}").ExecuteReturnEntity(); + + return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess); + } + else + { + var info = tenantDb.Queryable().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 GetClientCodeCarrierInfo(string id) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var data = tenantDb.Queryable() + .Where(a => a.Id == long.Parse(id)) + .Select() + .First(); + return DataResult.Success(data,MultiLanguageConst.DataQuerySuccess); + } + + public DataResult BatchDelCodeCarrier(IdModel req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var list = tenantDb.Queryable().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); + } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs b/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs index eca8327d..9f3d7ce3 100644 --- a/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs +++ b/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs @@ -196,7 +196,7 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService public DataResult CancelFlowInstance(CancelFlowInstanceReq req) { var instance = Db.Queryable().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().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(); diff --git a/ds-wms-service/DS.WMS.Core/Flow/Method/FlowRuntime.cs b/ds-wms-service/DS.WMS.Core/Flow/Method/FlowRuntime.cs index b68ab460..da3b835c 100644 --- a/ds-wms-service/DS.WMS.Core/Flow/Method/FlowRuntime.cs +++ b/ds-wms-service/DS.WMS.Core/Flow/Method/FlowRuntime.cs @@ -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(); info.Child = list.First(x => x.Pid == "root"); - UpdateChild(info.Child); - + try + { + UpdateChild(info.Child); + } + catch + { + } + return info; } diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/SeaExportOrder.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/SeaExportOrder.cs new file mode 100644 index 00000000..9bda1677 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/SeaExportOrder.cs @@ -0,0 +1,1293 @@ +using System.ComponentModel; +using DS.Module.Core; + +namespace DS.WMS.Core.Op.Dtos.TaskInteraction; + +/// +/// 海运出口信息 +/// +public class SeaExportOrder +{ + /// + /// 财务日期 + /// + [Description("财务日期")] + public string AccountDate { get; set; } + + /// + /// 主提单号 + /// + [Description("主提单号")] + public string MBLNO { get; set; } + + /// + /// 分提单号 + /// + [Description("分提单号")] + public string HBLNO { get; set; } + + /// + /// 委托单位Id + /// + public long CustomerId { get; set; } + + /// + /// 委托编号 + /// + [Description("委托编号")] + public string CustomerNo { get; set; } + + /// + /// 运单号 + /// + [Description("运单号")] + public string TransNo { get; set; } + + /// + /// 委托单位名称 + /// + [Description("委托单位名称")] + public string CustomerName { get; set; } + + /// + /// 装运方式 整箱、拼箱单票、拼箱主票、拼箱分票 + /// + [Description("装运方式")] + public string BLType { get; set; } + + ///// + ///// 发货人 t_info_client CUSTNAME + ///// + //public long? ShipperId { get; set; } + + ///// + ///// 收货人 t_info_client CUSTNAME + ///// + //public long? ConsigneeId { get; set; } + + ///// + ///// 通知人 t_info_client CUSTNAME + ///// + //public long? NotifyPartyId { get; set; } + + ///// + ///// 国外代理人Id t_info_client CUSTNAME + ///// + //public long? AgentId { get; set; } + + /// + /// 国外代理人 t_info_client CUSTNAME + /// + [Description("国外代理人")] + public string Agent { get; set; } + + /// + /// 发货人内容 + /// + [Description("发货人内容")] + public string ShipperContent { get; set; } + + /// + /// 收货人内容 + /// + [Description("收货人内容")] + public string ConsigneeContent { get; set; } + + /// + /// 通知人内容 + /// + [Description("通知人内容")] + public string NotifyPartyContent { get; set; } + + /// + /// 国外代理内容 + /// + [Description("国外代理内容")] + public string AgentContent { get; set; } + + /// + /// 场站Id t_crm_client CUSTNAME + /// + public long YardId { get; set; } + + /// + /// 场站 t_crm_client CUSTNAME + /// + [Description("场站")] + public string Yard { get; set; } + + /// + /// 场站备注 + /// + [Description("场站备注")] + public string YardRemark { get; set; } + + /// + /// 船名 t_code_vessel + /// + [Description("船名")] + public string Vessel { get; set; } + + ///// + ///// 船名Id t_code_vessel + ///// + //public long VesselId { get; set; } + + /// + /// 航次 + /// + [Description("航次")] + public string Voyno { get; set; } + + /// + /// 开船日期 + /// + [Description("开船日期")] + public DateTime? ETD { get; set; } + + /// + /// 预抵日期 + /// + [Description("预抵日期")] + public DateTime? ETA { get; set; } + + /// + /// ATD + /// + public DateTime? ATD { get; set; } + + /// + /// ATA 实际到港(目的港)时间 + /// + [Description("实际到港日期")] + public DateTime? ATA { get; set; } + + /// + /// 截港日期 + /// + [Description("截港日期")] + public DateTime? ClosingDate { get; set; } + + /// + /// 收货地 + /// + [Description("收货地")] + public string ReceiptPlace { get; set; } + + ///// + ///// 装货港Id + ///// + //public long ReceiptPlaceId { get; set; } + + ///// + ///// 装货港代码 + ///// + //public long LoadPortId { get; set; } + + /// + /// 装货港 + /// + [Description("装货港")] + public string LoadPort { get; set; } + + ///// + ///// 卸货港代码 + ///// + //public long DischargePortId { get; set; } + + /// + /// 卸货港 + /// + [Description("卸货港")] + public string DischargePort { get; set; } + + ///// + ///// 交货地代码 + ///// + //public long DeliveryPlaceId { get; set; } + + /// + /// 交货地 + /// + [Description("交货地")] + public string DeliveryPlace { get; set; } + + ///// + ///// 目的地代码 + ///// + //public long DestinationId { get; set; } + + /// + /// 目的地 + /// + [Description("目的地")] + public string Destination { get; set; } + + /// + /// 提单份数 + /// + public string NoBill { get; set; } + + /// + /// 副本份数 + /// + public string CopyNoBill { get; set; } + + /// + /// 签单方式 t_code_issutype + /// + [Description("签单方式")] + public string IssueType { get; set; } + + /// + /// 签单日期 + /// + [Description("签单日期")] + public DateTime? IssueDate { get; set; } + + ///// + ///// 签单地点Id + ///// + //public long IssuePlaceId { get; set; } + + /// + /// 签单地点 + /// + [Description("签单地点")] + public string IssuePlace { get; set; } + + /// + /// 签单状态 + /// + public DateTime? BLIssueSatus { get; set; } + + ///// + ///// 付款地点Id + ///// + //public long PrepareAtId { get; set; } + + /// + /// 预付地点 + /// + public string PrepareAt { get; set; } + + /// + /// 预付地点 + /// + public string PayableAt { get; set; } + + /// + /// 运输条款 CY-CY t_code_service + /// + [Description("运输条款")] + public string Service { get; set; } + + /// + /// 唛头 N/M + /// + [Description("唛头")] + public string Marks { get; set; } + + /// + /// 箱号封号 + /// + public string CntrSealNo { get; set; } + + /// + /// 件数包装 + /// + public string NoPkgs { get; set; } + + /// + /// 货物描述 + /// + [Description("货物描述")] + public string Description { get; set; } + + /// + /// 品名 t_code_goods + /// + [Description("品名")] + public string GoodsName { get; set; } + + ///// + ///// 品名Id + ///// + //public long GoodsId { get; set; } + + /// + /// 货物毛重 + /// + [Description("货物毛重")] + public string GrossWeight { get; set; } + + /// + /// 货物尺码 + /// + [Description("货物尺码")] + public string Measurement { get; set; } + + /// + /// 件数 + /// + [Description("件数")] + public int? PKGS { get; set; } + + /// + /// 包装 t_code_package + /// + [Description("包装")] + public string KindPkgs { get; set; } + + /// + /// 毛重 + /// + public decimal? KGS { get; set; } + + /// + /// 尺码 + /// + public decimal? CBM { get; set; } + + /// + /// 件数大写 + /// + public string TotalNo { get; set; } + + /// + /// 集装箱大写 + /// + public string CntrNo { get; set; } + + /// + /// 箱TEU + /// + public int TEU { get; set; } + + /// + /// 集装箱 + /// + public string CntrTotal { get; set; } + + /// + /// 操作员 + /// + public long OperatorId { get; set; } + + /// + /// 客服 + /// + public long CustomerService { get; set; } + + /// + /// Desc:单证 + /// + public long Doc { get; set; } + + ///// + ///// 外国客服 + ///// + //public long ForeignCustomerService { get; set; } + + ///// + ///// 航线Id + ///// + //public long LaneId { get; set; } + + /// + /// 航线 + /// + [Description("航线")] + public string Lane { get; set; } + + /// + /// 揽货人Id + /// + public long SaleId { get; set; } + + /// + /// 揽货人 + /// + [Description("揽货人")] + public string Sale { get; set; } + + /// + /// 船公司Id + /// + public long CarrierId { get; set; } + + /// + /// 船公司 + /// + [Description("船公司")] + public string Carrier { get; set; } + + /// + /// 货代公司Id + /// + public long ForwarderId { get; set; } + + /// + /// 货代公司 + /// + [Description("货代公司")] + public string Forwarder { get; set; } + + ///// + ///// 报关行Id + ///// + //public long CustomserId { get; set; } + + /// + /// 报关行 + /// + [Description("报关行")] + public string Customser { get; set; } + + /// + /// 承运车队Id + /// + public long TruckerId { get; set; } + + /// + /// 承运车队 + /// + [Description("车队")] + public string Trucker { get; set; } + + /// + /// 发票号 + /// + public string InvoiceNo { get; set; } + + /// + /// 货物标识 S/R/D/O + /// + [Description("货物标识")] + public string CargoId { get; set; } + + /// + /// 危险品分类 + /// + public string DangerClass { get; set; } + + /// + /// 危险品编号 + /// + public string DangerNo { get; set; } + + /// + /// 危险品页号 + /// + public string DangerPage { get; set; } + + /// + /// 危险品标签 + /// + public string DangerLabel { get; set; } + + /// + /// 冷藏通风量 + /// + public string ReeferQuantity { get; set; } + + /// + /// 温度单位 + /// + public string TemperatureUnit { get; set; } + + /// + /// 设置温度 + /// + public string TemperatureSet { get; set; } + + /// + /// 最低温度 + /// + public string TemperatureMin { get; set; } + + /// + /// 最高温度 + /// + public string TemperatureMax { get; set; } + + ///// + ///// Desc:业务来源Id + ///// + //public long SourceId { get; set; } + + ///// + ///// Desc:业务来源明细Id + ///// + //public long SourceDetailId { get; set; } + + /// + /// Desc:业务来源明细 + /// + [Description("业务来源明细")] + public string SourceDetailName { get; set; } + + /// + /// Desc:报关票数 + /// + public int CustomsNum { get; set; } + + /// + /// 运费协议号(约号) + /// + public string ContractNo { get; set; } + + /// + /// 订舱类型 + /// + [Description("订舱类型")] + public string BookingType { get; set; } + + /// + /// 订舱编号 + /// + [Description("订舱编号")] + public string BookingNo { get; set; } + + /// + /// Desc:保险人 + /// + public string Insuranceer { get; set; } + + /// + /// Desc:保险单号 + /// + public string InsuranceNo { get; set; } + + /// + /// Desc:保险金额 + /// + public decimal? InsuranceAmount { get; set; } + + /// + /// Desc:是否生成凭证 + /// + public bool? IsVoucher { get; set; } = false; + + /// + /// Desc:凭证号 + /// + public string VoucherNo { get; set; } + + /// + /// Desc:备注 + /// + public string Remark { get; set; } + + /// + /// Desc:熏蒸 + /// + public bool? IsFumigation { get; set; } = false; + + /// + /// Desc:仓储 + /// + public bool? IsStorage { get; set; } = false; + + /// + /// Desc:陆运 + /// + public bool? IsLand { get; set; } = false; + + /// + /// Desc:报关 + /// + public bool? IsCustoms { get; set; } = false; + + /// + /// Desc:报检 + /// + public bool? IsInspection { get; set; } = false; + + /// + /// Desc:订舱 + /// + public bool? IsBooking { get; set; } = false; + + /// + /// Desc:使用代理 + /// + public bool? IsAgent { get; set; } = false; + + /// + /// Desc:分单签单 + /// + public bool? IsHBLNO { get; set; } = false; + + ///// + ///// Desc:服务项目9 + ///// + //public bool? Service9 { get; set; } = false; + + ///// + ///// Desc:服务项目10 + ///// + //public bool? Service10 { get; set; } = false; + + /// + /// Desc:装箱类型 + /// + public string PackingType { get; set; } + + ///// + ///// Desc:仓库Id + ///// + //public long WareHouseId { get; set; } + + /// + /// Desc:仓库 + /// + public string WareHouse { get; set; } + + /// + /// 截单日期 + /// + public DateTime CloseDocDate { get; set; } + + /// + /// 集港日期 + /// + public DateTime IntoPortDocDate { get; set; } + + ///// + ///// Desc:所属业务部门 + ///// + //public long SaleDeptId { get; set; } + + /// + /// Desc:MBL付费方式 t_code_frt + /// + public string MBLFrt { get; set; } + + /// + /// Desc:结算方式 + /// + public string StlName { get; set; } + + /// + /// Desc:月结算时间 + /// + public DateTime StlDate { get; set; } + + /// + /// Desc:委托方式 + /// + public string OrderType { get; set; } + + /// + /// Desc:订舱编号 + /// + public string OrderNo { get; set; } + + /// + /// Desc:操作员代码 + /// + [Description("操作员代码")] + public string OperatorCode { get; set; } + + /// + /// Desc:是否为操作 + /// + public bool IsOperator { get; set; } + + /// + /// Desc:操作员邮箱 + /// + public string OperatorEmail { get; set; } + + /// + /// Desc:操作员电话 + /// + public string OperatorTel { get; set; } + + /// + /// Desc:操作员传真 + /// + public string OperatorFax { get; set; } + + /// + /// Desc:场站自结 + /// + public string FinancialStaffCode { get; set; } + + /// + /// Desc:是否为财务 + /// + public bool? IsFinancialStaff { get; set; } = false; + + /// + /// Desc:财务邮箱 + /// + public string FinancialStaffEmail { get; set; } + + /// + /// Desc:财务电话 + /// + public string FinancialStaffTel { get; set; } + + /// + /// Desc:财务传真 + /// + public string FinancialStaffFax { get; set; } + + /// + /// Desc:业务来源代码 + /// + public string SourceCode { get; set; } + + /// + /// Desc:联系人 + /// + public string LinkMan { get; set; } + + /// + /// Desc:海关代码 + /// + public string HSCode { get; set; } + + /// + /// Desc:EDI备注 + /// + public string EdiRemark { get; set; } + + ///// + ///// Desc:邮件方案 + ///// + //public long MailProjectId { get; set; } + + /// + /// Desc:CSR/IR号 + /// + public string IRCode { get; set; } + + /// + /// Desc:服务合同号 + /// + public string ServiceContractNo { get; set; } + + /// + /// Desc:申请放箱号 + /// + public string ApplyNo { get; set; } + + /// + /// Desc:报关单号 + /// + [Description("报关单号")] + public string CustomNo { get; set; } + + /// + /// Desc: 报关日期 + /// + [Description("报关日期")] + public DateTime CustomDate { get; set; } + + ///// + ///// 单位编码 + ///// + //public long? EnterpriseId { get; set; } + + /// + /// 单位 + /// + public string Enterprise { get; set; } + + /// + /// Desc:商检单号 + /// + public string InspectionNo { get; set; } + + /// + /// Desc:商检日期 + /// + public DateTime InspectionDate { get; set; } + + /// + /// Desc:贸易条款 + /// + [Description("贸易条款")] + public string TradeTerm { get; set; } + + /// + /// Desc:贸易方式 + /// + [Description("贸易方式")] + public string TermDelivery { get; set; } + + /// + /// Desc:清关日期 + /// + [Description("清关日期")] + public DateTime ClearCustomDate { get; set; } + + /// + /// Desc:报检项目 + /// + public string InsperctService { get; set; } + + ///// + ///// 船代Id + ///// + //public long ShipAgencyId { get; set; } + + /// + /// 船代 + /// + [Description("船代")] + public string ShipAgency { get; set; } + + /// + /// Desc:湿度 + /// + public string Humidity { get; set; } + + ///// + ///// Master发货人 + ///// + //public long? MasterShipperId { get; set; } + + ///// + ///// Master收货人 t_info_client CUSTNAME + ///// + //public long? MasterConsigneeId { get; set; } + + ///// + ///// Master通知人 t_info_client CUSTNAME + ///// + //public long? MasterNotifyPartyId { get; set; } + + /// + /// Master收货人内容 + /// + public string MasterConsigneeContent { get; set; } + + /// + /// Master通知人内容 + /// + public string MasterNotifyPartyContent { get; set; } + + /// + /// Master发货人内容 + /// + public string MasterShipperContent { get; set; } + + /// + /// Master单描述 + /// + public string MasterDescription { get; set; } + + /// + /// Desc:是否SOC + /// + public bool? IsContainerSoc { get; set; } = false; + + /// + /// Desc:运输状态 + /// + [Description("运输状态")] + public string TranStatus { get; set; } + + /// + /// Desc: + /// + public string ManifestStatus { get; set; } + + /// + /// 是否多品名 + /// + public bool IsMoreGood { get; set; } + + /// + /// 是否打印小票 + /// + public bool IsPrintReceipt { get; set; } + + /// + /// 船名 t_code_vessel + /// + [Description("船名")] + public string Vessel2N { get; set; } + + ///// + ///// 船名Id t_code_vessel + ///// + //public long VesselId2N { get; set; } + + /// + /// 二程航次 + /// + [Description("二程航次")] + public string Voyno2N { get; set; } + + /// + /// 交货日期 + /// + [Description("交货日期")] + public DateTime DeliveryDate { get; set; } + + /// + /// 场站联系人 + /// + public string YardATTN { get; set; } + + /// + /// 场站联系方式 + /// + public string YardTel { get; set; } + + ///// + ///// 销售公司Id + ///// + //public long SaleOrgId { get; set; } + + ///// + ///// 中转港Id + ///// + //public long TransPortId { get; set; } + + /// + /// 中转港 + /// + [Description("中转港")] + public string TransPort { get; set; } + + /// + /// 转运备注 + /// + public string TransRemark { get; set; } + + /// + /// 预录 + /// + public int PreRecord { get; set; } + + /// + /// 备注 + /// + public string? Note { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 截单备注 + /// + public string CloseDocRemark { get; set; } + + /// + /// 订舱备注 + /// + public string BookingRemark { get; set; } + + /// + /// Desc:提单签发状态 + /// + public int BLIssueStatus { get; set; } + + /// + /// Desc:整票提交状态 + /// + public AuditStatusEnum BillSubmitStatus { get; set; } + + /// + /// 是否订阅运踪 0 没有订阅 1 订阅起运港 2 订阅目的港 3 订阅起运港目的港 + /// + public string IsBookingYZ { get; set; } + + /// + /// VGM截止日期 + /// + [Description("VGM截止日期")] + public DateTime? CloseVgmDate { get; set; } + + /// + /// 中转港代码 + /// + public string TransPortCode { get; set; } + + /// + /// 第三付款地 + /// + public string ThirdPayAt { get; set; } + + /// + /// 发货人 t_info_client CUSTNAME + /// + [Description("发货人")] + public string Shipper { get; set; } + + /// + /// 收货人 t_info_client CUSTNAME + /// + [Description("收货人")] + public string Consignee { get; set; } + + /// + /// 通知人 t_info_client CUSTNAME + /// + public string NotifyParty { get; set; } + + /// + /// 内部航次 + /// + public string InnerVoyno { get; set; } + + ///// + ///// 第二通知人Id t_info_client CUSTNAME + ///// + //public long? SecondNotifyPartyId { get; set; } + + /// + /// 第二通知人 t_info_client CUSTNAME + /// + public string SecondNotifyParty { get; set; } + + /// + /// 第二通知人内容 + /// + public string SecondNotifyPartyContent { get; set; } + + ///// + ///// 委托单位联系人Id + ///// + //public long CustomerContactId { get; set; } + + ///// + ///// 场站联系人Id + ///// + //public long YardContactId { get; set; } + + ///// + ///// 车队联系人Id + ///// + //public long CarrierContactId { get; set; } + + ///// + ///// 第三付款地Id + ///// + //public long ThirdPayAtId { get; set; } + + ///// + ///// 预付地点Id + ///// + //public long PayableAtId { get; set; } + + /// + /// Desc:单证人员 + /// + [Description("单证")] + public string DocName { get; set; } + + /// + /// 操作员名称 + /// + [Description("操作员")] + public string OperatorName { get; set; } + + /// + /// 客服名称 + /// + [Description("客服")] + public string CustomerServiceName { get; set; } + + /// + /// 外国客服名称 + /// + public string ForeignCustomerServiceName { get; set; } + + /// + /// 截VGM时间 + /// + public DateTime? VGMCloseDate { get; set; } + + /// + /// 单证备注 + /// + public string DocRemark { get; set; } + + /// + /// 操作备注 + /// + public string OperatorRemark { get; set; } + + /// + /// 申请箱使 + /// + public string ApplyCtnRemark { get; set; } + + /// + /// 客户编号 + /// + public string CustomerNum { get; set; } + + ///// + ///// 国内发货人 t_info_client CUSTNAME + ///// + //public long? ShipperCnId { get; set; } + + /// + /// 国内发货人 t_info_client CUSTNAME + /// + public string ShipperCn { get; set; } + + /// + /// 所属分部名称 + /// + [Description("所属分部")] + public string SaleOrgName { get; set; } + + /// + /// 所属部门名称 + /// + [Description("所属部门")] + public string SaleDeptName { get; set; } + + /// + /// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常 + /// + public string LstShipOrderCompareRlt { get; set; } + + /// + /// 最后下货纸比对时间 + /// + public DateTime? LstShipOrderCompareDate { get; set; } + + /// + /// 最后下货纸比对批次号 + /// + public string LstShipOrderCompareId { get; set; } + + /// + /// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常 + /// + public string LstShipOrderCompareRltName { get; set; } + + /// + /// 最后下货纸比对方式 MANUAL-手动 AUTO-自动 + /// + public string LstShipOrderCompareMode { get; set; } + + /// + /// 最后格式单比对状态 NO_DIFF-无异常;DIFF-有差异; + /// + public string LstDraftCompareRlt { get; set; } + + /// + /// 最后格式单比对时间 + /// + public DateTime? LstDraftCompareDate { get; set; } + + /// + /// CNPTNo + /// + public string CNPTNo { get; set; } + + /// + /// 装运方式代码 整箱、拼箱单票、拼箱主票、拼箱分票代码 + /// + public string BLTypeCode { get; set; } + + /// + /// Desc:结算方式代码 + /// + public string StlCode { get; set; } + + /// + /// Desc:贸易方式代码 + /// + public string TermDeliveryCode { get; set; } + + /// + /// Desc:贸易条款代码 + /// + public string TradeTermCode { get; set; } + + /// + /// 签单方式代码 t_code_issutype + /// + public string IssueTypeCode { get; set; } + + /// + /// Desc:MBL付费方式代码 t_code_frt + /// + public string MBLFrtCode { get; set; } + /// + /// 运输条款代码 CY-CY t_code_service + /// + public string ServiceCode { get; set; } + + /// + /// 收货地代码 + /// + public string ReceiptPlaceCode { get; set; } + /// + /// 装货港代码 + /// + public string LoadPortCode { get; set; } + + /// + /// 卸货港代码 + /// + public string DischargePortCode { get; set; } + + /// + /// 交货地代码 + /// + public string DeliveryPlaceCode { get; set; } + + /// + /// 目的地代码 + /// + public string DestinationCode { get; set; } + + /// + /// 预付地点 + /// + public string PayableAtCode { get; set; } + /// + /// 第三付款地代码 + /// + public string ThirdPayAtCode { get; set; } + + /// + /// 签单地点代码 + /// + public string IssuePlaceCode { get; set; } + + /// + /// 航线代码 + /// + public string LaneCode { get; set; } + + /// + /// 舱位类型 + /// + public string ShippingSpaceType { get; set; } + + /// + /// 出单方式 + /// + public string IssuingWay { get; set; } + + /// + /// 包装名称 t_code_package + /// + public string KindPkgsName { get; set; } + + ///// + ///// 约主Id + ///// + //public long ContractClientId { get; set; } + + /// + /// 约主名称 + /// + public string ContractClientName { get; set; } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/MailActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/MailActionExecutor.cs similarity index 96% rename from ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/MailActionExecutor.cs rename to ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/MailActionExecutor.cs index b479f451..5558e81a 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/MailActionExecutor.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/MailActionExecutor.cs @@ -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 { /// /// 用于邮件发送的执行器 @@ -87,17 +87,17 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction } string title, content = string.Empty; - var templateModel = new MailTemplateModel { Primary = result.Data }; + var templateModel = new MailTemplateModel { Primary = result.Data.Adapt() }; IRazorEngine razorEngine = new RazorEngine(); try { - var titleTemplate = razorEngine.Compile>>(mailConfig.Title); + var titleTemplate = razorEngine.Compile>>(mailConfig.Title); title = await titleTemplate.RunAsync(x => { x.Model = templateModel; }); - var contentTemplate = razorEngine.Compile>>(mailConfig.Content); + var contentTemplate = razorEngine.Compile>>(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 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); diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs index d8851223..a6c2a0e2 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs @@ -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; diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TemplateTranslator.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TemplateTranslator.cs new file mode 100644 index 00000000..c10749e6 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TemplateTranslator.cs @@ -0,0 +1,9 @@ +using RazorEngineCore; + +namespace DS.WMS.Core.Op.Method.TaskInteraction +{ + internal class TemplateTranslator + { + + } +} diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs index 71dfdc49..827f89cf 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs @@ -14,6 +14,12 @@ namespace DS.WMS.Core.Sys.Interface; /// public interface IClientCommonService { + /// + /// 获取船公司下拉列表 + /// + /// + public Task>> GetCarrierSelectList(string queryKey = ""); + /// /// 获取约号下拉列表-客户端 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs index f8d78b8c..20fb95d1 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs @@ -47,8 +47,23 @@ public class ClientCommonService : IClientCommonService user = _serviceProvider.GetRequiredService(); saasService = _serviceProvider.GetRequiredService(); } + /// + /// 获取船公司下拉列表 + /// + /// + public async Task>> GetCarrierSelectList(string queryKey = "") { + + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var list = await tenantDb.Queryable() + .WhereIF(!string.IsNullOrEmpty(queryKey), a => a.Code.Contains(queryKey) || a.CnName.Contains(queryKey)) + .Select() + .Take(20) + .WithCache($"{SqlSugarCacheConst.Carrier}{user.TenantId}") + .ToListAsync(); + return await Task.FromResult(DataResult>.Success("获取数据成功!", list)); + + } - /// /// 获取约号下拉列表-客户端 /// diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs index f876aa98..e945a7f0 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs @@ -29,6 +29,18 @@ public class ClientCommonController : ApiController _invokeService = invokeService; } + /// + /// 获取船公司下拉列表-客户端 + /// + /// 船公司代码或中文名称 + /// + [HttpGet] + [Route("GetCarrierSelectList")] + public async Task>> GetCarrierSelectList([FromQuery] string queryKey) + { + var res = await _invokeService.GetCarrierSelectList(queryKey); + return res; + } /// /// 获取发票商品编码下拉数据 /// diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/CodeCarrierController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/CodeCarrierController.cs new file mode 100644 index 00000000..c0e35975 --- /dev/null +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/CodeCarrierController.cs @@ -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; + +/// +/// 船公司信息服务 +/// +public class CodeCarrierController : ApiController +{ + private readonly ICodeCarrierService _invokeService; + + /// + /// 构造函数 + /// + /// + public CodeCarrierController(ICodeCarrierService invokeService) + { + _invokeService = invokeService; + } + + /// + /// 列表 + /// + /// + /// + [HttpPost] + [Route("GetCodeCarrierList")] + public DataResult> GetCodeCarrierList([FromBody] PageRequest request) + { + var res = _invokeService.GetClientListByPage(request); + return res; + } + + /// + /// 编辑 + /// + /// + /// + [HttpPost] + [Route("EditCodeCarrier")] + public DataResult EditCodeCarrier([FromBody] CodeCarrierReq model) + { + var res = _invokeService.EditClientCodeCarrier(model); + return res; + } + + /// + /// 详情 + /// + /// + /// + [HttpGet] + [Route("GetCodeCarrierInfo")] + public DataResult GetCodeCarrierInfo([FromQuery] string id) + { + var res = _invokeService.GetClientCodeCarrierInfo(id); + return res; + } + /// + /// 批量删除 + /// + /// 主表Ids + /// + [HttpPost] + [Route("BatchDelCodeCarrier")] + public DataResult BatchDelCodeCarrier([FromBody] IdModel req) + { + var res = _invokeService.BatchDelCodeCarrier(req); + return res; + } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user index 21e5222f..fb7be066 100644 --- a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user +++ b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user @@ -1,7 +1,7 @@  - D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml + D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml MvcControllerEmptyScaffolder root/Common/MVC/Controller diff --git a/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs b/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs index 0b3bbc3e..b9177215 100644 --- a/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs +++ b/ds-wms-service/DS.WMS.Test/SaasDBUpdateTest.cs @@ -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);