From 579f2d3a39415238d4aea1ef4d154c858ed28762 Mon Sep 17 00:00:00 2001 From: majian <780924089@qq.com> Date: Tue, 23 Apr 2024 10:16:16 +0800 Subject: [PATCH] =?UTF-8?q?bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 2 +- .../Dto/BasMaterial/ErpBasMaterialInput.cs | 370 ++++++++++++ .../Entity/BasLocation.cs | 2 +- .../Entity/BasMaterial.cs | 5 + .../BasMaterialIntoFactorySpecifications.cs | 2 +- BasicData/Tnb.BasicData/BasMaterialService.cs | 183 ++++++ BasicData/Tnb.BasicData/Tnb.BasicData.csproj | 8 - BasicData/Tnb.BasicData/ValuesController.cs | 54 -- .../Entity/PrdMoTaskDefectRecord.cs | 2 +- .../Tnb.ProductionMgr/PrdInstockService.cs | 144 ++--- .../Tnb.ProductionMgr/PrdMoTaskService.cs | 325 +++++----- .../Tnb.ProductionMgr/PrdOutstockService.cs | 171 +++++- .../Tnb.ProductionMgr/PrdPackReportService.cs | 233 +++---- .../Tnb.ProductionMgr/RedisBackGround.cs | 566 +++++++++++++++--- .../Tnb.ProductionMgr.csproj | 4 +- .../Consts/MechanicalArmConsts.cs | 73 +++ .../Entity/WmsMechanicalArmD.cs | 19 + .../Entity/WmsMechanicalArmH.cs | 17 + .../Tnb.WarehouseMgr/DevServBase`1.cs | 119 ++++ .../Tnb.WarehouseMgr/DeviceProviderService.cs | 112 ++-- .../ElevatorControlService.cs | 13 +- .../Tnb.WarehouseMgr/ServiceLoggerBase`1.cs | 84 --- .../Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj | 1 - .../Tnb.WarehouseMgr/WareHouseService.cs | 265 +++++--- .../Tnb.WarehouseMgr/WmsCheckTaskService.cs | 2 +- .../Tnb.WarehouseMgr/WmsDistaskService.cs | 4 +- .../Tnb.WarehouseMgr/WmsOutStockService.cs | 13 +- .../WmsPDAScanInStockService.cs | 10 +- .../Tnb.API.Entry/Configurations/Cache.json | 4 +- .../Configurations/ConnectionStrings.json | 2 +- .../Configurations/Location.json | 3 + .../Tnb.API.Entry/Configurations/Nacos.json | 29 - apihost/Tnb.API.Entry/Tnb.API.Entry.csproj | 2 + apihost/Tnb.API.Entry/appsettings.json | 7 +- .../VengineSqlSugar/AppService.cshtml | 6 +- .../Template/VengineSqlSugar/EntityDto.cshtml | 6 +- .../VengineSqlSugar/EntityDtoAcmen.cshtml | 8 +- .../VengineSqlSugar/EntityInfo.cshtml | 6 +- .../VengineSqlSugar/EntityInfoAcmen.cshtml | 8 +- app/Tnb.Apps.Entitys/Entity/AppDataEntity.cs | 2 +- app/Tnb.Apps.Interfaces/IAppDataService.cs | 2 +- app/Tnb.Apps/AppDataService.cs | 2 +- app/Tnb.Apps/AppMenuService.cs | 2 +- app/Tnb.Apps/AppUserService.cs | 2 +- app/Tnb.Apps/AppVersion.cs | 2 +- .../EventBus/LogEventSubscriber.cs | 17 +- .../Filter/RequestActionFilter.cs | 70 --- common/Tnb.Common/Contracts/Entity.cs | 4 + common/Tnb.Common/Models/AnnexModel.cs | 2 +- common/Tnb.Common/Models/ChunkModel.cs | 2 +- .../Models/NPOI/ExcelColumnModel.cs | 2 + common/Tnb.Common/Models/NPOI/ExcelConfig.cs | 2 + .../Models/NPOI/ExcelTemplateModel.cs | 2 + .../Tnb.Common/Models/User/UserInfoModel.cs | 2 + common/Tnb.Common/Security/CodeGenHelper.cs | 4 +- .../Tnb.Common/Security/ExcelExportHelper.cs | 26 +- .../Tnb.Common/Security/ExcelImportHelper.cs | 2 +- common/Tnb.Common/Security/FileHelper.cs | 2 +- common/Tnb.Common/Security/JsonHelper.cs | 2 +- common/Tnb.Common/Security/NetHelper.cs | 2 +- common/Tnb.Common/Security/PinyinHelper.cs | 2 +- common/Tnb.Common/Security/QueryTreeHelper.cs | 2 +- common/Tnb.Common/Utils/AdapterCfg.cs | 6 +- common/Tnb.Common/Utils/HttpClientHelper.cs | 1 + .../Repositories/SqlSugarRepository.cs | 40 +- common/Tnb.SqlSugar/Tnb.SqlSugar.csproj | 2 +- .../Dto/IM/OnlineUserListOutput.cs | 2 +- .../Entity/IMContentEntity.cs | 2 +- .../Entity/MessageAccountEntity.cs | 2 +- .../Entity/MessageDataTypeEntity.cs | 2 +- .../Entity/MessageEntity.cs | 2 +- .../Entity/MessageMonitorEntity.cs | 1 + .../Entity/MessageReceiveEntity.cs | 2 +- .../Entity/MessageSendEntity.cs | 2 +- .../Entity/MessageSendRecordEntity.cs | 2 +- .../Entity/MessageSendTemplateEntity.cs | 2 +- .../Entity/MessageShortLinkEntity.cs | 2 +- .../Entity/MessageSmsFieldEntity.cs | 2 +- .../Entity/MessageTemplateEntity.cs | 2 +- .../Entity/MessageTemplateParamEntity.cs | 2 +- .../Entity/MessageWechatUserEntity.cs | 2 +- .../Entity/UserDeviceEntity.cs | 2 +- .../Tnb.Message.Interfaces/IMessageService.cs | 2 +- .../IShortLinkService.cs | 2 +- .../Service/MessageAccountService.cs | 2 +- .../Service/MessageDataTypeService.cs | 2 +- .../Service/MessageMonitorService.cs | 2 +- message/Tnb.Message/Service/MessageService.cs | 2 + .../Service/MessageTemplateService.cs | 2 +- .../Tnb.Message/Service/SendMessageService.cs | 2 +- .../Tnb.Message/Service/ShortLinkService.cs | 2 +- .../Tnb.Message/Service/WechatOpenService.cs | 2 +- request.http | 2 +- .../Entity/Permission/ColumnsPurviewEntity.cs | 2 +- .../Permission/OrganizeAdministratorEntity.cs | 2 +- .../Entity/Permission/OrganizeEntity.cs | 2 +- .../System/AdvancedQuerySchemeEntity.cs | 2 +- .../Entity/System/BillRuleEntity.cs | 2 +- .../Entity/System/ComFieldsEntity.cs | 2 +- .../Entity/System/CommonWordsEntity.cs | 2 + .../Entity/System/DataInterfaceEntity.cs | 2 +- .../Entity/System/DataInterfaceLogEntity.cs | 2 +- .../Entity/System/DbBackupEntity.cs | 2 +- .../Entity/System/DbLinkEntity.cs | 2 +- .../Entity/System/DictionaryDataEntity.cs | 2 +- .../Entity/System/DictionaryTypeEntity.cs | 2 +- .../Entity/System/InterfaceOauthEntity.cs | 2 +- .../Entity/System/MessageTemplateEntity.cs | 2 +- .../System/ModuleDataAuthorizeEntity.cs | 2 +- .../System/ModuleDataAuthorizeLinkEntity.cs | 2 +- .../Entity/System/ModuleFormEntity.cs | 2 +- .../Entity/System/PrintDevEntity.cs | 2 +- .../Entity/System/PrintLogEntity.cs | 2 + .../Entity/System/ProvinceEntity.cs | 2 +- .../Entity/System/SynThirdInfoEntity.cs | 2 +- .../Entity/System/TimeTaskEntity.cs | 2 +- .../Entity/System/TimeTaskLogEntity.cs | 2 +- .../IOrganizeAdministratorService.cs | 2 +- .../Permission/IOrganizeService.cs | 2 +- .../System/IBillRullService.cs | 2 +- .../System/IDataInterfaceService.cs | 2 +- .../System/IDbLinkService.cs | 2 +- .../System/IDictionaryDataService.cs | 2 +- .../System/IDictionaryTypeService.cs | 2 +- .../System/IModuleButtonService.cs | 2 +- .../System/IModuleColumnService.cs | 2 +- .../IModuleDataAuthorizeSchemeService.cs | 2 +- .../System/IModuleDataAuthorizeService.cs | 2 +- .../System/IModuleFormService.cs | 2 +- .../System/IModuleService.cs | 2 +- .../System/ISynThirdInfoService.cs | 2 +- .../System/ISysConfigService.cs | 2 +- .../Permission/AuthorizeService.cs | 4 - system/Tnb.Systems/Permission/GroupService.cs | 2 +- .../OrganizeAdministratorService.cs | 2 +- .../Tnb.Systems/Permission/OrganizeService.cs | 2 +- .../Tnb.Systems/Permission/PositionService.cs | 2 +- system/Tnb.Systems/System/ComFieldsService.cs | 2 +- system/Tnb.Systems/System/DataBaseService.cs | 2 +- .../System/DataInterfaceLogService.cs | 2 +- .../System/DataInterfaceService.cs | 23 +- system/Tnb.Systems/System/DataSyncService.cs | 2 +- system/Tnb.Systems/System/DbBackupService.cs | 2 +- system/Tnb.Systems/System/DbLinkService.cs | 2 +- .../System/DictionaryDataService.cs | 2 +- .../System/DictionaryTypeService.cs | 2 +- .../System/InterfaceOauthService.cs | 2 +- .../Tnb.Systems/System/ModuleButtonService.cs | 2 +- .../Tnb.Systems/System/ModuleColumnService.cs | 2 +- .../System/ModuleDataAuthorizeLinkService.cs | 2 +- .../ModuleDataAuthorizeSchemeService.cs | 2 +- .../System/ModuleDataAuthorizeService.cs | 2 +- .../Tnb.Systems/System/ModuleFormService.cs | 2 +- system/Tnb.Systems/System/ModuleService.cs | 2 +- system/Tnb.Systems/System/MonitorService.cs | 2 +- system/Tnb.Systems/System/PrintDevService.cs | 2 +- system/Tnb.Systems/System/PrintLogService.cs | 2 + system/Tnb.Systems/System/ProvinceService.cs | 2 +- .../Tnb.Systems/System/SynThirdInfoService.cs | 2 +- system/Tnb.Systems/System/SysCacheService.cs | 2 +- system/Tnb.Systems/System/SysConfigService.cs | 2 +- system/Tnb.Systems/System/SysLogService.cs | 2 +- .../Entity/SnowId.cs | 2 +- .../Entity/TimeTaskEntity.cs | 2 +- .../Entity/TimeTaskLogEntity.cs | 2 +- .../ITimeTaskService.cs | 2 +- .../Listener/QcTaskTimeWorker.cs | 298 ++++----- .../Listener/RequestOneTimeWorker.cs | 46 -- .../Listener/RequestThreeTimeWorker.cs | 45 -- .../Listener/RequestTwoTimeWorker.cs | 45 -- .../Tnb.TaskScheduler/TimeTaskService.cs | 2 +- .../Tnb.TaskScheduler.csproj | 1 + tnb.server.iml | 9 - .../Tnb.Vengine/AppService/BaseAppService.cs | 6 +- .../AppService/IVengineAppService.cs | 6 +- .../AppService/IVmodelAppService.cs | 6 +- .../AppService/IVmodelPageAppService.cs | 6 +- .../AppService/VengineAppService.cs | 6 +- .../AppService/VengineAppServiceT.cs | 6 +- .../AppService/VmodelAppService.cs | 6 +- visualdev/Tnb.Vengine/AppService/VmodelDto.cs | 4 + .../AppService/VmodelPageAppService.cs | 6 +- visualdev/Tnb.Vengine/Constants/DbConsts.cs | 6 +- visualdev/Tnb.Vengine/Constants/VmodelEnum.cs | 6 +- visualdev/Tnb.Vengine/Domain/VengineDto.cs | 6 +- visualdev/Tnb.Vengine/Domain/VmBaseProp.cs | 4 + visualdev/Tnb.Vengine/Domain/VmCalcProp.cs | 4 + visualdev/Tnb.Vengine/Domain/VmDbProp.cs | 4 + visualdev/Tnb.Vengine/Domain/VmNavProp.cs | 4 + visualdev/Tnb.Vengine/Domain/Vmodel.cs | 4 + visualdev/Tnb.Vengine/Domain/VmodelLink.cs | 4 + visualdev/Tnb.Vengine/Domain/VmodelPage.cs | 4 + visualdev/Tnb.Vengine/Mapper/VmodelMapper.cs | 6 +- .../Model/EntityFieldModel.cs | 2 + .../Entity/EmailReceiveEntity.cs | 2 + .../Entity/VisualDevModelDataEntity.cs | 2 +- .../VisualDevModelDataService.cs | 4 +- 197 files changed, 2509 insertions(+), 1363 deletions(-) create mode 100644 BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/ErpBasMaterialInput.cs delete mode 100644 BasicData/Tnb.BasicData/ValuesController.cs create mode 100644 WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/MechanicalArmConsts.cs create mode 100644 WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmD.cs create mode 100644 WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmH.cs create mode 100644 WarehouseMgr/Tnb.WarehouseMgr/DevServBase`1.cs delete mode 100644 WarehouseMgr/Tnb.WarehouseMgr/ServiceLoggerBase`1.cs create mode 100644 apihost/Tnb.API.Entry/Configurations/Location.json delete mode 100644 apihost/Tnb.API.Entry/Configurations/Nacos.json delete mode 100644 taskschedule/Tnb.TaskScheduler/Listener/RequestOneTimeWorker.cs delete mode 100644 taskschedule/Tnb.TaskScheduler/Listener/RequestThreeTimeWorker.cs delete mode 100644 taskschedule/Tnb.TaskScheduler/Listener/RequestTwoTimeWorker.cs delete mode 100644 tnb.server.iml diff --git a/.editorconfig b/.editorconfig index 9b90f5f3..68beb43f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# Rules in this file were initially inferred by Visual Studio IntelliCode from the J:\卡奥斯-NET 6\src codebase based on best match to current usage at 2022/3/31 +# Rules in this file were initially inferred by Visual Studio IntelliCode from the J:\引迈-NET 6\src codebase based on best match to current usage at 2022/3/31 # You can modify the rules from these initially generated values to suit your own policies # You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference [*.cs] diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/ErpBasMaterialInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/ErpBasMaterialInput.cs new file mode 100644 index 00000000..0ccd30c4 --- /dev/null +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/ErpBasMaterialInput.cs @@ -0,0 +1,370 @@ +namespace Tnb.BasicData.Entities.Dto +{ + public class ErpBasMaterialInput + { + public ErpBasMaterial bas_material { get; set; } + public List bas_material_units { get; set; } = new List(); + + // public List bas_material_into_factory_specificationses { get; set; } = new List(); + // + // public List bas_substitution_materials { get; set; } = new List(); + // + // public List bas_material_send_warehouses { get; set; } = new List(); + // + // public List bas_material_inbound_whs { get; set; } = new List(); + } + + public class ErpBasMaterial + { + /// + /// 物料代码 + /// + public string code { get; set; } = string.Empty; + + /// + /// 物料名称 + /// + public string name { get; set; } = string.Empty; + + /// + /// 物料分类ID + /// + public string category_id { get; set; } = string.Empty; + + /// + /// 单位ID + /// + public string unit_id { get; set; } = string.Empty; + + // /// + // /// 单价 + // /// + // public decimal? cost { get; set; } + // + // /// + // /// 毛重 + // /// + // public decimal? grossweight { get; set; } + // + // /// + // /// 净重 + // /// + // public decimal? netweight { get; set; } + // + // /// + // /// 长 + // /// + // public decimal? length { get; set; } + // + // /// + // /// 宽 + // /// + // public decimal? width { get; set; } + // + // /// + // /// 高 + // /// + // public decimal? high { get; set; } + // + // /// + // /// 体积 + // /// + // public decimal? volumn { get; set; } + // + // /// + // /// 是否免检 + // /// + // public int? isexemption { get; set; } + + /// + /// 安全库存 + /// + public decimal? safeqty { get; set; } + + /// + /// 保质期 + /// + public int? qualityperiod { get; set; } + + // /// + // /// 是否过期允许出库 + // /// + // public string? expireout { get; set; } + + /// + /// 最小包装 + /// + public decimal? minpacking { get; set; } + + /// + /// 是否先进先出管控 + /// + public string? fifo { get; set; } + + // /// + // /// 先进先出间隔天数,批次间隔天数 + // /// + // public int? fifo_interval_days { get; set; } + + /// + /// 物料规格型号 + /// + public string? material_standard { get; set; } + + // /// + // /// 海关编码 + // /// + // public string? fhscode { get; set; } + + // /// + // /// 附属性 + // /// + // public string? attribute { get; set; } + + // /// + // /// 管控类型: 批管控:Lot 单管控:KeyParts 非管控:NoControl + // /// + // public string? controltype { get; set; } + + /// + /// 备注 + /// + public string? remark { get; set; } + + // /// + // /// 创建用户 + // /// + // public string? create_id { get; set; } + + /// + /// 创建用户 + /// + public string? create_count { get; set; } + + /// + /// 创建时间 + /// + public DateTime? create_time { get; set; } + + // /// + // /// 修改用户 + // /// + // public string? modify_id { get; set; } + + /// + /// 修改用户 + /// + public string? modify_count { get; set; } + + /// + /// 修改时间 + /// + public DateTime? modify_time { get; set; } + + // /// + // /// 扩展字段 + // /// + // public string? extras { get; set; } + + /// + /// 状态 + /// + public string? state { get; set; } + + /// + /// 物料属性 + /// + public string? material_property { get; set; } + + /// + /// 标签 + /// + public string? label { get; set; } + + /// + /// 描述 + /// + public string? descrip { get; set; } + + /// + /// 批次管理 + /// + public int? is_batch_enabled { get; set; } + + /// + /// 标签管理 + /// + public int? is_label_enabled { get; set; } + + // /// + // /// 附件 + // /// + // public string? attachment { get; set; } + + /// + /// 先进先出 0否 1是 + /// + public int? first_in_out { get; set; } + + /// + /// 存储有效期(天) + /// + public int? storage_valid_day { get; set; } + + /// + /// 预警提前期(天) + /// + public int? early_warn_day { get; set; } + + /// + /// 安全库存 + /// + public int? safe_stock { get; set; } + + /// + /// 安全库存包含状态 + /// + public string? safe_stock_stauts { get; set; } + + /// + /// 发料仓库id + /// + public string? send_warehouse_id { get; set; } + + /// + /// 入厂单位id + /// + public string? into_factory_unit_id { get; set; } + + /// + /// 投料单位 + /// + public string? material_in_unit_id { get; set; } + + /// + /// 产出单位 + /// + public string? material_out_unit_id { get; set; } + + /// + /// 请料方式 1按计划排程请料 2自行管控 + /// + public string? material_request_method { get; set; } + + /// + /// 是否包含入库数 + /// + public int? is_contain_into_num { get; set; } + + /// + /// 是否创建子工单 + /// + public string? is_create_sub_work_order { get; set; } + + /// + /// 保质期 + /// + public int? quality_guarantee_period { get; set; } + + /// + /// DI编码 + /// + public string? di { get; set; } + + } + + public class ErpBasMaterialUnit + { + /// + /// 主单位数量 + /// + public string? number_of_primary_unit { get; set; } + + /// + /// 辅助单位数量 + /// + public string? number_of_auxiliary_unit { get; set; } + + /// + /// 辅助单位 + /// + public string auxiliary_unit_id { get; set; } = string.Empty; + + } + + public class ErpBasMaterialIntoFactorySpecifications + { + /// + /// 单位id + /// + public string unit_id { get; set; } = string.Empty; + + /// + /// 数量 + /// + public decimal num { get; set; } + } + + public class ErpBasSubstitutionMaterial + { + + /// + /// 替代料编号 + /// + public string sub_material_code { get; set; } = string.Empty; + + /// + /// 替代比例,如1(一个物料可以用一个替代料代替) + /// + public decimal proportion { get; set; } + + } + + public class ErpBasMaterialSendWarehouse + { + + /// + /// 仓库编号 + /// + public string? wh_code { get; set; } + + /// + /// 最大库存 + /// + public int? max_stock { get; set; } + + /// + /// 最小库存 + /// + public int? min_stock { get; set; } + + /// + /// 安全库存 + /// + public int? safe_stock { get; set; } + } + + public class ErpBasMaterialInboundWh + { + + /// + /// 仓库编号 + /// + public string? wh_code { get; set; } + + /// + /// 最大库存 + /// + public int? max_stock { get; set; } + + /// + /// 最小库存 + /// + public int? min_stock { get; set; } + + /// + /// 安全库存 + /// + public int? safe_stock { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs index 375db58b..03c249a9 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs @@ -125,5 +125,5 @@ public partial class BasLocation : BaseEntity /// /// 是否超配(1:不超配 2:超配) /// - public string is_overmatch { get; set; } + public string is_overmatch { get; set; } = "1"; } diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs index 77335163..ceb22bc4 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs @@ -263,5 +263,10 @@ public partial class BasMaterial : BaseEntity /// DI编码 /// public string? di { get; set; } + + /// + /// 删除标志 + /// + public int? deleted { get; set; } } diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasMaterialIntoFactorySpecifications.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasMaterialIntoFactorySpecifications.cs index 952e4a49..cf53bac8 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasMaterialIntoFactorySpecifications.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasMaterialIntoFactorySpecifications.cs @@ -5,7 +5,7 @@ using SqlSugar; namespace Tnb.BasicData.Entities; /// -/// 物料入场规格 +/// 物料入厂规格 /// [SugarTable("bas_material_into_factory_specifications")] public partial class BasMaterialIntoFactorySpecifications : BaseEntity diff --git a/BasicData/Tnb.BasicData/BasMaterialService.cs b/BasicData/Tnb.BasicData/BasMaterialService.cs index 6cb32234..386096b8 100644 --- a/BasicData/Tnb.BasicData/BasMaterialService.cs +++ b/BasicData/Tnb.BasicData/BasMaterialService.cs @@ -6,10 +6,13 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; +using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.System; +using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; +using SQLitePCL; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.BasicData.Entities.Dto; @@ -275,5 +278,185 @@ namespace Tnb.BasicData return ids; } + + + /// + /// 物料新增修改接口 + /// + /// + /// + [HttpPost] + public async Task CreateCreateOrUpdateMaterial(ErpBasMaterialInput input) + { + var db = _repository.AsSugarClient(); + if (input == null) + { + throw Oops.Bah("参数为空"); + } + if (input.bas_material == null) + { + throw Oops.Bah("物料信息为空"); + } + if (!string.IsNullOrEmpty(input.bas_material.code)) + { + throw Oops.Bah("物料编号为空"); + } + if (!string.IsNullOrEmpty(input.bas_material.name)) + { + throw Oops.Bah("物料名称为空"); + } + DbResult result = await db.Ado.UseTranAsync(async () => + { + BasMaterial basMaterial = input.bas_material.Adapt(); + if (!await db.Queryable().AnyAsync(x => x.code == input.bas_material.code)) + { + basMaterial.id = SnowflakeIdHelper.NextId(); + } + + if (!string.IsNullOrEmpty(input.bas_material.create_count)) + { + UserEntity userEntity = await db.Queryable().FirstAsync(x=>x.Account==input.bas_material.create_count); + if (userEntity == null) + { + throw Oops.Bah($"未找到用户{input.bas_material.create_count}"); + } + basMaterial.create_id = userEntity?.Id; + } + + if (!string.IsNullOrEmpty(input.bas_material.modify_count)) + { + UserEntity userEntity = await db.Queryable().FirstAsync(x=>x.Account==input.bas_material.modify_count); + if (userEntity == null) + { + throw Oops.Bah($"未找到用户{input.bas_material.modify_count}"); + } + basMaterial.modify_id = userEntity?.Id; + } + + List basMaterialUnits = new List(); + // List basMaterialIntoFactorySpecificationsList = new List(); + // List basSubstitutionMaterials = new List(); + // List basMaterialSendWarehouses = new List(); + // List basMaterialInboundWhs = new List(); + + if (input.bas_material_units != null && input.bas_material_units.Count > 0) + { + foreach(var item in input.bas_material_units) + { + BasMaterialUnit basMaterialUnit = item.Adapt(); + basMaterialUnit.id = SnowflakeIdHelper.NextId(); + basMaterialUnit.material_id = basMaterial.id; + basMaterialUnits.Add(basMaterialUnit); + } + } + + // if (input.bas_material_into_factory_specificationses != null && input.bas_material_into_factory_specificationses.Count > 0) + // { + // foreach(var item in input.bas_material_into_factory_specificationses) + // { + // BasMaterialIntoFactorySpecifications basMaterialIntoFactorySpecifications = item.Adapt(); + // basMaterialIntoFactorySpecifications.id = SnowflakeIdHelper.NextId(); + // basMaterialIntoFactorySpecifications.material_id = basMaterial.id; + // basMaterialIntoFactorySpecificationsList.Add(basMaterialIntoFactorySpecifications); + // } + // } + // + // if (input.bas_substitution_materials != null && input.bas_substitution_materials.Count > 0) + // { + // foreach(var item in input.bas_substitution_materials) + // { + // BasSubstitutionMaterial basSubstitutionMaterial = item.Adapt(); + // basSubstitutionMaterial.id = SnowflakeIdHelper.NextId(); + // basSubstitutionMaterial.material_id = basMaterial.id; + // BasMaterial subBasMaterial = await db.Queryable().FirstAsync(x=>x.code==item.sub_material_code); + // if (subBasMaterial == null) + // { + // throw Oops.Bah($"未找到替代物料{item.sub_material_code}"); + // } + // basSubstitutionMaterial.sub_material_id = subBasMaterial?.id ?? item.sub_material_code; + // basSubstitutionMaterials.Add(basSubstitutionMaterial); + // } + // } + // + // if (input.bas_material_send_warehouses != null && input.bas_material_send_warehouses.Count > 0) + // { + // foreach(var item in input.bas_material_send_warehouses) + // { + // BasMaterialSendWarehouse basMaterialSendWarehouse = item.Adapt(); + // basMaterialSendWarehouse.id = SnowflakeIdHelper.NextId(); + // basMaterialSendWarehouse.material_id = basMaterial.id; + // BasWarehouse basWarehouse = await db.Queryable().FirstAsync(x=>x.whcode==item.wh_code); + // if (basWarehouse == null) + // { + // throw Oops.Bah($"发料仓库未找到仓库{item.wh_code}"); + // } + // basMaterialSendWarehouse.wh_id = basWarehouse?.id ?? item.wh_code; + // basMaterialSendWarehouses.Add(basMaterialSendWarehouse); + // } + // } + // + // if (input.bas_material_inbound_whs != null && input.bas_material_inbound_whs.Count > 0) + // { + // foreach(var item in input.bas_material_inbound_whs) + // { + // BasMaterialInboundWh basMaterialInboundWh = item.Adapt(); + // basMaterialInboundWh.id = SnowflakeIdHelper.NextId(); + // basMaterialInboundWh.material_id = basMaterial.id; + // BasWarehouse basWarehouse = await db.Queryable().FirstAsync(x=>x.whcode==item.wh_code); + // if (basWarehouse == null) + // { + // throw Oops.Bah($"入库仓库未找到仓库{item.wh_code}"); + // } + // basMaterialInboundWh.wh_id = basWarehouse?.id ?? item.wh_code; + // basMaterialInboundWhs.Add(basMaterialInboundWh); + // } + // } + + if (!await db.Queryable().AnyAsync(x => x.code == input.bas_material.code)) + { + await db.Insertable(basMaterial).ExecuteCommandAsync(); + } + else + { + await db.Updateable(basMaterial).ExecuteCommandAsync(); + } + + // var x= await db.Storageable(basMaterial).ToStorageAsync(); + // await x.AsInsertable.ExecuteCommandAsync();//不存在插入 + // await x.AsUpdateable.ExecuteCommandAsync();//存在更新 + + if (basMaterialUnits.Count > 0) + { + await db.Deleteable().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync(); + await db.Insertable(basMaterialUnits).ExecuteCommandAsync(); + } + + // if (basMaterialIntoFactorySpecificationsList.Count > 0) + // { + // await db.Deleteable().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync(); + // await db.Insertable(basMaterialIntoFactorySpecificationsList).ExecuteCommandAsync(); + // } + // + // if (basSubstitutionMaterials.Count > 0) + // { + // await db.Deleteable().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync(); + // await db.Insertable(basSubstitutionMaterials).ExecuteCommandAsync(); + // } + // + // if (basMaterialSendWarehouses.Count > 0) + // { + // await db.Deleteable().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync(); + // await db.Insertable(basMaterialSendWarehouses).ExecuteCommandAsync(); + // } + // + // if (basMaterialInboundWhs.Count > 0) + // { + // await db.Deleteable().Where(x=>x.material_id==basMaterial.id).ExecuteCommandAsync(); + // await db.Insertable(basMaterialInboundWhs).ExecuteCommandAsync(); + // } + + }); + return !result.IsSuccess ? throw Oops.Oh(result.ErrorMessage) : "保存成功"; + } } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/Tnb.BasicData.csproj b/BasicData/Tnb.BasicData/Tnb.BasicData.csproj index 319b7872..349cdb7c 100644 --- a/BasicData/Tnb.BasicData/Tnb.BasicData.csproj +++ b/BasicData/Tnb.BasicData/Tnb.BasicData.csproj @@ -15,12 +15,4 @@ - - - - - - - - diff --git a/BasicData/Tnb.BasicData/ValuesController.cs b/BasicData/Tnb.BasicData/ValuesController.cs deleted file mode 100644 index ce9cb5dd..00000000 --- a/BasicData/Tnb.BasicData/ValuesController.cs +++ /dev/null @@ -1,54 +0,0 @@ -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace Tnb.BasicData; - -[Route("api/[controller]")] -[ApiController] -// public class ValuesController : ControllerBase -public class ValuesController : IDynamicApiController, ITransient -{ - private readonly Nacos.V2.INacosNamingService _nacosNamingService; - - public ValuesController(Nacos.V2.INacosNamingService nacosNamingService) - { - _nacosNamingService = nacosNamingService; - } - - [HttpGet] - [AllowAnonymous] - public string Get() - { - return "Ok~" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); - } - - - [HttpGet("test")] - [AllowAnonymous] - public async Task Test() - { - // 被调用方的服务名称 - var instance = await _nacosNamingService.SelectOneHealthyInstance("tnb-core", "DEFAULT_GROUP"); - var host = $"{instance.Ip}:{instance.Port}"; - - var baseUrl = instance.Metadata.TryGetValue("secure", out _) - ? $"https://{host}" - : $"http://{host}"; - - if(string.IsNullOrWhiteSpace(baseUrl)) - { - return "empty"; - } - - var url = $"{baseUrl}/api/values"; - - using (HttpClient client = new HttpClient()) - { - var result = await client.GetAsync(url); - return await result.Content.ReadAsStringAsync(); - } - } - -} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs index b1625663..b463b200 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskDefectRecord.cs @@ -5,7 +5,7 @@ using SqlSugar; namespace Tnb.ProductionMgr.Entities; /// -/// 自检报废记录表 +/// /// [SugarTable("prd_mo_task_defect_record")] public partial class PrdMoTaskDefectRecord : BaseEntity diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs index ffe40a86..80ace7e1 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs @@ -31,7 +31,7 @@ using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.ProductionMgr { /// - /// mes生产入库申请 + /// mes /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] @@ -42,7 +42,7 @@ namespace Tnb.ProductionMgr private readonly IUserManager _userManager; private readonly IOrganizeService _organizeService; private readonly IBillRullService _billRuleService; - + private const string ModuleId = "25572529329173"; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); @@ -56,7 +56,7 @@ namespace Tnb.ProductionMgr _repository = repository; _organizeService = organizeService; _userManager = userManager; - _billRuleService= billRullService; + _billRuleService = billRullService; OverideFuncs.GetListAsync = GetList; } @@ -69,7 +69,7 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c) => a.mold_id == c.id) .LeftJoin((a, b, c, d) => a.eqp_id == d.id) .WhereIF(!string.IsNullOrEmpty(moCode), (a, b, c, d) => a.mo_task_code!.Contains(moCode)) - .Where(a=>string.IsNullOrEmpty(a.parent_id)) + .Where(a => string.IsNullOrEmpty(a.parent_id)) .Select((a, b, c, d) => new PrdMoTaskTreeOutput() { id = a.id, @@ -111,7 +111,7 @@ namespace Tnb.ProductionMgr if (string.IsNullOrEmpty(input.station_id)) { - throw Oops.Bah("请先选择工位"); + throw Oops.Bah("ѡλ"); } DbResult result = await db.Ado.UseTranAsync(async () => @@ -207,7 +207,7 @@ namespace Tnb.ProductionMgr string domain = _userManager.Domain; Dictionary header = new() { - ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : "" + ["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" }; string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header); Log.Information(sendResult); @@ -225,11 +225,11 @@ namespace Tnb.ProductionMgr }); } - return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "保存成功" : result2.ErrorMessage); + return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "ɹ" : result2.ErrorMessage); } /// - /// 入库申请同步 + /// ͬ /// /// source_id /// @@ -259,7 +259,7 @@ namespace Tnb.ProductionMgr } /// - /// 注塑满箱到位后入库申请 + /// ע䵽λ /// /// /// @@ -272,12 +272,12 @@ namespace Tnb.ProductionMgr string warehouse_id = "2"; if (string.IsNullOrEmpty(equip_code)) { - throw Oops.Bah("请传机台号"); + throw Oops.Bah("봫̨"); } - + if (string.IsNullOrEmpty(label_code)) { - throw Oops.Bah("请传标签号"); + throw Oops.Bah("봫ǩ"); } ISqlSugarClient db = _repository.AsSugarClient(); @@ -285,9 +285,9 @@ namespace Tnb.ProductionMgr try { equipment = await db.Queryable() - .LeftJoin((x,y)=>x.id==y.equip_id) - .Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="注塑空满箱请求") - .Select((x,y)=>x) + .LeftJoin((x, y) => x.id == y.equip_id) + .Where((x, y) => y.equip_code == equip_code && y.label_name == label_code && y.label_point == "עܿ") + .Select((x, y) => x) .FirstAsync(); } catch (Exception e) @@ -297,18 +297,18 @@ namespace Tnb.ProductionMgr } if (equipment == null) { - throw Oops.Bah("未找到机台"); + throw Oops.Bah("δҵ̨"); } if (string.IsNullOrEmpty(equipment.as_location_id)) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("δҵλ"); } BasLocation basLocation = await db.Queryable().SingleAsync(x => x.id == equipment.as_location_id); if (basLocation == null) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("δҵλ"); } PrdReport prdReport = await db.Queryable() @@ -319,7 +319,7 @@ namespace Tnb.ProductionMgr string org_id = user.OrganizeId; if (prdReport == null) { - throw Oops.Bah("未找到提报记录"); + throw Oops.Bah("δҵᱨ¼"); } @@ -423,18 +423,18 @@ namespace Tnb.ProductionMgr { _ = await db.Insertable(prdInstockDs).ExecuteCommandAsync(); } - //todo 入库申请后是否修改提报记录状态 + //todo Ƿ޸ᱨ¼״̬ }); } - return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功" ; + return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "ɹ"; } // [HttpPost] // public async Task InstockTubeOne(PrdReport prdReport) // { // ISqlSugarClient db = _repository.AsSugarClient(); - // string location_code = "ZCR01";//todo 短管挤出件目标库位之后改 + // string location_code = "ZCR01";//todo ̹ܼĿλ֮ // string warehouse_id = "2"; // // PrdInstockH? prdInstockH = null; @@ -539,8 +539,8 @@ namespace Tnb.ProductionMgr // // return result2.IsSuccess ? "true" : "false"; // } - - + + [HttpPost] public async Task InstockTubeOne(InstockInput input) { @@ -548,16 +548,16 @@ namespace Tnb.ProductionMgr string label_code = input.label_code; if (string.IsNullOrEmpty(equip_code)) { - throw Oops.Bah("请传机台号"); + throw Oops.Bah("봫̨"); } - + if (string.IsNullOrEmpty(label_code)) { - throw Oops.Bah("请传标签号"); + throw Oops.Bah("봫ǩ"); } - + ISqlSugarClient db = _repository.AsSugarClient(); - // string location_code = "ZCR01";//todo 短管挤出件目标库位之后改 + // string location_code = "ZCR01";//todo ̹ܼĿλ֮ string warehouse_id = "2"; PrdInstockH? prdInstockH = null; @@ -567,9 +567,9 @@ namespace Tnb.ProductionMgr try { equipment = await db.Queryable() - .LeftJoin((x,y)=>x.id==y.equip_id) - .Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="挤出空满箱请求") - .Select((x,y)=>x) + .LeftJoin((x, y) => x.id == y.equip_id) + .Where((x, y) => y.equip_code == equip_code && y.label_name == label_code && y.label_point == "") + .Select((x, y) => x) .FirstAsync(); } catch (Exception e) @@ -579,27 +579,27 @@ namespace Tnb.ProductionMgr } if (equipment == null) { - throw Oops.Bah("未找到机台"); + throw Oops.Bah("δҵ̨"); } if (string.IsNullOrEmpty(equipment.as_location_id)) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("δҵλ"); } BasLocation basLocation = await db.Queryable().SingleAsync(x => x.id == equipment.as_location_id); if (basLocation == null) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("δҵλ"); } string location_code = basLocation.location_code; - + PrdReport prdReport = await db.Queryable() - .LeftJoin((x,y)=>x.material_id==y.id) - .Where((x,y) => y.category_id.Contains("\"DGJCJ\"") && x.status == 0).OrderByDescending(x => x.create_time) + .LeftJoin((x, y) => x.material_id == y.id) + .Where((x, y) => y.category_id.Contains("\"DGJCJ\"") && x.status == 0).OrderByDescending(x => x.create_time) .FirstAsync(); - + BasMaterial basMaterial = await db.Queryable().SingleAsync(x => x.id == prdReport.material_id); string create_id = prdReport.create_id; UserEntity user = await db.Queryable().SingleAsync(x => x.Id == create_id); @@ -609,7 +609,7 @@ namespace Tnb.ProductionMgr OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorkshopCode); string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE); - + prdInstockH = new PrdInstockH() { code = code, @@ -702,11 +702,11 @@ namespace Tnb.ProductionMgr }); } - return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功" ; + return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "ɹ"; } /// - /// 长管管挤出入库申请 + /// ܹܼ /// /// /// @@ -714,7 +714,7 @@ namespace Tnb.ProductionMgr { ISqlSugarClient db = _repository.AsSugarClient(); string location_code = prdReport.location_code; - string warehouse_id = "27209786980373";//长件挤出缓存仓 + string warehouse_id = "27209786980373";// PrdInstockH? prdInstockH = null; List prdInstockDs = new() { }; @@ -818,11 +818,11 @@ namespace Tnb.ProductionMgr }); } - return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功" ; + return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "ɹ"; } /// - /// 外包装入库申请 + /// װ /// /// /// @@ -830,70 +830,70 @@ namespace Tnb.ProductionMgr { string equip_code = input.equip_code; string label_code = input.label_code; - string warehouse_id = "26103367464997";//四楼解析库 + string warehouse_id = "26103367464997";//¥ if (!string.IsNullOrEmpty(equip_code)) { - throw Oops.Bah("请传机台号"); + throw Oops.Bah("봫̨"); } - + if (!string.IsNullOrEmpty(label_code)) { - throw Oops.Bah("请传标签号"); + throw Oops.Bah("봫ǩ"); } ISqlSugarClient db = _repository.AsSugarClient(); EqpEquipment equipment = await db.Queryable() - .LeftJoin((x,y)=>x.id==y.equip_id) - .Where((x,y) => y.equip_code==equip_code && y.label_name==label_code && y.label_point=="外包装成品码垛点位") - .Select((x,y)=>x) + .LeftJoin((x, y) => x.id == y.equip_id) + .Where((x, y) => y.equip_code == equip_code && y.label_name == label_code && y.label_point == "װƷλ") + .Select((x, y) => x) .FirstAsync(); - + if (equipment == null) { - throw Oops.Bah("未找到机台"); + throw Oops.Bah("δҵ̨"); } if (string.IsNullOrEmpty(equipment.as_location_id)) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("δҵλ"); } BasLocation basLocation = await db.Queryable().SingleAsync(x => x.id == equipment.as_location_id); if (basLocation == null) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("δҵλ"); } - + OrganizeEntity station = await db.Queryable() .LeftJoin((x, y) => x.Id == y.OrganizeId) .Where((x, y) => y.ObjectType == "Eqp" && y.ObjectId == equipment.id).FirstAsync(); if (station == null) { - throw Oops.Bah("未找到工位"); + throw Oops.Bah("δҵλ"); } - - PrdOutPacking prdOutPacking = await db.Queryable().Where(x=>x.station_id==station.Id && x.status=="0").OrderByDescending(x=>x.create_time).FirstAsync(); + + PrdOutPacking prdOutPacking = await db.Queryable().Where(x => x.station_id == station.Id && x.status == "0").OrderByDescending(x => x.create_time).FirstAsync(); if (prdOutPacking == null) { - throw Oops.Bah("未找到托盘"); + throw Oops.Bah("δҵ"); } - - var prdOutPackMarkLabelList = await db.Queryable().Where(x=>x.station_id==station.Id && x.status=="1").ToListAsync(); + + var prdOutPackMarkLabelList = await db.Queryable().Where(x => x.station_id == station.Id && x.status == "1").ToListAsync(); if (prdOutPackMarkLabelList == null || prdOutPackMarkLabelList.Count <= 0) { - throw Oops.Bah("未找到提报记录"); + throw Oops.Bah("δҵᱨ¼"); } List reportIds = prdOutPackMarkLabelList.Select(x => x.report_id).ToList(); - List prdReports = await db.Queryable().Where(x => reportIds.Contains(x.id)).ToListAsync(); + List prdReports = await db.Queryable().Where(x => reportIds.Contains(x.id)).ToListAsync(); - - if (prdReports == null || prdReports.Count<=0) + + if (prdReports == null || prdReports.Count <= 0) { - throw Oops.Bah("未找到提报记录"); + throw Oops.Bah("δҵᱨ¼"); } string create_id = prdReports[0].create_id; UserEntity user = await db.Queryable().SingleAsync(x => x.Id == create_id); @@ -910,7 +910,7 @@ namespace Tnb.ProductionMgr OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(station.Id, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(station.Id, DictConst.RegionCategoryWorkshopCode); string code = await _billRuleService.GetBillNumber(CodeTemplateConst.PRDINSTOCK_CODE); - + prdInstockH = new PrdInstockH() { code = code, @@ -1012,12 +1012,12 @@ namespace Tnb.ProductionMgr await db.Updateable() .SetColumns(x => x.status == "2") .Where(x => x.station_id == station.Id && x.status == "1").ExecuteCommandAsync(); - - //todo 入库申请后是否修改提报记录状态 + + //todo Ƿ޸ᱨ¼״̬ }); } - return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "申请成功" : result2.ErrorMessage); + return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "ɹ" : result2.ErrorMessage); } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 9bea8e27..6251fdc3 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -21,14 +21,15 @@ using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.BasicData.Entities.Dto; using Tnb.EquipMgr.Entities; +using Tnb.PerMgr.Entities; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Entities.Enums; using Tnb.ProductionMgr.Interfaces; -// using Tnb.QcMgr.Entities; -// using Tnb.QcMgr.Entities.Enums; -// using Tnb.QcMgr.Interfaces; +using Tnb.QcMgr.Entities; +using Tnb.QcMgr.Entities.Enums; +using Tnb.QcMgr.Interfaces; // using Tnb.PerMgr.Entities; @@ -53,7 +54,7 @@ namespace Tnb.ProductionMgr private readonly ISqlSugarClient _db; private readonly IBillRullService _billRuleService; private readonly IPrdInstockService _prdInstockService; - // private readonly IQcCheckPlanService _qcCheckPlanService; + private readonly IQcCheckPlanService _qcCheckPlanService; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public PrdMoTaskService( @@ -63,8 +64,8 @@ namespace Tnb.ProductionMgr IRunService runService, IBillRullService billRullService, IPrdInstockService prdInstockService, - // IQcCheckPlanService qcCheckPlanService, - IVisualDevService visualDevService + IVisualDevService visualDevService, + IQcCheckPlanService qcCheckPlanService ) { _repository = repository; @@ -77,7 +78,7 @@ namespace Tnb.ProductionMgr OverideFuncs.GetListAsync = GetList; _billRuleService = billRullService; _prdInstockService = prdInstockService; - // _qcCheckPlanService = qcCheckPlanService; + _qcCheckPlanService = qcCheckPlanService; } #region Get @@ -383,7 +384,7 @@ namespace Tnb.ProductionMgr estimated_end_date = a.estimated_end_date == null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), bom_id = d.id, bom_version = d.version, - create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS) + create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS) }) .Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "") .ToListAsync(); @@ -701,14 +702,14 @@ namespace Tnb.ProductionMgr row = await db.Insertable(moTask).ExecuteCommandAsync(); #region 质检模块 //质检 - // TriggerPlanEntity entity = new() - // { - // materialid = moTask.material_id, - // processid = moTask.process_id, - // workid = moTask.workstation_id, - // triggerevent = EnumTriggerEvent.首件检新的生产任务 - // }; - // await _qcCheckPlanService.CreateTask(entity); + TriggerPlanEntity entity = new() + { + materialid = moTask.material_id, + processid = moTask.process_id, + workid = moTask.workstation_id, + triggerevent = EnumTriggerEvent.首件检新的生产任务 + }; + await _qcCheckPlanService.CreateTask(entity); #endregion //根据工单号获取当前工单包含的已排产数 int? schedQty = db.Queryable().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty); @@ -842,14 +843,14 @@ namespace Tnb.ProductionMgr row = await _db.Insertable(moTask).ExecuteCommandAsync(); #region 质检模块 //质检 - // TriggerPlanEntity entity = new() - // { - // materialid = moTask.material_id, - // processid = moTask.process_id, - // workid = moTask.workstation_id, - // triggerevent = EnumTriggerEvent.首件检新的生产任务 - // }; - // await _qcCheckPlanService.CreateTask(entity); + TriggerPlanEntity entity = new() + { + materialid = moTask.material_id, + processid = moTask.process_id, + workid = moTask.workstation_id, + triggerevent = EnumTriggerEvent.首件检新的生产任务 + }; + await _qcCheckPlanService.CreateTask(entity); #endregion @@ -1086,20 +1087,20 @@ namespace Tnb.ProductionMgr { #region 质检模块 //质检 - // if (prdTaskList.Where(p => p.mo_task_status == "Pause").Count() > 0 && status == "InProgress") - // { - // foreach (PrdMoTask? task in prdTaskList.Where(p => p.mo_task_status == "Pause").ToList()) - // { - // TriggerPlanEntity entity = new() - // { - // materialid = task.material_id, - // processid = task.process_id, - // workid = task.workstation_id, - // triggerevent = EnumTriggerEvent.首件检生产任务暂停 - // }; - // await _qcCheckPlanService.CreateTask(entity); - // } - // } + if (prdTaskList.Where(p => p.mo_task_status == "Pause").Count() > 0 && status == "InProgress") + { + foreach (PrdMoTask? task in prdTaskList.Where(p => p.mo_task_status == "Pause").ToList()) + { + TriggerPlanEntity entity = new() + { + materialid = task.material_id, + processid = task.process_id, + workid = task.workstation_id, + triggerevent = EnumTriggerEvent.首件检生产任务暂停 + }; + await _qcCheckPlanService.CreateTask(entity); + } + } #endregion foreach (PrdMoTask item in prdTaskList) @@ -1502,13 +1503,13 @@ namespace Tnb.ProductionMgr { throw Oops.Bah("载具不能为空"); } - + if (string.IsNullOrEmpty((input.location_code))) { throw Oops.Bah("入库库位不能为空"); } - - if (input.reported_qty <= 0) + + if (input.reported_qty<=0) { throw Oops.Bah("提报数量为正数"); } @@ -1535,18 +1536,18 @@ namespace Tnb.ProductionMgr #region 质检模块 //质检模块 - // TriggerPlanEntity entity = new() - // { - // materialid = prdMoTask.material_id, - // processid = prdMoTask.process_id, - // workid = prdMoTask.workstation_id - // }; - // int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; - // int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; - // entity.oldpronum = reported + scrap; - // entity.newpronum = input.reported_qty; - // entity.triggerevent = EnumTriggerEvent.生产检定量; - // await _qcCheckPlanService.CreateTask(entity); + TriggerPlanEntity entity = new() + { + materialid = prdMoTask.material_id, + processid = prdMoTask.process_id, + workid = prdMoTask.workstation_id + }; + int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; + int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; + entity.oldpronum = reported + scrap; + entity.newpronum = input.reported_qty; + entity.triggerevent = EnumTriggerEvent.生产检定量; + await _qcCheckPlanService.CreateTask(entity); #endregion _ = prdMoTask.reported_work_qty == null ? await db.Updateable() @@ -1578,24 +1579,24 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty) .Where(x => x.id == prdMo.id).ExecuteCommandAsync(); - // PerProcessStandardsH processStandardsH = await db.Queryable() - // .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && - // x.output_material_id == prdMoTask.material_id && x.enabled == 1) - // .OrderByDescending(x => x.create_time).FirstAsync(); + PerProcessStandardsH processStandardsH = await db.Queryable() + .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && + x.output_material_id == prdMoTask.material_id && x.enabled == 1) + .OrderByDescending(x => x.create_time).FirstAsync(); - // ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mold_id); - // if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && - // processStandardsH?.moulding_cycle > 0) - // { - // decimal? addTime = ((((prdMoTask.scheduled_qty - input.reported_qty - (prdMoTask.scrap_qty ?? 0)) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; - // if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) - // { - // DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); - // _ = await db.Updateable() - // .SetColumns(x => x.plan_end_date == cal_plan_end_date) - // .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); - // } - // } + ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mold_id); + if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && + processStandardsH?.moulding_cycle > 0) + { + decimal? addTime = ((((prdMoTask.scheduled_qty - input.reported_qty - (prdMoTask.scrap_qty ?? 0)) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; + if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) + { + DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); + _ = await db.Updateable() + .SetColumns(x => x.plan_end_date == cal_plan_end_date) + .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); + } + } } if (prdMoTask.schedule_type == 2 && !string.IsNullOrEmpty(prdMoTask.mbom_process_id)) @@ -1751,7 +1752,7 @@ namespace Tnb.ProductionMgr // return resultMsg == "true" ? (dynamic)true : throw Oops.Bah(resultMsg); return true; } - + if (arr.Length > 0 && arr.Contains("CGJCJ"))//短管挤出件入库申请 { string resultMsg = await _prdInstockService.InstockTubeThree(report); @@ -1830,18 +1831,18 @@ namespace Tnb.ProductionMgr #region 质检模块 //质检模块 - // TriggerPlanEntity entity = new() - // { - // materialid = prdMoTask.material_id, - // processid = prdMoTask.process_id, - // workid = prdMoTask.workstation_id - // }; - // int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; - // int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; - // entity.oldpronum = reported + scrap; - // entity.newpronum = input.scrap_qty; - // entity.triggerevent = EnumTriggerEvent.生产检定量; - // await _qcCheckPlanService.CreateTask(entity); + TriggerPlanEntity entity = new() + { + materialid = prdMoTask.material_id, + processid = prdMoTask.process_id, + workid = prdMoTask.workstation_id + }; + int? reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; + int? scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; + entity.oldpronum = reported + scrap; + entity.newpronum = input.scrap_qty; + entity.triggerevent = EnumTriggerEvent.生产检定量; + await _qcCheckPlanService.CreateTask(entity); #endregion _ = await db.Updateable().SetColumns(it => new PrdMoTask { scrap_qty = scrapQty.Value }).Where(it => it.id == input.mo_task_id).ExecuteCommandAsync(); } @@ -1878,24 +1879,24 @@ namespace Tnb.ProductionMgr if (prdMoTask.schedule_type == 1) { - // PerProcessStandardsH processStandardsH = await db.Queryable() - // .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && - // x.output_material_id == prdMoTask.material_id && x.enabled == 1) - // .OrderByDescending(x => x.create_time).FirstAsync(); - // - // ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mold_id); - // if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && - // processStandardsH?.moulding_cycle > 0) - // { - // decimal? addTime = ((((prdMoTask.scheduled_qty - prdMoTask.reported_work_qty - input.scrap_qty) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; - // if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) - // { - // DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); - // _ = await db.Updateable() - // .SetColumns(x => x.plan_end_date == cal_plan_end_date) - // .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); - // } - // } + PerProcessStandardsH processStandardsH = await db.Queryable() + .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && + x.output_material_id == prdMoTask.material_id && x.enabled == 1) + .OrderByDescending(x => x.create_time).FirstAsync(); + + ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mold_id); + if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && + processStandardsH?.moulding_cycle > 0) + { + decimal? addTime = ((((prdMoTask.scheduled_qty - prdMoTask.reported_work_qty - input.scrap_qty) * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; + if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) + { + DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); + _ = await db.Updateable() + .SetColumns(x => x.plan_end_date == cal_plan_end_date) + .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); + } + } } else { @@ -2178,53 +2179,53 @@ namespace Tnb.ProductionMgr /// /// /// - // [HttpPost] - // public async Task GetEstimatedEndTime(CountEstimatedEndTimeInput input) - // { - // ISqlSugarClient db = _repository.AsSugarClient(); - // if (input.type == 1) - // { - // PerProcessStandardsH processStandardsH = await db.Queryable() - // .Where(x => x.equip_id == input.equip_id && x.molds_id == input.molds_id && - // x.output_material_id == input.material_id && x.enabled == 1) - // .OrderByDescending(x => x.create_time).FirstAsync(); - // - // ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == input.molds_id); - // if (toolMolds == null) - // { - // throw Oops.Bah("没找到模具"); - // } - // - // if (toolMolds?.mold_cavity <= 0) - // { - // throw Oops.Bah("模穴数错误"); - // } - // - // if (processStandardsH == null) - // { - // throw Oops.Bah("工艺标准成型周期错误"); - // } - // - // if (processStandardsH?.moulding_cycle <= 0) - // { - // throw Oops.Bah("工艺标准成型周期错误"); - // } - // - // decimal? addTime = (((input.scheduled_qty * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; - // return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss"); - // } - // else - // { - // List list = await db.Queryable() - // .LeftJoin((a, b) => a.process_id == b.process_id && b.enabled == 1) - // .Where((a, b) => a.mbom_id == input.mbom_id).Select((a, b) => b).ToListAsync(); - // - // decimal max = list.Select(x => Convert.ToDecimal(x.standard_time)).Max(x => x); - // decimal? addTime = input.scheduled_qty * max; - // return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss"); - // } - // - // } + [HttpPost] + public async Task GetEstimatedEndTime(CountEstimatedEndTimeInput input) + { + ISqlSugarClient db = _repository.AsSugarClient(); + if (input.type == 1) + { + PerProcessStandardsH processStandardsH = await db.Queryable() + .Where(x => x.equip_id == input.equip_id && x.molds_id == input.molds_id && + x.output_material_id == input.material_id && x.enabled == 1) + .OrderByDescending(x => x.create_time).FirstAsync(); + + ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == input.molds_id); + if (toolMolds == null) + { + throw Oops.Bah("没找到模具"); + } + + if (toolMolds?.mold_cavity <= 0) + { + throw Oops.Bah("模穴数错误"); + } + + if (processStandardsH == null) + { + throw Oops.Bah("工艺标准成型周期错误"); + } + + if (processStandardsH?.moulding_cycle <= 0) + { + throw Oops.Bah("工艺标准成型周期错误"); + } + + decimal? addTime = (((input.scheduled_qty * processStandardsH?.moulding_cycle) - 1) / toolMolds.mold_cavity) + 1; + return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss"); + } + else + { + List list = await db.Queryable() + .LeftJoin((a, b) => a.process_id == b.process_id && b.enabled == 1) + .Where((a, b) => a.mbom_id == input.mbom_id).Select((a, b) => b).ToListAsync(); + + decimal max = list.Select(x => Convert.ToDecimal(x.standard_time)).Max(x => x); + decimal? addTime = input.scheduled_qty * max; + return input.estimated_start_date.AddSeconds((double)addTime.Value).ToString("yyyy-MM-dd HH:mm:ss"); + } + + } /// @@ -2765,7 +2766,7 @@ namespace Tnb.ProductionMgr return prdMoTask; } - + /// /// 根据工位获取进行中待开工暂停的任务单信息 /// @@ -2780,8 +2781,8 @@ namespace Tnb.ProductionMgr throw Oops.Bah("工位错误"); } - List list = await _db.Queryable().Where(x => x.workstation_id == station_id && x.parent_id != null && (x.mo_task_status == DictConst.InProgressEnCode || x.mo_task_status == DictConst.ToBeStartedEnCode || x.mo_task_status == DictConst.MoStatusPauseCode)).ToListAsync(); - if (list != null && list.Count > 0) + List list = await _db.Queryable().Where(x => x.workstation_id == station_id && x.parent_id != null && (x.mo_task_status == DictConst.InProgressEnCode || x.mo_task_status == DictConst.ToBeStartedEnCode || x.mo_task_status == DictConst.MoStatusPauseCode )).ToListAsync(); + if (list != null && list.Count>0) { foreach (var prdMoTask in list) { @@ -2792,7 +2793,7 @@ namespace Tnb.ProductionMgr return list; } - + /// /// 外包装根据工位id获取喷码数据 /// @@ -2808,7 +2809,7 @@ namespace Tnb.ProductionMgr if (prdMoTask == null) throw Oops.Bah("没找到对应任务单"); if (await _db.Queryable().Where(x => - x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == 0 && x.is_mark == null).AnyAsync()) + x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == 0 && x.is_mark==null).AnyAsync()) { await _db.Updateable() .SetColumns(x => x.is_mark == 0) @@ -2831,10 +2832,10 @@ namespace Tnb.ProductionMgr } PrdMoTask parent = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.parent_id); - BasMaterial basMaterial = await _db.Queryable().SingleAsync(x => x.id == parent.material_id); - - string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch ?? ""}"; + BasMaterial basMaterial = await _db.Queryable().SingleAsync(x=>x.id==parent.material_id); + string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch??""}"; + return code; } @@ -2851,9 +2852,9 @@ namespace Tnb.ProductionMgr { "station_id", input.station_id } }); if (prdMoTask == null) throw Oops.Bah("没找到对应任务单"); - + if (await _db.Queryable().Where(x => - x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == null && x.is_mark == 0).AnyAsync()) + x.mo_task_code == prdMoTask.mo_task_code && x.status == "0" && x.is_label == null && x.is_mark==0).AnyAsync()) { await _db.Updateable() .SetColumns(x => x.is_label == 0) @@ -2874,12 +2875,12 @@ namespace Tnb.ProductionMgr await _db.Insertable(prdOutPackMarkLabel).ExecuteCommandAsync(); } - + PrdMoTask parent = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.parent_id); - BasMaterial basMaterial = await _db.Queryable().SingleAsync(x => x.id == parent.material_id); - - string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch ?? ""}"; + BasMaterial basMaterial = await _db.Queryable().SingleAsync(x=>x.id==parent.material_id); + string code = $"(01){basMaterial.di ?? ""}\\n(11){DateTime.Now.ToString("yyMMdd")}\\n(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}\\n(10){parent.batch??""}"; + return code; } } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs index 41c2048d..a616d988 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs @@ -45,7 +45,7 @@ namespace Tnb.ProductionMgr private readonly IBillRullService _billRullService; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); - public PrdOutstockService(ISqlSugarRepository repository, IOrganizeService organizeService, IBillRullService billRullService,IRunService runService, IUserManager userManager, IVisualDevService visualDevService, IDictionaryDataService dictionaryDataService) + public PrdOutstockService(ISqlSugarRepository repository, IOrganizeService organizeService, IBillRullService billRullService, IRunService runService, IUserManager userManager, IVisualDevService visualDevService, IDictionaryDataService dictionaryDataService) { _db = repository.AsSugarClient(); _runService = runService; @@ -98,7 +98,7 @@ namespace Tnb.ProductionMgr string domain = _userManager.Domain; Dictionary header = new() { - ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : "" + ["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" }; string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); Log.Information(sendResult); @@ -190,7 +190,7 @@ namespace Tnb.ProductionMgr string domain = _userManager.Domain; Dictionary header = new() { - ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : "" + ["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" }; string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); Log.Information(sendResult); @@ -266,12 +266,12 @@ namespace Tnb.ProductionMgr MESCreateOutstockInput input = new MESCreateOutstockInput(); input.outstock = new MESWmsOutstockHInput(); input.outstockDs = new List(); - - PrdMoTask prdMoTask = await db.Queryable().SingleAsync(x=>x.id==materialOutstockInput.mo_task_id); - BasLocation location = await db.Queryable().Where(x=>x.location_code==materialOutstockInput.location_code).FirstAsync(); + + PrdMoTask prdMoTask = await db.Queryable().SingleAsync(x => x.id == materialOutstockInput.mo_task_id); + BasLocation location = await db.Queryable().Where(x => x.location_code == materialOutstockInput.location_code).FirstAsync(); if (location == null) throw Oops.Bah("未找到库位"); string locationId = location.id; - + PrdOutstockH prdOutstockH = new() { bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE), @@ -287,17 +287,17 @@ namespace Tnb.ProductionMgr input.outstock.source_code = prdOutstockH.bill_code; input.outstock.source_id = prdOutstockH.id; OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(materialOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode); - + List materialIds = materialOutstockInput.details.Select(x => x.material_id).ToList(); - List basMaterials = await db.Queryable().Where(x=>materialIds.Contains(x.id)).ToListAsync(); - Dictionary unitIdDic = await db.Queryable() + List basMaterials = await db.Queryable().Where(x => materialIds.Contains(x.id)).ToListAsync(); + Dictionary unitIdDic = await db.Queryable() .LeftJoin((a, b) => b.EnCode == DictConst.MeasurementUnit) .LeftJoin((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode) - .Where((a,b,c)=>materialIds.Contains(a.id)) - .Select((a, b, c) => new + .Where((a, b, c) => materialIds.Contains(a.id)) + .Select((a, b, c) => new { key = a.id, - value = c.Id + value = c.Id }) .ToDictionaryAsync(x => x.key, x => x.value); @@ -306,18 +306,18 @@ namespace Tnb.ProductionMgr input.outstockDs.Add(new MESWmsOutstockDInput() { material_id = item.material_id, - material_code = basMaterials.First(x=>x.id==item.material_id).code, + material_code = basMaterials.First(x => x.id == item.material_id).code, pr_qty = item.num, unit_id = unitIdDic[item.material_id].ToString() }); } - + string domain = _userManager.Domain; Dictionary header = new Dictionary() { - ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : "" + ["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK,JsonConvert.SerializeObject(input),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); @@ -346,16 +346,16 @@ namespace Tnb.ProductionMgr prdOutstockDs.Add(new PrdOutstockD() { material_id = item.material_id, - material_code = basMaterials.First(x=>x.id==item.material_id).code, - material_name = basMaterials.First(x=>x.id==item.material_id).name, + material_code = basMaterials.First(x => x.id == item.material_id).code, + material_name = basMaterials.First(x => x.id == item.material_id).name, pr_qty = item.num, unit_id = unitIdDic[item.material_id].ToString(), outstock_id = prdOutstockH.id, source_id = prdMoTask.mo_task_code }); } - - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { await _repository.InsertAsync(prdOutstockH); if (prdOutstockDs.Count > 0) @@ -379,5 +379,132 @@ namespace Tnb.ProductionMgr throw Oops.Bah(e.Message); } } + + + [HttpPost] + public async Task MaterialOutstockTest(MaterialOutstockInput materialOutstockInput) + { + try + { + var db = _repository.AsSugarClient(); + string warehouse_id = "1";//一楼原材料仓 + + MESCreateOutstockInput input = new MESCreateOutstockInput(); + input.outstock = new MESWmsOutstockHInput(); + input.outstockDs = new List(); + + BasLocation location = await db.Queryable().Where(x => x.location_code == materialOutstockInput.location_code).FirstAsync(); + if (location == null) throw new AppFriendlyException("未找到库位", 500); + string locationId = location.id; + + PrdOutstockH prdOutstockH = new() + { + bill_code = await _billRullService.GetBillNumber(CodeTemplateConst.PRDOUTSTOCK_CODE), + }; + + input.outstock.bill_type = DictConst.SHENGCHANLINGLIAO; + // input.outstock.bill_date = visualDevModelDataCrInput.data.ContainsKey("bill_date") ? Convert.ToDateTime(visualDevModelDataCrInput.data["bill_date"].ToString()) : DateTime.Now; + input.outstock.bill_date = DateTime.Now; + input.outstock.org_id = _userManager.GetUserInfo().Result.organizeId; + input.outstock.warehouse_id = warehouse_id; + input.outstock.create_id = _userManager.UserId; + input.outstock.location_code = location?.location_code ?? ""; + input.outstock.source_code = prdOutstockH.bill_code; + input.outstock.source_id = prdOutstockH.id; + OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(materialOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode); + + List materialIds = materialOutstockInput.details.Select(x => x.material_id).ToList(); + List basMaterials = await db.Queryable().Where(x => materialIds.Contains(x.id)).ToListAsync(); + Dictionary unitIdDic = await db.Queryable() + .LeftJoin((a, b) => b.EnCode == DictConst.MeasurementUnit) + .LeftJoin((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode) + .Where((a, b, c) => materialIds.Contains(a.id)) + .Select((a, b, c) => new + { + key = a.id, + value = c.Id + }) + .ToDictionaryAsync(x => x.key, x => x.value); + + foreach (var item in materialOutstockInput.details) + { + input.outstockDs.Add(new MESWmsOutstockDInput() + { + material_id = item.material_id, + material_code = basMaterials.First(x => x.id == item.material_id).code, + pr_qty = item.num, + unit_id = unitIdDic[item.material_id].ToString() + }); + } + + string domain = _userManager.Domain; + Dictionary header = new Dictionary() + { + ["Authorization"] = App.HttpContext != null ? App.HttpContext.Request.Headers["Authorization"] : "" + }; + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); + Log.Information(sendResult); + + AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); + if (authResponse.code != 200) + { + throw new AppFriendlyException(authResponse.msg, 500); + + } + else + { + prdOutstockH.bill_type = DictConst.SHENGCHANLINGLIAO; + prdOutstockH.type = "2"; + prdOutstockH.warehouse_id = warehouse_id; + prdOutstockH.location_code = materialOutstockInput.location_code; + prdOutstockH.create_id = _userManager.UserId; + prdOutstockH.org_id = _userManager.GetUserInfo().Result.organizeId; + prdOutstockH.bill_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + prdOutstockH.create_time = DateTime.Now; + prdOutstockH.workstation_id = materialOutstockInput.workstation_id; + prdOutstockH.workline = workline?.Id ?? ""; + prdOutstockH.status = DictConst.OUTSTOCKSTATUSADD; + prdOutstockH.mo_task_id = ""; + + List prdOutstockDs = new List(); + foreach (var item in materialOutstockInput.details) + { + prdOutstockDs.Add(new PrdOutstockD() + { + material_id = item.material_id, + material_code = basMaterials.First(x => x.id == item.material_id).code, + material_name = basMaterials.First(x => x.id == item.material_id).name, + pr_qty = item.num, + unit_id = unitIdDic[item.material_id].ToString(), + outstock_id = prdOutstockH.id, + source_id = "" + }); + } + + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + { + await _repository.InsertAsync(prdOutstockH); + if (prdOutstockDs.Count > 0) + { + await db.Insertable(prdOutstockDs).ExecuteCommandAsync(); + } + }); + + if (!result.IsSuccess) + { + throw new AppFriendlyException(result.ErrorMessage, 500); + + } + + } + return await Task.FromResult(true); + } + catch (Exception e) + { + Log.Error(e.Message); + throw new AppFriendlyException(e.Message, 500); + } + } } -} \ No newline at end of file +} + \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs index 578971a1..8f442b57 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs @@ -14,6 +14,7 @@ using SqlSugar; using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; +using Tnb.PerMgr.Entities; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Entities.Entity; @@ -361,122 +362,122 @@ namespace Tnb.ProductionMgr return PageResult.SqlSugarPageResult(result); } - // /// - // /// pda端根据工位获取任务单列表 - // /// - // /// - // [HttpPost] - // public async Task GetPadPrdMoTaskList(PrdMoTaskListOutput input) - // { - // if (string.IsNullOrEmpty(input.stationId)) - // { - // return new - // { - // pagination = new PageResult(), - // list = Array.Empty() - // }; - // } - // - // Dictionary queryJson = string.IsNullOrEmpty(input.queryJson) ? new Dictionary() : input.queryJson.ToObject>(); - // string? mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; - // string? status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : ""; - // DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; - // DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; - // List statusList = new(); - // if (!string.IsNullOrEmpty(status)) - // { - // switch (status) - // { - // case "1": - // statusList.Add(DictConst.InProgressEnCode); - // statusList.Add(DictConst.MoStatusPauseCode); - // break; - // case "2": - // statusList.Add(DictConst.ToBeScheduledEncode); - // statusList.Add(DictConst.ToBeStartedEnCode); - // break; - // case "3": - // statusList.Add(DictConst.ComplatedEnCode); - // statusList.Add(DictConst.ClosedEnCode); - // break; - // } - // } - // // string mo_task_status = queryJson.ContainsKey("mo_task_status") ? queryJson["mo_task_status"].ToString() : ""; - // if (string.IsNullOrEmpty(input.sidx)) - // { - // input.sidx = "create_time"; - // input.sort = "desc"; - // } - // - // SqlSugarPagedList result = await _db.Queryable() - // .LeftJoin((a, b) => a.material_id == b.id) - // .LeftJoin((a, b, c) => a.process_id == c.id) - // .LeftJoin((a, b, c, d) => a.workline_id == d.Id) - // .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode) - // .LeftJoin((a, b, c, d, e, f) => a.eqp_id == f.id) - // .LeftJoin((a, b, c, d, e, f, g) => a.mold_id == g.id) - // .LeftJoin((a, b, c, d, e, f, g, h) => a.material_id == h.output_material_id && a.eqp_id == h.equip_id && a.mold_id == h.molds_id && h.enabled == 1) - // .LeftJoin((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1) - // .LeftJoin((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id) - // .LeftJoin((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg") - // .LeftJoin((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "注塑空满箱请求") - // .Where((a, b) => a.workstation_id == input.stationId) - // .WhereIF(!string.IsNullOrEmpty(mo_task_code), a => a.mo_task_code.Contains(mo_task_code)) - // //.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status) - // .WhereIF(statusList.Count > 0, a => statusList.Contains(a.mo_task_status)) - // .WhereIF(status == "3" && start_time != null, a => a.act_end_date >= start_time) - // .WhereIF(status == "3" && end_time != null, a => a.act_end_date <= end_time) - // .Select((a, b, c, d, e, f, g, h, i, j, k, l) => new PADPackageTaskPageOutput - // { - // id = a.id, - // mo_task_code = a.mo_task_code, - // mo_id = a.mo_id, - // mo_code = j.mo_code, - // material_id = a.material_id, - // material_code = b.code, - // material_name = b.name, - // workline_id = a.workline_id, - // workline_name = d.FullName, - // bom_id = a.bom_id, - // mo_task_status = e.FullName, - // complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), - // scrap_qty = a.scrap_qty, - // scheduled_qty = a.scheduled_qty, - // reported_work_qty = a.reported_work_qty, - // estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), - // estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), - // parent_id = a.parent_id, - // process_id = a.process_id, - // process_name = c.process_name, - // mbom_process_id = a.mbom_process_id, - // create_time = a.create_time, - // equip_id = a.eqp_id, - // equip_code = f.code, - // equip_name = f.name, - // mold_id = a.mold_id, - // mold_code = g.mold_code, - // mold_name = g.mold_name, - // schedule_type = a.schedule_type, - // mold_cavity = g.mold_cavity, - // moulding_cycle = h.moulding_cycle, - // standard_time = i.standard_time, - // act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), - // act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS), - // plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS), - // minpacking = b.minpacking, - // main_num = k.number_of_primary_unit, - // deputy_num = k.number_of_auxiliary_unit, - // third_equip_code = l.equip_code, - // weight_name = l.label_name, - // category_id = b.category_id - // }) - // .MergeTable() - // .OrderBy($"{input.sidx} {input.sort}") - // .ToPagedListAsync(input.currentPage, input.pageSize); - // - // return PageResult.SqlSugarPageResult(result); - // - // } + /// + /// pda端根据工位获取任务单列表 + /// + /// + [HttpPost] + public async Task GetPadPrdMoTaskList(PrdMoTaskListOutput input) + { + if (string.IsNullOrEmpty(input.stationId)) + { + return new + { + pagination = new PageResult(), + list = Array.Empty() + }; + } + + Dictionary queryJson = string.IsNullOrEmpty(input.queryJson) ? new Dictionary() : input.queryJson.ToObject>(); + string? mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; + string? status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : ""; + DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; + DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; + List statusList = new(); + if (!string.IsNullOrEmpty(status)) + { + switch (status) + { + case "1": + statusList.Add(DictConst.InProgressEnCode); + statusList.Add(DictConst.MoStatusPauseCode); + break; + case "2": + statusList.Add(DictConst.ToBeScheduledEncode); + statusList.Add(DictConst.ToBeStartedEnCode); + break; + case "3": + statusList.Add(DictConst.ComplatedEnCode); + statusList.Add(DictConst.ClosedEnCode); + break; + } + } + // string mo_task_status = queryJson.ContainsKey("mo_task_status") ? queryJson["mo_task_status"].ToString() : ""; + if (string.IsNullOrEmpty(input.sidx)) + { + input.sidx = "create_time"; + input.sort = "desc"; + } + + SqlSugarPagedList result = await _db.Queryable() + .LeftJoin((a, b) => a.material_id == b.id) + .LeftJoin((a, b, c) => a.process_id == c.id) + .LeftJoin((a, b, c, d) => a.workline_id == d.Id) + .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode) + .LeftJoin((a, b, c, d, e, f) => a.eqp_id == f.id) + .LeftJoin((a, b, c, d, e, f, g) => a.mold_id == g.id) + .LeftJoin((a, b, c, d, e, f, g, h) => a.material_id == h.output_material_id && a.eqp_id == h.equip_id && a.mold_id == h.molds_id && h.enabled == 1) + .LeftJoin((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1) + .LeftJoin((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id) + .LeftJoin((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg") + .LeftJoin((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "注塑空满箱请求") + .Where((a, b) => a.workstation_id == input.stationId) + .WhereIF(!string.IsNullOrEmpty(mo_task_code), a => a.mo_task_code.Contains(mo_task_code)) + //.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status) + .WhereIF(statusList.Count > 0, a => statusList.Contains(a.mo_task_status)) + .WhereIF(status == "3" && start_time != null, a => a.act_end_date >= start_time) + .WhereIF(status == "3" && end_time != null, a => a.act_end_date <= end_time) + .Select((a, b, c, d, e, f, g, h, i, j, k, l) => new PADPackageTaskPageOutput + { + id = a.id, + mo_task_code = a.mo_task_code, + mo_id = a.mo_id, + mo_code = j.mo_code, + material_id = a.material_id, + material_code = b.code, + material_name = b.name, + workline_id = a.workline_id, + workline_name = d.FullName, + bom_id = a.bom_id, + mo_task_status = e.FullName, + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), + scrap_qty = a.scrap_qty, + scheduled_qty = a.scheduled_qty, + reported_work_qty = a.reported_work_qty, + estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), + estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), + parent_id = a.parent_id, + process_id = a.process_id, + process_name = c.process_name, + mbom_process_id = a.mbom_process_id, + create_time = a.create_time, + equip_id = a.eqp_id, + equip_code = f.code, + equip_name = f.name, + mold_id = a.mold_id, + mold_code = g.mold_code, + mold_name = g.mold_name, + schedule_type = a.schedule_type, + mold_cavity = g.mold_cavity, + moulding_cycle = h.moulding_cycle, + standard_time = i.standard_time, + act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), + act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS), + plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS), + minpacking = b.minpacking, + main_num = k.number_of_primary_unit, + deputy_num = k.number_of_auxiliary_unit, + third_equip_code = l.equip_code, + weight_name = l.label_name, + category_id = b.category_id + }) + .MergeTable() + .OrderBy($"{input.sidx} {input.sort}") + .ToPagedListAsync(input.currentPage, input.pageSize); + + return PageResult.SqlSugarPageResult(result); + + } /// /// 上模校验 diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs index 43b82cbd..83fedbc8 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs @@ -1,39 +1,71 @@ -using Aop.Api.Domain; +using System; +using System.Data; +using System.Dynamic; +using System.Security.Policy; +using System.Text; +using Aop.Api.Domain; +using JNPF; using JNPF.Common.Cache; +using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Extension; +using JNPF.FriendlyException; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using NetTaste; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using NPOI.OpenXmlFormats; +using Qiniu.Util; using SqlSugar; +using Tnb.Common.Extension; using Tnb.Common.Redis; +using Tnb.Common.Utils; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; using Tnb.ProductionMgr.Entities.Enums; using Tnb.ProductionMgr.Interfaces; +using Tnb.WarehouseMgr.Entities; +using Tnb.WarehouseMgr.Entities.Configs; +using Tnb.WarehouseMgr.Entities.Consts; +using Tnb.WarehouseMgr.Entities.Enums; +using Tnb.WarehouseMgr.Interfaces; namespace Tnb.ProductionMgr { //redis定时获取数采数据 public class RedisBackGround : IHostedService, IDisposable { - private Timer? Readtimer; + private Timer? Readtimer; + private Timer? CheckGettimer; + private Timer? Scantimer; + private Timer? SSXcodetimer; + + // 二楼上升降机 + private Timer? Floor2UpMachinecodetimer; + // 二楼下升降机 + private Timer? Floor2DownMachinecodetimer; + private readonly RedisData _redisData; private readonly IPrdInstockService _prdInstockService; private readonly ISqlSugarRepository _repository; - public RedisBackGround(RedisData redisData, IPrdInstockService prdInstockService, ISqlSugarRepository repository) + private readonly IWmsPDAScanInStockService _wmsPDAScanInStock; + private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build(); + public RedisBackGround(RedisData redisData, IPrdInstockService prdInstockService, ISqlSugarRepository repository, IWmsPDAScanInStockService wmsPDAScanInStock) { _redisData = redisData; _prdInstockService = prdInstockService; - _repository = repository; + _repository = repository; + _wmsPDAScanInStock = wmsPDAScanInStock; } //获取redis数据 private void GetRedisData(object state) { - var _redisReadConfigs = _repository.AsQueryable().Where(p => p.enabled == 1).ToList(); + var _redisReadConfigs = _repository.AsQueryable().Where(p => p.enabled == 1).ToList(); foreach (var config in _redisReadConfigs) { try { - var json= _redisData.GetHash(config.dev_name!, config.tag_name!).Result; + var json = _redisData.GetHash(config.dev_name!, config.tag_name!).Result; JObject? res = JsonConvert.DeserializeObject(json); if (config.data_type == (int)DataType.INT) { @@ -51,7 +83,7 @@ namespace Tnb.ProductionMgr } else if (config.check_type == (int)CheckType.包含) { - int[] ints= Array.ConvertAll(config.data!.Replace("[","").Replace("]","").Split(",",StringSplitOptions.RemoveEmptyEntries),int.Parse); + int[] ints = Array.ConvertAll(config.data!.Replace("[", "").Replace("]", "").Split(",", StringSplitOptions.RemoveEmptyEntries), int.Parse); if (ints.Contains(res.Value("Value"))) { InstockInput instockInput = new() @@ -101,126 +133,498 @@ namespace Tnb.ProductionMgr break; } } - //获取注塑装箱状态 - private void GetZSPackStatus(object state) + //ctu取货 + private void CheckGet(object state) { - try + Dictionary getdic = new Dictionary(); + getdic.Add("SSX-021-005", new string[] { "YTCS", "AllowFullOut_CS05", "LiftCode" }); + getdic.Add("SSX-011-002", new string[] { "YTCS", "AllowAgvFullIn_CS02", "Code_CS02" }); + getdic.Add("SSX-011-004", new string[] { "YTCS", "AllowCtuFullOut_CS04", "Code_CS04" }); + + getdic.Add("SSX-011-008", new string[] { "东面提升机输送线", "入库输送线8允许出箱", "入库输送线7条码" }); + + getdic.Add("SSX-111-011", new string[] { "东面提升机输送线", "下升降机11允许出箱", "下升降机11条码" }); + getdic.Add("SSX-111-012", new string[] { "东面提升机输送线", "下升降机12允许出箱", "下升降机12条码" }); + getdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowAgvEmptyOut_CS03", "" }); + getdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AllowAgvEmptyOut_CS01", "" }); + + + foreach (var key in getdic.Keys) { - string[] strs = new string[1] { "TY4C-ZHUSU1" }; - string sign = "agvMode"; - foreach (string s in strs) + try { - Dictionary dic = _redisData.HGetAll(s).Result; - foreach (KeyValuePair kv in dic) + var strs = getdic.Where(p => p.Key == key).First().Value; + bool flag = _redisData.HashExist(strs[0], strs[1]).Result; + string data = _redisData.GetHash(strs[0], strs[1]).Result; + JObject? res = JsonConvert.DeserializeObject(data); + + bool result = res != null && res["Value"] != null ? res.Value("Value") : false; + if (result) { - if (!kv.Key.Contains(sign)) + if (!string.IsNullOrEmpty(strs[2])) { - continue; - } - JObject? res = JsonConvert.DeserializeObject(kv.Value); - if (res != null && res["Value"] != null) - { - if (int.Parse(res["Value"]!.ToString()) is not ((int)Eagvmode.无请求) and not ((int)Eagvmode.收到请求)) + string codedata = _redisData.GetHash(strs[0], strs[2]).Result; + JObject? coderes = JsonConvert.DeserializeObject(codedata); + string coderesult = coderes != null && coderes["Value"] != null ? coderes.Value("Value")! : ""; + coderesult = coderesult.Replace("\r", ""); + + + var DistaskH = _repository.AsSugarClient().Queryable().Where(p => p.carry_code == coderesult && p.status == WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID && string.IsNullOrEmpty(p.extras)).First(); + + + if (DistaskH != null) { - InstockInput instockInput = new() + Logger.LogInformation($@"【定时任务CheckGet】 {JsonConvert.SerializeObject(DistaskH)}"); + dynamic reqBody = new ExpandoObject(); + reqBody.taskCode = DistaskH.bill_code; + reqBody.slotCode = key; + reqBody.containerCode = coderesult; + CancellationTokenSource Ctu = new(); + if (strs[0] == "东面提升机输送线") { - equip_code = res["DevName"]!.ToString(), - label_code = res["TagName"]!.ToString() - }; - _prdInstockService.InstockTypeOne(instockInput); + Logger.LogInformation($"【定时任务CheckGet】 开始发送请求到 http://192.168.11.104:1880/wcs/notify/cargo "); + } + dynamic respBody = HttpClientHelper.PostStreamAsync("http://192.168.11.104:1880/wcs/notify/cargo", reqBody, Ctu.Token).Result; + if (strs[0] == "东面提升机输送线") + { + Logger.LogInformation($"【定时任务CheckGet】 接收请求 http://192.168.11.104:1880/wcs/notify/cargo 结果 {respBody} "); + } + DistaskH.extras = respBody; + _repository.AsSugarClient().Updateable(DistaskH).ExecuteCommand(); + Ctu.Dispose(); + } + else + { + LoggerSSX.LogInformation($@"【定时任务CheckGet】 {key}->{strs[0]} {strs[2]} +采集结果:{ $@"任务执行(wms_distask_h)中找不到匹配的记录 任务执行需要存在载具编号(carry_code)为{coderesult} +且单据状态(status)为已下达(26126853976101) 且扩展字段(extras)为空的记录 +select extras,* from wms_distask_h +where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID}' " }"); + + } + } + else { + var DistaskH = _repository.AsSugarClient().Queryable().Where(p => p.startlocation_code == key && p.status == WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID && string.IsNullOrEmpty(p.extras)).First(); + if (DistaskH != null) + { + dynamic reqBody = new ExpandoObject(); + reqBody.taskCode = DistaskH.bill_code; + reqBody.slotCode = key; + reqBody.containerCode = DistaskH.carry_code; + CancellationTokenSource Ctu = new(); + dynamic respBody = HttpClientHelper.PostStreamAsync("http://192.168.11.104:1880/wcs/notify/cargo", reqBody, Ctu.Token).Result; + DistaskH.extras = respBody; + _repository.AsSugarClient().Updateable(DistaskH).ExecuteCommand(); + Ctu.Dispose(); } } } } - } - catch (Exception) - { + catch (Exception ex) + { + LoggerSSX.LogError(ex.ToString()); + } } } - //获取挤出装箱状态 - private void GetJCPackStatus(object state) + + private static readonly Dictionary s_logLevelMap = new() { - try + [LogLevel.Debug] = "DBG", + [LogLevel.Information] = "INF", + [LogLevel.Warning] = "WRN", + [LogLevel.Error] = "ERR", + }; + + + #region 日志 + + protected ILogger Logger => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/custom{DateTime.Now:yyyyMMdd}.log", cfgOpts => + { + + //cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff"; + cfgOpts.MessageFormat = (logMsg) => { - string[] strs = new string[1] { "TY4C-SHUSONG-JC" }; - string sign = "AGVFullCall"; - foreach (string s in strs) + var logLevel = s_logLevelMap[logMsg.LogLevel]; + var sb = new StringBuilder(); + _ = sb.Append($"[{logLevel}] "); + _ = sb.Append($"{logMsg.LogName} "); + _ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} "); + _ = sb.Append($"#{logMsg.EventId.Id} "); + _ = sb.Append(logMsg.Message + " "); + _ = sb.Append(logMsg.Exception?.ToString()); + return sb.ToString(); + }; + + })).CreateLogger(this.GetType()); + + + protected ILogger LoggerBGW => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/customBGW{DateTime.Now:yyyyMMdd}.log", cfgOpts => + { + + //cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff"; + cfgOpts.MessageFormat = (logMsg) => + { + var logLevel = s_logLevelMap[logMsg.LogLevel]; + var sb = new StringBuilder(); + _ = sb.Append($"[{logLevel}] "); + _ = sb.Append($"{logMsg.LogName} "); + _ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} "); + _ = sb.Append($"#{logMsg.EventId.Id} "); + _ = sb.Append(logMsg.Message + " "); + _ = sb.Append(logMsg.Exception?.ToString()); + return sb.ToString(); + }; + + })).CreateLogger(this.GetType()); + + protected ILogger LoggerSSX => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/customSSX{DateTime.Now:yyyyMMdd}.log", cfgOpts => + { + + //cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff"; + cfgOpts.MessageFormat = (logMsg) => + { + var logLevel = s_logLevelMap[logMsg.LogLevel]; + var sb = new StringBuilder(); + _ = sb.Append($"[{logLevel}] "); + _ = sb.Append($"{logMsg.LogName} "); + _ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} "); + _ = sb.Append($"#{logMsg.EventId.Id} "); + _ = sb.Append(logMsg.Message + " "); + _ = sb.Append(logMsg.Exception?.ToString()); + return sb.ToString(); + }; + + })).CreateLogger(this.GetType()); + + // 二楼上下升降机日志 + protected ILogger LoggerFloor2UpDownMachine => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/customFloor2UpDownMachine{DateTime.Now:yyyyMMdd}.log", cfgOpts => + { + + //cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff"; + cfgOpts.MessageFormat = (logMsg) => + { + var logLevel = s_logLevelMap[logMsg.LogLevel]; + var sb = new StringBuilder(); + _ = sb.Append($"[{logLevel}] "); + _ = sb.Append($"{logMsg.LogName} "); + _ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} "); + _ = sb.Append($"#{logMsg.EventId.Id} "); + _ = sb.Append(logMsg.Message + " "); + _ = sb.Append(logMsg.Exception?.ToString()); + return sb.ToString(); + }; + + })).CreateLogger(this.GetType()); + + + // 二楼料架补充 + protected ILogger LoggerFloor2RackSupplement => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/customFloor2RackSupplement{DateTime.Now:yyyyMMdd}.log", cfgOpts => + { + //cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff"; + cfgOpts.MessageFormat = (logMsg) => + { + var logLevel = s_logLevelMap[logMsg.LogLevel]; + var sb = new StringBuilder(); + _ = sb.Append($"[{logLevel}] "); + _ = sb.Append($"{logMsg.LogName} "); + _ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} "); + _ = sb.Append($"#{logMsg.EventId.Id} "); + _ = sb.Append(logMsg.Message + " "); + _ = sb.Append(logMsg.Exception?.ToString()); + return sb.ToString(); + }; + + })).CreateLogger(this.GetType()); + + #endregion + + //扫码入库 + private void ScanInStock(object state) + { + Dictionary getdic = new Dictionary(); + getdic.Add("BGWRKYCL02", new string[] { "CP8", "AllowGetFullBox1", "code1", "PutDoneEmptyBox", "false" }); + getdic.Add("BGWRKYCL01", new string[] { "CP8", "AllowGetFullBox2", "code2", "PutDoneEmptyBox", "false" }); + foreach (var key in getdic.Keys) + { + try { - Dictionary dic = _redisData.HGetAll(s).Result; - foreach (KeyValuePair kv in dic) + var strs = getdic.Where(p => p.Key == key).First().Value; + bool flag = _redisData.HashExist(strs[0], strs[1]).Result; + string data = _redisData.GetHash(strs[0], strs[1]).Result; + JObject? res = JsonConvert.DeserializeObject(data); + + + bool result = res != null && res["Value"] != null ? res.Value("Value") : false; + if (result) { - if (!kv.Key.Contains(sign)) + Logger.LogInformation($"【ScanInStock】 八工位 {key} AllowGetFullBox1采集到 {res["Value"]}"); + + Dictionary dicCommand = new(StringComparer.OrdinalIgnoreCase) { - continue; - } - JObject? res = JsonConvert.DeserializeObject(kv.Value); - if (res != null && res["Value"] != null) + ["DevName"] = strs[0], + ["token"] = _eleCtlCfg.token, + ["TagName"] = strs[3], + ["Value"] = strs[4], + }; + Logger.LogInformation($"【ScanInStock】 八工位 {key} 发送PutDoneEmptyBox指令 {_eleCtlCfg.WriteTagUrl} {JsonConvert.SerializeObject(dicCommand)}"); + HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait(); + string codedata = _redisData.GetHash(strs[0], strs[2]).Result; + Logger.LogInformation($"【ScanInStock】 八工位 {key} 获取到扫码信息: {codedata}"); + JObject? coderes = JsonConvert.DeserializeObject(codedata); + string coderesult = coderes != null && coderes["Value"] != null ? coderes.Value("Value")! : ""; + WmsCarryH? carry = _repository.AsSugarClient().Queryable().Single(it => it.carry_code == coderesult); + Logger.LogInformation($"【ScanInStock】 八工位 {key} 查找{coderesult}绑定的托盘: {JsonConvert.SerializeObject(carry)}"); + if (carry != null) { - if (res.Value("Value")) + if (_repository.AsSugarClient().Queryable().Where(p => p.carry_id == carry.id && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID ).Any()) { - InstockInput instockInput = new() - { - equip_code = res["DevName"]!.ToString(), - label_code = res["TagName"]!.ToString() - }; - _prdInstockService.InstockTypeOne(instockInput); + Logger.LogInformation($"【ScanInStock】 八工位 {key} 托盘 {carry.id} 对应的执行任务状态(status)不是26126860808229(已完成),此时不能执行入库"); + continue; + } + + var WmsCarryCode = _repository.AsSugarClient().Queryable().Where(it => it.carry_id == carry.id).OrderByDescending(it => it.id).First(); + // 用适当的字段替换 YourTimestampField + + if (WmsCarryCode != null) + { + Logger.LogInformation($"【ScanInStock】 八工位 {key} 查找到托盘{carry.id}在WmsCarryCode中存在"); + + VisualDevModelDataCrInput input = new VisualDevModelDataCrInput(); + input.data = new Dictionary(); + input.data.Add("barcode", coderesult); + input.data.Add("codeqty", WmsCarryCode.codeqty);//条码数量 + input.data.Add("material_code", WmsCarryCode.material_code); + input.data.Add("extras", key);//location_code + input.data.Add("warehouse_id", "1");//TEST + input.data.Add("bill_code", "");//采购收货单号 + input.data.Add("code_batch", WmsCarryCode.code_batch!);//批次 + input.data.Add("material_specification", WmsCarryCode.material_specification!);//规格型号 + input.data.Add("container_no", WmsCarryCode.container_no!);//箱号 + input.data.Add("material_id", WmsCarryCode.material_id); + input.data.Add("id", null); + _wmsPDAScanInStock.ScanInStockByRedis(input).Wait(); } } } } - } - catch (Exception) - { + catch (Exception ex) + { + Logger.LogInformation($"【ScanInStock】 八工位扫到码发送入库请求发生异常:{ex}"); + } } } - //获取限位状态 - private void GetLimitStatus(object state) + + private void SSXcode(object state) { - /* - Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss}"); - Console.WriteLine($"获取挤出装箱状态"); - string data = _redisData.GetHash("TY4C-SHUSONG-JC", "AGVFullCall").Result; - Console.WriteLine(data);*/ - try + Dictionary dic = new Dictionary(); + //有问题 + dic.Add("东面提升机输送线", new string[] { "下升降机判断请求", "下升降机判断条码", "下升降机判断完毕", "下升降机判断结果" }); + Dictionary putdic = new Dictionary(); + putdic.Add("SSX-111-011", 11); + putdic.Add("SSX-111-012", 12); + foreach (var key in dic.Keys) { - string[] strs = new string[1] { "TY4C-WAIBAO" }; - string sign = "AGVCall"; - foreach (string s in strs) + try { - Dictionary dic = _redisData.HGetAll(s).Result; - foreach (KeyValuePair kv in dic) + var strs = dic.Where(p => p.Key == key).First().Value; + string dataflag = _redisData.GetHash(key, strs[0]).Result; + JObject? resflag = JsonConvert.DeserializeObject(dataflag); + + + //Logger.LogInformation($"【定时任务SSXcode】 {key}->{strs[0]} 采集结果:{resflag}"); + bool re = resflag != null && resflag["Value"] != null ? resflag.Value("Value") : false; + if (!re) + continue; + string data = _redisData.GetHash(key, strs[1]).Result; + JObject? res = JsonConvert.DeserializeObject(data); + //Logger.LogInformation($"【定时任务SSXcode】 {key}->{strs[1]} 采集结果:{res}"); + string? result = res != null && res["Value"] != null ? res.Value("Value") : ""; + if (!string.IsNullOrEmpty(result)) { - if (!kv.Key.Contains(sign)) + if (result.Length < 5) { - continue; + result = "LX" + result.Replace("\r", ""); } - JObject? res = JsonConvert.DeserializeObject(kv.Value); - if (res != null && res["Value"] != null) + var DistaskH = _repository.AsSugarClient().Queryable().Where(p => p.carry_code == result && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).OrderByDescending(p => p.create_time).First(); + if (DistaskH != null) { - if (res.Value("Value")) + Dictionary dicCommand2 = new(StringComparer.OrdinalIgnoreCase) { - InstockInput instockInput = new() - { - equip_code = res["DevName"]!.ToString(), - label_code = res["TagName"]!.ToString() - }; - _prdInstockService.InstockOutPack(instockInput); - } + ["DevName"] = key, + ["token"] = _eleCtlCfg.token, + ["TagName"] = strs[3], + ["Value"] = putdic.Keys.Contains(DistaskH.startlocation_code) ? putdic.Where(p => p.Key == DistaskH.startlocation_code).First().Value.ToString() : "13", + }; + HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand2).Wait(); + Dictionary dicCommand = new(StringComparer.OrdinalIgnoreCase) + { + ["DevName"] = key, + ["token"] = _eleCtlCfg.token, + ["TagName"] = strs[2], + ["Value"] = "true", + }; + HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait(); + } + else + { + Dictionary dicCommand2 = new(StringComparer.OrdinalIgnoreCase) + { + ["DevName"] = key, + ["token"] = _eleCtlCfg.token, + ["TagName"] = strs[3], + ["Value"] = "13", + }; + HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand2).Wait(); + Dictionary dicCommand = new(StringComparer.OrdinalIgnoreCase) + { + ["DevName"] = key, + ["token"] = _eleCtlCfg.token, + ["TagName"] = strs[2], + ["Value"] = "true", + }; + HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand).Wait(); } } } - } - catch (Exception) - { + catch (Exception ex) + { + + Logger.LogInformation($"【定时任务SSXcode】发生异常 {ex}"); + } } } + public void Dispose() { Readtimer?.Dispose(); + CheckGettimer?.Dispose(); + Scantimer?.Dispose(); + SSXcodetimer?.Dispose(); + } + + #region 二楼升降机 + + // 上升降机 + private void Floor2UpMachinecode(object args) + { + // 补充料架 + //var DistaskH = _repository.AsSugarClient().Queryable().Where(p => p.carry_code == && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).OrderByDescending(p => p.create_time).First(); + + + + // MechanicalArmConsts.上升降机满托2数量 + + // 扫码分配码垛位 + + + } + + // 下升降机 + private void Floor2DownMachinecode(object args) + { + // 补充料架 + + + // 扫码分配拆垛位 + + + + } + + // 上下升降机生成预任务(补充料架、上升降机取货到料架、上升降机满托运走,下升降机拿货到输送线、下升降机空托运走) + private void Floor2UpDownMachinecode_createPretask() + { + + } + + // 上下升降机生成任务执行 + private void Floor2UpDownMachinecode_createDistask() + { + + } + + private Tuple Floor2UpDownMachinecode_GetTag(MechanicalArmConsts tag) + { + //string key = "东面提升机输送线"; + //string data = _redisData.GetHash(key, tag.ToString()).Result; + //JObject? res = JsonConvert.DeserializeObject(data); + //T result = res != null && res["Value"] != null ? res.Value("Value") : false; + //return new Tuple(result, res.Value("Value")); + return new Tuple(false, default(T)); + } + + /// + /// Agv调度 + /// + /// + /// + /// + private async Task Floor2UpDownMachinecode_AgvDispatch(List disTasks, CancellationToken token) + { + LoggerFloor2UpDownMachine.LogInformation("【AgvDispatch】 Agv任务执行...."); + //调用AGV创建任务链接口 + try + { + AgvRequestConfig requestCfg = App.Configuration.Build(); + string url = requestCfg.AgvRequestUrls.CreateTaskChainUrl; + + LoggerFloor2UpDownMachine.LogInformation($"【AgvDispatch】 Agv任务执行的disTasks:{JsonConvert.SerializeObject(disTasks)}"); + + var taskChainCodeDic = disTasks.Where(t => !t.groups.IsNullOrWhiteSpace()).GroupBy(g => g.groups!) + .ToDictionary(x => x.Key, x => x.Select(it => new + { + taskCode = it.bill_code, + sourceName = it.startpoint_code, + targetName = it.endpoint_code, + containerCode = it.carry_code, + })); + + LoggerFloor2UpDownMachine.LogInformation($"【AgvDispatch】 Agv任务执行的taskChainCodeDic:{JsonConvert.SerializeObject(taskChainCodeDic)}"); + + foreach ((string k, object v) in taskChainCodeDic) + { + var dis = disTasks.Where(p => p.groups == k).First(); + dynamic reqBody = new ExpandoObject(); + reqBody.taskChainCode = k; + reqBody.type = (int)EnumTaskChainType.AGV; + reqBody.sequential = false; + reqBody.taskChainPriority = 0; + reqBody.taskList = v; + reqBody.floor = dis.end_floor; + LoggerFloor2UpDownMachine.LogInformation($"【AgvDispatch】 Agv任务执行 开始请求联核/task-chain/create接口 请求地址:{url} 请求参数:{reqBody} "); + dynamic respBody = await HttpClientHelper.PostStreamAsync(url, reqBody, token); + LoggerFloor2UpDownMachine.LogInformation($"【AgvDispatch】 Agv任务执行 接收到联核/task-chain/create接口信息:{respBody}"); + } + } + catch (Exception ex) + { + LoggerFloor2UpDownMachine.LogInformation($"【AgvDispatch】 agv任务执行 请求联核/task-chain/create接口失败 异常信息:{ex}"); + throw; + } + } + + private void Floor2UpDownMachinecode_SetTag() + { + string key = "东面提升机输送线"; + + } + + + #endregion + public Task StartAsync(CancellationToken cancellationToken) { Readtimer = new Timer(GetRedisData, null, TimeSpan.Zero, TimeSpan.FromSeconds(300)); + CheckGettimer = new Timer(CheckGet, null, TimeSpan.Zero, TimeSpan.FromSeconds(10)); + Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(60)); + SSXcodetimer= new Timer(SSXcode, null, TimeSpan.Zero, TimeSpan.FromSeconds(10)); + + // 二楼上升降机 + Floor2UpMachinecodetimer = new Timer(Floor2UpMachinecode, null, TimeSpan.Zero, TimeSpan.FromSeconds(10)); + // 二楼下升降机 + Floor2DownMachinecodetimer = new Timer(Floor2DownMachinecode, null, TimeSpan.Zero, TimeSpan.FromSeconds(10)); + return Task.CompletedTask; } public Task StopAsync(CancellationToken cancellationToken) diff --git a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj index 975e58c2..fd26adc3 100644 --- a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj +++ b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj @@ -12,9 +12,11 @@ + + - + diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/MechanicalArmConsts.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/MechanicalArmConsts.cs new file mode 100644 index 00000000..d74fe2d0 --- /dev/null +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/MechanicalArmConsts.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tnb.WarehouseMgr.Entities.Consts +{ + public class MechanicalArmConsts + { + /// + /// + /// + public const string 上升降机请求送空托1 = "上升降机请求送空托1"; + + /// + /// + /// + public const string 上升降机请求送空托2 = "上升降机请求送空托2"; + + /// + /// + /// + public const string 上升降机空托1送到 = "上升降机空托1送到"; + + /// + /// + /// + public const string 上升降机空托2送到 = "上升降机空托2送到"; + + /// + /// + /// + public const string 上升降机请求取满托1 = "上升降机请求取满托1"; + + /// + /// + /// + public const string 上升降机请求取满托2 = "上升降机请求取满托2"; + + /// + /// + /// + public const string 上升降机满托1移走 = "上升降机满托1移走"; + + /// + /// + /// + public const string 上升降机满托2移走 = "上升降机满托2移走"; + + /// + /// + /// + public const string 上升降机满托1数量 = "上升降机满托1数量"; + + /// + /// + /// + public const string 上升降机满托2数量 = "上升降机满托2数量"; + + /// + /// + /// + public const string 上升降机当前码垛位 = "上升降机当前码垛位"; + + /// + /// + /// + public const string 下升降机当前码垛位 = "下升降机当前码垛位"; + + + } +} diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmD.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmD.cs new file mode 100644 index 00000000..071db2f7 --- /dev/null +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmD.cs @@ -0,0 +1,19 @@ +using JNPF.Common.Contracts; +using JNPF.Common.Security; +using SqlSugar; + +namespace Tnb.WarehouseMgr.Entities; + +/// +/// 机械臂主表 +/// +[SugarTable("wms_mechanicalArm_d")] +public partial class WmsMechanicalArmD : BaseEntity +{ + public WmsMechanicalArmD() + { + id = SnowflakeIdHelper.NextId(); + } + + +} diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmH.cs new file mode 100644 index 00000000..8b52523e --- /dev/null +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsMechanicalArmH.cs @@ -0,0 +1,17 @@ +using JNPF.Common.Contracts; +using JNPF.Common.Security; +using SqlSugar; + +namespace Tnb.WarehouseMgr.Entities; + +/// +/// 机械臂主表 +/// +[SugarTable("wms_mechanicalArm_h")] +public partial class WmsMechanicalArmH : BaseEntity +{ + public WmsMechanicalArmH() + { + id = SnowflakeIdHelper.NextId(); + } +} diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DevServBase`1.cs b/WarehouseMgr/Tnb.WarehouseMgr/DevServBase`1.cs new file mode 100644 index 00000000..0367f680 --- /dev/null +++ b/WarehouseMgr/Tnb.WarehouseMgr/DevServBase`1.cs @@ -0,0 +1,119 @@ +using System.Text; +using JNPF; +using JNPF.Common.Extension; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using SqlSugar; +using Tnb.WarehouseMgr.Entities; +using Tnb.WarehouseMgr.Entities.Dto.Queries; +using Tnb.WarehouseMgr.Entities.Entity; + +namespace Tnb.WarehouseMgr +{ + public class DevServBase : BaseWareHouseService + { + protected static Dictionary s_elevatorMap = new(); + + private static readonly Lazy initializationTask; + private static SqlSugarScope context; + private readonly ISqlSugarClient _db; + public static Dictionary s_eleUseStatusDic = new(); + public static Dictionary s_loadedStatusDic = new(); + + static DevServBase() + { + //initializationTask = new Lazy(InitializeAsync); + _ = Task.Run(() => InitializeAsync()); + } + + public DevServBase(ISqlSugarClient db) + { + _db = db; + } + + + private static async Task InitializeAsync() + { + + ConnectionStringsOptions connectionOpts = App.GetConfig("ConnectionStrings", true); + ConnectionConfig cfg = new() + { + ConfigId = connectionOpts.ConfigId, + ConnectionString = connectionOpts.ConnectString, + DbType = DbType.PostgreSQL, + IsAutoCloseConnection = true, + }; + context = new(cfg); + + s_elevatorMap = await context.Queryable().ToDictionaryAsync(x => x.elevator_id, x => x.elevator_code); + + } + //public static Task InitializationTask => initializationTask.Value; + + /// + /// 获取电梯根据任务单号 + /// + /// + /// taskCode:子任务编号 + /// endlocation_id:目标库位ID + /// + /// + + protected async Task FindElevatorFromPars(ElevagorInfoQuery input) + { + var whereExpable = Expressionable.Create() + .And((a, b, c) => a.enabled == 1); + if (!input.taskCode.IsNullOrEmpty()) + { + whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.taskCode), (a, b, c) => c.bill_code == input.taskCode); + } + if (!input.endlocation_id.IsNullOrEmpty()) + { + whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.endlocation_id), (a, b, c) => b.location_id == input.endlocation_id); + } + if (!input.startlocation_id.IsNullOrEmpty()) + { + whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.startlocation_id), (a, b, c) => b.location_id == input.startlocation_id); + } + var ele = await _db.CopyNew().Queryable().InnerJoin((a, b) => a.id == b.bill_id) + .InnerJoin((a, b, c) => b.location_code == c.endlocation_code || b.location_code == c.startlocation_code) + .Where(whereExpable.ToExpression()) + .WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-R", input.sourceName), (a, b, c) => c.startpoint_code == input.sourceName) + .WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-C", input.sourceName), (a, b, c) => c.endpoint_code == input.sourceName) + .Select((a, b, c) => new WmsElevatorH + { + bill_code = c.bill_code, + device_id = a.elevator_id, + end_floor = c.end_floor + }, true) + .FirstAsync(); + + return ele; + + } + } + + public static class CustomLoggerExtenstions + { + public static void Debug(this ILogger logger, string message, params object[] parameters) + { + logger.Debug(message, parameters); + } + + public static void Information(this ILogger logger, string message, params object[] parameters) + { + logger.LogInformation(message, parameters); + } + + public static void Error(this ILogger logger, string message, Exception ex, params object[] parameters) + { + logger.LogError(ex, message, parameters); + } + + public static void Error(this ILogger logger, string message, params object[] parameters) + { + logger.LogError(message, parameters); + } + } +} diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs index c6cbea81..0cdb68e1 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs @@ -1,4 +1,6 @@ -using JNPF; +using Aliyun.OSS; +using Aop.Api.Domain; +using JNPF; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -34,7 +36,7 @@ namespace Tnb.WarehouseMgr /// Wms设备接口提供程序服务类 /// - public class DeviceProviderService : ServiceLoggerBase + public class DeviceProviderService : DevServBase { private readonly ISqlSugarClient _db; private readonly IWareHouseService _wareHouseService; @@ -45,7 +47,6 @@ namespace Tnb.WarehouseMgr private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build(); private readonly ILoggerFactory _loggerFactory; public static Dictionary s_eleUseStatusDic = new(); - public static Dictionary s_loadedStatusDic = new(); @@ -54,7 +55,7 @@ namespace Tnb.WarehouseMgr IEventPublisher eventPublisher, IUserManager userManger, IElevatorControlService elevatorControlService - ) //: base(repository.AsSugarClient()) + ) : base(repository.AsSugarClient()) { _db = repository.AsSugarClient(); _wareHouseService = wareHouseService; @@ -92,7 +93,7 @@ namespace Tnb.WarehouseMgr public async Task LoadConfirm(ConfirmInput input) { - Logger.Information("取货确认.................."); + Logger.Information("【LoadConfirm】接收到WCS取货确认信号.................. "); var dis = _db.Queryable().Where(P => P.bill_code == input.taskCode).First(); if (dis.area_code == "ZSCJ001") @@ -101,12 +102,12 @@ namespace Tnb.WarehouseMgr if (flag) { await _wareHouseService.SsxControl(dis, "LOAD"); - Logger.Information(dis.startlocation_code+"取货确认..................成功"); + Logger.Information("【LoadConfirm】 " + dis.startlocation_code + "取货确认..................成功"); return await ToApiResult(HttpStatusCode.OK, "成功"); } else { - Logger.Information(dis.startlocation_code + "取货确认..................失败"); + Logger.Information("【LoadConfirm】 " + dis.startlocation_code + "取货确认..................失败"); return await ToApiResult(HttpStatusCode.InternalServerError, "失败"); } } @@ -126,14 +127,14 @@ namespace Tnb.WarehouseMgr device_id = a.elevator_id, }, true) .FirstAsync();*/ - Logger.Information($"当前取货,子任务编号:{input.taskCode}"); + Logger.Information($"【LoadConfirm】 当前取货,子任务编号:{input.taskCode}"); ElevagorInfoQuery q = new() { taskCode = input.taskCode, sourceName = input.sourceName }; WmsElevatorH elevator = await FindElevatorFromPars(q); if (elevator.IsNull()) { - Logger.Error("未找到匹配的电梯任务", new Exception($"根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务")); - return await ToApiResult(HttpStatusCode.InternalServerError, $"根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务"); + Logger.Error("【LoadConfirm】 未找到匹配的电梯任务", new Exception($"【LoadConfirm】 根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务")); + return await ToApiResult(HttpStatusCode.InternalServerError, $"【LoadConfirm】 根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务"); } try { @@ -141,11 +142,11 @@ namespace Tnb.WarehouseMgr { //s_eleUseStatusDic[elevator.device_id] = (int)EnumElevatorUseStatus.空闲; string devName = elevatorCode?.ToString(); - Logger.Information($"获取设备:{devName},状态"); + Logger.Information($"【LoadConfirm】 获取设备:{devName},状态"); var tags = _eleCtlCfg.tags; await Task.Delay(1000); (int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) = await _elevatorControlService.GetElevatorStatus(devName, tags, CancellationToken.None); - Logger.Information($"电梯当前状态->系统状态:{sysStatus.ToEnum()},运行状态:{runStatus.ToEnum()},Agv状态:{agvStatus.ToEnum()},当前楼层:{floorNo}"); + Logger.Information($"【LoadConfirm】 电梯当前状态->系统状态:{sysStatus.ToEnum()},运行状态:{runStatus.ToEnum()},Agv状态:{agvStatus.ToEnum()},当前楼层:{floorNo}"); { var curFloor = await GetRealFloor(elevator.end_floor); /* Logger.Information($"目标楼层:{curFloor},电梯当前楼层:{floorNo}"); @@ -153,13 +154,13 @@ namespace Tnb.WarehouseMgr var loadedStatus = s_eleUseStatusDic[elevator.device_id] == 1 ? "完成" : "未完成"; Logger.Information($"{devName.Match(@"\d+")}#梯,取货-> {loadedStatus}"); */ - if (s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.空闲 &&curFloor != floorNo) + if (s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.空闲 && curFloor != floorNo) { _ = await _elevatorControlService.CallLift(devName, curFloor, CancellationToken.None); } if (curFloor != floorNo) { - return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!"); + return await ToApiResult(HttpStatusCode.InternalServerError, "【LoadConfirm】 电梯还未开门,请重试!"); } if (doorStatus.ToEnum() != EnumDoorStatus.开门到位保持 && runStatus.ToEnum() == EnumRunStatus.停梯 && floorNo == curFloor) //判断电梯楼层与当前放货在同一楼层在允许放货 { @@ -199,6 +200,7 @@ namespace Tnb.WarehouseMgr protected async Task FindElevatorFromPars(ElevagorInfoQuery input) { + Logger.Information($"【FindElevatorFromPars】 根据任务单号获取电梯参数: {JsonConvert.SerializeObject(input)}"); var whereExpable = Expressionable.Create() .And((a, b, c) => a.enabled == 1); if (!input.taskCode.IsNullOrEmpty()) @@ -213,7 +215,8 @@ namespace Tnb.WarehouseMgr { whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.startlocation_id), (a, b, c) => b.location_id == input.startlocation_id); } - var ele = await _db.CopyNew().Queryable().InnerJoin((a, b) => a.id == b.bill_id) + + ISugarQueryable queryable = _db.CopyNew().Queryable().InnerJoin((a, b) => a.id == b.bill_id) .InnerJoin((a, b, c) => b.location_code == c.endlocation_code || b.location_code == c.startlocation_code) .Where(whereExpable.ToExpression()) .WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-R", input.sourceName), (a, b, c) => c.startpoint_code == input.sourceName) @@ -223,9 +226,13 @@ namespace Tnb.WarehouseMgr bill_code = c.bill_code, device_id = a.elevator_id, end_floor = c.end_floor - }, true) + }, true); + Logger.Information($"【FindElevatorFromPars】 根据任务单号获取电梯sql {queryable.ToSqlString()}"); + var ele = await queryable .FirstAsync(); + + return ele; } @@ -238,8 +245,8 @@ namespace Tnb.WarehouseMgr [HttpPost, NonUnify, AllowAnonymous] public async Task UnloadConfirm(ConfirmInput input)// { - Logger.Information("放货确认.................."); - Logger.Information($"当前放货,任务编号:{input.taskCode}"); + Logger.Information("【UnloadConfirm】 接收到WCS放货确认信号.................."); + Logger.Information($"【UnloadConfirm】 当前放货,任务编号:{input.taskCode}"); var dis = _db.Queryable().Where(P => P.bill_code == input.taskCode).First(); if (dis.area_code == "ZSCJ001") { @@ -277,49 +284,48 @@ namespace Tnb.WarehouseMgr WmsElevatorH elevator = await FindElevatorFromPars(q); if (elevator.IsNull()) { - Logger.Error($"根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务"); + Logger.Error($"【UnloadConfirm】 根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务"); } if (s_elevatorMap.TryGetValue(elevator.device_id, out object? elevatorCode)) { string devName = elevatorCode?.ToString(); - Logger.Information($"当前放货设备ID:{elevator.device_id}"); + Logger.Information($"【UnloadConfirm】 当前放货设备ID:{elevator.device_id}"); var loadedStatus = s_eleUseStatusDic[elevator.device_id] == 1 ? "占用" : "空闲"; - Logger.Information($"{devName.Match(@"\d+")}#梯,状态-> {loadedStatus}"); - Logger.Information($"获取设备:{devName},状态"); + Logger.Information($"【UnloadConfirm】 {devName.Match(@"\d+")}#梯,状态-> {loadedStatus}"); + Logger.Information($"【UnloadConfirm】 获取设备:{devName},状态"); //await Task.Delay(3000); (int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) = await _elevatorControlService.GetElevatorStatus(devName, _eleCtlCfg.tags, CancellationToken.None);//elevator.elevator_code - Logger.Information($"电梯当前状态->系统状态:{sysStatus.ToEnum()},运行状态:{runStatus},门状态:{doorStatus},Agv状态:{agvStatus},当前楼层:{floorNo}"); + Logger.Information($"【UnloadConfirm】 电梯当前状态->系统状态:{sysStatus.ToEnum()},运行状态:{runStatus},门状态:{doorStatus},Agv状态:{agvStatus},当前楼层:{floorNo}"); //判断Agv电梯是否进入状态 if (agvStatus != (int)EnumAgvStatus.AGV运行状态) { - await _elevatorControlService.WriteTagAsync(devName, ElevatorConsts.AGVControl, 1); + dynamic res = await _elevatorControlService.WriteTagAsync(devName, ElevatorConsts.AGVControl, 1); + Logger.Information($"【UnloadConfirm】 发送AGVControl 切换电梯{devName}控制模式结果 {JsonConvert.SerializeObject(res)}"); } var curFloor = await GetRealFloor(elevator.end_floor); - + Logger.Information($"【UnloadConfirm】 电梯状态 {s_eleUseStatusDic[elevator.device_id]} 当前楼层:{curFloor},电梯所在楼层:{floorNo}"); if (s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.空闲 && curFloor != floorNo) { _ = await _elevatorControlService.CallLift(devName, curFloor, CancellationToken.None); } if (curFloor != floorNo) { + Logger.Information($"【UnloadConfirm】 电梯还未开门,请重试!curFloor != floorNo"); return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!"); } - Logger.Information($"当前楼层:{curFloor},电梯所在楼层:{floorNo}"); - - - if (doorStatus == (int)EnumDoorStatus.开门到位保持 && s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.占用) { + Logger.Information($"【UnloadConfirm】 电梯当前在s_eleUseStatusDic中的状态为占用!"); await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!"); } //电梯到达目标楼层后,判断当前电梯门状态是否为开门到位保持状态 - if (doorStatus != (int)EnumDoorStatus.开门到位保持 && curFloor == floorNo) //判断目标楼层与电梯所在楼层在同一层才可开门放货 + if (doorStatus != (int)EnumDoorStatus.开门到位保持 && s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.空闲 && curFloor == floorNo) //判断目标楼层与电梯所在楼层在同一层才可开门放货 { _ = await _elevatorControlService.SendOpenCloseCmd(devName, 3); //发送电梯前门开门指令 } @@ -327,21 +333,23 @@ namespace Tnb.WarehouseMgr if (sysStatus == (int)EnumSysStatus.正常状态 && runStatus == (int)EnumRunStatus.停梯 && doorStatus == (int)EnumDoorStatus.开门到位保持 && s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.空闲) { + Logger.Information($"【UnloadConfirm】 成功"); s_eleUseStatusDic[elevator.device_id] = (int)EnumElevatorUseStatus.占用; return await ToApiResult(HttpStatusCode.OK, "成功"); } + Logger.Information($"【UnloadConfirm】 电梯还未开门,请重试!sysStatus: {sysStatus} runStatus:{runStatus} doorStatus: {doorStatus} s_eleUseStatusDic[elevator.device_id]: {s_eleUseStatusDic[elevator.device_id]}"); } return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!"); } catch (Exception ex) { - Logger.Error("放货确认失败", ex); + Logger.Error("【UnloadConfirm】 放货确认失败", ex); return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!"); throw; } } - + /// /// 任务链状态上报 /// @@ -352,7 +360,7 @@ namespace Tnb.WarehouseMgr try { - Logger.Information($"任务链上报->任务链编号:{input.taskChainCode},状态:{input.status},设备ID:{input.deviceID}"); + Logger.Information($"【TaskChainCallBack】 接收到WCS信号 任务链上报->任务链编号:{input.taskChainCode},状态:{input.status},设备ID:{input.deviceID}"); switch (input.status) { case "CREATED": break; @@ -366,7 +374,7 @@ namespace Tnb.WarehouseMgr List eps = await _db.Queryable().Where(it => it.code.Contains(input.deviceID)).ToListAsync(); if (disTasks == null || disTasks.Count < 1) { - Logger.Error($"根据任务链编号:{input.taskChainCode} ,未获取到任何任务"); + Logger.Error($"【TaskChainCallBack】 根据任务链编号:{input.taskChainCode} ,未获取到任何任务"); } if (disTasks?.Count > 0) { @@ -410,8 +418,8 @@ namespace Tnb.WarehouseMgr } catch (Exception ex) { - Logger.Error("任务链状态上报", ex); - Logger.Error($"任务链状态上报错误堆栈{Environment.NewLine}{ex.StackTrace}"); + Logger.Error("【TaskChainCallBack】 任务链状态上报", ex); + Logger.Error($"【TaskChainCallBack】 任务链状态上报错误堆栈{Environment.NewLine}{ex.StackTrace}"); return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!"); throw; } @@ -429,7 +437,7 @@ namespace Tnb.WarehouseMgr public async Task TaskCallback(TaskCallBackInput input) { - Logger.Information($"任务状态上报->接收参数:{JsonConvert.SerializeObject(input)}"); + Logger.Information($"【TaskCallback】 接收到WCS信号 任务状态上报->接收参数:{JsonConvert.SerializeObject(input)}"); try { var disTask = await _db.Queryable().FirstAsync(it => it.bill_code == input.taskCode); @@ -441,34 +449,44 @@ namespace Tnb.WarehouseMgr { disTaskIds = disTasks.Select(x => x.id).ToList() }; - Logger.Information($"设备取返回输入参数:{JsonConvert.SerializeObject(taskExecuteAfterUpInput)}"); + Logger.Information($"【TaskCallback】 设备取返回输入参数:{JsonConvert.SerializeObject(taskExecuteAfterUpInput)}"); await _wareHouseService.TaskExecuteAfter(taskExecuteAfterUpInput); - Logger.Information($"Agv取货完成,任务编号:{string.Join(",", disTasks.Select(x => x.bill_code))}"); + Logger.Information($"【TaskCallback】 Agv取货完成,任务编号:{string.Join(",", disTasks.Select(x => x.bill_code))}"); //根据Agv传递的参数获取,对应的电梯 - - if(!input.sourceName.IsNullOrWhiteSpace() && input.sourceName.Contains("DT-R", StringComparison.OrdinalIgnoreCase)) + + if (!input.sourceName.IsNullOrWhiteSpace() && (input.sourceName.Contains("DT-R", StringComparison.OrdinalIgnoreCase))) { + Logger.Information($"【TaskCallback】 开始根据任务单查找电梯 {input.sourceName}"); ElevagorInfoQuery q = new() { taskCode = input.taskCode }; if (!input.sourceName.IsNullOrEmpty()) { q = new() { taskCode = input.taskCode, sourceName = input.sourceName }; } WmsElevatorH elevator = await FindElevatorFromPars(q); + Logger.Information($"【TaskCallback】 根据任务单查找电梯结果 {JsonConvert.SerializeObject(elevator)}"); if (!elevator?.device_id.IsNullOrEmpty() ?? false) { s_eleUseStatusDic[elevator.device_id] = (int)EnumElevatorUseStatus.空闲; // 根据disTask StartLocationId 起始库位关联电梯获取设备ID location_code.Continas("") var devName = s_elevatorMap[elevator.device_id]?.ToString(); - Logger.Information($"{devName.Match(@"\d+")}#梯,设备名称:{devName},开始进入关门流程"); + Logger.Information($"【TaskCallback】 {devName.Match(@"\d+")}#梯,设备名称:{devName},开始进入关门流程"); int doorStatus = await _elevatorControlService.GetTagAsync(devName, ElevatorConsts.DoorStatus); - Logger.Information($"设备:{devName},门状态:{doorStatus.ToEnum().ToString()}"); + Logger.Information($"【TaskCallback】 设备:{devName},门状态:{doorStatus.ToEnum().ToString()}"); if (doorStatus.ToEnum() != EnumDoorStatus.关门到位保持 )//&& !disTask.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) { _ = await _elevatorControlService.SendOpenCloseCmd(devName, 4); //向电梯发送前门关门指令 } } + else + { + Logger.Information($"【TaskCallback】 没找到电梯,不能解锁电梯状态 {JsonConvert.SerializeObject(elevator)}"); + } + } + else + { + Logger.Information($"【TaskCallback】sourceName不符合条件 {input.sourceName}"); } @@ -503,8 +521,8 @@ namespace Tnb.WarehouseMgr } catch (Exception ex) { - Logger.Error("任务状态上报出现错误", ex); - Logger.Error("任务状态上报错误堆栈信息", ex.StackTrace); + Logger.Error("【TaskCallback】 任务状态上报出现错误", ex); + Logger.Error("【TaskCallback】 任务状态上报错误堆栈信息", ex.StackTrace); return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!"); throw; } @@ -526,13 +544,15 @@ namespace Tnb.WarehouseMgr { try { + Logger.Information($"【ElevatorConfirm】 接收到WCS申请进出电梯信号 接收参数:{JsonConvert.SerializeObject(input)}"); List eles = await _db.Queryable().LeftJoin((a, b) => a.id == b.bill_id) .LeftJoin((a, b, c) => b.location_id == c.startlocation_id) .Where((a, b, c) => c.startlocation_code == input.sourceName && c.bill_code == input.taskCode) .ToListAsync(); } - catch (Exception) + catch (Exception ex) { + Logger.Error("【ElevatorConfirm】 申请进出电梯信号错误", ex); return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!"); throw; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs index b2d76469..7ec321ec 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Tnb.Common.Extension; using Tnb.Common.Utils; @@ -200,11 +201,15 @@ namespace Tnb.WarehouseMgr var eleStatusMap = await RedisHelper.HGetAllAsync(devName); try { - _ = await HttpClientHelper.GetAsync(_elevatorCtlCfg.WriteTagUrl, pars: dicCommand); + Logger.Information($"【SendOpenCloseCmd】 向系统发送开关门指令 {_elevatorCtlCfg.WriteTagUrl} {JsonConvert.SerializeObject(dicCommand)}"); + var res = await HttpClientHelper.GetAsync(_elevatorCtlCfg.WriteTagUrl, pars: dicCommand); + Logger.Information($"【SendOpenCloseCmd】 向系统发送开关门指令 结果:{res}"); + flag = true; //flag = await RedisHelper.HSetAsync(devName, ElevatorConsts.DoorExecute, value); } - catch (Exception) + catch (Exception ex) { + Logger.Information($"【SendOpenCloseCmd】 向系统发送开关门指令发生异常 {ex}"); return false; } return flag; @@ -243,6 +248,7 @@ namespace Tnb.WarehouseMgr ["TagName"] = tagName, ["Value"] = value.ToString() }; + Logger.Information($"【WriteTagAsync】 呼梯指令开始发送 {_elevatorCtlCfg.WriteTagUrl} {JsonConvert.SerializeObject(dicCommand)}"); return await HttpClientHelper.GetAsync(_elevatorCtlCfg.WriteTagUrl, pars: dicCommand); //return await RedisHelper.HSetAsync(devName, tagName, value); @@ -448,7 +454,7 @@ namespace Tnb.WarehouseMgr bool isSuccefuly = false; var tags = new[] { "SysStatus", "RunStatus", "FloorNo", "DoorStatus", "AGVStatus" }; (int sysStatus, int runStatus, _, int doorStatus, int agvStatus) = await GetElevatorStatus(devName, tags, CancellationToken.None); - Logger.Information($"开始呼梯,当前{devName.Match(@"\d+")}#梯,sysStatus:{sysStatus.ToEnum().ToString()},runStatus:{runStatus.ToEnum().ToString()},doorStatus:{doorStatus.ToEnum().ToString()},agvStatus:{agvStatus.ToEnum().ToString()}"); + Logger.Information($"【CallLift】 开始呼梯(FloorExecute)到{floor}(此楼层编号经实际楼层转换),当前{devName.Match(@"\d+")}#梯,sysStatus:{sysStatus.ToEnum().ToString()},runStatus:{runStatus.ToEnum().ToString()},doorStatus:{doorStatus.ToEnum().ToString()},agvStatus:{agvStatus.ToEnum().ToString()}"); //判断当前楼层是否是放货楼层,如不是则呼叫电梯到当前楼层 if (sysStatus.ToEnum() == EnumSysStatus.正常状态 && runStatus.ToEnum() == EnumRunStatus.停梯 && agvStatus.ToEnum() == EnumAgvStatus.AGV运行状态) @@ -458,6 +464,7 @@ namespace Tnb.WarehouseMgr _ = await SendOpenCloseCmd(devName, (int)EnumAgvControl.前门关门); } dynamic result = await WriteTagAsync(devName, ElevatorConsts.FloorExecute, floor); //呼叫电梯到指定楼层 + Logger.Information($"【CallLift】 呼梯结果:{JsonConvert.SerializeObject(result)}"); if (!string.IsNullOrEmpty(result)) { JObject jo = JObject.Parse(result); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ServiceLoggerBase`1.cs b/WarehouseMgr/Tnb.WarehouseMgr/ServiceLoggerBase`1.cs deleted file mode 100644 index f4c9cb7c..00000000 --- a/WarehouseMgr/Tnb.WarehouseMgr/ServiceLoggerBase`1.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.Text; -using JNPF; -using Microsoft.Extensions.Logging; -using SqlSugar; -using Tnb.WarehouseMgr.Entities; - -namespace Tnb.WarehouseMgr -{ - public class ServiceLoggerBase : BaseWareHouseService - { - protected static Dictionary s_elevatorMap = new(); - private static readonly Lazy initializationTask; - - - static ServiceLoggerBase() - { - initializationTask = new Lazy(InitializeAsync); - } - - - - private static async Task InitializeAsync() - { - - ConnectionStringsOptions connectionOpts = App.GetConfig("ConnectionStrings", true); - ConnectionConfig cfg = new() - { - ConfigId = connectionOpts.ConfigId, - ConnectionString = connectionOpts.ConnectString, - DbType = DbType.PostgreSQL, - IsAutoCloseConnection = true, - }; - SqlSugarScope context = new(cfg); - - s_elevatorMap = await context.Queryable().ToDictionaryAsync(x => x.elevator_id, x => x.elevator_code); - - } - public static Task InitializationTask => initializationTask.Value; - - - - //protected ILogger Logger => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/{this.GetType().Name}{DateTime.Now:yyyyMMdd}.log", cfgOpts => - //{ - - // //cfgOpts.DateFormat = "yyyy-MM-dd HH:mm:ss.fff"; - // cfgOpts.MessageFormat = (logMsg) => - // { - // Span span = logMsg.LogLevel.ToString().ToCharArray(); - // StringBuilder sb = new(); - // _ = sb.Append($"{span[..4]} "); - // _ = sb.Append($"{logMsg.LogName} "); - // _ = sb.Append($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} "); - // _ = sb.Append($"#{logMsg.EventId.Id} "); - // _ = sb.Append(logMsg.Message + " "); - // _ = sb.Append(logMsg.Exception?.ToString()); - // return sb.ToString(); - // }; - - //})).CreateLogger(this.GetType()); - } - - public static class CustomLoggerExtenstions - { - public static void Debug(this ILogger logger, string message, params object[] parameters) - { - logger.Debug(message, parameters); - } - - public static void Information(this ILogger logger, string message, params object[] parameters) - { - logger.LogInformation(message, parameters); - } - - public static void Error(this ILogger logger, string message, Exception ex, params object[] parameters) - { - logger.LogError(ex, message, parameters); - } - - public static void Error(this ILogger logger, string message, params object[] parameters) - { - logger.LogError(message, parameters); - } - } -} diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj b/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj index 5df2f6b2..60b81e8b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj +++ b/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj @@ -18,7 +18,6 @@ - diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index cc8ef672..52cd40d2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -2,6 +2,7 @@ using System.Dynamic; using System.Linq.Expressions; using System.Security.Policy; +using System.Threading.Tasks; using Aop.Api.Domain; using JNPF; using JNPF.Common.Contracts; @@ -18,6 +19,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; using NetTaste; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -28,6 +30,7 @@ using Tnb.BasicData.Entities; using Tnb.Common.Extension; using Tnb.Common.Redis; using Tnb.Common.Utils; +using Tnb.ProductionMgr.Entities; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Configs; using Tnb.WarehouseMgr.Entities.Consts; @@ -43,7 +46,7 @@ namespace Tnb.WarehouseMgr /// /// 库房业务类(出入库) /// - public class WareHouseService : ServiceLoggerBase, IWareHouseService + public class WareHouseService : DevServBase, IWareHouseService { private readonly ISqlSugarClient _db; private readonly IDictionaryDataService _dictionaryDataService; @@ -63,7 +66,7 @@ namespace Tnb.WarehouseMgr public WareHouseService(ISqlSugarRepository repository, IDictionaryDataService dictionaryDataService, RedisData redisData, IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService //IConfiguration configuration - )// : base(repository.AsSugarClient()) + ) : base(repository.AsSugarClient()) { _db = repository.AsSugarClient(); _dictionaryDataService = dictionaryDataService; @@ -73,7 +76,9 @@ namespace Tnb.WarehouseMgr _elevatorControlService = elevatorControlService; _redisData = redisData; //_configuration = configuration; + } + /// /// 根据载具Id带出库位、仓库信息 /// @@ -238,6 +243,7 @@ namespace Tnb.WarehouseMgr .ToListAsync(); return input.Size > 0 ? items.Take(input.Size).ToList() : items; } + /// /// 判断CTU是否可以放货 /// @@ -246,20 +252,20 @@ namespace Tnb.WarehouseMgr [AllowAnonymous] public async Task CheckPut(CheckPutInput input) { - Logger.Information("联合请求CheckPut接口传入参数为:" + JsonConvert.SerializeObject(input)); + Logger.Information("联核请求CheckPut接口传入参数为:" + JsonConvert.SerializeObject(input)); Dictionary putdic = new Dictionary(); - + putdic.Add("SSX-011-006", new string[] { "YTCS", "AllowEmptyIn_CS06" }); putdic.Add("SSX-021-007", new string[] { "东面提升机输送线", "出库输送线7允许入箱" }); putdic.Add("SSX-121-009", new string[] { "东面提升机输送线", "上升降机9允许入箱" }); putdic.Add("SSX-121-010", new string[] { "东面提升机输送线", "上升降机10允许入箱" }); putdic.Add("SSX-021-003", new string[] { "YTCS", "AllowCtuEmptyIn_CS03" }); putdic.Add("SSX-021-001", new string[] { "YTCS", "AllowCtuEmptyIn_CS01" }); - putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowCtuFullOut_CS04", }); + putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowCtuFullOut_CS04", }); putdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AllowCtuFullOut_CS02", }); var strs = new string[] { }; - + if (!putdic.ContainsKey(input.targetName)) throw new AppFriendlyException("点位" + input.targetName + "不存在", 500); strs = putdic.Where(p => p.Key == input.targetName).First().Value; @@ -270,12 +276,12 @@ namespace Tnb.WarehouseMgr throw new AppFriendlyException("点位" + input.targetName + "不存在", 500); } string data = await _redisData.GetHash(strs[0], strs[1]); - Logger.Information("联合请求CheckPut接口查询X2Server数据:" + data); + Logger.Information("联核请求CheckPut接口查询X2Server数据:" + data); JObject? res = JsonConvert.DeserializeObject(data); bool result = res != null && res["Value"] != null ? res.Value("Value") : false; if (!result) throw new AppFriendlyException("点位" + input.targetName + "不可放", 500); - Logger.Information("联合请求CheckPut接口结果:CTU可放货" + data); + Logger.Information("联核请求CheckPut接口结果:CTU可放货" + data); } /// @@ -285,6 +291,7 @@ namespace Tnb.WarehouseMgr public async Task Check(string code, string action) { + Logger.Information($"【Check】 判断CTU是否可以取货 {code} {action}"); Dictionary putdic = new Dictionary(); Dictionary getdic = new Dictionary(); putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowCtuFullOut_CS04", }); @@ -313,12 +320,15 @@ namespace Tnb.WarehouseMgr if (action == "LOAD")//取货 { if (!getdic.ContainsKey(code)) + { return false; + } strs = getdic.Where(p => p.Key == code).First().Value; bool flag = _redisData.HashExist(strs[0], strs[1]).Result; if (!flag) { + Logger.Information($"【Check】 判断CTU是否可以取货 {code} {action} flag:{flag} "); return false; } string data = _redisData.GetHash(strs[0], strs[1]).Result; @@ -337,6 +347,7 @@ namespace Tnb.WarehouseMgr bool flag = _redisData.HashExist(strs[0], strs[1]).Result; if (!flag) { + Logger.Information($"【Check】 判断CTU是否可以取货 {code} {action} flag:{flag} "); return false; } string data = _redisData.GetHash(strs[0], strs[1]).Result; @@ -377,7 +388,7 @@ namespace Tnb.WarehouseMgr putdic.Add("SSX-021-001", new string[] { "YTCS", "CtuEmptyIn_CS01Done", "true" }); putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "右输送线下层允许入箱4", "true" }); putdic.Add("ZSSSXCTU01", new string[] { "YTCS", "左输送线下层允许入箱2", "true" }); - putdic.Add("SSX-121-009", new string[] { "东面提升机输送线", "上升降机9入箱完毕", "true" }); + putdic.Add("SSX-121-009", new string[] { "东面提升机输送线", "上升降机9入箱完毕", "true" }); putdic.Add("SSX-121-010", new string[] { "东面提升机输送线", "上升降机10入箱完毕", "true" }); putdic.Add("YCLCKBGW", new string[] { "CP8", "PutDoneEmptyBox", "true" }); putdic.Add("ZS-C01-1", new string[] { "hxjC", "A2AGV允许出空箱", "true" }); @@ -441,7 +452,9 @@ namespace Tnb.WarehouseMgr try { //获取所有未下发的预任务申请 - List preTasks = await db.Queryable().InnerJoin((a, b) => a.startlocation_id == b.location_id && a.carry_id == b.id) + Logger.Information("【GenTaskExecute】 开始获取未下发的预任务..."); + + ISugarQueryable sugarQueryable = db.Queryable().InnerJoin((a, b) => a.startlocation_id == b.location_id && a.carry_id == b.id) .InnerJoin((a, b, c) => a.area_id == c.id) .InnerJoin((a, b, c, d) => a.endlocation_id == d.id && d.is_use == "0") .Where(a => a.status == WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID && !string.IsNullOrWhiteSpace(a.startlocation_id)) @@ -450,10 +463,13 @@ namespace Tnb.WarehouseMgr { move_num = c.move_num, third_eqp_type = c.third_eqp_type, - }, true) - .ToListAsync(); + }, true); + + Logger.Information("【GenTaskExecute】 执行SQL: " + sugarQueryable.ToSqlString()); + + List preTasks = await sugarQueryable.ToListAsync(); + - //List executedPreTasks = await db.Queryable().Where(it => it.status != WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID && it.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID).ToListAsync(); @@ -461,25 +477,31 @@ namespace Tnb.WarehouseMgr .Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) && !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)) .ToList(); - + var elePreTasks = preTasks.Where(it => it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList(); - var normalPreTasks = preTasks.Where(it =>it.area_code!="B"&& !agvElevatorTasks.Concat(elePreTasks).Select(x => x.endlocation_code).Contains(it.endlocation_code)).ToList(); + var normalPreTasks = preTasks.Where(it => it.area_code != "B" && !agvElevatorTasks.Concat(elePreTasks).Select(x => x.endlocation_code).Contains(it.endlocation_code)).ToList(); -/* IEnumerable firstEleGrp = agvElevatorTasks.GroupBy(g => g.endlocation_code).Select(t => t.OrderBy(o => o.bill_code).FirstOrDefault()); - agvElevatorTasks = firstEleGrp?.ToList() ?? Enumerable.Empty().ToList()!; -*/ + + Logger.Information("【GenTaskExecute】 电梯预任务elePreTasks:" + JsonConvert.SerializeObject(elePreTasks)); + Logger.Information("【GenTaskExecute】 AGV/CTU/KIVA预任务normalPreTasks:" + JsonConvert.SerializeObject(normalPreTasks)); + Logger.Information("【GenTaskExecute】 AGV电梯预任务agvElevatorTasks:" + JsonConvert.SerializeObject(agvElevatorTasks)); + + /* IEnumerable firstEleGrp = agvElevatorTasks.GroupBy(g => g.endlocation_code).Select(t => t.OrderBy(o => o.bill_code).FirstOrDefault()); + agvElevatorTasks = firstEleGrp?.ToList() ?? Enumerable.Empty().ToList()!; + */ //如果电梯任务,预Agv任务存在相同目标库位,删除Agv任务保证电梯任务先行 var equalEndLocPreTasks = elePreTasks.Select(x => x.endlocation_code).Intersect(agvElevatorTasks.Select(x => x.endlocation_code)); if (equalEndLocPreTasks.Any()) { + Logger.Information("【GenTaskExecute】 执行:如果电梯任务,预Agv任务存在相同目标库位,删除Agv任务保证电梯任务先行 "); agvElevatorTasks = agvElevatorTasks.Where(x => !equalEndLocPreTasks.Contains(x.endlocation_code)).ToList(); } preTasks = normalPreTasks.Concat(agvElevatorTasks).Concat(elePreTasks).ToList(); //一楼中储仓CTU - + List ids = preTasks.Select(x => x.id).Distinct().ToList(); List? preTaskCodes = await db.Queryable().Where(it => ids.Contains(it.bill_id)).ToListAsync(); if (preTasks.Count > 0) @@ -571,25 +593,29 @@ namespace Tnb.WarehouseMgr await db.Ado.BeginTranAsync(); int row = await db.Insertable(disTasks).ExecuteCommandAsync(); + Logger.Information("【GenTaskExecute】 插入任务执行表数据: " + JsonConvert.SerializeObject(disTasks)); if (preTaskCodes?.Count > 0) { row = await db.Insertable(distaskCodes).ExecuteCommandAsync(); + Logger.Information("【GenTaskExecute】 插入任务执行条码表数据: " + JsonConvert.SerializeObject(disTasks)); } if (row > 0) { List preTaskIds = preTasks.Select(x => x.id).ToList(); + List preTaskBill_codes = preTasks.Select(x => x.bill_code).ToList(); row = await db.Updateable().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_YXF_ID }).Where(it => preTaskIds.Contains(it.id)).ExecuteCommandAsync(); + Logger.Information("【GenTaskExecute】 更改这些预任务执行状态为 已下发: " + JsonConvert.SerializeObject(preTaskBill_codes)); } await db.Ado.CommitTranAsync(); - Logger.Information("预任务执行完成"); - Logger.Information($"_eleCtlCfg.Environment={_eleCtlCfg.Environment}"); + Logger.Information("【GenTaskExecute】 预任务执行完成"); + Logger.Information($"【GenTaskExecute】_eleCtlCfg.Environment={_eleCtlCfg.Environment}"); if (string.Equals(_eleCtlCfg.Environment, ElevatorConsts.EnvironmentName, StringComparison.OrdinalIgnoreCase)) { //呼梯操作 //获取目标库位为电梯库位的任务 - Logger.Information("操作设备"); + Logger.Information("【GenTaskExecute】操作设备"); var agvDTTasks = disTasks.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) && !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList(); @@ -597,27 +623,29 @@ namespace Tnb.WarehouseMgr foreach (var task in agvDTTasks) { ElevagorInfoQuery q = new() { endlocation_id = task.endlocation_id }; + Logger.Information($"【GenTaskExecute】呼梯时 根据任务单号获取电梯参数 {JsonConvert.SerializeObject(q)}"); var e = await FindElevatorFromPars(q); + Logger.Information($"【GenTaskExecute】呼梯时 根据任务单号获取电梯结果 {JsonConvert.SerializeObject(e)}"); if (e != null) { task.device_id = e.device_id; } } - + List<(string endlocation_code, string device_id, string id, int start_floor)> endLocCodes = agvDTTasks .Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList(); var callLiftCnt = endLocCodes?.Count ?? 0; - Logger.Information($"呼梯任务数:{callLiftCnt}"); + Logger.Information($"【GenTaskExecute】呼梯任务数:{callLiftCnt}"); if (endLocCodes?.Count > 0) { if (endLocCodes.Select(x => x.device_id).All(x => !x.IsNullOrWhiteSpace())) { - Logger.Information("呼梯操作"); + Logger.Information("【GenTaskExecute】呼梯操作"); _ = CallingLanding(endLocCodes); } else { - Logger.Error("呼梯失败,没有设备ID"); + Logger.Error("【GenTaskExecute】呼梯失败,没有设备ID"); return; } } @@ -625,11 +653,20 @@ namespace Tnb.WarehouseMgr //执行电梯任务 List? elevatorTasks = disTasks.Where(it => it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList(); + Logger.Information($"【GenTaskExecute】当前电梯任务数:{elevatorTasks?.Count ?? 0}"); if (elevatorTasks?.Count > 0) { - Logger.Information($"当前电梯任务数:{elevatorTasks?.Count ?? 0}"); foreach (WmsDistaskH? elevatorTask in elevatorTasks) { + ElevagorInfoQuery q = new() { endlocation_id = elevatorTask.endlocation_id }; + Logger.Information($"【GenTaskExecute】执行电梯任务时 根据任务单号获取电梯参数 {JsonConvert.SerializeObject(q)}"); + var e = await FindElevatorFromPars(q); + Logger.Information($"【GenTaskExecute】执行电梯任务时 根据任务单号获取电梯结果 {JsonConvert.SerializeObject(e)}"); + if (e != null) + { + elevatorTask.device_id = e.device_id; + } + _ = ExecuteTargetFloorTask(elevatorTask); } } @@ -637,7 +674,7 @@ namespace Tnb.WarehouseMgr if (agvTasks?.Count > 0) { - Logger.Information($"Agv任务数量:{agvTasks.Count},taskCodes:{string.Join(",", agvTasks.Select(x => x.bill_code).Distinct())}"); + Logger.Information($"【GenTaskExecute】Agv任务数量:{agvTasks.Count},taskCodes:{string.Join(",", agvTasks.Select(x => x.bill_code).Distinct())}"); _ = AgvDispatch(agvTasks, agvCts.Token); } } @@ -677,6 +714,9 @@ namespace Tnb.WarehouseMgr { var whereExpable = Expressionable.Create() .And((a, b, c) => a.enabled == 1); + + Logger.Information($"【FindElevatorFromPars】 {JsonConvert.SerializeObject(input)}"); + if (!input.taskCode.IsNullOrEmpty()) { whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.taskCode), (a, b, c) => c.bill_code == input.taskCode); @@ -689,7 +729,8 @@ namespace Tnb.WarehouseMgr { whereExpable.AndIF(!SqlFunc.IsNullOrEmpty(input.startlocation_id), (a, b, c) => b.location_id == input.startlocation_id); } - var ele = await _db.CopyNew().Queryable().InnerJoin((a, b) => a.id == b.bill_id) + + ISugarQueryable queryable = _db.CopyNew().Queryable().InnerJoin((a, b) => a.id == b.bill_id) .InnerJoin((a, b, c) => b.location_code == c.endlocation_code || b.location_code == c.startlocation_code) .Where(whereExpable.ToExpression()) .WhereIF(!SqlFunc.IsNullOrEmpty(input.sourceName) && SqlFunc.StartsWith("DT-R", input.sourceName), (a, b, c) => c.startpoint_code == input.sourceName) @@ -699,8 +740,11 @@ namespace Tnb.WarehouseMgr bill_code = c.bill_code, device_id = a.elevator_id, end_floor = c.end_floor - }, true) - .FirstAsync(); + }, true); + + var ele = await queryable.FirstAsync(); + + Logger.Information($"【FindElevatorFromPars】 " + queryable.ToSqlString()); return ele; @@ -731,13 +775,25 @@ namespace Tnb.WarehouseMgr third_eqp_type = b.third_eqp_type, }, true).ToListAsync(); List TaskCodes = await db.Queryable().Where(it => CTUTasks.Select(p => p.id).ToList().Contains(it.bill_id)).ToListAsync(); + + Logger.Information($@"【CTUTaskExecute】 获取任务TaskCodes: {JsonConvert.SerializeObject(TaskCodes)}"); + var InTasks = CTUTasks.Where(a => a.task_type == WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID).ToList(); var OutTasks = CTUTasks.Where(a => a.task_type == WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID).ToList(); + + Logger.Information($@"【CTUTaskExecute】 获取任务InTasks: {JsonConvert.SerializeObject(InTasks)}"); + Logger.Information($@"【CTUTaskExecute】 获取任务OutTasks: {JsonConvert.SerializeObject(OutTasks)}"); + var OriginDistaskHs = await db.Queryable() .InnerJoin((a, b) => a.area_id == b.id) .Where((a, b) => b.code == "B" && a.status == WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID) .OrderBy(a => a.bill_code) .ToListAsync(); + + + Logger.Information($@"【CTUTaskExecute】 OriginDistaskHs: {JsonConvert.SerializeObject(OriginDistaskHs)}"); + + List DistaskHs = new List(); List UpDistaskHs = new List(); List DistaskCodes = new List(); @@ -763,46 +819,45 @@ namespace Tnb.WarehouseMgr }*/ WmsDistaskH distaskH = item.Adapt(); - distaskH.id = SnowflakeIdHelper.NextId(); - distaskH.status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID; - distaskH.is_chain = 1; - distaskH.create_time = DateTime.Now; - var billcode = GetBillCode(OriginDistaskHs, DistaskHs, distaskH); - distaskH.groups = billcode.Substring(0, billcode.Length - 2); - distaskH.bill_code = billcode; - var num = int.Parse(distaskH.bill_code.Substring(billcode.Length - 1, 1)); - if (num == item.move_num) + distaskH.id = SnowflakeIdHelper.NextId(); + distaskH.status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID; + distaskH.is_chain = 1; + distaskH.create_time = DateTime.Now; + var billcode = GetBillCode(OriginDistaskHs, DistaskHs, distaskH); + distaskH.groups = billcode.Substring(0, billcode.Length - 2); + distaskH.bill_code = billcode; + var num = int.Parse(distaskH.bill_code.Substring(billcode.Length - 1, 1)); + Logger.Information($@"【CTUTaskExecute】 比对billcode:{num}和单次搬运数量move_num:{item.move_num},如果一致 会添加到inCtuExec"); + if (num == item.move_num) + { + distaskH.status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID; + inCtuExec.Add(distaskH); + if (OriginDistaskHs.Where(p => p.groups == distaskH.groups).Any()) { - distaskH.status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID; - inCtuExec.Add(distaskH); - if (OriginDistaskHs.Where(p => p.groups == distaskH.groups).Any()) - { - OriginDistaskHs.Where(p => p.groups == distaskH.groups).ToList().ForEach(p => p.status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID); + OriginDistaskHs.Where(p => p.groups == distaskH.groups).ToList().ForEach(p => p.status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID); - UpDistaskHs.AddRange(OriginDistaskHs.Where(p => p.groups == distaskH.groups).ToList()); - inCtuExec.AddRange(OriginDistaskHs.Where(p => p.groups == distaskH.groups).ToList()); - } - if (DistaskHs.Where(p => p.groups == distaskH.groups).Any()) - { - DistaskHs.Where(p => p.groups == distaskH.groups).ToList().ForEach(p => p.status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID); - inCtuExec.AddRange(DistaskHs.Where(p => p.groups == distaskH.groups).ToList()); - } + UpDistaskHs.AddRange(OriginDistaskHs.Where(p => p.groups == distaskH.groups).ToList()); + inCtuExec.AddRange(OriginDistaskHs.Where(p => p.groups == distaskH.groups).ToList()); } + if (DistaskHs.Where(p => p.groups == distaskH.groups).Any()) + { + DistaskHs.Where(p => p.groups == distaskH.groups).ToList().ForEach(p => p.status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID); + inCtuExec.AddRange(DistaskHs.Where(p => p.groups == distaskH.groups).ToList()); + } + } - Logger.Information($"开始执行CTU入库任务: {JsonConvert.SerializeObject(distaskH)}"); - List preTaskCodes = TaskCodes.FindAll(x => x.bill_id == distaskH.pretask_id); - List disTaskCodes = preTaskCodes.Adapt>(); - disTaskCodes.ForEach(x => - { - x.id = SnowflakeIdHelper.NextId(); - x.bill_id = distaskH.id; - x.create_time = DateTime.Now; - }); - DistaskHs.Add(distaskH); - DistaskCodes.AddRange(disTaskCodes); - + List disTaskCodes = preTaskCodes.Adapt>(); + disTaskCodes.ForEach(x => + { + x.id = SnowflakeIdHelper.NextId(); + x.bill_id = distaskH.id; + x.create_time = DateTime.Now; + }); + DistaskHs.Add(distaskH); + DistaskCodes.AddRange(disTaskCodes); + } foreach (var item in OutTasks) { @@ -815,6 +870,8 @@ namespace Tnb.WarehouseMgr distaskH.groups = billcode.Substring(0, billcode.Length - 2); distaskH.bill_code = billcode; var num = int.Parse(distaskH.bill_code.Substring(billcode.Length - 1, 1)); + + Logger.Information($@"【CTUTaskExecute】 比对billcode:{num}和单次搬运数量move_num:{item.move_num},如果一致 会添加到outCtuExec"); if (num == item.move_num) { distaskH.status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID; @@ -833,7 +890,6 @@ namespace Tnb.WarehouseMgr } } - Logger.Information($"开始执行CTU出库任务: {JsonConvert.SerializeObject(distaskH)}"); List preTaskCodes = TaskCodes.FindAll(x => x.bill_id == distaskH.pretask_id); List disTaskCodes = preTaskCodes.Adapt>(); disTaskCodes.ForEach(x => @@ -866,31 +922,37 @@ namespace Tnb.WarehouseMgr } await db.Ado.CommitTranAsync(); //判断 + Logger.Information($"【CTUTaskExecute】 判断单据状态(status)是否为26126851525157 {JsonConvert.SerializeObject(DistaskHs)}"); if (DistaskHs.Where(p => p.status == WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID).Any()) { - var time =int.Parse( db.Queryable().Where(P => P.key == "getinterval").First().value); + var time = int.Parse(db.Queryable().Where(P => P.key == "getinterval").First().value); timer = new Timer(TimerExec, null, TimeSpan.FromMinutes(time), TimeSpan.FromMinutes(time)); } + Logger.Information($@"【CTUTaskExecute】 可执行的CTU任务inCtuExec: {JsonConvert.SerializeObject(inCtuExec)}"); if (inCtuExec.Count > 0) { + Logger.Information($"开始执行CTU入库任务: {JsonConvert.SerializeObject(inCtuExec)}"); //呼叫ctu入库 // await db.Updateable().SetColumns(it => new WmsDistaskH { status = WmsWareHouseConst.TASK_BILL_STATUS_RUNING_ID }).Where(it => inCtuExec.Select(p => p.id).ToList().Contains(it.id)).ExecuteCommandAsync(); // await db.Updateable().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_START_ID }).Where(it => inCtuExec.Select(x => x.pretask_id).ToList().Contains(it.id)).ExecuteCommandAsync(); CancellationTokenSource Ctu = new(); + await CallingCTU(inCtuExec, Ctu.Token, 1); Ctu.Dispose(); } + Logger.Information($@"【CTUTaskExecute】 可执行的CTU任务outCtuExec: {JsonConvert.SerializeObject(outCtuExec)}"); if (outCtuExec.Count > 0) { + Logger.Information($"开始执行CTU出库任务: {JsonConvert.SerializeObject(outCtuExec)}"); //呼叫ctu出库 - // await db.Updateable().SetColumns(it => new WmsDistaskH { status = WmsWareHouseConst.TASK_BILL_STATUS_RUNING_ID }).Where(it => outCtuExec.Select(p => p.id).ToList().Contains(it.id)).ExecuteCommandAsync(); - // await db.Updateable().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_START_ID }).Where(it => outCtuExec.Select(x => x.pretask_id).ToList().Contains(it.id)).ExecuteCommandAsync(); + // await db.Updateable().SetColumns(it => new WmsDistaskH { status = WmsWareHouseConst.TASK_BILL_STATUS_RUNING_ID }).Where(it => outCtuExec.Select(p => p.id).ToList().Contains(it.id)).ExecuteCommandAsync(); + // await db.Updateable().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_START_ID }).Where(it => outCtuExec.Select(x => x.pretask_id).ToList().Contains(it.id)).ExecuteCommandAsync(); CancellationTokenSource Ctu = new(); await CallingCTU(outCtuExec, Ctu.Token, 0); Ctu.Dispose(); } } - catch(Exception ex) + catch (Exception ex) { } } @@ -955,7 +1017,7 @@ namespace Tnb.WarehouseMgr { var execlist = list.Where(p => p.groups == item.groups).ToList(); await db.Updateable().SetColumns(it => new WmsDistaskH { status = WmsWareHouseConst.TASK_BILL_STATUS_YXD_ID }).Where(it => execlist.Select(p => p.id).ToList().Contains(it.id)).ExecuteCommandAsync(); - // await db.Updateable().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_START_ID }).Where(it => execlist.Select(x => x.pretask_id).ToList().Contains(it.id)).ExecuteCommandAsync(); + // await db.Updateable().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_START_ID }).Where(it => execlist.Select(x => x.pretask_id).ToList().Contains(it.id)).ExecuteCommandAsync(); CancellationTokenSource Ctu = new(); int type = execlist.First().task_type == WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID ? 1 : 0; await CallingCTU(execlist, Ctu.Token, type); @@ -970,9 +1032,9 @@ namespace Tnb.WarehouseMgr { timer?.Dispose(); } - + } - private async Task CallingCTU(List distaskHs, CancellationToken token,int type) + private async Task CallingCTU(List distaskHs, CancellationToken token, int type) { try { @@ -995,12 +1057,14 @@ namespace Tnb.WarehouseMgr reqBody.taskChainPriority = 0; reqBody.taskList = v; reqBody.inOut = type; + Logger.Information($"【CallingCTU】 CTU任务下发 开始请求联核/task-chain/create接口 请求地址:{url} 请求参数:{reqBody} type:{(type == 0 ? "CTU出库" : "CTU入库")}"); dynamic respBody = await HttpClientHelper.PostStreamAsync(url, reqBody, token); - Logger.Information($"CTU任务下发:{respBody}"); + Logger.Information($"【CallingCTU】 CTU任务下发 接收到联核/task-chain/create接口信息:{respBody}"); } } catch (Exception ex) { + Logger.Information($"【CallingCTU】 CTU任务下发 请求联核/task-chain/create接口失败 异常信息:{ex}"); } } #endregion @@ -1011,26 +1075,26 @@ namespace Tnb.WarehouseMgr /// private async Task CallingLanding(List<(string endlocation_code, string device_id, string id, int floorNO)> endLocCodes) { - Logger.Information($" 开始呼梯操作............."); + Logger.Information($"【CallingLanding】 开始呼梯操作............."); try { foreach ((_, string devId, string disTaskId, int floorNO) in endLocCodes) { - Logger.Information($"devId:{devId}"); + Logger.Information($"【CallingLanding】 devId:{devId}"); if (!s_elevatorMap.TryGetValue(devId, out object? elevatorCode)) { continue; } string? devName = elevatorCode.ToString(); - Logger.Information($"电梯编号:{devName}"); - Logger.Information($"当前:{devName.Match(@"\d+")}#梯"); + Logger.Information($"【CallingLanding】 电梯编号:{devName}"); + Logger.Information($"【CallingLanding】 当前:{devName.Match(@"\d+")}#梯"); await _elevatorControlService.WriteTagAsync(devName, ElevatorConsts.AGVControl, 1); (int sysStatus, int runStatus, int curFloorNo, int doorStatus, int agvStatus) eleStatusMulti = (-1, -1, -1, -1, -1); + Logger.Information("【CallingLanding】 获取电梯AGV运行状态"); if (!_elevatorAgvCtlStatusMap.TryGetValue(devId, out int agvCtlStatus) || agvCtlStatus != (int)EnumAgvStatus.AGV运行状态) { - Logger.Information("获取电梯AGV运行状态"); var tags = new[] { "SysStatus", "RunStatus", "FloorNo", "DoorStatus", "AGVStatus" }; do { @@ -1040,18 +1104,22 @@ namespace Tnb.WarehouseMgr Logger.Information($"{devName.Match(@"\d+")}#, 当前Agv状态:{eleStatusMulti.agvStatus.ToEnum()}"); _elevatorAgvCtlStatusMap[devId] = eleStatusMulti.agvStatus; } + else + { + Logger.Information("【CallingLanding】 AGV运行状态:" + agvCtlStatus); + } - Logger.Information($"任务开始目标楼层为:{floorNO}"); + Logger.Information($"【CallingLanding】 任务开始目标楼层为:{floorNO}"); int floorN = await GetRealFloor(floorNO); //如果电梯在当前楼层则不呼梯 if (floorN == eleStatusMulti.curFloorNo) { - Logger.Information($"{devName.Match(@"\d+")}#,在当前楼层,无需呼梯"); + Logger.Information($"【CallingLanding】 {devName.Match(@"\d+")}#,在当前楼层,无需呼梯"); continue; } - Logger.Information($"实际目标楼层为:{floorN}"); + Logger.Information($"【CallingLanding】 实际目标楼层为:{floorN}"); WmsElevatorUnexecute elevatorQueueItem = new() { @@ -1064,8 +1132,10 @@ namespace Tnb.WarehouseMgr create_time = DateTime.Now }; List elevatorQueue = await _db.Queryable().Where(it => it.distask_id == disTaskId && it.task_status == "执行中").ToListAsync(); + if ((elevatorQueue.IsNull() || elevatorQueue.Count < 1) && floorN != eleStatusMulti.curFloorNo) { + Logger.Information($"【CallingLanding】 判断当前电梯{devName.Match(@"\d+")}#梯 无任务在做执行呼梯"); elevatorQueueItem.task_status = "执行中"; bool callLiftRes = await _elevatorControlService.CallLift(devName, floorN, CancellationToken.None); @@ -1073,17 +1143,21 @@ namespace Tnb.WarehouseMgr string callLiftResult = callLiftRes ? successful : fail; Logger.Information($"{devName.Match(@"\d+")}#, 呼梯结果:{callLiftResult}"); } - + else + { + Logger.Information("【CallingLanding】 当前有任务在做,不会呼梯"); + } + //如果当前电梯有任务在做,将当前呼梯任务放入待执行队列 _ = await _db.Insertable(elevatorQueueItem).ExecuteCommandAsync(); - Logger.Information("呼梯任务执行完成"); + Logger.Information("【CallingLanding】 呼梯任务执行完成"); } } catch (Exception ex) { - Logger.Error("呼梯操作错误", ex); - Logger.Error($"呼梯操作错误堆栈跟踪:{Environment.NewLine}{ex.StackTrace}"); + Logger.Error("【CallingLanding】 呼梯操作错误", ex); + Logger.Error($"【CallingLanding】 呼梯操作错误堆栈跟踪:{Environment.NewLine}{ex.StackTrace}"); throw; } } @@ -1101,6 +1175,7 @@ namespace Tnb.WarehouseMgr { if (!s_elevatorMap.TryGetValue(disTask.device_id, out object? elevatorCode)) { + Logger.Information($"开始执行电梯任务,没有取到设备{disTask.device_id}的 elevatorCode! s_elevatorMap: {JsonConvert.SerializeObject(s_elevatorMap)}"); return; } string devName = s_elevatorMap[disTask.device_id]?.ToString() ?? _eleCtlCfg.DevName3; @@ -1186,7 +1261,7 @@ namespace Tnb.WarehouseMgr /// private async Task AgvDispatch(List disTasks, CancellationToken token) { - Logger.Information("Agv任务执行...."); + Logger.Information("【AgvDispatch】 Agv任务执行...."); List kiva = new List(); kiva.Add("ZSSSXCTU02"); kiva.Add("ZSSSXCTU01"); @@ -1196,7 +1271,7 @@ namespace Tnb.WarehouseMgr AgvRequestConfig requestCfg = App.Configuration.Build(); string url = requestCfg.AgvRequestUrls.CreateTaskChainUrl; - Logger.Information($"Agv任务执行的disTasks:{JsonConvert.SerializeObject(disTasks)}"); + Logger.Information($"【AgvDispatch】 Agv任务执行的disTasks:{JsonConvert.SerializeObject(disTasks)}"); var taskChainCodeDic = disTasks.Where(t => !t.groups.IsNullOrWhiteSpace()).GroupBy(g => g.groups!) .ToDictionary(x => x.Key, x => x.Select(it => new @@ -1206,9 +1281,8 @@ namespace Tnb.WarehouseMgr targetName = it.endpoint_code, containerCode = it.carry_code, })); - Logger.Information($"请求地址:{url}"); - Logger.Information($"Agv任务执行的taskChainCodeDic:{JsonConvert.SerializeObject(taskChainCodeDic)}"); + Logger.Information($"【AgvDispatch】 Agv任务执行的taskChainCodeDic:{JsonConvert.SerializeObject(taskChainCodeDic)}"); foreach ((string k, object v) in taskChainCodeDic) { @@ -1225,19 +1299,20 @@ namespace Tnb.WarehouseMgr reqBody.taskChainPriority = 0; reqBody.taskList = v; reqBody.floor = dis.end_floor; - Logger.Information($"请求参数:{JsonConvert.SerializeObject(reqBody)}"); + Logger.Information($"【AgvDispatch】 Agv任务执行 开始请求联核/task-chain/create接口 请求地址:{url} 请求参数:{reqBody} "); dynamic respBody = await HttpClientHelper.PostStreamAsync(url, reqBody, token); - Logger.Information($"调用Agv接口响应结果:{respBody}"); + Logger.Information($"【AgvDispatch】 Agv任务执行 接收到联核/task-chain/create接口信息:{respBody}"); } } catch (Exception ex) { - Logger.Error("agv调度失败异常", ex); + Logger.Information($"【AgvDispatch】 agv任务执行 请求联核/task-chain/create接口失败 异常信息:{ex}"); throw; } } + /// /// 任务执行 /// @@ -1332,9 +1407,7 @@ namespace Tnb.WarehouseMgr _ = await _db.Updateable().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID }).Where(it => preTaskIds.Contains(it.id)).ExecuteCommandAsync(); //更新电梯任务数量 - var eles = await _db.Queryable().Where(it => disTasks.Select(x => x.area_code).Contains(it.area_code)).ToListAsync(); - if (eles?.Count > 0) - await _db.Updateable(eles).ReSetValue(it => it.task_nums--).ExecuteCommandAsync(); + _ = await _db.Updateable().SetColumns(it => new WmsElevatorH { task_nums = it.task_nums - 1}).Where(it => disTasks.Select(x => x.area_code).Contains(it.area_code)).ExecuteCommandAsync(); //更新载具,锁定状态为未锁定,更新载具的库位当前任务的目标库位 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs index 5a870070..371801cb 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs @@ -34,7 +34,7 @@ namespace Tnb.WarehouseMgr /// 盘点任务 /// [OverideVisualDev(ModuleConsts.MODULE_WMSCHECKTASK_ID)] - public class WmsCheckTaskService : ServiceLoggerBase + public class WmsCheckTaskService : BaseWareHouseService { private readonly ISqlSugarClient _db; private readonly IWareHouseService _warehouseService; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs index a594fa26..75f13e5a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs @@ -6,11 +6,11 @@ using Tnb.WarehouseMgr.Entities.Consts; namespace Tnb.WarehouseMgr { [OverideVisualDev(ModuleConsts.MODULE_WMSDISTASK_ID)] - public class WmsDistaskService : BaseWareHouseService + public class WmsDistaskService : TaskManagerDelBase { private readonly ISqlSugarClient _db; - public WmsDistaskService(ISqlSugarRepository repository) + public WmsDistaskService(ISqlSugarRepository repository):base(repository.AsSugarClient()) { _db = repository.AsSugarClient(); OverideFuncs.DeleteAsync = Delete; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index 1224e725..e7f9d768 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -35,7 +35,7 @@ namespace Tnb.WarehouseMgr /// [OverideVisualDev(ModuleConsts.MODULE_WMSOUTSTOCK_ID)] [ServiceModule(BizTypeId)] - public class WmsOutStockService : ServiceLoggerBase, IWmsOutStockService + public class WmsOutStockService : DevServBase, IWmsOutStockService { private const string BizTypeId = "26191522660645"; private readonly ISqlSugarClient _db; @@ -59,7 +59,7 @@ namespace Tnb.WarehouseMgr IBillRullService billRullService, IWmsCarryMoveInStockService wmsCarryMoveInStockService, IWmsCarryService wareCarryService, - IEventPublisher eventPublisher) + IEventPublisher eventPublisher) : base(repository.AsSugarClient()) { _db = repository.AsSugarClient(); _dictionaryDataService = dictionaryDataService; @@ -72,7 +72,6 @@ namespace Tnb.WarehouseMgr _wareCarryService = wareCarryService; OverideFuncs.CreateAsync = OutStockApplyFor; - _ = InitializationTask; } public async Task OutStockApplyFor(VisualDevModelDataCrInput input) @@ -115,7 +114,7 @@ namespace Tnb.WarehouseMgr List freeLocIds = fLocIds.Except(minTaskNumLocs.Select(x => x.endlocation_id)).ToList(); if (freeLocIds?.Count > 0) { - int rIdx = Random.Shared.Next(0, freeLocIds.Count); + int rIdx = Random.Shared.Next(0, freeLocIds.Count); loc = await _db.Queryable().SingleAsync(it => it.id == freeLocIds[rIdx]); } else @@ -712,6 +711,7 @@ namespace Tnb.WarehouseMgr List points = new List(); if (sPoint.area_code != ePoint.area_code) { + points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); if (points.Count <= 2) { throw new AppFriendlyException("该路径不存在", 500); @@ -739,6 +739,11 @@ namespace Tnb.WarehouseMgr startlocation_code = sPoint?.location_code ?? string.Empty, endlocation_id = ePoint?.location_id ?? string.Empty, endlocation_code = ePoint?.location_code ?? string.Empty, + startpoint_id = sPoint.id, + startpoint_code = sPoint.point_code, + endpoint_id = ePoint.id, + endpoint_code = ePoint.point_code, + start_floor = sPoint?.floor.ToString(), end_floor = ePoint?.floor.ToString(), bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(), diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs index 8111df84..bee74024 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs @@ -8,6 +8,8 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using Mapster; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.ProductionMgr.Interfaces; @@ -348,6 +350,7 @@ namespace Tnb.WarehouseMgr public async Task ScanInStockByRedis(VisualDevModelDataCrInput input) { + Logger.LogInformation($"【ScanInStockByRedis】执行入库 {JsonConvert.SerializeObject(input)}"); try { await _db.Ado.BeginTranAsync(); @@ -470,10 +473,13 @@ namespace Tnb.WarehouseMgr } _ = await _db.Insertable(instock).ExecuteCommandAsync(); + Logger.LogInformation($"【ScanInStockByRedis】插入WmsInstockH {JsonConvert.SerializeObject(instock)}"); _ = await _db.Insertable(instockDs).ExecuteCommandAsync(); + Logger.LogInformation($"【ScanInStockByRedis】插入WmsInstockD {JsonConvert.SerializeObject(instockDs)}"); if (instockCode != null) { _ = await _db.Insertable(instockCode).ExecuteCommandAsync(); + Logger.LogInformation($"【ScanInStockByRedis】插入WmsInstockCode {JsonConvert.SerializeObject(instockCode)}"); } InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = "1", Size = 1 }; @@ -492,13 +498,15 @@ namespace Tnb.WarehouseMgr ePoint = await _db.Queryable().FirstAsync(it => it.location_id == endLocations[0].id); } sPoint = await _db.Queryable().FirstAsync(it => it.location_id == loc.id); - + + Logger.LogInformation($"【ScanInStockByRedis】sPoint:{JsonConvert.SerializeObject(sPoint)} ePoint:{JsonConvert.SerializeObject(ePoint)}"); if (sPoint != null && ePoint != null) { List points = new List(); if (sPoint.area_code != ePoint.area_code) { points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id); + Logger.LogInformation($"【ScanInStockByRedis】 路径点数量为:{points.Count}"); if (points.Count <= 2) { throw new AppFriendlyException("该路径不存在", 500); diff --git a/apihost/Tnb.API.Entry/Configurations/Cache.json b/apihost/Tnb.API.Entry/Configurations/Cache.json index dadb1be5..6b399190 100644 --- a/apihost/Tnb.API.Entry/Configurations/Cache.json +++ b/apihost/Tnb.API.Entry/Configurations/Cache.json @@ -1,13 +1,13 @@ { "Cache": { "CacheType": "RedisCache", //MemoryCache - "ip": "localhost", + "ip": "192.168.11.109", "port": 6379, "password": "05jWEoJa8v", "RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=0" }, "Redis": { - "ip": "localhost", + "ip": "192.168.11.109", "port": 6379, "password": "05jWEoJa8v", "RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=0" diff --git a/apihost/Tnb.API.Entry/Configurations/ConnectionStrings.json b/apihost/Tnb.API.Entry/Configurations/ConnectionStrings.json index b9d5c954..3195bfb6 100644 --- a/apihost/Tnb.API.Entry/Configurations/ConnectionStrings.json +++ b/apihost/Tnb.API.Entry/Configurations/ConnectionStrings.json @@ -2,7 +2,7 @@ "ConnectionStrings": { "ConfigId": "default", "DBType": "PostgreSQL", //MySql;SqlServer;Oracle;PostgreSQL;Dm;Kdbndp;Sqlite; - "Host": "localhost", + "Host": "192.168.11.109", //"Host": "127.0.0.1", "Port": "5432", //"DBName": "tianyi_db", diff --git a/apihost/Tnb.API.Entry/Configurations/Location.json b/apihost/Tnb.API.Entry/Configurations/Location.json new file mode 100644 index 00000000..82fd2b30 --- /dev/null +++ b/apihost/Tnb.API.Entry/Configurations/Location.json @@ -0,0 +1,3 @@ +{ + "TestLocation": "CP-A08-47" +} \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Configurations/Nacos.json b/apihost/Tnb.API.Entry/Configurations/Nacos.json deleted file mode 100644 index b10e5b9e..00000000 --- a/apihost/Tnb.API.Entry/Configurations/Nacos.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Nacos": { - "EndPoint": "", - "ServerAddresses": [ "http://localhost:8848/" ], // nacos服务端地址 - "DefaultTimeOut": 15000, - "Namespace": "dev", // 服务注册到的命名空间id - "ListenInterval": 1000, - "ServiceName": "tnb-core", //服务名称 - "GroupName": "DEFAULT_GROUP", //服务分组 - "ClusterName": "DEFAULT", - "Ip": "", - "PreferredNetworks": "", // select an IP that matches the prefix as the service registration IP - "Port": 9212, - "Weight": 100, // 权重 - "RegisterEnabled": true, - "InstanceEnabled": true, - "Ephemeral": true, - "Secure": false, - "AccessKey": "", - "SecretKey": "", - "UserName": "nacos", - "Password": "nacos", - "ConfigUseRpc": true, // 为true时,通过 gRPC 去和 nacos server 交互,nacos 2.x版本要设置为true": null, - "NamingUseRpc": true, // 为true时,通过 gRPC 去和 nacos server 交互, nacos 2.x版本要设置为true": null, - "NamingLoadCacheAtStart": "", - "LBStrategy": "WeightRandom", // WeightRandom WeightRoundRobin - "Metadata": {} - } -} \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj index 5628c052..8267f70f 100644 --- a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj +++ b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj @@ -44,7 +44,9 @@ + + diff --git a/apihost/Tnb.API.Entry/appsettings.json b/apihost/Tnb.API.Entry/appsettings.json index 6a4434b5..44864973 100644 --- a/apihost/Tnb.API.Entry/appsettings.json +++ b/apihost/Tnb.API.Entry/appsettings.json @@ -1,9 +1,4 @@ { "AllowedHosts": "*", - "ConfigurationScanDirectories": [ "Configurations" ], - "YitId": { - "WorkerId": 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1 - "WorkerIdBitLength": 4, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16] - "SeqBitLength": 4 //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数 - } + "ConfigurationScanDirectories": [ "Configurations" ] } \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/AppService.cshtml b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/AppService.cshtml index 5217c36e..1652292b 100644 --- a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/AppService.cshtml +++ b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/AppService.cshtml @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + @using Tnb.Core; @using Tnb.Vengine; @using Tnb.Vengine.Domain; diff --git a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDto.cshtml b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDto.cshtml index 2e127f32..ef7ef708 100644 --- a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDto.cshtml +++ b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDto.cshtml @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + @using Tnb.Core; @using Tnb.Vengine; @using Tnb.Vengine.Domain; diff --git a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDtoAcmen.cshtml b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDtoAcmen.cshtml index 514fcec5..a1fd3788 100644 --- a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDtoAcmen.cshtml +++ b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityDtoAcmen.cshtml @@ -1,5 +1,11 @@ //////////////////////////////////////////////////// -// 本文件由卡奥斯低代码开发平台自动生成,请不要修改 // +// 本文件由拓通低代码开发平台自动生成,请不要修改 // +// ________ ___ ________ // +// /__ __/ / \ /__ __/ // +// / / / / / / // +// / / / / / / // +// /__/ \___/ /__/ // +// // //////////////////////////////////////////////////// @using Tnb.Core; diff --git a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfo.cshtml b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfo.cshtml index 6a654f33..86c1e79f 100644 --- a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfo.cshtml +++ b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfo.cshtml @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + @using Tnb.Core; @using Tnb.Vengine; @using Tnb.Vengine.Domain; diff --git a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfoAcmen.cshtml b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfoAcmen.cshtml index 92480391..8178413c 100644 --- a/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfoAcmen.cshtml +++ b/apihost/Tnb.API.Entry/wwwroot/Template/VengineSqlSugar/EntityInfoAcmen.cshtml @@ -1,5 +1,11 @@ //////////////////////////////////////////////////// -// 本文件由卡奥斯低代码开发平台自动生成,请不要修改 // +// 本文件由拓通低代码开发平台自动生成,请不要修改 // +// ________ ___ ________ // +// /__ __/ / \ /__ __/ // +// / / / / / / // +// / / / / / / // +// /__/ \___/ /__/ // +// // //////////////////////////////////////////////////// @using JNPF.Common.Extension; diff --git a/app/Tnb.Apps.Entitys/Entity/AppDataEntity.cs b/app/Tnb.Apps.Entitys/Entity/AppDataEntity.cs index a2fce06e..90cf559e 100644 --- a/app/Tnb.Apps.Entitys/Entity/AppDataEntity.cs +++ b/app/Tnb.Apps.Entitys/Entity/AppDataEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Apps.Entitys; /// /// App常用数据 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_APPDATA")] diff --git a/app/Tnb.Apps.Interfaces/IAppDataService.cs b/app/Tnb.Apps.Interfaces/IAppDataService.cs index 5d1710be..9d1dacc9 100644 --- a/app/Tnb.Apps.Interfaces/IAppDataService.cs +++ b/app/Tnb.Apps.Interfaces/IAppDataService.cs @@ -5,7 +5,7 @@ namespace JNPF.Apps.Interfaces; /// /// App常用数据 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01 . /// public interface IAppDataService diff --git a/app/Tnb.Apps/AppDataService.cs b/app/Tnb.Apps/AppDataService.cs index 91c95cda..27cd871c 100644 --- a/app/Tnb.Apps/AppDataService.cs +++ b/app/Tnb.Apps/AppDataService.cs @@ -23,7 +23,7 @@ namespace JNPF.Apps; /// /// App常用数据 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01 . /// [ApiDescriptionSettings(Tag = "App", Name = "Data", Order = 800)] diff --git a/app/Tnb.Apps/AppMenuService.cs b/app/Tnb.Apps/AppMenuService.cs index cbb7d697..1102d5a0 100644 --- a/app/Tnb.Apps/AppMenuService.cs +++ b/app/Tnb.Apps/AppMenuService.cs @@ -11,7 +11,7 @@ namespace JNPF.Apps; /// /// App菜单 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01 . /// [ApiDescriptionSettings(Tag = "App", Name = "Menu", Order = 800)] diff --git a/app/Tnb.Apps/AppUserService.cs b/app/Tnb.Apps/AppUserService.cs index 431f5dd8..fcd60326 100644 --- a/app/Tnb.Apps/AppUserService.cs +++ b/app/Tnb.Apps/AppUserService.cs @@ -12,7 +12,7 @@ namespace JNPF.Apps; /// /// App用户信息 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "App", Name = "User", Order = 800)] diff --git a/app/Tnb.Apps/AppVersion.cs b/app/Tnb.Apps/AppVersion.cs index 4498391b..9be75f5b 100644 --- a/app/Tnb.Apps/AppVersion.cs +++ b/app/Tnb.Apps/AppVersion.cs @@ -10,7 +10,7 @@ namespace JNPF.Apps; /// /// App版本信息 /// 版 本:V3.3 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2022-04-07. /// [ApiDescriptionSettings(Tag = "App", Name = "Version", Order = 806)] diff --git a/common/Tnb.Common.Core/EventBus/LogEventSubscriber.cs b/common/Tnb.Common.Core/EventBus/LogEventSubscriber.cs index 1c3a10d0..a9a47d5c 100644 --- a/common/Tnb.Common.Core/EventBus/LogEventSubscriber.cs +++ b/common/Tnb.Common.Core/EventBus/LogEventSubscriber.cs @@ -1,8 +1,6 @@ -using System.Text.RegularExpressions; -using JNPF.Common.Configuration; +using JNPF.Common.Configuration; using JNPF.DependencyInjection; using JNPF.EventBus; -using JNPF.VisualDev.Entitys; using SqlSugar; namespace JNPF.EventHandler; @@ -44,18 +42,7 @@ public class LogEventSubscriber : IEventSubscriber, ISingleton _sqlSugarClient.ChangeDatabase(log.ConnectionConfig.ConfigId); } - string pattern = @"^[0-9]*$"; - var db = _sqlSugarClient.CopyNew(); - if (!string.IsNullOrEmpty(log.Entity.ModuleId) && new Regex(pattern).IsMatch(log.Entity.ModuleId)) - { - var module = await db.Queryable().Where(x => x.Id == log.Entity.ModuleId).FirstAsync(); - if (module != null) - { - log.Entity.ModuleName = module.FullName; - } - } - - await db.Insertable(log.Entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); + await _sqlSugarClient.CopyNew().Insertable(log.Entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); } /// diff --git a/common/Tnb.Common.Core/Filter/RequestActionFilter.cs b/common/Tnb.Common.Core/Filter/RequestActionFilter.cs index 8eb30bff..46d764a8 100644 --- a/common/Tnb.Common.Core/Filter/RequestActionFilter.cs +++ b/common/Tnb.Common.Core/Filter/RequestActionFilter.cs @@ -107,77 +107,7 @@ public class RequestActionFilter : IAsyncActionFilter ModuleName = module.ModuleName, Json = string.Format("{0}应用【{1}】【{2}】", module.Action, args, result?.ToJsonString()) })); - }else if (actionName == "JNPF.VisualDev.VisualDevModelDataService.Create") - { - var args = context.ActionArguments.ToJsonString(); - var result = (actionContext.Result as JsonResult)?.Value; - - string moduleId = httpRequest.Path.Value.Substring(httpRequest.Path.Value.LastIndexOf("/")+1); - - await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateOpLog", options, new SysLogEntity - { - Id = SnowflakeIdHelper.NextId(), - UserId = userId, - UserName = userName, - Category = 3, - IPAddress = NetHelper.Ip, - RequestURL = httpRequest.Path, - RequestDuration = (int)sw.ElapsedMilliseconds, - RequestMethod = "新增", - PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue), - CreatorTime = DateTime.Now, - ModuleName = moduleId, - ModuleId = moduleId, - Json = string.Format("{0}应用【{1}】【{2}】", "新增", args, result?.ToJsonString()) - })); - }else if (actionName == "JNPF.VisualDev.VisualDevModelDataService.Update") - { - var args = context.ActionArguments.ToJsonString(); - var result = (actionContext.Result as JsonResult)?.Value; - string[] arr = httpRequest.Path.Value.Split("/"); - string moduleId = arr[arr.Length - 2]; - - await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateOpLog", options, new SysLogEntity - { - Id = SnowflakeIdHelper.NextId(), - UserId = userId, - UserName = userName, - Category = 3, - IPAddress = NetHelper.Ip, - RequestURL = httpRequest.Path, - RequestDuration = (int)sw.ElapsedMilliseconds, - RequestMethod = "编辑", - PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue), - CreatorTime = DateTime.Now, - ModuleName = moduleId, - ModuleId = moduleId, - Json = string.Format("{0}应用【{1}】【{2}】", "编辑", args, result?.ToJsonString()) - })); - }else if (actionName == "JNPF.VisualDev.VisualDevModelDataService.Delete") - { - var args = context.ActionArguments.ToJsonString(); - var result = (actionContext.Result as JsonResult)?.Value; - string[] arr = httpRequest.Path.Value.Split("/"); - string moduleId = arr[arr.Length - 2]; - - await _eventPublisher.PublishAsync(new LogEventSource("Log:CreateOpLog", options, new SysLogEntity - { - Id = SnowflakeIdHelper.NextId(), - UserId = userId, - UserName = userName, - Category = 3, - IPAddress = NetHelper.Ip, - RequestURL = httpRequest.Path, - RequestDuration = (int)sw.ElapsedMilliseconds, - RequestMethod = "删除", - PlatForm = string.Format("{0}-{1}", userAgent.OS.ToString(), userAgent.RawValue), - CreatorTime = DateTime.Now, - ModuleName = moduleId, - ModuleId = moduleId, - Json = string.Format("{0}应用【{1}】【{2}】", "删除", args, result?.ToJsonString()) - })); } - } } } \ No newline at end of file diff --git a/common/Tnb.Common/Contracts/Entity.cs b/common/Tnb.Common/Contracts/Entity.cs index 2e8b4bc6..19f7378b 100644 --- a/common/Tnb.Common/Contracts/Entity.cs +++ b/common/Tnb.Common/Contracts/Entity.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using JNPF.Common.Contracts; diff --git a/common/Tnb.Common/Models/AnnexModel.cs b/common/Tnb.Common/Models/AnnexModel.cs index 6850a8b1..64e66bc7 100644 --- a/common/Tnb.Common/Models/AnnexModel.cs +++ b/common/Tnb.Common/Models/AnnexModel.cs @@ -5,7 +5,7 @@ namespace JNPF.Common.Models /// /// 附件模型 /// 版 本:V3.3.3 - + /// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 作 者:JNPF开发平台组. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Models/ChunkModel.cs b/common/Tnb.Common/Models/ChunkModel.cs index 1132e23b..7e47314a 100644 --- a/common/Tnb.Common/Models/ChunkModel.cs +++ b/common/Tnb.Common/Models/ChunkModel.cs @@ -6,7 +6,7 @@ namespace JNPF.Common.Models; /// /// 文件分片模型 /// 版 本:V3.3.3 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 作 者:JNPF开发平台组. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs b/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs index 0dbbc8f6..4d665ed8 100644 --- a/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs +++ b/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs @@ -6,6 +6,8 @@ namespace JNPF.Common.Models.NPOI; /// /// Excel导出列名 /// 版 本:V3.0.0 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2017.03.09. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Models/NPOI/ExcelConfig.cs b/common/Tnb.Common/Models/NPOI/ExcelConfig.cs index 2c255f4c..8f215a02 100644 --- a/common/Tnb.Common/Models/NPOI/ExcelConfig.cs +++ b/common/Tnb.Common/Models/NPOI/ExcelConfig.cs @@ -6,6 +6,8 @@ namespace JNPF.Common.Models.NPOI; /// /// Excel导出配置 /// 版 本:V3.0.0 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2017.03.09. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Models/NPOI/ExcelTemplateModel.cs b/common/Tnb.Common/Models/NPOI/ExcelTemplateModel.cs index b75ce5ff..ce795303 100644 --- a/common/Tnb.Common/Models/NPOI/ExcelTemplateModel.cs +++ b/common/Tnb.Common/Models/NPOI/ExcelTemplateModel.cs @@ -5,6 +5,8 @@ namespace JNPF.Common.Models.NPOI; /// /// Excel导出模板 /// 版 本:V3.0.0 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2017.03.09. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Models/User/UserInfoModel.cs b/common/Tnb.Common/Models/User/UserInfoModel.cs index 2a9f5102..909727f7 100644 --- a/common/Tnb.Common/Models/User/UserInfoModel.cs +++ b/common/Tnb.Common/Models/User/UserInfoModel.cs @@ -5,6 +5,8 @@ namespace JNPF.Common.Models.User /// /// 登录者信息 /// 版 本:V3.2.0 + /// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) + /// 作 者:JNPF开发平台组. /// [SuppressSniffer] public class UserInfoModel diff --git a/common/Tnb.Common/Security/CodeGenHelper.cs b/common/Tnb.Common/Security/CodeGenHelper.cs index c77c0613..aa75e88c 100644 --- a/common/Tnb.Common/Security/CodeGenHelper.cs +++ b/common/Tnb.Common/Security/CodeGenHelper.cs @@ -291,7 +291,7 @@ public static class CodeGenHelper result.Add(label, "系统自动生成"); break; case JnpfKeyConst.COMSELECT: - result.Add(label, multiple ? "例:卡奥斯信息/产品部,卡奥斯信息/技术部" : "例:卡奥斯信息/技术部"); + result.Add(label, multiple ? "例:引迈信息/产品部,引迈信息/技术部" : "例:引迈信息/技术部"); break; case JnpfKeyConst.DEPSELECT: result.Add(label, multiple ? "例:产品部/部门编码,技术部/部门编码" : "例:技术部/部门编码"); @@ -303,7 +303,7 @@ public static class CodeGenHelper result.Add(label, multiple ? "例:张三/账号,李四/账号" : "例:张三/账号"); break; case JnpfKeyConst.USERSSELECT: - result.Add(label, multiple ? "例:卡奥斯信息/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号"); + result.Add(label, multiple ? "例:引迈信息/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号"); break; case JnpfKeyConst.ROLESELECT: result.Add(label, multiple ? "例:研发人员/角色编码,测试人员/角色编码" : "例:研发人员/角色编码"); diff --git a/common/Tnb.Common/Security/ExcelExportHelper.cs b/common/Tnb.Common/Security/ExcelExportHelper.cs index 7657801f..4c3c7fa2 100644 --- a/common/Tnb.Common/Security/ExcelExportHelper.cs +++ b/common/Tnb.Common/Security/ExcelExportHelper.cs @@ -16,7 +16,7 @@ namespace JNPF.Common.Security; /// /// Excel导出操作类 /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2017.03.09. /// [SuppressSniffer] @@ -226,16 +226,16 @@ public class ExcelExportHelper SummaryInformation si = PropertySetFactory.CreateSummaryInformation(); // 填加xls文件作者信息 - si.Author = "卡奥斯数字科技有限公司"; + si.Author = "拓通智联科技有限公司"; // 填加xls文件创建程序信息 - si.ApplicationName = "卡奥斯数字科技有限公司"; + si.ApplicationName = "拓通智联科技有限公司"; // 填加xls文件最后保存者信息 - si.LastAuthor = "卡奥斯数字科技有限公司"; + si.LastAuthor = "拓通智联科技有限公司"; // 填加xls文件作者信息 - si.Comments = "卡奥斯数字科技有限公司"; + si.Comments = "拓通智联科技有限公司"; // 填加xls文件标题信息 si.Title = "标题信息"; @@ -487,16 +487,16 @@ public class ExcelExportHelper SummaryInformation si = PropertySetFactory.CreateSummaryInformation(); // 填加xls文件作者信息 - si.Author = "卡奥斯数字科技有限公司"; + si.Author = "拓通智联科技有限公司"; // 填加xls文件创建程序信息 - si.ApplicationName = "卡奥斯数字科技有限公司"; + si.ApplicationName = "拓通智联科技有限公司"; // 填加xls文件最后保存者信息 - si.LastAuthor = "卡奥斯数字科技有限公司"; + si.LastAuthor = "拓通智联科技有限公司"; // 填加xls文件作者信息 - si.Comments = "卡奥斯数字科技有限公司"; + si.Comments = "拓通智联科技有限公司"; // 填加xls文件标题信息 si.Title = "标题信息"; @@ -762,16 +762,16 @@ public class ExcelExportHelper SummaryInformation si = PropertySetFactory.CreateSummaryInformation(); // 填加xls文件作者信息 - si.Author = "卡奥斯数字科技有限公司"; + si.Author = "拓通智联科技有限公司"; // 填加xls文件创建程序信息 - si.ApplicationName = "卡奥斯数字科技有限公司"; + si.ApplicationName = "拓通智联科技有限公司"; // 填加xls文件最后保存者信息 - si.LastAuthor = "卡奥斯数字科技有限公司"; + si.LastAuthor = "拓通智联科技有限公司"; // 填加xls文件作者信息 - si.Comments = "卡奥斯数字科技有限公司"; + si.Comments = "拓通智联科技有限公司"; // 填加xls文件标题信息 si.Title = "标题信息"; diff --git a/common/Tnb.Common/Security/ExcelImportHelper.cs b/common/Tnb.Common/Security/ExcelImportHelper.cs index ecd4abaa..77b164b1 100644 --- a/common/Tnb.Common/Security/ExcelImportHelper.cs +++ b/common/Tnb.Common/Security/ExcelImportHelper.cs @@ -9,7 +9,7 @@ namespace JNPF.Common.Helper /// /// Excel导入操作类 /// 版 本:V3.2.0 - + /// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2017.03.12. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Security/FileHelper.cs b/common/Tnb.Common/Security/FileHelper.cs index 4c40635a..06985c42 100644 --- a/common/Tnb.Common/Security/FileHelper.cs +++ b/common/Tnb.Common/Security/FileHelper.cs @@ -12,7 +12,7 @@ namespace JNPF.Common.Security; /// /// FileHelper /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 作 者:JNPF开发平台组. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Security/JsonHelper.cs b/common/Tnb.Common/Security/JsonHelper.cs index b0a968d8..dc9f8913 100644 --- a/common/Tnb.Common/Security/JsonHelper.cs +++ b/common/Tnb.Common/Security/JsonHelper.cs @@ -7,7 +7,7 @@ namespace JNPF.Common.Security; /// /// JsonHelper /// 版 本:V3.4.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 作 者:JNPF开发平台组. /// public static class JsonHelper diff --git a/common/Tnb.Common/Security/NetHelper.cs b/common/Tnb.Common/Security/NetHelper.cs index fed555c6..9444de66 100644 --- a/common/Tnb.Common/Security/NetHelper.cs +++ b/common/Tnb.Common/Security/NetHelper.cs @@ -9,7 +9,7 @@ namespace JNPF.Common.Security; /// /// 网络操作 /// 版 本:V3.0.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 作 者:JNPF开发平台组. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Security/PinyinHelper.cs b/common/Tnb.Common/Security/PinyinHelper.cs index 0b8ba55f..1d862a43 100644 --- a/common/Tnb.Common/Security/PinyinHelper.cs +++ b/common/Tnb.Common/Security/PinyinHelper.cs @@ -6,7 +6,7 @@ namespace JNPF.Common.Security; /// /// 汉字转换拼音 /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 作 者:JNPF开发平台组. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Security/QueryTreeHelper.cs b/common/Tnb.Common/Security/QueryTreeHelper.cs index bedbfe22..3baf070b 100644 --- a/common/Tnb.Common/Security/QueryTreeHelper.cs +++ b/common/Tnb.Common/Security/QueryTreeHelper.cs @@ -7,7 +7,7 @@ namespace JNPF.Common.Security; /// /// 树形结构查询 /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 作 者:JNPF开发平台组. /// [SuppressSniffer] diff --git a/common/Tnb.Common/Utils/AdapterCfg.cs b/common/Tnb.Common/Utils/AdapterCfg.cs index f2449f18..3fe5d46e 100644 --- a/common/Tnb.Common/Utils/AdapterCfg.cs +++ b/common/Tnb.Common/Utils/AdapterCfg.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// + using Newtonsoft.Json.Linq; namespace Mapster; diff --git a/common/Tnb.Common/Utils/HttpClientHelper.cs b/common/Tnb.Common/Utils/HttpClientHelper.cs index 57837871..290e4b51 100644 --- a/common/Tnb.Common/Utils/HttpClientHelper.cs +++ b/common/Tnb.Common/Utils/HttpClientHelper.cs @@ -100,6 +100,7 @@ namespace Tnb.Common.Utils } public static async Task GetRequestAsync(string url, Dictionary pars = null) { + Log.Information($"开始请求 {url} 请求参数: {JsonConvert.SerializeObject(pars)}"); HttpClient Client = new HttpClient(); var reqUri = url; if (pars?.Count > 0) diff --git a/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs b/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs index 44195df4..f1805b1a 100644 --- a/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs +++ b/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs @@ -71,26 +71,26 @@ where TEntity : class, new() // 设置超时时间 base.Context.Ado.CommandTimeOut = 30; - base.Context.Aop.OnLogExecuted = (sql, pars) => - { - // var oldColor = Console.ForegroundColor; - Console.ForegroundColor = ConsoleColor.Green; - var finalSql = UtilMethods.GetSqlString(Context.CurrentConnectionConfig.DbType, sql, pars); - // Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{Context.Ado.SqlExecutionTime.TotalMilliseconds} ms"); - // Console.WriteLine(finalSql); - // Console.ForegroundColor = oldColor; - if (Context.Ado.SqlExecutionTime.TotalMilliseconds > 3000) - { - Log.Warning($"慢查询: {Context.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql); - } - // Console.WriteLine(); - //App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + base.Context.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value))); - }; - base.Context.Aop.OnError = (ex) => - { - Log.Error("SQL执行错误: " + UtilMethods.GetSqlString(base.Context.CurrentConnectionConfig.DbType, ex.Sql, (SugarParameter[])ex.Parametres)); - //App.PrintToMiniProfiler("SqlSugar", "Error", $"{ex.Message}{Environment.NewLine}{ex.Sql}{pars}{Environment.NewLine}"); - }; + //base.Context.Aop.OnLogExecuted = (sql, pars) => + //{ + // var oldColor = Console.ForegroundColor; + // Console.ForegroundColor = ConsoleColor.Green; + // var finalSql = UtilMethods.GetSqlString(Context.CurrentConnectionConfig.DbType, sql, pars); + // Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{Context.Ado.SqlExecutionTime.TotalMilliseconds} ms"); + // Console.WriteLine(finalSql); + // Console.ForegroundColor = oldColor; + // if (Context.Ado.SqlExecutionTime.TotalMilliseconds > 3000) + // { + // Log.Warning($"慢查询: {Context.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql); + // } + // Console.WriteLine(); + // //App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + base.Context.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value))); + //}; + //base.Context.Aop.OnError = (ex) => + //{ + // Log.Error("SQL执行错误: " + UtilMethods.GetSqlString(base.Context.CurrentConnectionConfig.DbType, ex.Sql, (SugarParameter[])ex.Parametres)); + // //App.PrintToMiniProfiler("SqlSugar", "Error", $"{ex.Message}{Environment.NewLine}{ex.Sql}{pars}{Environment.NewLine}"); + //}; if (base.Context.CurrentConnectionConfig.DbType == DbType.Oracle) diff --git a/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj b/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj index 20799dc6..87c80703 100644 --- a/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj +++ b/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj @@ -5,7 +5,7 @@ - cosmoplat + ToTong TNB 数据库访问器 SqlSugar 插件 enable $(NoWarn);CS1591; diff --git a/message/Tnb.Message.Entitys/Dto/IM/OnlineUserListOutput.cs b/message/Tnb.Message.Entitys/Dto/IM/OnlineUserListOutput.cs index 534b1cfe..13205261 100644 --- a/message/Tnb.Message.Entitys/Dto/IM/OnlineUserListOutput.cs +++ b/message/Tnb.Message.Entitys/Dto/IM/OnlineUserListOutput.cs @@ -5,7 +5,7 @@ namespace JNPF.Message.Entitys.Dto.IM; /// /// 在线用户 /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2017.09.20. /// [SuppressSniffer] diff --git a/message/Tnb.Message.Entitys/Entity/IMContentEntity.cs b/message/Tnb.Message.Entitys/Entity/IMContentEntity.cs index 0234a8e9..2beba0c2 100644 --- a/message/Tnb.Message.Entitys/Entity/IMContentEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/IMContentEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys; /// /// 在线聊天 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_IMCONTENT")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageAccountEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageAccountEntity.cs index 01e04b06..39416b8f 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageAccountEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageAccountEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息账号配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_ACCOUNT_CONFIG")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageDataTypeEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageDataTypeEntity.cs index 46b395cb..b632cbf0 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageDataTypeEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageDataTypeEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息字典配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_DATA_TYPE")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageEntity.cs index 5c75bef9..ab55cc10 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys; /// /// 消息实例 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageMonitorEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageMonitorEntity.cs index a175a8a4..ed4aa312 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageMonitorEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageMonitorEntity.cs @@ -6,6 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息监控 /// 版 本:V3.2 +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_MONITOR")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageReceiveEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageReceiveEntity.cs index 355b2131..66a84eaa 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageReceiveEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageReceiveEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys; /// /// 消息接收 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGERECEIVE")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageSendEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageSendEntity.cs index 18c5b2c3..15f1fc97 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageSendEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageSendEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息发送配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_SEND_CONFIG")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageSendRecordEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageSendRecordEntity.cs index 39f5d925..6a2cdd84 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageSendRecordEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageSendRecordEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息发送记录配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_SEND_RECORD")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageSendTemplateEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageSendTemplateEntity.cs index 054f7f88..fa34cd6b 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageSendTemplateEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageSendTemplateEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息发送模板配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_SEND_TEMPLATE")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageShortLinkEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageShortLinkEntity.cs index baa30e53..ff7d9060 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageShortLinkEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageShortLinkEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息连接 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_SHORT_LINK")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageSmsFieldEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageSmsFieldEntity.cs index d3fe8e6e..ad432df4 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageSmsFieldEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageSmsFieldEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 短信变量 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_SMS_FIELD")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageTemplateEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageTemplateEntity.cs index 41aefdf8..08ca9030 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageTemplateEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageTemplateEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息模板配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_TEMPLATE_CONFIG")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageTemplateParamEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageTemplateParamEntity.cs index a78a8aeb..47baf4ac 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageTemplateParamEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageTemplateParamEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 消息模板参数 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_TEMPLATE_PARAM")] diff --git a/message/Tnb.Message.Entitys/Entity/MessageWechatUserEntity.cs b/message/Tnb.Message.Entitys/Entity/MessageWechatUserEntity.cs index b8298f6a..c9fe39b4 100644 --- a/message/Tnb.Message.Entitys/Entity/MessageWechatUserEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/MessageWechatUserEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 微信公众号用户 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_WECHAT_USER")] diff --git a/message/Tnb.Message.Entitys/Entity/UserDeviceEntity.cs b/message/Tnb.Message.Entitys/Entity/UserDeviceEntity.cs index 041229ed..1b988883 100644 --- a/message/Tnb.Message.Entitys/Entity/UserDeviceEntity.cs +++ b/message/Tnb.Message.Entitys/Entity/UserDeviceEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Message.Entitys.Entity; /// /// 个推用户表. /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_USER_DEVICE")] diff --git a/message/Tnb.Message.Interfaces/IMessageService.cs b/message/Tnb.Message.Interfaces/IMessageService.cs index 86d02ed6..d9b18ce4 100644 --- a/message/Tnb.Message.Interfaces/IMessageService.cs +++ b/message/Tnb.Message.Interfaces/IMessageService.cs @@ -3,7 +3,7 @@ /// /// 系统消息 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IMessageService diff --git a/message/Tnb.Message.Interfaces/IShortLinkService.cs b/message/Tnb.Message.Interfaces/IShortLinkService.cs index 4a44a1c0..d01fb7bb 100644 --- a/message/Tnb.Message.Interfaces/IShortLinkService.cs +++ b/message/Tnb.Message.Interfaces/IShortLinkService.cs @@ -5,7 +5,7 @@ namespace JNPF.Message.Interfaces.Message; /// /// 系统消息 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IShortLinkService diff --git a/message/Tnb.Message/Service/MessageAccountService.cs b/message/Tnb.Message/Service/MessageAccountService.cs index ebcc7766..af1cd157 100644 --- a/message/Tnb.Message/Service/MessageAccountService.cs +++ b/message/Tnb.Message/Service/MessageAccountService.cs @@ -20,7 +20,7 @@ namespace JNPF.Message.Service; /// /// 消息账号 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "AccountConfig", Order = 240)] diff --git a/message/Tnb.Message/Service/MessageDataTypeService.cs b/message/Tnb.Message/Service/MessageDataTypeService.cs index 60d00c6a..3198d3db 100644 --- a/message/Tnb.Message/Service/MessageDataTypeService.cs +++ b/message/Tnb.Message/Service/MessageDataTypeService.cs @@ -9,7 +9,7 @@ namespace JNPF.Message.Service; /// /// 消息账号 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "MessageDataType", Order = 240)] diff --git a/message/Tnb.Message/Service/MessageMonitorService.cs b/message/Tnb.Message/Service/MessageMonitorService.cs index 271e4ea9..1b20d43f 100644 --- a/message/Tnb.Message/Service/MessageMonitorService.cs +++ b/message/Tnb.Message/Service/MessageMonitorService.cs @@ -15,7 +15,7 @@ namespace JNPF.Message.Service; /// /// 消息监控 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "MessageMonitor", Order = 240)] diff --git a/message/Tnb.Message/Service/MessageService.cs b/message/Tnb.Message/Service/MessageService.cs index 9aa75e94..4c6d71de 100644 --- a/message/Tnb.Message/Service/MessageService.cs +++ b/message/Tnb.Message/Service/MessageService.cs @@ -26,6 +26,8 @@ namespace JNPF.Message; /// /// 系统消息 /// 版 本:V3.2 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "message", Order = 240)] diff --git a/message/Tnb.Message/Service/MessageTemplateService.cs b/message/Tnb.Message/Service/MessageTemplateService.cs index 85f99a4d..41b56eaa 100644 --- a/message/Tnb.Message/Service/MessageTemplateService.cs +++ b/message/Tnb.Message/Service/MessageTemplateService.cs @@ -18,7 +18,7 @@ namespace JNPF.Message.Service; /// /// 消息监控 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "MessageTemplate", Order = 240)] diff --git a/message/Tnb.Message/Service/SendMessageService.cs b/message/Tnb.Message/Service/SendMessageService.cs index 8f40a35d..658e4e59 100644 --- a/message/Tnb.Message/Service/SendMessageService.cs +++ b/message/Tnb.Message/Service/SendMessageService.cs @@ -35,7 +35,7 @@ namespace JNPF.Message.Service; /// /// 发送配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "SendMessage", Order = 240)] diff --git a/message/Tnb.Message/Service/ShortLinkService.cs b/message/Tnb.Message/Service/ShortLinkService.cs index 2b0bba06..85b77538 100644 --- a/message/Tnb.Message/Service/ShortLinkService.cs +++ b/message/Tnb.Message/Service/ShortLinkService.cs @@ -27,7 +27,7 @@ namespace JNPF.Message.Service; /// /// 公众号. /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "ShortLink", Order = 240)] diff --git a/message/Tnb.Message/Service/WechatOpenService.cs b/message/Tnb.Message/Service/WechatOpenService.cs index 7d9af6a1..d7d5a4fa 100644 --- a/message/Tnb.Message/Service/WechatOpenService.cs +++ b/message/Tnb.Message/Service/WechatOpenService.cs @@ -18,7 +18,7 @@ namespace JNPF.Message.Service; /// /// 公众号. /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "Message", Name = "WechatOpen", Order = 240)] diff --git a/request.http b/request.http index 60a984df..eea74a8c 100644 --- a/request.http +++ b/request.http @@ -1,5 +1,5 @@ @host=http://localhost:9231 -//@host=http://api.cosmoplat-tech.com +//@host=http://api.tuotong-tech.com ### 用户登录 # @name login diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/ColumnsPurviewEntity.cs b/system/Tnb.Systems.Entitys/Entity/Permission/ColumnsPurviewEntity.cs index c40e1513..2a7dbf75 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/ColumnsPurviewEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/ColumnsPurviewEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.Permission; /// /// 模块列表权限 /// 版 本:V3.3 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2022-03-15. /// [SugarTable("BASE_COLUMNSPURVIEW")] diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeAdministratorEntity.cs b/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeAdministratorEntity.cs index 7e6c1c24..16df5510 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeAdministratorEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeAdministratorEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.Permission; /// /// 分级管理 /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021.09.27. /// [SugarTable("BASE_ORGANIZEADMINISTRATOR")] diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.cs b/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.cs index d9bd8fbe..774b8a81 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.Permission; /// /// 机构管理 /// 版 本:V3.0.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2017.09.20. /// [SugarTable("BASE_ORGANIZE")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/AdvancedQuerySchemeEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/AdvancedQuerySchemeEntity.cs index 2c1278dc..b4af3482 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/AdvancedQuerySchemeEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/AdvancedQuerySchemeEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 高级查询方案 /// 版 本:V3.4 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2022-06-06. /// [SugarTable("BASE_ADVANCEDQUERYSCHEME")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/BillRuleEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/BillRuleEntity.cs index f0b334bf..6a92a153 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/BillRuleEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/BillRuleEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 单据规则 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_BILLRULE")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/ComFieldsEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/ComFieldsEntity.cs index 969bcc24..54319176 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/ComFieldsEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/ComFieldsEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 常用字段 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_COMFIELDS")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/CommonWordsEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/CommonWordsEntity.cs index 2f0b4b39..c5b9bbf1 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/CommonWordsEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/CommonWordsEntity.cs @@ -6,6 +6,8 @@ namespace JNPF.Systems.Entitys.Entity.System; /// /// 常用语 /// 版 本:V3.2 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2021-06-01. /// [SugarTable("BASE_COMMONWORDS")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceEntity.cs index 04c20593..e80ff18d 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 数据接口 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_DATAINTERFACE")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceLogEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceLogEntity.cs index 08ec99d5..54a2f80f 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceLogEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/DataInterfaceLogEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 数据接口日志 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_DATAINTERFACELOG")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/DbBackupEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/DbBackupEntity.cs index c2169292..72b91f5f 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/DbBackupEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/DbBackupEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 数据备份 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_DBBACKUP")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/DbLinkEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/DbLinkEntity.cs index 94de3baf..7d70e43e 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/DbLinkEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/DbLinkEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 数据连接 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_DBLINK")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/DictionaryDataEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/DictionaryDataEntity.cs index 1036879b..9ab45095 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/DictionaryDataEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/DictionaryDataEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 字典数据 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_DICTIONARYDATA")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/DictionaryTypeEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/DictionaryTypeEntity.cs index 3a7ca9c8..5178206d 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/DictionaryTypeEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/DictionaryTypeEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 字典分类 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_DICTIONARYTYPE")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/InterfaceOauthEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/InterfaceOauthEntity.cs index 0f7f8bc1..a34f7fd0 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/InterfaceOauthEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/InterfaceOauthEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 接口认证 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_INTERFACEOAUTH")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/MessageTemplateEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/MessageTemplateEntity.cs index e20018b6..fc2afc8a 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/MessageTemplateEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/MessageTemplateEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 消息模板 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MESSAGE_TEMPLATE")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeEntity.cs index e056edc6..a00eff2b 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 数据权限 /// 版 本:V3.0.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2017.09.20. /// [SugarTable("BASE_MODULEDATAAUTHORIZE")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeLinkEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeLinkEntity.cs index 4bba5b72..4f94ee53 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeLinkEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/ModuleDataAuthorizeLinkEntity.cs @@ -7,7 +7,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 数据权限连接管理 /// 版 本:V3.0.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2017.09.20. /// [SugarTable("BASE_MODULEDATAAUTHORIZELINK")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/ModuleFormEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/ModuleFormEntity.cs index 9053a1bc..f73c142c 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/ModuleFormEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/ModuleFormEntity.cs @@ -7,7 +7,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 表单权限 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_MODULEFORM")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/PrintDevEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/PrintDevEntity.cs index f617a9d3..e08e062d 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/PrintDevEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/PrintDevEntity.cs @@ -7,7 +7,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 打印模板配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_PRINTDEV")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/PrintLogEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/PrintLogEntity.cs index bbb55a0a..d309b5af 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/PrintLogEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/PrintLogEntity.cs @@ -7,6 +7,8 @@ namespace JNPF.Systems.Entitys.Entity.System; /// /// 打印模板日志 /// 版 本:V3.2 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2021-06-01. /// [SugarTable("BASE_PRINT_LOG")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/ProvinceEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/ProvinceEntity.cs index 8a89072c..cee92b65 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/ProvinceEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/ProvinceEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 行政区划 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_PROVINCE")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs index bf02cc77..c0369c37 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 第三方工具对象同步表 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_SYNTHIRDINFO")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs index 5a1c2a1e..613d40fe 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs @@ -7,7 +7,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 定时任务 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [SugarTable("BASE_TIMETASK")] diff --git a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs index 64ee202f..27d5d357 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Entitys.System; /// /// 定时任务日志 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01 . /// [SugarTable("BASE_TIMETASKLOG")] diff --git a/system/Tnb.Systems.Interfaces/Permission/IOrganizeAdministratorService.cs b/system/Tnb.Systems.Interfaces/Permission/IOrganizeAdministratorService.cs index 4961bd12..786bd3f9 100644 --- a/system/Tnb.Systems.Interfaces/Permission/IOrganizeAdministratorService.cs +++ b/system/Tnb.Systems.Interfaces/Permission/IOrganizeAdministratorService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.Permission; /// /// 分级管理 /// 版 本:V3.2.5 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021.09.27. /// public interface IOrganizeAdministratorService diff --git a/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs b/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs index 185be808..beb26e7b 100644 --- a/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs +++ b/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs @@ -8,7 +8,7 @@ namespace JNPF.Systems.Interfaces.Permission; /// 机构管理 /// 组织架构:公司》部门》岗位》用户 /// 版 本:V3.0.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021.06.07. /// public interface IOrganizeService diff --git a/system/Tnb.Systems.Interfaces/System/IBillRullService.cs b/system/Tnb.Systems.Interfaces/System/IBillRullService.cs index b9097007..3ef0a989 100644 --- a/system/Tnb.Systems.Interfaces/System/IBillRullService.cs +++ b/system/Tnb.Systems.Interfaces/System/IBillRullService.cs @@ -3,7 +3,7 @@ /// /// 单据规则 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IBillRullService diff --git a/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs b/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs index f2a669a4..5ebe0623 100644 --- a/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs +++ b/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs @@ -8,7 +8,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 数据接口 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IDataInterfaceService diff --git a/system/Tnb.Systems.Interfaces/System/IDbLinkService.cs b/system/Tnb.Systems.Interfaces/System/IDbLinkService.cs index d54451b8..1941267f 100644 --- a/system/Tnb.Systems.Interfaces/System/IDbLinkService.cs +++ b/system/Tnb.Systems.Interfaces/System/IDbLinkService.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 数据连接 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IDbLinkService diff --git a/system/Tnb.Systems.Interfaces/System/IDictionaryDataService.cs b/system/Tnb.Systems.Interfaces/System/IDictionaryDataService.cs index 0e259d94..d166c8dc 100644 --- a/system/Tnb.Systems.Interfaces/System/IDictionaryDataService.cs +++ b/system/Tnb.Systems.Interfaces/System/IDictionaryDataService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 字典数据 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IDictionaryDataService diff --git a/system/Tnb.Systems.Interfaces/System/IDictionaryTypeService.cs b/system/Tnb.Systems.Interfaces/System/IDictionaryTypeService.cs index f9cdda53..29b9a2cf 100644 --- a/system/Tnb.Systems.Interfaces/System/IDictionaryTypeService.cs +++ b/system/Tnb.Systems.Interfaces/System/IDictionaryTypeService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 字典分类 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IDictionaryTypeService diff --git a/system/Tnb.Systems.Interfaces/System/IModuleButtonService.cs b/system/Tnb.Systems.Interfaces/System/IModuleButtonService.cs index 1ab0230a..58fc8dbf 100644 --- a/system/Tnb.Systems.Interfaces/System/IModuleButtonService.cs +++ b/system/Tnb.Systems.Interfaces/System/IModuleButtonService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 功能按钮 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IModuleButtonService diff --git a/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs b/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs index bf54ff5a..465af3eb 100644 --- a/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs +++ b/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 功能列表 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IModuleColumnService diff --git a/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeSchemeService.cs b/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeSchemeService.cs index 70d17c84..4c8d421a 100644 --- a/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeSchemeService.cs +++ b/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeSchemeService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 数据权限方案 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IModuleDataAuthorizeSchemeService diff --git a/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeService.cs b/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeService.cs index 7923f913..c01891a6 100644 --- a/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeService.cs +++ b/system/Tnb.Systems.Interfaces/System/IModuleDataAuthorizeService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 数据权限 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IModuleDataAuthorizeService diff --git a/system/Tnb.Systems.Interfaces/System/IModuleFormService.cs b/system/Tnb.Systems.Interfaces/System/IModuleFormService.cs index dcf28c91..36b56053 100644 --- a/system/Tnb.Systems.Interfaces/System/IModuleFormService.cs +++ b/system/Tnb.Systems.Interfaces/System/IModuleFormService.cs @@ -5,7 +5,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 表单权限 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IModuleFormService diff --git a/system/Tnb.Systems.Interfaces/System/IModuleService.cs b/system/Tnb.Systems.Interfaces/System/IModuleService.cs index 3c62f1d8..481b84b2 100644 --- a/system/Tnb.Systems.Interfaces/System/IModuleService.cs +++ b/system/Tnb.Systems.Interfaces/System/IModuleService.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 菜单管理 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface IModuleService diff --git a/system/Tnb.Systems.Interfaces/System/ISynThirdInfoService.cs b/system/Tnb.Systems.Interfaces/System/ISynThirdInfoService.cs index ec4212fc..5cb87031 100644 --- a/system/Tnb.Systems.Interfaces/System/ISynThirdInfoService.cs +++ b/system/Tnb.Systems.Interfaces/System/ISynThirdInfoService.cs @@ -7,7 +7,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 第三方同步 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface ISynThirdInfoService diff --git a/system/Tnb.Systems.Interfaces/System/ISysConfigService.cs b/system/Tnb.Systems.Interfaces/System/ISysConfigService.cs index 99539939..dd16f00f 100644 --- a/system/Tnb.Systems.Interfaces/System/ISysConfigService.cs +++ b/system/Tnb.Systems.Interfaces/System/ISysConfigService.cs @@ -6,7 +6,7 @@ namespace JNPF.Systems.Interfaces.System; /// /// 系统配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// public interface ISysConfigService diff --git a/system/Tnb.Systems/Permission/AuthorizeService.cs b/system/Tnb.Systems/Permission/AuthorizeService.cs index 49fc9100..ae68c5d3 100644 --- a/system/Tnb.Systems/Permission/AuthorizeService.cs +++ b/system/Tnb.Systems/Permission/AuthorizeService.cs @@ -784,10 +784,6 @@ public class AuthorizeService : IAuthorizeService, IDynamicApiController, ITrans { var tenantId = _userManager.TenantId; var list = await GetOnlineUserList(tenantId); - if (list == null) - { - return; - } var user = list.Find(it => it.tenantId == tenantId && it.userId == id); if (user != null) { diff --git a/system/Tnb.Systems/Permission/GroupService.cs b/system/Tnb.Systems/Permission/GroupService.cs index 13d34a90..c6fa135d 100644 --- a/system/Tnb.Systems/Permission/GroupService.cs +++ b/system/Tnb.Systems/Permission/GroupService.cs @@ -19,7 +19,7 @@ namespace JNPF.Systems; /// /// 业务实现:分组管理 /// 版 本:V3.3.3 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2022.03.11. /// [ApiDescriptionSettings(Tag = "Permission", Name = "Group", Order = 162)] diff --git a/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs b/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs index 760b223f..fa2e3cb8 100644 --- a/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs +++ b/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs @@ -21,7 +21,7 @@ namespace JNPF.Systems; /// /// 分级管理 /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021.09.27. /// [ApiDescriptionSettings(Tag = "Permission", Name = "OrganizeAdministrator", Order = 166)] diff --git a/system/Tnb.Systems/Permission/OrganizeService.cs b/system/Tnb.Systems/Permission/OrganizeService.cs index ecf80705..a0a14251 100644 --- a/system/Tnb.Systems/Permission/OrganizeService.cs +++ b/system/Tnb.Systems/Permission/OrganizeService.cs @@ -27,7 +27,7 @@ namespace JNPF.Systems; /// 机构管理. /// 组织架构:公司》部门》岗位》用户 /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021.06.07. /// [ApiDescriptionSettings(Tag = "Permission", Name = "Organize", Order = 165)] diff --git a/system/Tnb.Systems/Permission/PositionService.cs b/system/Tnb.Systems/Permission/PositionService.cs index c73e42ac..29753cdd 100644 --- a/system/Tnb.Systems/Permission/PositionService.cs +++ b/system/Tnb.Systems/Permission/PositionService.cs @@ -21,7 +21,7 @@ namespace JNPF.Systems; /// /// 业务实现:岗位管理. /// 版 本:V3.2.0 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021.06.07. /// [ApiDescriptionSettings(Tag = "Permission", Name = "Position", Order = 162)] diff --git a/system/Tnb.Systems/System/ComFieldsService.cs b/system/Tnb.Systems/System/ComFieldsService.cs index 75b6fd89..e26ba5e1 100644 --- a/system/Tnb.Systems/System/ComFieldsService.cs +++ b/system/Tnb.Systems/System/ComFieldsService.cs @@ -13,7 +13,7 @@ namespace JNPF.Systems; /// /// 常用字段 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "CommonFields", Order = 201)] diff --git a/system/Tnb.Systems/System/DataBaseService.cs b/system/Tnb.Systems/System/DataBaseService.cs index f401a4e6..45599bce 100644 --- a/system/Tnb.Systems/System/DataBaseService.cs +++ b/system/Tnb.Systems/System/DataBaseService.cs @@ -29,7 +29,7 @@ namespace JNPF.Systems; /// /// 数据管理 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DataModel", Order = 208)] diff --git a/system/Tnb.Systems/System/DataInterfaceLogService.cs b/system/Tnb.Systems/System/DataInterfaceLogService.cs index 1c663a59..75590863 100644 --- a/system/Tnb.Systems/System/DataInterfaceLogService.cs +++ b/system/Tnb.Systems/System/DataInterfaceLogService.cs @@ -13,7 +13,7 @@ namespace JNPF.Systems; /// /// 数据接口日志 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DataInterfaceLog", Order = 204)] diff --git a/system/Tnb.Systems/System/DataInterfaceService.cs b/system/Tnb.Systems/System/DataInterfaceService.cs index 6b0d7741..91a451b7 100644 --- a/system/Tnb.Systems/System/DataInterfaceService.cs +++ b/system/Tnb.Systems/System/DataInterfaceService.cs @@ -47,6 +47,8 @@ namespace JNPF.Systems; /// /// 数据接口 /// 版 本:V3.2 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DataInterface", Order = 204)] @@ -312,7 +314,6 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController /// [HttpPost("{id}/Actions/Preview")] [UnitOfWork] - [AllowAnonymous] public async Task Preview(string id, [FromBody] DataInterfacePreviewInput input) { _configId = _userManager.TenantId; @@ -324,11 +325,6 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController { dicParameters = input.paramList.ToDictionary(x => x.field, y => y.defaultValue); } - - if (!string.IsNullOrEmpty(info.Path) && !info.Path.StartsWith("http")) - { - info.Path = $"{App.HttpContext.Request.Scheme}://{App.HttpContext.Request.Host}{info.Path}"; - } VerifyRequired(info, dicParameters); ReplaceParameterValue(info, dicParameters); if (info?.DataType == 1) @@ -562,7 +558,6 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController [UnitOfWork] public async Task GetFields(string id, [FromBody] DataInterfacePreviewInput input) { - Object tempObj = null; try { //modifyby zhoukeda 20230803 @@ -574,22 +569,12 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController } else { - tempObj = result; - var list = result.ToObject>>().FirstOrDefault().Keys.ToList(); - return list; + return result.ToObject>>().FirstOrDefault().Keys.ToList(); } } catch (Exception e) { - try - { - return JsonConvert.DeserializeObject>>(JsonConvert.SerializeObject(tempObj)).FirstOrDefault().Keys.ToList(); - } - catch (Exception exception) - { - throw Oops.Oh(ErrorCode.COM1020); - } - + throw Oops.Oh(ErrorCode.COM1020); } } #endregion diff --git a/system/Tnb.Systems/System/DataSyncService.cs b/system/Tnb.Systems/System/DataSyncService.cs index 8920ce4f..6d70632a 100644 --- a/system/Tnb.Systems/System/DataSyncService.cs +++ b/system/Tnb.Systems/System/DataSyncService.cs @@ -18,7 +18,7 @@ namespace JNPF.Systems; /// /// 数据同步 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DataSync", Order = 209)] diff --git a/system/Tnb.Systems/System/DbBackupService.cs b/system/Tnb.Systems/System/DbBackupService.cs index c399ef0c..c175a554 100644 --- a/system/Tnb.Systems/System/DbBackupService.cs +++ b/system/Tnb.Systems/System/DbBackupService.cs @@ -18,7 +18,7 @@ namespace JNPF.Systems; /// /// 数据备份 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DataBackup", Order = 207)] diff --git a/system/Tnb.Systems/System/DbLinkService.cs b/system/Tnb.Systems/System/DbLinkService.cs index 242146dd..3ead4d4b 100644 --- a/system/Tnb.Systems/System/DbLinkService.cs +++ b/system/Tnb.Systems/System/DbLinkService.cs @@ -20,7 +20,7 @@ namespace JNPF.Systems; /// /// 数据连接 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DataSource", Order = 205)] diff --git a/system/Tnb.Systems/System/DictionaryDataService.cs b/system/Tnb.Systems/System/DictionaryDataService.cs index 30ad940a..ec5ed2db 100644 --- a/system/Tnb.Systems/System/DictionaryDataService.cs +++ b/system/Tnb.Systems/System/DictionaryDataService.cs @@ -20,7 +20,7 @@ namespace JNPF.Systems; /// /// 字典数据 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DictionaryData", Order = 203)] diff --git a/system/Tnb.Systems/System/DictionaryTypeService.cs b/system/Tnb.Systems/System/DictionaryTypeService.cs index acbf2541..2498f0cb 100644 --- a/system/Tnb.Systems/System/DictionaryTypeService.cs +++ b/system/Tnb.Systems/System/DictionaryTypeService.cs @@ -16,7 +16,7 @@ namespace JNPF.Systems; /// /// 字典分类 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "DictionaryType", Order = 202)] diff --git a/system/Tnb.Systems/System/InterfaceOauthService.cs b/system/Tnb.Systems/System/InterfaceOauthService.cs index 78f6f105..a67f4a2a 100644 --- a/system/Tnb.Systems/System/InterfaceOauthService.cs +++ b/system/Tnb.Systems/System/InterfaceOauthService.cs @@ -21,7 +21,7 @@ namespace JNPF.Systems.System; /// /// 接口认证 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "InterfaceOauth", Order = 202)] diff --git a/system/Tnb.Systems/System/ModuleButtonService.cs b/system/Tnb.Systems/System/ModuleButtonService.cs index a997773b..3f17c752 100644 --- a/system/Tnb.Systems/System/ModuleButtonService.cs +++ b/system/Tnb.Systems/System/ModuleButtonService.cs @@ -19,7 +19,7 @@ namespace JNPF.Systems; /// /// 功能按钮 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "ModuleButton", Order = 212)] diff --git a/system/Tnb.Systems/System/ModuleColumnService.cs b/system/Tnb.Systems/System/ModuleColumnService.cs index e2f1f578..bd3a250e 100644 --- a/system/Tnb.Systems/System/ModuleColumnService.cs +++ b/system/Tnb.Systems/System/ModuleColumnService.cs @@ -23,7 +23,7 @@ namespace JNPF.Systems; /// /// 功能列表 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "ModuleColumn", Order = 213)] diff --git a/system/Tnb.Systems/System/ModuleDataAuthorizeLinkService.cs b/system/Tnb.Systems/System/ModuleDataAuthorizeLinkService.cs index 1419490f..2cb31625 100644 --- a/system/Tnb.Systems/System/ModuleDataAuthorizeLinkService.cs +++ b/system/Tnb.Systems/System/ModuleDataAuthorizeLinkService.cs @@ -21,7 +21,7 @@ namespace JNPF.Systems; /// /// 数据权限连接管理 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "ModuleDataAuthorizeLink", Order = 214)] diff --git a/system/Tnb.Systems/System/ModuleDataAuthorizeSchemeService.cs b/system/Tnb.Systems/System/ModuleDataAuthorizeSchemeService.cs index 04baafa2..b38d1292 100644 --- a/system/Tnb.Systems/System/ModuleDataAuthorizeSchemeService.cs +++ b/system/Tnb.Systems/System/ModuleDataAuthorizeSchemeService.cs @@ -17,7 +17,7 @@ namespace JNPF.Systems; /// /// 数据权限 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "ModuleDataAuthorizeScheme", Order = 214)] diff --git a/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs b/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs index 2c0c87ff..1d6cdea0 100644 --- a/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs +++ b/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs @@ -22,7 +22,7 @@ namespace JNPF.Systems; /// /// 数据权限 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "ModuleDataAuthorize", Order = 214)] diff --git a/system/Tnb.Systems/System/ModuleFormService.cs b/system/Tnb.Systems/System/ModuleFormService.cs index 6d297d92..bdf22970 100644 --- a/system/Tnb.Systems/System/ModuleFormService.cs +++ b/system/Tnb.Systems/System/ModuleFormService.cs @@ -23,7 +23,7 @@ namespace JNPF.Systems; /// /// 功能表单. /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "ModuleForm", Order = 212)] diff --git a/system/Tnb.Systems/System/ModuleService.cs b/system/Tnb.Systems/System/ModuleService.cs index 06904263..6689ee65 100644 --- a/system/Tnb.Systems/System/ModuleService.cs +++ b/system/Tnb.Systems/System/ModuleService.cs @@ -23,7 +23,7 @@ namespace JNPF.Systems; /// /// 菜单管理 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "Menu", Order = 212)] diff --git a/system/Tnb.Systems/System/MonitorService.cs b/system/Tnb.Systems/System/MonitorService.cs index b3507db8..f304fe7b 100644 --- a/system/Tnb.Systems/System/MonitorService.cs +++ b/system/Tnb.Systems/System/MonitorService.cs @@ -10,7 +10,7 @@ namespace JNPF.Systems; /// /// 系统监控 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "Monitor", Order = 215)] diff --git a/system/Tnb.Systems/System/PrintDevService.cs b/system/Tnb.Systems/System/PrintDevService.cs index 82c2599d..35c0f307 100644 --- a/system/Tnb.Systems/System/PrintDevService.cs +++ b/system/Tnb.Systems/System/PrintDevService.cs @@ -24,7 +24,7 @@ namespace JNPF.Systems; /// /// 打印模板配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "PrintDev", Order = 200)] diff --git a/system/Tnb.Systems/System/PrintLogService.cs b/system/Tnb.Systems/System/PrintLogService.cs index 77cd9670..45f27513 100644 --- a/system/Tnb.Systems/System/PrintLogService.cs +++ b/system/Tnb.Systems/System/PrintLogService.cs @@ -19,6 +19,8 @@ namespace JNPF.Systems.System; /// /// 打印模板日志 /// 版 本:V3.2 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "PrintLog", Order = 200)] diff --git a/system/Tnb.Systems/System/ProvinceService.cs b/system/Tnb.Systems/System/ProvinceService.cs index 9875889e..da0db5e5 100644 --- a/system/Tnb.Systems/System/ProvinceService.cs +++ b/system/Tnb.Systems/System/ProvinceService.cs @@ -15,7 +15,7 @@ namespace JNPF.Systems.Core.Province; /// /// 行政区划 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "Area", Order = 206)] diff --git a/system/Tnb.Systems/System/SynThirdInfoService.cs b/system/Tnb.Systems/System/SynThirdInfoService.cs index c778392c..83086b37 100644 --- a/system/Tnb.Systems/System/SynThirdInfoService.cs +++ b/system/Tnb.Systems/System/SynThirdInfoService.cs @@ -24,7 +24,7 @@ namespace JNPF.Systems.System; /// /// 第三方同步 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "SynThirdInfo", Order = 210)] diff --git a/system/Tnb.Systems/System/SysCacheService.cs b/system/Tnb.Systems/System/SysCacheService.cs index 57e2f5b8..ed324a61 100644 --- a/system/Tnb.Systems/System/SysCacheService.cs +++ b/system/Tnb.Systems/System/SysCacheService.cs @@ -17,7 +17,7 @@ namespace JNPF.Systems; /// /// 缓存管理 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "CacheManage", Order = 100)] diff --git a/system/Tnb.Systems/System/SysConfigService.cs b/system/Tnb.Systems/System/SysConfigService.cs index 3127b11b..23c44693 100644 --- a/system/Tnb.Systems/System/SysConfigService.cs +++ b/system/Tnb.Systems/System/SysConfigService.cs @@ -20,7 +20,7 @@ namespace JNPF.Systems.System; /// /// 系统配置 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "SysConfig", Order = 211)] diff --git a/system/Tnb.Systems/System/SysLogService.cs b/system/Tnb.Systems/System/SysLogService.cs index c00c702b..20d6453d 100644 --- a/system/Tnb.Systems/System/SysLogService.cs +++ b/system/Tnb.Systems/System/SysLogService.cs @@ -17,7 +17,7 @@ namespace JNPF.Systems; /// /// 系统日志 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "Log", Order = 211)] diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs index 44524b3a..ee306a88 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs @@ -7,7 +7,7 @@ namespace JNPF.TaskScheduler.Entitys.Entity; /// /// 定时任务 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01 . /// [SugarTable("snowid")] diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs index 766ddf29..6528ad2f 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs @@ -6,7 +6,7 @@ namespace JNPF.TaskScheduler.Entitys; /// /// 定时任务 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01 . /// [SugarTable("base_timetask")] diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskLogEntity.cs b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskLogEntity.cs index f545f38b..9f070550 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskLogEntity.cs +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskLogEntity.cs @@ -7,7 +7,7 @@ namespace JNPF.TaskScheduler.Entitys; /// /// 定时任务日志 /// 版 本:V3.2 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01 . /// [SugarTable("BASE_TIMETASKLOG")] diff --git a/taskschedule/Tnb.TaskScheduler.Interfaces/ITimeTaskService.cs b/taskschedule/Tnb.TaskScheduler.Interfaces/ITimeTaskService.cs index 4e9f7fff..e8559489 100644 --- a/taskschedule/Tnb.TaskScheduler.Interfaces/ITimeTaskService.cs +++ b/taskschedule/Tnb.TaskScheduler.Interfaces/ITimeTaskService.cs @@ -5,7 +5,7 @@ namespace JNPF.TaskScheduler.Interfaces.TaskScheduler; ///     /// 定时任务     /// 版 本:V3.2 -     +    /// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)     /// 作 者:JNPF开发平台组     /// 日 期:2021-06-01 .     /// diff --git a/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs index dbea3b49..3b041b3c 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs @@ -1,149 +1,149 @@ -// using JNPF; -// using JNPF.Common.Security; -// using JNPF.Systems.Entitys.System; -// using JNPF.TaskScheduler; -// using JNPF.TaskScheduler.Entitys.Model; -// using JNPF.TaskScheduler.Interfaces.TaskScheduler; -// using SqlSugar; -// using Tnb.ProductionMgr.Entities; -// using Tnb.QcMgr.Entities; -// using Tnb.QcMgr.Entities.Entity; -// -// namespace Tnb.TaskScheduler.Listener -// { -// /// -// /// 生成质检任务 -// /// -// public class QcTaskTimeWorker //u: ISpareTimeWorker -// { -// private ISqlSugarRepository repository => App.GetService>(); -// private ITimeTaskService timeTaskService => App.GetService(); -// [SpareTime("0 0 0 * * ?", "生成质检任务", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] -// public async void CreateTask(SpareTimer timer, long count) -// { -// try -// { -// var TimeTasks = await timeTaskService.GetTasks(); -// var timeTaskEntity = TimeTasks.Where(p => p.Id == timer.WorkerName && p.EnabledMark == 1).FirstOrDefault(); -// if (timeTaskEntity == null) -// return; -// ContentModel? comtentModel = timeTaskEntity.ExecuteContent.ToObject(); -// var client = repository.CopyNew(); -// var PlanH = await client.Queryable().Where(p => p.id == comtentModel.parameter.Where(p => p.field == "id").First().value).FirstAsync(); -// var PlanDs = await client.Queryable().Where(p => p.mainid == PlanH.id).ToListAsync(); -// if (PlanH == null || PlanDs.Count == 0) -// return; -// List strs = new List(); -// strs.Add("26589795199765");//首检 -// strs.Add("26589835919125");//生产检 -// strs.Add("26590141686549");//巡检 -// if (strs.Contains(PlanH.checktype)) -// { -// var PlanMaterials = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.materialid).ToListAsync(); -// var PlanProcesss = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.processid).ToListAsync(); -// var PlanWork = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.workid).ToListAsync(); -// //物料工序工位不能同时为空 -// if (PlanMaterials.Count == 0 && PlanProcesss.Count == 0 && PlanWork.Count == 0) -// return; -// var PrdMoTasks = await client.Queryable() -// .WhereIF(PlanMaterials.Count > 0, p => PlanMaterials.Contains(p.material_id)) -// .WhereIF(PlanProcesss.Count > 0, p => PlanProcesss.Contains(p.process_id)) -// .WhereIF(PlanWork.Count > 0, p => PlanWork.Contains(p.workstation_id)) -// .Where(p => p.mo_task_status == "InProgress")//进行中 -// .ToListAsync(); -// -// var DictionaryType = await client.Queryable().Where(p => p.FullName == "质检状态").FirstAsync(); -// var DictionaryData = await client.Queryable().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "待执行").FirstAsync(); -// var time = DateTime.Now; -// foreach (var PrdMoTask in PrdMoTasks) -// { -// -// QcCheckExecH qcCheckExecH = new QcCheckExecH(); -// qcCheckExecH.id = SnowflakeIdHelper.NextId(); -// qcCheckExecH.checktype = PlanH.checktype; -// qcCheckExecH.status = DictionaryData.Id; -// qcCheckExecH.tasktime = time.ToString("yyyy-MM-dd HH:mm:ss"); -// qcCheckExecH.materialid = PrdMoTask.material_id; -// qcCheckExecH.processid = PrdMoTask.process_id; -// qcCheckExecH.workid = PrdMoTask.workstation_id; -// qcCheckExecH.create_time = time; -// var ExecDs = new List(); -// foreach (var PlanD in PlanDs) -// { -// QcCheckExecD QcCheckExecD = new QcCheckExecD(); -// QcCheckExecD.mainid = qcCheckExecH.id; -// QcCheckExecD.extype = PlanD.extype; -// QcCheckExecD.excontent = PlanD.excontent; -// QcCheckExecD.check = PlanD.check; -// QcCheckExecD.errorcause = PlanD.errorcause; -// QcCheckExecD.errorlevel = PlanD.errorlevel; -// QcCheckExecD.remark = PlanD.remark; -// QcCheckExecD.attachment = PlanD.attachment; -// QcCheckExecD.isexec = PlanD.isexec; -// QcCheckExecD.custom = PlanD.custom; -// QcCheckExecD.typeid = PlanD.typeid; -// QcCheckExecD.itemid = PlanD.itemid; -// QcCheckExecD.create_time = time; -// ExecDs.Add(QcCheckExecD); -// } -// await client.Insertable(qcCheckExecH).ExecuteCommandAsync(); -// await client.Insertable(ExecDs).ExecuteCommandAsync(); -// } -// } -// else -// { -// var PlanMaterials = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.materialid).ToListAsync(); -// var DictionaryType = await client.Queryable().Where(p => p.FullName == "质检状态").FirstAsync(); -// var DictionaryData = await client.Queryable().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "待执行").FirstAsync(); -// var time = DateTime.Now; -// foreach (var Material in PlanMaterials) -// { -// QcCheckExecH qcCheckExecH = new QcCheckExecH(); -// qcCheckExecH.id = SnowflakeIdHelper.NextId(); -// qcCheckExecH.checktype = PlanH.checktype; -// qcCheckExecH.status = DictionaryData.Id; -// qcCheckExecH.tasktime = time.ToString("yyyy-MM-dd HH:mm:ss"); -// qcCheckExecH.materialid = Material; -// qcCheckExecH.processid = ""; -// qcCheckExecH.workid = ""; -// qcCheckExecH.create_time = time; -// var ExecDs = new List(); -// foreach (var PlanD in PlanDs) -// { -// QcCheckExecD QcCheckExecD = new QcCheckExecD(); -// QcCheckExecD.mainid = qcCheckExecH.id; -// QcCheckExecD.extype = PlanD.extype; -// QcCheckExecD.excontent = PlanD.excontent; -// QcCheckExecD.check = PlanD.check; -// QcCheckExecD.errorcause = PlanD.errorcause; -// QcCheckExecD.errorlevel = PlanD.errorlevel; -// QcCheckExecD.remark = PlanD.remark; -// QcCheckExecD.attachment = PlanD.attachment; -// QcCheckExecD.isexec = PlanD.isexec; -// QcCheckExecD.custom = PlanD.custom; -// QcCheckExecD.typeid = PlanD.typeid; -// QcCheckExecD.itemid = PlanD.itemid; -// QcCheckExecD.create_time = time; -// ExecDs.Add(QcCheckExecD); -// } -// await client.Insertable(qcCheckExecH).ExecuteCommandAsync(); -// await client.Insertable(ExecDs).ExecuteCommandAsync(); -// } -// -// } -// //只执行一次的 修改EnabledMark字段 -// var InterfaceParameter = comtentModel.parameter.Where(p => p.field == "doonce").FirstOrDefault(); -// if (InterfaceParameter != null && bool.Parse(InterfaceParameter.value)) -// { -// timeTaskEntity.EnabledMark = 0; -// await client.Updateable(timeTaskEntity).ExecuteCommandAsync(); -// SpareTime.Cancel(timeTaskEntity.Id); -// } -// } -// catch (Exception) -// { -// } -// -// } -// } -// } +using JNPF; +using JNPF.Common.Security; +using JNPF.Systems.Entitys.System; +using JNPF.TaskScheduler; +using JNPF.TaskScheduler.Entitys.Model; +using JNPF.TaskScheduler.Interfaces.TaskScheduler; +using SqlSugar; +using Tnb.ProductionMgr.Entities; +using Tnb.QcMgr.Entities; +using Tnb.QcMgr.Entities.Entity; + +namespace Tnb.TaskScheduler.Listener +{ + /// + /// 生成质检任务 + /// + public class QcTaskTimeWorker //u: ISpareTimeWorker + { + private ISqlSugarRepository repository => App.GetService>(); + private ITimeTaskService timeTaskService => App.GetService(); + [SpareTime("0 0 0 * * ?", "生成质检任务", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] + public async void CreateTask(SpareTimer timer, long count) + { + try + { + var TimeTasks = await timeTaskService.GetTasks(); + var timeTaskEntity = TimeTasks.Where(p => p.Id == timer.WorkerName && p.EnabledMark == 1).FirstOrDefault(); + if (timeTaskEntity == null) + return; + ContentModel? comtentModel = timeTaskEntity.ExecuteContent.ToObject(); + var client = repository.CopyNew(); + var PlanH = await client.Queryable().Where(p => p.id == comtentModel.parameter.Where(p => p.field == "id").First().value).FirstAsync(); + var PlanDs = await client.Queryable().Where(p => p.mainid == PlanH.id).ToListAsync(); + if (PlanH == null || PlanDs.Count == 0) + return; + List strs = new List(); + strs.Add("26589795199765");//首检 + strs.Add("26589835919125");//生产检 + strs.Add("26590141686549");//巡检 + if (strs.Contains(PlanH.checktype)) + { + var PlanMaterials = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.materialid).ToListAsync(); + var PlanProcesss = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.processid).ToListAsync(); + var PlanWork = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.workid).ToListAsync(); + //物料工序工位不能同时为空 + if (PlanMaterials.Count == 0 && PlanProcesss.Count == 0 && PlanWork.Count == 0) + return; + var PrdMoTasks = await client.Queryable() + .WhereIF(PlanMaterials.Count > 0, p => PlanMaterials.Contains(p.material_id)) + .WhereIF(PlanProcesss.Count > 0, p => PlanProcesss.Contains(p.process_id)) + .WhereIF(PlanWork.Count > 0, p => PlanWork.Contains(p.workstation_id)) + .Where(p => p.mo_task_status == "InProgress")//进行中 + .ToListAsync(); + + var DictionaryType = await client.Queryable().Where(p => p.FullName == "质检状态").FirstAsync(); + var DictionaryData = await client.Queryable().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "待执行").FirstAsync(); + var time = DateTime.Now; + foreach (var PrdMoTask in PrdMoTasks) + { + + QcCheckExecH qcCheckExecH = new QcCheckExecH(); + qcCheckExecH.id = SnowflakeIdHelper.NextId(); + qcCheckExecH.checktype = PlanH.checktype; + qcCheckExecH.status = DictionaryData.Id; + qcCheckExecH.tasktime = time.ToString("yyyy-MM-dd HH:mm:ss"); + qcCheckExecH.materialid = PrdMoTask.material_id; + qcCheckExecH.processid = PrdMoTask.process_id; + qcCheckExecH.workid = PrdMoTask.workstation_id; + qcCheckExecH.create_time = time; + var ExecDs = new List(); + foreach (var PlanD in PlanDs) + { + QcCheckExecD QcCheckExecD = new QcCheckExecD(); + QcCheckExecD.mainid = qcCheckExecH.id; + QcCheckExecD.extype = PlanD.extype; + QcCheckExecD.excontent = PlanD.excontent; + QcCheckExecD.check = PlanD.check; + QcCheckExecD.errorcause = PlanD.errorcause; + QcCheckExecD.errorlevel = PlanD.errorlevel; + QcCheckExecD.remark = PlanD.remark; + QcCheckExecD.attachment = PlanD.attachment; + QcCheckExecD.isexec = PlanD.isexec; + QcCheckExecD.custom = PlanD.custom; + QcCheckExecD.typeid = PlanD.typeid; + QcCheckExecD.itemid = PlanD.itemid; + QcCheckExecD.create_time = time; + ExecDs.Add(QcCheckExecD); + } + await client.Insertable(qcCheckExecH).ExecuteCommandAsync(); + await client.Insertable(ExecDs).ExecuteCommandAsync(); + } + } + else + { + var PlanMaterials = await client.Queryable().Where(p => p.planid == PlanH.id).Select(p => p.materialid).ToListAsync(); + var DictionaryType = await client.Queryable().Where(p => p.FullName == "质检状态").FirstAsync(); + var DictionaryData = await client.Queryable().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "待执行").FirstAsync(); + var time = DateTime.Now; + foreach (var Material in PlanMaterials) + { + QcCheckExecH qcCheckExecH = new QcCheckExecH(); + qcCheckExecH.id = SnowflakeIdHelper.NextId(); + qcCheckExecH.checktype = PlanH.checktype; + qcCheckExecH.status = DictionaryData.Id; + qcCheckExecH.tasktime = time.ToString("yyyy-MM-dd HH:mm:ss"); + qcCheckExecH.materialid = Material; + qcCheckExecH.processid = ""; + qcCheckExecH.workid = ""; + qcCheckExecH.create_time = time; + var ExecDs = new List(); + foreach (var PlanD in PlanDs) + { + QcCheckExecD QcCheckExecD = new QcCheckExecD(); + QcCheckExecD.mainid = qcCheckExecH.id; + QcCheckExecD.extype = PlanD.extype; + QcCheckExecD.excontent = PlanD.excontent; + QcCheckExecD.check = PlanD.check; + QcCheckExecD.errorcause = PlanD.errorcause; + QcCheckExecD.errorlevel = PlanD.errorlevel; + QcCheckExecD.remark = PlanD.remark; + QcCheckExecD.attachment = PlanD.attachment; + QcCheckExecD.isexec = PlanD.isexec; + QcCheckExecD.custom = PlanD.custom; + QcCheckExecD.typeid = PlanD.typeid; + QcCheckExecD.itemid = PlanD.itemid; + QcCheckExecD.create_time = time; + ExecDs.Add(QcCheckExecD); + } + await client.Insertable(qcCheckExecH).ExecuteCommandAsync(); + await client.Insertable(ExecDs).ExecuteCommandAsync(); + } + + } + //只执行一次的 修改EnabledMark字段 + var InterfaceParameter = comtentModel.parameter.Where(p => p.field == "doonce").FirstOrDefault(); + if (InterfaceParameter != null && bool.Parse(InterfaceParameter.value)) + { + timeTaskEntity.EnabledMark = 0; + await client.Updateable(timeTaskEntity).ExecuteCommandAsync(); + SpareTime.Cancel(timeTaskEntity.Id); + } + } + catch (Exception) + { + } + + } + } +} diff --git a/taskschedule/Tnb.TaskScheduler/Listener/RequestOneTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/RequestOneTimeWorker.cs deleted file mode 100644 index 864eef5f..00000000 --- a/taskschedule/Tnb.TaskScheduler/Listener/RequestOneTimeWorker.cs +++ /dev/null @@ -1,46 +0,0 @@ -using JNPF; -using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Logging; -using JNPF.Systems.Entitys.System; -using JNPF.TaskScheduler; -using SqlSugar; -using Tnb.BasicData.Entities; - -namespace Tnb.TaskScheduler.Listener -{ - public class RequestJavaOneTimeWorker : ISpareTimeWorker - { - private ISqlSugarRepository _repository => App.GetService>(); - - [SpareTime("* * * * * ?", "自动生成待检出库", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false, DoOnce = true)] - public async void RequestOne(SpareTimer timer, long count) - { - // Log.Information("----------------------开始生成特种设备检验计划----------------------"); - - try - { - Log.Information($"开始调用自动生成待检出库:"); - var db = _repository.CopyNew(); - TimeTaskEntity timeTaskEntity = await db.Queryable().SingleAsync(x => x.Id == timer.WorkerName); - string url = timeTaskEntity.Description; - if (url != null && !string.IsNullOrEmpty(url)) - { - Dictionary header = new() - { - //["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : "" - }; - string sendResult = HttpUtils.RequestPost(url, "", header); - Log.Information($"开始调用j自动生成待检出库:{url}结束"); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - Log.Error(e.Message); - } - - - // Log.Information("----------------------结束生成特种设备检验计划----------------------"); - } - } -} \ No newline at end of file diff --git a/taskschedule/Tnb.TaskScheduler/Listener/RequestThreeTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/RequestThreeTimeWorker.cs deleted file mode 100644 index 323d4cf7..00000000 --- a/taskschedule/Tnb.TaskScheduler/Listener/RequestThreeTimeWorker.cs +++ /dev/null @@ -1,45 +0,0 @@ -using JNPF; -using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Logging; -using JNPF.Systems.Entitys.System; -using JNPF.TaskScheduler; -using SqlSugar; -using Tnb.BasicData.Entities; - -namespace Tnb.TaskScheduler.Listener -{ - public class RequestJavaThreeTimeWorker : ISpareTimeWorker - { - private ISqlSugarRepository _repository => App.GetService>(); - - [SpareTime("* * * * * ?", "定时任务3", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false, DoOnce = true)] - public async void RequestThree(SpareTimer timer, long count) - { - // Log.Information("----------------------开始生成特种设备检验计划----------------------"); - - try - { - var db = _repository.CopyNew(); - TimeTaskEntity timeTaskEntity = await db.Queryable().SingleAsync(x => x.Id == timer.WorkerName); - string url = timeTaskEntity.Description; - if (url != null && !string.IsNullOrEmpty(url)) - { - Dictionary header = new() - { - //["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : "" - }; - string sendResult = HttpUtils.RequestPost(url, "", header); - Log.Error($"开始调用java接口3:{url}"); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - Log.Error(e.Message); - } - - - // Log.Information("----------------------结束生成特种设备检验计划----------------------"); - } - } -} \ No newline at end of file diff --git a/taskschedule/Tnb.TaskScheduler/Listener/RequestTwoTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/RequestTwoTimeWorker.cs deleted file mode 100644 index 9cb3c289..00000000 --- a/taskschedule/Tnb.TaskScheduler/Listener/RequestTwoTimeWorker.cs +++ /dev/null @@ -1,45 +0,0 @@ -using JNPF; -using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Logging; -using JNPF.Systems.Entitys.System; -using JNPF.TaskScheduler; -using SqlSugar; -using Tnb.BasicData.Entities; - -namespace Tnb.TaskScheduler.Listener -{ - public class RequestJavaTwoTimeWorker : ISpareTimeWorker - { - private ISqlSugarRepository _repository => App.GetService>(); - - [SpareTime("* * * * * ?", "定时任务2", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false, DoOnce = true)] - public async void RequestTwo(SpareTimer timer, long count) - { - // Log.Information("----------------------开始生成特种设备检验计划----------------------"); - - try - { - var db = _repository.CopyNew(); - TimeTaskEntity timeTaskEntity = await db.Queryable().SingleAsync(x => x.Id == timer.WorkerName); - string url = timeTaskEntity.Description; - if (url != null && !string.IsNullOrEmpty(url)) - { - Dictionary header = new() - { - //["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : "" - }; - string sendResult = HttpUtils.RequestPost(url, "", header); - Log.Error($"开始调用java接口2:{url}"); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - Log.Error(e.Message); - } - - - // Log.Information("----------------------结束生成特种设备检验计划----------------------"); - } - } -} \ No newline at end of file diff --git a/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs b/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs index e0c662eb..3261e1ed 100644 --- a/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs +++ b/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs @@ -27,7 +27,7 @@ namespace JNPF.TaskScheduler; /// /// 定时任务 /// 版 本:V3.4.1 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "TaskScheduler", Name = "scheduletask", Order = 220)] diff --git a/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj b/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj index e77fe966..64004e32 100644 --- a/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj +++ b/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj @@ -15,6 +15,7 @@ + diff --git a/tnb.server.iml b/tnb.server.iml deleted file mode 100644 index 8021953e..00000000 --- a/tnb.server.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/visualdev/Tnb.Vengine/AppService/BaseAppService.cs b/visualdev/Tnb.Vengine/AppService/BaseAppService.cs index 5ee71c99..1f1ddfab 100644 --- a/visualdev/Tnb.Vengine/AppService/BaseAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/BaseAppService.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF; using JNPF.DependencyInjection; using JNPF.DynamicApiController; diff --git a/visualdev/Tnb.Vengine/AppService/IVengineAppService.cs b/visualdev/Tnb.Vengine/AppService/IVengineAppService.cs index 9ec9e7c1..62b22eef 100644 --- a/visualdev/Tnb.Vengine/AppService/IVengineAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/IVengineAppService.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF.DependencyInjection; namespace Tnb.Vengine.AppService; diff --git a/visualdev/Tnb.Vengine/AppService/IVmodelAppService.cs b/visualdev/Tnb.Vengine/AppService/IVmodelAppService.cs index a1ad0a75..b677945d 100644 --- a/visualdev/Tnb.Vengine/AppService/IVmodelAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/IVmodelAppService.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF.DependencyInjection; namespace Tnb.Vengine.AppService; diff --git a/visualdev/Tnb.Vengine/AppService/IVmodelPageAppService.cs b/visualdev/Tnb.Vengine/AppService/IVmodelPageAppService.cs index 223ce1e6..dd916bd4 100644 --- a/visualdev/Tnb.Vengine/AppService/IVmodelPageAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/IVmodelPageAppService.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF.DependencyInjection; namespace Tnb.Vengine.AppService; diff --git a/visualdev/Tnb.Vengine/AppService/VengineAppService.cs b/visualdev/Tnb.Vengine/AppService/VengineAppService.cs index 11b2fda0..56003c72 100644 --- a/visualdev/Tnb.Vengine/AppService/VengineAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/VengineAppService.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF; using JNPF.Common.Security; using Mapster; diff --git a/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs b/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs index dbc333a3..ddcbb15d 100644 --- a/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs +++ b/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + using System.Reflection; using System.Security.Cryptography; using Aop.Api.Domain; diff --git a/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs b/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs index 2031a470..886507cf 100644 --- a/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF; using JNPF.Common.Core.Manager; using JNPF.Common.Extension; diff --git a/visualdev/Tnb.Vengine/AppService/VmodelDto.cs b/visualdev/Tnb.Vengine/AppService/VmodelDto.cs index 52a72b06..c3d22d99 100644 --- a/visualdev/Tnb.Vengine/AppService/VmodelDto.cs +++ b/visualdev/Tnb.Vengine/AppService/VmodelDto.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using Mapster; using Newtonsoft.Json; diff --git a/visualdev/Tnb.Vengine/AppService/VmodelPageAppService.cs b/visualdev/Tnb.Vengine/AppService/VmodelPageAppService.cs index 706f8b93..d0d2234f 100644 --- a/visualdev/Tnb.Vengine/AppService/VmodelPageAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/VmodelPageAppService.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb-server // +///////////////////////////////////////////////////////////////////////////////// + using System.Text; using JNPF.Common.Security; using Mapster; diff --git a/visualdev/Tnb.Vengine/Constants/DbConsts.cs b/visualdev/Tnb.Vengine/Constants/DbConsts.cs index 94e5b182..8599135e 100644 --- a/visualdev/Tnb.Vengine/Constants/DbConsts.cs +++ b/visualdev/Tnb.Vengine/Constants/DbConsts.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// + namespace Tnb.Vengine; public static class DbConsts diff --git a/visualdev/Tnb.Vengine/Constants/VmodelEnum.cs b/visualdev/Tnb.Vengine/Constants/VmodelEnum.cs index 0ac3bad3..fdf26479 100644 --- a/visualdev/Tnb.Vengine/Constants/VmodelEnum.cs +++ b/visualdev/Tnb.Vengine/Constants/VmodelEnum.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// + using System.ComponentModel; namespace Tnb.Vengine; diff --git a/visualdev/Tnb.Vengine/Domain/VengineDto.cs b/visualdev/Tnb.Vengine/Domain/VengineDto.cs index 76fb1633..42536884 100644 --- a/visualdev/Tnb.Vengine/Domain/VengineDto.cs +++ b/visualdev/Tnb.Vengine/Domain/VengineDto.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF.Common.Security; using Mapster; using Microsoft.AspNetCore.Http; diff --git a/visualdev/Tnb.Vengine/Domain/VmBaseProp.cs b/visualdev/Tnb.Vengine/Domain/VmBaseProp.cs index 9a06308c..55986796 100644 --- a/visualdev/Tnb.Vengine/Domain/VmBaseProp.cs +++ b/visualdev/Tnb.Vengine/Domain/VmBaseProp.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using Newtonsoft.Json.Linq; diff --git a/visualdev/Tnb.Vengine/Domain/VmCalcProp.cs b/visualdev/Tnb.Vengine/Domain/VmCalcProp.cs index e548293e..7ac0c208 100644 --- a/visualdev/Tnb.Vengine/Domain/VmCalcProp.cs +++ b/visualdev/Tnb.Vengine/Domain/VmCalcProp.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// namespace Tnb.Vengine.Domain; diff --git a/visualdev/Tnb.Vengine/Domain/VmDbProp.cs b/visualdev/Tnb.Vengine/Domain/VmDbProp.cs index f4687c18..cb89b77c 100644 --- a/visualdev/Tnb.Vengine/Domain/VmDbProp.cs +++ b/visualdev/Tnb.Vengine/Domain/VmDbProp.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using JNPF.Common.Extension; using Newtonsoft.Json; diff --git a/visualdev/Tnb.Vengine/Domain/VmNavProp.cs b/visualdev/Tnb.Vengine/Domain/VmNavProp.cs index e820b17c..4f7d08c9 100644 --- a/visualdev/Tnb.Vengine/Domain/VmNavProp.cs +++ b/visualdev/Tnb.Vengine/Domain/VmNavProp.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using Newtonsoft.Json; diff --git a/visualdev/Tnb.Vengine/Domain/Vmodel.cs b/visualdev/Tnb.Vengine/Domain/Vmodel.cs index df630e9c..05c05155 100644 --- a/visualdev/Tnb.Vengine/Domain/Vmodel.cs +++ b/visualdev/Tnb.Vengine/Domain/Vmodel.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using System.ComponentModel; using System.ComponentModel.DataAnnotations; diff --git a/visualdev/Tnb.Vengine/Domain/VmodelLink.cs b/visualdev/Tnb.Vengine/Domain/VmodelLink.cs index 6b539eeb..ce51cf3e 100644 --- a/visualdev/Tnb.Vengine/Domain/VmodelLink.cs +++ b/visualdev/Tnb.Vengine/Domain/VmodelLink.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using JNPF.Common.Contracts; using SqlSugar; diff --git a/visualdev/Tnb.Vengine/Domain/VmodelPage.cs b/visualdev/Tnb.Vengine/Domain/VmodelPage.cs index df9dd97c..e2354eae 100644 --- a/visualdev/Tnb.Vengine/Domain/VmodelPage.cs +++ b/visualdev/Tnb.Vengine/Domain/VmodelPage.cs @@ -1,3 +1,7 @@ +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// using JNPF.Common.Contracts; using Newtonsoft.Json.Linq; diff --git a/visualdev/Tnb.Vengine/Mapper/VmodelMapper.cs b/visualdev/Tnb.Vengine/Mapper/VmodelMapper.cs index a2cadc5e..fe8cd4df 100644 --- a/visualdev/Tnb.Vengine/Mapper/VmodelMapper.cs +++ b/visualdev/Tnb.Vengine/Mapper/VmodelMapper.cs @@ -1,4 +1,8 @@ - +///////////////////////////////////////////////////////////////////////////////// +// 宁波拓通e智造平台 ToTong Next Builder // +// https://git.tuotong-tech.com/tnb/tnb.server // +///////////////////////////////////////////////////////////////////////////////// + using JNPF.Common.Security; using Mapster; using SqlSugar; diff --git a/visualdev/Tnb.VisualDev.Engine/Model/EntityFieldModel.cs b/visualdev/Tnb.VisualDev.Engine/Model/EntityFieldModel.cs index 175c489a..0bcc7749 100644 --- a/visualdev/Tnb.VisualDev.Engine/Model/EntityFieldModel.cs +++ b/visualdev/Tnb.VisualDev.Engine/Model/EntityFieldModel.cs @@ -5,6 +5,8 @@ namespace JNPF.VisualDev.Engine; /// /// 实体字段模型 /// 版 本:V3.0.0 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组. /// [SuppressSniffer] public class EntityFieldModel diff --git a/visualdev/Tnb.VisualDev.Entitys/Entity/EmailReceiveEntity.cs b/visualdev/Tnb.VisualDev.Entitys/Entity/EmailReceiveEntity.cs index a99a4080..ab28635e 100644 --- a/visualdev/Tnb.VisualDev.Entitys/Entity/EmailReceiveEntity.cs +++ b/visualdev/Tnb.VisualDev.Entitys/Entity/EmailReceiveEntity.cs @@ -6,6 +6,8 @@ namespace JNPF.VisualDev.Entitys; /// /// 邮件接收 /// 版 本:V3.2 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 /// 日 期:2021-06-01. /// [SugarTable("EXT_EMAILRECEIVE")] diff --git a/visualdev/Tnb.VisualDev.Entitys/Entity/VisualDevModelDataEntity.cs b/visualdev/Tnb.VisualDev.Entitys/Entity/VisualDevModelDataEntity.cs index 1846125a..19083e0a 100644 --- a/visualdev/Tnb.VisualDev.Entitys/Entity/VisualDevModelDataEntity.cs +++ b/visualdev/Tnb.VisualDev.Entitys/Entity/VisualDevModelDataEntity.cs @@ -7,7 +7,7 @@ namespace JNPF.VisualDev.Entitys; /// /// 可视化开发功能实体 /// 版 本:V2.6.200612 - +/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) /// 日 期:2020-10-28. /// [SugarTable("BASE_VISUALDEV_MODELDATA")] diff --git a/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs b/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs index 7bee90d2..c80c4268 100644 --- a/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs +++ b/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs @@ -541,7 +541,7 @@ namespace JNPF.VisualDev dicItem.Add(item.__vModel__, "系统自动生成"); break; case JnpfKeyConst.COMSELECT: - dicItem.Add(item.__vModel__, item.multiple ? "例:卡奥斯/产品部,卡奥斯/技术部" : "例:卡奥斯/技术部"); + dicItem.Add(item.__vModel__, item.multiple ? "例:拓通智联/产品部,拓通智联/技术部" : "例:拓通智联/技术部"); break; case JnpfKeyConst.DEPSELECT: dicItem.Add(item.__vModel__, item.multiple ? "例:产品部/部门编码,技术部/部门编码" : "例:技术部/部门编码"); @@ -550,7 +550,7 @@ namespace JNPF.VisualDev dicItem.Add(item.__vModel__, item.multiple ? "例:技术经理/岗位编码,技术员/岗位编码" : "例:技术员/岗位编码"); break; case JnpfKeyConst.USERSSELECT: - dicItem.Add(item.__vModel__, item.selectType.Equals("all") ? "例:卡奥斯/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号"); + dicItem.Add(item.__vModel__, item.selectType.Equals("all") ? "例:拓通智联/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号"); break; case JnpfKeyConst.USERSELECT: dicItem.Add(item.__vModel__, item.multiple ? "例:张三/账号,李四/账号" : "例:张三/账号");